Three lessons I learnt from porting Diablo
petewarden.typepad.com
petewarden.typepad.com
"There were hundreds of pieces of x86 assembler scattered throughout the code base, which was a problem since we were porting to the Playstation's MIPS processor. Usually just a couple of instructions long, and in the middle of functions, these snippets were pretty puzzling. Finally one of the team figured it out; somebody had struggled with C's signed/unsigned casting rules, and so they'd fallen back on the assembler instructions they understood! The whole team had a good laugh at that"
I've heard that Photoshop is also riddled with assembly code, that's why it took so long for Adobe to port it full-performance for the new Intel-based Macs in 2006. (Lots of PPC -> x86 mini-ports)
It was common for any 3d games to have 16.16 fixed point type all wrapped up in macros using asm fragments. The crucial thing was using a 64 bit intermediate for muldiv and mulacc expressions.
Also, I recall assembler code (65816) where the programmers had directly encoded instructions (DB $aa,$bb) since an earlier (probably 6502) assembler had not supported them.
In those days, gamers programmers had more in common with scientists in their attitude to programming - they made games, programming was simply a means to that end. Also, games had pretty much zero maintenance after release.
Other fun ones were variable length structs, and bitfields. http://www.ddj.com/cpp/184403480
When I started programming, the running joke was "you can write FORTRAN in any language, some are just more difficult."
http://news.ycombinator.com/item?id=975575
I wonder if my response to that post triggered him making that blog for clarification. (Basically rebutting my quality complaint.)
The industry trades on how 'cool' it is to work on games knowing that there are hundreds of talented kids who will do anything to get in to it. They often end up doing poorly paid difficult work under tight deadlines with bosses that make The Office seems like heaven.
Unfortunately people like Liddon are few and far between within the industry.
1) Get a paycheck I can live on.
2) Get a mentor.
3) You don't have to finish a job before moving on if things aren't working out.
(not that I'd agree with #3, that just seems to be my takeaway from the story).
"The third lesson I learnt was that you don't need great code to make a great product."
I really believe this to be true. Coders are far too analytical for their own good. If a product works great, then the poor code can be fixed later.
But some of the ones with that ability would be better off a little bit less goal driven and spending just a few hours a month reading up on their tools. (And the rest of the world would be better off, too...)
Edit: (A bit clearer syntax.) I might add -- it is OK to do evil stuff if you are in a hurry, but at least isolate those part so they are easily replaceable. (Yes, most everyone should know this.)
This comes from two lessons to us:
1) No matter how long you spend designing a feature, it'll probably not be 100% of what the user wants. Do a quicker "draft" of the feature, solicit feedback, and release fast to fulfill customer needs.
2) No matter how long you spend trying to write elegant code, the software will have bugs, and other kinds of problems. Do it quick, observe it in the field, take notes and do bug patches.
Getting the team on-board for these was hard due to the resistance of this being the perceived Microsoft way of doing things, but it has resulted in much higher customer satisfaction because they see continuous progress and feel like their feedback is turning into product (they feel part of the process) rather than tens of months of no progress followed by something they probably didn't want to begin with.
My attitude is simple: code like the person who will be working on the app next is standing behind you with a gun to your head. Be diligent in making sure your code is legible, maintainable and documented. If you can't get to one of these now, at least make a note to get back to it.
It's a case of making sure that you know you're doing the wrong thing, vs just assuming that it's the right thing. The latter causes all code to be bad, and the poor code never gets fixed.
I did feel pretty terrible about leaving the project at the time, and I never left a half-finished game again. I'm not sure this attitude makes rational sense from a selfish point-of-view, but I knew I was leaving my colleagues with more work by quitting.
At any rate, I'm sure it was a good learning experience all around. There is something particularly unique about game development in the software field that isn't necessarily shared anywhere else. I've heard many of these sentiments echoed.
That's so true. At least for me.