|
|
# ? Apr 20, 2024 09:44 |
|
Supplementary Materials Parts Datasheets Client-Provided Assignment Info Quackles fucked around with this message at 21:14 on Jul 7, 2019 |
# ? Aug 15, 2018 09:10 |
|
Welcome Here we go. Day 1 at Shenzhen Longteng Electronics. I’ve got a cubicle, a cool tablet with a keyboard and a camera view of the outside (no actual window, unfortunately), and a big manual binder sitting on the desk next to me. My coworkers all checked in - by email, of course. First off, we have Mr. Wang Yonghong, AKA The Big Boss. I strongly suspect this is the first and last time I will hear from him - unless I screw up royally, which I’m not planning to. Next up, there's Carl Tesky, AKA ‘the other engineer’, and my next-door desk neighbor. We had a bit of a good conversation about the circumstances that collectively drove us here. I’m sure we’ll be partners-in-rhyme soon enough. Whoa, this guy’s enthusiastic! Not shown in the email: Joe met me in person and he’s exactly as upbeat. He insisted I call him (just) Joe. The only issue is I don’t really know what a Product Manager does - it’s not like he’s my boss, really, and his spiel suggests he’s more a wheeler and dealer than an actually, you know… manager. I guess I’ll find out. Ms. Lili Wu is straightforward, formal, and… I can just tell that when around her, you can feel that she’s in charge. ‘Nuff said. David “Daiwei” Solomon - International Product Manager, whatever that means. From his email, I got the feeling that he’s a consultant - brought in to help with a “this is what Western audiences might like” outlook, maybe? The other thing I should probably mention is that it’s pretty obvious that David is a biiiig Sinophile. The Chinese characters in his name are kind of the giveaway… among other things. To be fair, he did say I could come to him if I need help with translation requests, so things should work out fine. Finally, we have Mr. Jie Zhang, AKA my boss. (Also Carl’s.) Like Ms. Wu, he’s very professional. More pertinently, he’s My Boss. It looks like I’ll be getting most of my work assignments from him. That’s everyone in the vicinity of my office. All the people here seem really nice so far, and I’m excited to work with them. Of course, I probably shouldn’t make any judgements until I’ve been at Longteng a little while. Let’s do this.
|
# ? Aug 15, 2018 09:10 |
|
Important: Read the Manual! It looks like Carl's got some advice for me before I start. I’ve had a look at the book. It doesn’t seem too complicated. There’s your basic moving-data-around instructions, and add, subtract, multiply… no divide, though. Nothing too fancy. In fact, it feels bargain-basement, compared to the hardware-mapping exercises I did in school. But I guess programmable, modular microcontrollers turned out cheaper than custom silicon in this timeline. There’s a space at the back of the manual for datasheets, but there’s only one so far: the MC4000. It’s a basic microcontroller. I was a little surprised to hear they cost 3 Yuan each— about a dollar— but apparently there’s a discount for purchasing them in bulk. I’m a little MORE disconcerted at the specs. One register, four I/O pins - that I can deal with. But each can store only 9 lines of code…! I wonder if I can start up a custom silicon fabrication company in my spare time.
|
# ? Aug 15, 2018 09:11 |
|
Security Camera (Fake) They’re starting me off easy with this fake security camera. Once you get rid of the security-camera-shaped casing, it's basically two lights. That blink. That’s it. I don't even have to hook up a motor to make it turn, or anything. I’m a little relieved, to be honest. When Carl mentioned the last guy, I was worried I’d come up against something super-duper challenging— that I’d be following him out the door. Now, I’m a little bit skeptical... [ ~ ] I’ve found the design abandoned by the last guy. He even wrote, “why is this so hard? :(” in comments before bailing…! Carl said I was almost certain to do better than him, and I’m inclined to agree. From what I could see, he did get the first light working — turn it off (even though it starts off), wait, turn it on, wait some more, repeat forever — but he couldn’t figure out the second light after that? Really? [ ~~ ] Job's done, and I’m pretty sure my predecessor was a fraud. This only took me a few minutes to finish. It’s an auspicious beginning for me, at least. That said, things can only really go uphill from here... Quackles fucked around with this message at 09:37 on Aug 15, 2018 |
# ? Aug 15, 2018 09:21 |
|
Engineer’s Corner 1: The Basics I got a lot of comments to the last post where people said that they had no idea what those screenshots I was posting were supposed to mean. I’m starting this series of posts to explain what’s going on. These screenshots are from my chip design simulator, ConceptCAD. The labeled circles in the prototype board are inputs or outputs that I can get / send a signal to if I hook up a part to it with a wire. The green things are, you guessed it, the wires. This chip is the MC4000 microcontroller I was talking about before, and the straight lines on its side are pins (note the labels). The MC4000 can read signals from pins or write signals to them, if I tell it to with the right instruction (and the pin is connected to something meaningful by a wire). The space on the left of the MC4000 is for instructions. I can have up to 9 lines of code, which doesn’t sound like a lot! Spoiler: it’s really not. When a MC4000 is turned on, it will follow its programmed instructions forever in a loop. So far, the instructions I’ve had to use are: • mov - push a value somewhere, or copy a value from one place to another mov value dest mov source dest • slp - wait for a set number of time units slp time This is the MC for the power light of the fake security camera. The mov instructions in the image push a specific value out to p0, which then travels along the wire from p0 to the output that leads to the active LED. The instructions start by telling the MC to wait six time units (slp 6). Then, by pushing 100 to p0 (mov 100 p0), I turn the LED on. I wait six more time units (slp 6) and then turn the LED off. (mov 0 p0) This repeats forever. (As an aside, every MC4000 has to have at least one instruction that makes the part wait for a period of time - or to put it another way, every MC has to have a slp instruction somewhere in its instruction list. MCs process really fast, and if you don't add a timed wait, the chip will consume infinite power, create a black hole, and forge a new universe. Also, if I don’t put in a slp instruction in a MC’s code, the simulator will throw an error. :P There is one other instruction that sleeps a MC - slx - but I don’t fully understand that one yet, so we’ll talk about it later.) A few more bits of the MC I haven’t talked about yet: the accumulator (acc for short) is a register, which is a fancy way of saying that it’s a box I can store numbers in. I could, for example: • put the number 3 into acc (mov 3 acc), • move a value received on the MC’s pin p1 into acc (mov p1 acc), • push a value from acc out to pin p1 (mov acc p1), ...and so on. There’s also several instructions that modify the value in acc, but we’ll cross that bridge when we come to it. Finally, “state” and “power” are used while the simulation’s running, to show if the MC’s active or waiting, and also how much power it’s using (MCs draw full power when active, but not when waiting). This might get relevant if I ever get a job that needs to go easy on a device’s batteries. That's the basics! I'll add new "Corner" posts if I run into any more concepts that might trip people up.
|
# ? Aug 15, 2018 09:21 |
|
Snazzy, I haven't heard about this genre of games before and my only knowledge of programming is in R, but I'm looking forward to seeing more. Is the in-game computer language actually an IRL one, or is it more something like the old school Turtle flowcharts? Also I'm gonna go out on a limb and say you probably don't need multiple posts for all that. Just one with section headings should be enough. Edit: fun fact, the CEO's name translates to King Forever Red
|
# ? Aug 15, 2018 12:14 |
|
Ibblebibble posted:Is the in-game computer language actually an IRL one, or is it more something like the old school Turtle flowcharts? It's a fake language but heavily influenced by Assembly, which is essentially the catch all term for processor specific low level languages (i.e. every instruction in assembly is translated by an assembler into actual ones and zeros fed into the processor) I really love this game though battling against the limitations you're up against can be frustrating (then again, that's sort of one of the things being an engineer is about). Zachtronics has also just put EXAPUNKS on Early Access which shares a lot with this only with more emphasis on code and 90s Hollywood hacking. AceOfFlames fucked around with this message at 12:26 on Aug 15, 2018 |
# ? Aug 15, 2018 12:23 |
|
AceOfFlames posted:I really love this game though battling against the limitations you're up against can be frustrating (then again, that's sort of one of the things being an engineer is about). Zachtronics has also just put EXAPUNKS on Early Access which shares a lot with this only with more emphasis on code and 90s Hollywood hacking. And if you want to go more old-school there is TIS-100 which also is assembly programming, but on a weird and very non-standard fictional (old) computer architecture.
|
# ? Aug 15, 2018 12:52 |
|
Oh man, I love Zachlikes. I remember way back in the day someone ran a Spacechem tournament LP, and it was awesome. Looking forward to seeing what you do!
|
# ? Aug 15, 2018 13:19 |
|
Having lived in Shenzhen this caught me by surprise. Never heard of this. "There is even a Macdonalds downtown" Haha like a fair ton of them - It was one of the first western fast food style places to come to Shenzhen. A city that is about 30-40 years old.
|
# ? Aug 15, 2018 13:44 |
|
Also on the programming train, there's the (just-released) EXAPUNKS. Also, there are charts at the end of each level that show you how well your solution performed compared to the world as a whole on several metrics, and leaderboards for those same metrics to see how you stack up against people on your Steam friends list. You should add a bunch of goons and beat our high scores!
|
# ? Aug 15, 2018 15:12 |
|
Nice, a Zachtronics LP! It'll be interesting to see how someone else tackled the later levels - I hope we see some nice optimisation tricks.
|
# ? Aug 15, 2018 15:44 |
|
I discovered this game just as I had to take a couple 8 hour flights, and it was a godsend.
|
# ? Aug 15, 2018 20:52 |
|
Tenebrais posted:Oh man, I love Zachlikes. I remember way back in the day someone ran a Spacechem tournament LP, and it was awesome. Looking forward to seeing what you do! Yeah, that tournament was pretty cool, whoever ran it. I'm looking forward on how you're supposed to solve later puzzles, instead of the hacky bullshit I crammed in there.
|
# ? Aug 15, 2018 22:02 |
|
I remember one of the SpaceChem tournaments fondly. I didn't really take part as a player but it was my first contribution to a "LP" on this forum, because I wrote informational sections about the chemistry behind the molecules in the assignments. They're still in the lparchive. Later on whenever I brought up SpaceChem as a good example of an educational game, people would ask me how it would help kids learn chemistry. Time and time again I had to explain it doesn't help teach chemistry, in fact the chemistry in it sucks. But it does help teach programming concepts. I feel Shenzhen I/O does more of a deep dive into programming than SpaceChem did, so it might not be the best game for people without programming experience to start with. But it's a great game, and I really like how much work Zachtronics puts in making the manual and other documents look neat. Apparently they did a great job on the documentation of their new game Exapunks as well, but I haven't played that yet.
|
# ? Aug 15, 2018 22:19 |
|
Shenzhen Days: Why Are We Even Here? I’ve signed up for a mailing list for English-speaking types, about Shenzhen. I knew some of the background - how pretty much everything in the world gets made here - but the history’s new to me, though. The interesting bit is Ms. Liu, the host, getting all existential towards the end of the email. She didn’t say what she thought the, uh, 'ultimate purpose' of Shenzhen was, but it’s a worthy thought. We’re pushing 9 billion, and we’re gonna hit the Earth’s resource limit sooner or later. So what’s the coal - er, I mean, goal, of continuing down this capitalist line? I say. Even as I’m helping do it. Carl wants to show me a dumpling shop that he says is pretty good. I’m off for now. P.S.: Answers to Readers Before I go, just wanted to mention that I'll try to answer any readers' questions that may pop up if I get a quiet moment. @ally_1986: You've been to the McDonalds? How is the cheese?
|
# ? Aug 15, 2018 23:48 |
|
Replacement Factory Module SMASHED? OK, sheer bloody-minded curiosity aside, it is nice to know that Longteng has its own factory floor, as opposed to leaving production to a subsidiary or partner. I suppose this way, it allows for vertical integration and also better quality control. That said, I'm running through all the ways you could get a factory part smashed in my head, and I'm torn between some sort of accident (robot having a bad day?) and the possibility of, like, some poor assembly line guy run amok in there. I hope it was an accident. Another super-easy-looking spec. You can't tell from the image, but the input signals are always only 0, 25, or 50 (meaning, the outputs are only 0, 50, or 100). I'm thinking all that's really necessary is a single MC that does exactly what the spec says, in order: read in the input value, multiply it by 2, and push it to the output. In a way, this feels like on-the-job training— teaching me how to do math on a MC all over again. They say a straight path is the shortest line between two points, and I think that accurately describes this design. At risk of sounding like a skipping CD, all it does is read in the input value, multiply it, and output it - with the unavoidable slp in there to finish the code. ...wait, is my audience going to know what a CD is? I had a friend in college who used to joke about 'broken records', but I ended up having to look up what a record was to get the joke. Anyway, design sent off to Jie.
|
# ? Aug 15, 2018 23:48 |
|
Engineer's Corner 2: MC Math 'n' More! Sharp-eyed readers might have noticed that when I used mul to multiply the input value in the last post, I never specified either a destination or the other half of the equation. This is because microcontroller math works a little bit differently than doing it on your phone. The basic rule is this: Every math instruction uses the acc register as the source, and also the place to store the result. From one point of view, this is easy, because you don't have to worry about where you're getting one of your numbers from. From another, this can be really annoying - you have to move your value from the accumulator (acc) to wherever you wanted to use it (like p1 for output, in the last job I had to do), and that's another instruction. Also, if you're using the accumulator as, say, a counter, and you want to do math in it, you have to do something with the value you *had* in acc so that you can do your math. You can't do math and leave acc untouched. The other thing about MC math is that you can't divide. No, really. Here's the list of all the arithmetic instructions in the spec, with a few arithmetic-adjacent ones thrown in for good measure: • add - Add this number to the accumulator, and store the result there. add number • sub - Subtract this number from the accumulator, and store the result there. sub number • mul - Multiply this number by the number in the accumulator, and store the result there. mul number No, there is no divide instruction. Dividing is a lot harder than multiplying, adding, or subtracting, computationally. So these low-level MCs don't have the option. • not - If the number in the accumulator is not 0, set it to 0. If it is already 0, set it to 100. not not is useful for logic stuff, mostly. But it does only affect the accumulator, so here it is in this list. • dgt - Get the nth digit of the number in acc and store that digit in acc. The ones digit is digit #0, the tens digit is digit #1, and the hundreds digit is digit #2. dgt target_digit • dst - Set the nth digit of acc to the number provided. Same positioning scheme as dgt. dgt target_digit new_number dgt and dst strike me as the type of instructions a clever programmer could use in efficiency-related hacks. It's a far cry from the cool things you could do with bit-shifting instructions on the binary microcontrollers I learned on back in college, but decimalized MCs appear to be all the rage in Shenzhen, so that's what I'm using. That's all of the math(-like) instructions. I think I've explained, like, half of the MC4000 instruction set to all of you already...! Of course, it's not the size of the language, but what you do with it that matters. ...you know, MC Math would be a good name for a DJ, come to think of it.
|
# ? Aug 15, 2018 23:48 |
|
David no you don't loving turn a western name into Chinese characters I've been to Shenzhen once, it's pretty great. The Pizza Huts are more upmarket dine-in establishments that serve steak and duck and the rollercoasters are insane. Good luck with the game, the puzzles get pretty drat interesting to the point where it's even hard for those having assembly programming experience!
|
# ? Aug 16, 2018 00:08 |
|
I sure hope you got permission from your manager and from Legal to post source code and pictures of hardware to your personal blog. Kidding aside, I think this is a great LP format for this game. I like the short updates and that you're splitting game mechanics explanations into their own updates. (I'm also glad you're doing this because I was thinking of LPing this game next and you're doing a better job than I would have.) Unfortunately, I'm not sure I'm going to follow this LP -- I want to beat this game myself!
|
# ? Aug 16, 2018 00:30 |
|
Can you multiply by decimals to divide?
|
# ? Aug 16, 2018 01:28 |
|
Ibblebibble posted:Can you multiply by decimals to divide? Though to clarify, does this language allow for complex calls within an operation? As it stands it looks like the above operation requires a few steps, and depending on whether they can be nested or not would change what one can do. Assuming your input is N, the way to generate N/5 is to get the 0th digit, multiply that by 10, add the 1st digit, then multiply all that by 2. Which isn't terribly crazy if you can nest operations or if you have multiple registers, but which does require some finagling if you only have one register available at a time that you can't perform nested operations on. In this case you'd need a register to store the 0th digit, another to store the 1st digit because dgt only sets acc to some value rather than allowing for adding, and a third to store the original value (which can be an input!) because you're performing multiple operations on it. The tricks you'd have to pull here remind me of swapping two variables while minimizing resource use. You're always going to need at least three registers to do so, but often you can get away with using the system's own RAM as a register rather than allocating a new temporary one. Nowadays you rarely need to care, but in the case of microcontrollers (such as here) there's always the XOR swap algorithm or its variants.
|
# ? Aug 16, 2018 01:54 |
|
I'm surprised that such a simple and limited chip has two analog I/O pins. Usually you only get digital on something like this.
|
# ? Aug 16, 2018 01:58 |
|
I saw this thread and immediately decided I needed EXAPUNK in my life. These games can certainly make you feel very smart or very silly. I can't wait to see the "elegance" in this one.
|
# ? Aug 16, 2018 04:13 |
|
Ibblebibble posted:Can you multiply by decimals to divide? There are no decimals. The chip supports all integer values between -999 and +999 inclusive (but the in/output on the analog p0 and p1 pins is always mapped to a number between 0 and 100). I kinda would like to look into the transistor design to find out how they got it to be so decimal. NGDBSS posted:I doubt the system explicitly allows for decimals, but you can certainly hack it by multiplying the 0th and 1st digits by something relevant. Dividing by 5 and rounding down, for instance, just requires you to chop off the 2nd digit and then multiply that by 2. Without going into spoiler territory too much: we're gonna get other parts than the MC4000 soon.
|
# ? Aug 16, 2018 06:53 |
|
I'm definitely sympathizing with the Unnamed Engineer at this point. Probably just that I don't have any background in programming except using basic-rear end website poo poo.
|
# ? Aug 16, 2018 08:20 |
|
So I glanced over the thread and I mean what the gently caress, how is this a game that anyone would play This is homework
|
# ? Aug 16, 2018 08:51 |
|
Crane Fist posted:So I glanced over the thread and I mean what the gently caress, how is this a game that anyone would play Some people like puzzles.
|
# ? Aug 16, 2018 08:53 |
|
Crane Fist posted:So I glanced over the thread and I mean what the gently caress, how is this a game that anyone would play Ratoslov posted:Some people like puzzles. Not only that but as someone who programs for a living, the stripped down nature can be quite appealing: you don't have to deal with crap like setting up dependencies correctly, or interfacing with third party or a co-worker's code that might not be the best or constantly changing requirements. Just you and the code. I once heard playing these games described in the Waypoint podcast aslike "the best days of your job".
|
# ? Aug 16, 2018 09:30 |
|
Programming is a fun and rewarding hobby that some people happen to make the mistake of doing as a job.
|
# ? Aug 16, 2018 09:37 |
|
AceOfFlames posted:Not only that but as someone who programs for a living, the stripped down nature can be quite appealing: you don't have to deal with crap like setting up dependencies correctly, or interfacing with third party or a co-worker's code that might not be the best or constantly changing requirements. Just you and the code. I once heard playing these games described in the Waypoint podcast aslike "the best days of your job". Exactly. The game tries to boil the tasks down to the good bits.
|
# ? Aug 16, 2018 11:29 |
|
That said, I've tried playing games in this stripe (SpaceChem, Human Resource Machine, etc.) and have invariably found that I, personally, would rather write actual programs than toy programs. I program to get poo poo done, so having to operate under artificial constraints is more annoying than interesting.
|
# ? Aug 16, 2018 15:53 |
|
AceOfFlames posted:I once heard playing these games described in the Waypoint podcast aslike "the best days of your job". That reminds me how Kerbal Space Program is incredibly popular with the guys at NASA and the Farming Simulator games are popular with farmers. The fantasy is 'what if I could do my job, but without the lovely part'.
|
# ? Aug 16, 2018 16:22 |
|
TooMuchAbstraction posted:That said, I've tried playing games in this stripe (SpaceChem, Human Resource Machine, etc.) and have invariably found that I, personally, would rather write actual programs than toy programs. I program to get poo poo done, so having to operate under artificial constraints is more annoying than interesting. I got a refund for Human Resource Machine because it's babby's first programming and the puzzles never get tricky at all. Zachtronics games are much better in that regard.
|
# ? Aug 16, 2018 17:35 |
|
Oh, how fun. I never finished TIS-100, so never started this one. And these chips are really about a dollar each? From what I can recall from the datasheets of some microcontrollers I've used in the past couple years, that seems pricy for the feature set. But maybe they've got some features I haven't seen or are ultra-low power or something. Also, on your second design, I'm a little curious about the timing requirements. Maybe you could save a smidge of power by sleeping for longer. Though if that really matters, I'd hope they'd have told you...
|
# ? Aug 16, 2018 18:09 |
|
This is post the rampant inflation and collapse of the dollar after Trump's enlightened rule don't forget.
|
# ? Aug 16, 2018 18:12 |
|
idhrendur posted:Oh, how fun. I never finished TIS-100, so never started this one. You see those little grey/black "blocks" on the verification input/output? Each corresponds to 1 time step, so that's a slp 1.
|
# ? Aug 16, 2018 18:14 |
|
Carbon dioxide posted:You see those little grey/black "blocks" on the verification input/output? Each corresponds to 1 time step, so that's a slp 1. Ah, thanks! I'm reading on mobile so hadn't seen them at first.
|
# ? Aug 16, 2018 19:27 |
|
|
# ? Apr 20, 2024 09:44 |
|
idhrendur posted:And these chips are really about a dollar each? From what I can recall from the datasheets of some microcontrollers I've used in the past couple years, that seems pricy for the feature set. But maybe they've got some features I haven't seen or are ultra-low power or something. Considering that the game is set in China, and that the currency symbol is ¥, I would assume that the costs are given in Chinese Yuan, so 1¥ = 0.15$. Does that sound less pricy?
|
# ? Aug 16, 2018 20:03 |