Slashdot Mirror


The Struggles of Developing StarCraft

An anonymous reader writes "Patrick Wyatt led production efforts for several of Blizzard Entertainment's early games, including Warcraft 1 & 2 and StarCraft. Wyatt has just published an in-depth look at the development of StarCraft, highlighting many of the problems the team encountered, and several of the hacks they came to later regret. Quoting: 'Given all the issues working against the team, you might think it was hard to identify a single large source of bugs, but based on my experiences the biggest problems in StarCraft related to the use of doubly-linked linked lists. Linked lists were used extensively in the engine to track units with shared behavior. With twice the number of units of its predecessor — StarCraft had a maximum of 1600, up from 800 in Warcraft 2 — it became essential to optimize the search for units of specific types by keeping them linked together in lists. ... All of these lists were doubly-linked to make it possible to add and remove elements from the list in constant time — O(1) — without the necessity to traverse the list looking for the element to remove — O(N). Unfortunately, each list was 'hand-maintained' — there were no shared functions to link and unlink elements from these lists; programmers just manually inlined the link and unlink behavior anywhere it was required. And hand-rolled code is far more error-prone than simply using a routine that's already been debugged. ... So the game would blow up all the time. All the time.'" Wyatt also has a couple interesting posts about the making of Warcraft 1.

135 comments

  1. Not so hard by Anonymous Coward · · Score: 5, Informative

    If Blizzard's #1 priority wasn't 'obscene profit' these days, it might make the job a little easier/fun.

    1. Re:Not so hard by binarylarry · · Score: 4, Funny

      There is no cow problem.

      --
      Mod me down, my New Earth Global Warmingist friends!
    2. Re:Not so hard by Culture20 · · Score: 1

      Hey, DRM is hard.

      Yeah, DRM is hard, and Blizzard should be able to compensate its programmers for selling you DRM instead of giving their time away for free. Heck, they even package in a game as a bonus! This is partly sarcasm, because I do believe a portion of the higher prices we now pay are due to the waste of time (ours and theirs) that is DRM.

    3. Re:Not so hard by Meski · · Score: 1

      Depends on the game. with WOW, you might as well regard it as a client/server - if the server isn't there, it just won't work. DRM for it is irrelevant. Diablo, that's another matter. No reason it should not work without it. Then again, I got bored with D3 after running the different types of character thru the different levels. Does *anyone* just keep playing it? SC is another D3 model.

    4. Re:Not so hard by nhat11 · · Score: 1

      This article is about SC gaming development back in the 90s, the TC post is off topic and nothing to do with SC or the trials and errors it went through.

  2. Bad code is a nightmare to debug by Anonymous Coward · · Score: 2, Funny

    ... congratulation... what a fresh piece of news !

  3. Teaching opportunity? by theRunicBard · · Score: 5, Insightful

    This is so pefect for Computer Science courses! Someone might actually look up from their laptop at the lecture slides if this gets mentioned!

    1. Re:Teaching opportunity? by K.+S.+Kyosuke · · Score: 4, Insightful

      "How Not to Do Stuff 101"? Don't do memory management by hand, use functions to factor out common operations? Honestly, I'm surprised that something written in this way made its way out the software shop doors in a working state.

      --
      Ezekiel 23:20
    2. Re:Teaching opportunity? by aintnostranger · · Score: 5, Insightful

      I'm surprised that something written in this way made its way out the software shop doors

      ROFL. I think most software is like that, what surprises me is finding that some widely deployed software is well coded.

    3. Re:Teaching opportunity? by jones_supa · · Score: 3, Insightful

      "How Not to Do Stuff 101"?

      Maybe. Lessons like that can be fruitful for education too.

    4. Re:Teaching opportunity? by neonKow · · Score: 4, Insightful

      "How Not to Do Stuff 101"? Don't do memory management by hand, use functions to factor out common operations? Honestly, I'm surprised that something written in this way made its way out the software shop doors in a working state.

      How about "why not to do this," or "trade-offs of doing it like this," or "pitfalls of hacky solutions in big projects."

      There is a lot more to teaching how to avoid mistakes than just a checklist of what not to do; you have to give students and understanding of why not to do things, and how to think through all the possible pitfalls that their design decisions will make. I'd would've definitely enjoyed learning good coding practices from one lecture based on real life-lessons learned.

    5. Re:Teaching opportunity? by wisty · · Score: 2

      Yes, it's very context dependent. Too much architecture, and you "lasagna code" - so many layers it's impossible to understand. Not enough architecture, and you get "spagetti code". If you care too much about nice code, you get Haskell - beautiful by ultimately pretty useless. If you don't care about good code, you get Fortran - extremely useful, but so ugly no-one wants to modify it. (Yes, it's possible to write practical stuff in Haskell, and nice code in Fortran ... but it's rarely seen in the wild).

    6. Re:Teaching opportunity? by davester666 · · Score: 2

      How? These kinds of issues are OLD. They have been talked about, discussed, studied, and explained to death.

      At some point, you have to say, it's either the teachers or it's the students.

      For this dll "problem", just using a macro fixes the problem while retaining maximum speed [no function call]. Unless they are doing stupid "I know I'm in the middle of the list, so no need to do nil checks" BS.

      --
      Sleep your way to a whiter smile...date a dentist!
    7. Re:Teaching opportunity? by Anonymous Coward · · Score: 0

      At some places where i worked mentioning that incoherent use of lists may be a problem would be seen as a major affront towards your co-workers "we did not know it better" may be thre reason but that does not mean that i should not analyze the problem.

    8. Re:Teaching opportunity? by Anonymous Coward · · Score: 2, Insightful

      There are people who are very good at what they do. They study, read books, perhaps do their own scientific research, they learn from mistakes and constantly try to improve not only themselves, but also people and company around them. But there are not many of these people. Not only does it require passion, it also requires experience and most often a little luck that you have met someone who taught you things.

      Most people want to either do the minimum that is required or they simply lack of experience or knowledge that would be needed. In managers the numbers are even worse. Because of this great majority, it doesn't matter what kind of knowledge the humankind has, because it won't be used.

  4. THANKS! by Anonymous Coward · · Score: 2, Interesting

    Thanks to Blizzard's new and idiotic direction with WoW, I discovered private servers and can finally enjoy the game again either on: vanilla, BC, or Wrath servers. Cataclysm and on, can suck my balls.

    1. Re:THANKS! by Anonymous Coward · · Score: 1, Funny

      Dude, No one, and I repeat NO ONE is going to ever suck your balls until you get out of your mom's basement, stop playing WoW 24/7 and give up the Cheeto habit.

    2. Re:THANKS! by Anonymous Coward · · Score: 4, Funny

      Huh. That's odd. The first time I had my balls sucked was in my mom's basement while playing WoW and eating Cheetos. That girl was awesome.

    3. Re:THANKS! by Anonymous Coward · · Score: 5, Funny

      Dude, the family dog doesn't count.

    4. Re:THANKS! by Anonymous Coward · · Score: 0

      How that sentence probably reads to most /.'s:

      The first time I had my balls sucked [it] was my mom ... eating. That girl was awesome.

      FTFY

      (also, the lack of any exclamatory punctuation or similar mark-up belies your comment about how awesome she really was... I'm just-sayin')

      -AC

  5. The largest source of Bugs in Starcraft? by Anonymous Coward · · Score: 5, Funny

    Obviously the Zerg.

    1. Re:The largest source of Bugs in Starcraft? by Columcille · · Score: 3, Interesting

      It's an ugly planet; a bug planet. A planet hostile to life as we know it.

      Oh wait, I may have the wrong thing in mind...

      --
      I love my sig.
    2. Re:The largest source of Bugs in Starcraft? by Anonymous Coward · · Score: 0

      Wrong thing in the overmind.

  6. Thus demonstrating my assertion by Chelloveck · · Score: 5, Insightful

    Thus demonstrating my long-time assertion (ever since my stint in the video game biz) that video game developers are crap programmers. No common routines to manipulate a heavily-used data structure? Not even a set of macros? This kind of story belongs over on The Daily WTF.

    --
    Chelloveck
    I give up on debugging. From now on, SIGSEGV is a feature.
    1. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 1

      yes, the fact that no programmer thought of writing general purpose list_add / list_remove functions is telling.

    2. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      IMO There's that, but also the fact that when they make a game, it's a "one time" project and then you scrap the stuff, unless you make a rehash then use the same codebase with minor changes.
      I'm sure a few of those companies are still trying to keep a base that will never change, and then all the rules can be coded differently.

      Good thing that's the thing I'm trying to do with my project.
      Now if I wasn't that depressed...

    3. Re:Thus demonstrating my assertion by srmalloy · · Score: 1

      This is just ugly, horrid programming practice. I remember a project I worked on years ago that managed training documents with a built-in tree structure to the contents (1, 1.1, 1.2. 1.2.1, 1.2.1.1, etc.), and the first thing I did was write a library to manage a generic double-linked tree structure with a generic pointer to the actual content block, so I could use the same list manipulation functions for all the document types.

    4. Re:Thus demonstrating my assertion by Chemisor · · Score: 5, Informative

      If you actually RTFA, you'll discover that this error was made by fresh-out-of-college newbie programmers working crunchtime with no supervision.

    5. Re:Thus demonstrating my assertion by K.+S.+Kyosuke · · Score: 1

      "fresh-out-of-college"

      If it was an actual CS/IT course, and not, say, English Literature, then it's hardly an excuse.

      --
      Ezekiel 23:20
    6. Re:Thus demonstrating my assertion by Fantasio · · Score: 1

      Unfortunately, this is not specific to game programmers at all. I happened to inherit some code a few years back with the same mistake. I replaced thousands of lines of pseudo repetitive code used for accessing the central data structure, by a common routine. This corrected a large number of bugs, decreased the size of the source code and removed a few size limitations which didn't have to exist.You've got crap programmers everywhere and I don't think that all game programmers are crap.

    7. Re:Thus demonstrating my assertion by Chris+Mattern · · Score: 5, Insightful

      If you actually RTFA, you'll discover that this error was made by fresh-out-of-college newbie programmers working crunchtime with no supervision.

      In other words, video game programmers.

    8. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      As a fresh-out-of-college newbie programmer, I know better than to do this. It screams "bite me in the ass later".

    9. Re:Thus demonstrating my assertion by WrecklessSandwich · · Score: 1

      Oops, forgot to log in.

    10. Re:Thus demonstrating my assertion by Lonewolf666 · · Score: 4, Insightful

      Without experience on the job. And this is important. I remember my own university time as a nice source of theoretical knowledge, but things like good development practices were not a topic.
      Of course, any halfway smart developer will eventually figure it out. But it may take one embarassing failure as a wake-up call. Tough luck (but maybe well deserved) for a company who only hired newbies and no experienced developers as team leaders.

      --
      C - the footgun of programming languages
    11. Re:Thus demonstrating my assertion by Chelloveck · · Score: 4, Interesting

      Funny you should mention this. I just returned from a job fair at a major university where we were interviewing and hiring programmers. Yes, the new grads tend to be pretty green, but some of them are really good. It's not terribly hard to separate those who may just lack experience but who grok the fundamentals from those who really need to reconsider the last four years of their lives. I actually talked with seniors in CS who couldn't describe the difference between a queue and a stack.

      As for the article specifically... Yes, they had "fresh-out-of-college newbie programmers working crunchtime with no supervision". Hired by programmers who were themselves once "fresh-out-of-college newbie programmers working crunchtime with no supervision". It's a self-perpetuating cycle that is really prevalent in the games industry. (Or at least was prevalent at the time this story takes place, which is roughly the same era in which I was a games programmer. Thankfully I got out. That scene is nuts!)

      --
      Chelloveck
      I give up on debugging. From now on, SIGSEGV is a feature.
    12. Re:Thus demonstrating my assertion by interval1066 · · Score: 1

      I see ads for programmers like this all the time; they are looking for new grads and then present a laundry list of technical tools and experiences they (the employer) expect from these people. Maybe I'm wrong but it seems like they are loooking for people with exerience they don't need to pay top dollar. How odd...

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    13. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      Now tell us what projects have you done that are actually more impressive than theirs, tough guy :-)

    14. Re:Thus demonstrating my assertion by phantomfive · · Score: 1

      It wasn't a one-time project though, it's going to be maintained and built on for at least two more releases.

      This does explain why they aren't making huge changes to HOTS, though, the code is so brittle it would be too hard, and break too many things.

      It also explains why Blizzard takes so long to get games out the door....

      --
      "First they came for the slanderers and i said nothing."
    15. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      I have exactly the same experience. It's not too different from those stories where they ask five years experience in X when X doesn't even exist that long yet. Tools and technology used in game development is very varied. It's impossible to have experience in every language and game engine on the planet fresh out of education.

      After reading the article it seems to me I would never make any of these mistakes, at least on the technical level. This should mean I am qualified to develop games right? I mean if they could do it...

      Yet I'm still having trouble right now trying to find a full-time job in an existing development company, even after winning an award in the latest Hilversum Gamejam. I could start for my own company but I don't have any friends that I both feel comfortable working with and have the time/interest in starting up something like that, and working alone sucks for motivation.

      Maybe I should have been born in 1975...

    16. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 1

      Or, possibly, they're looking for people who code a lot in their spare time instead of only doing the programming required of them in their degree. Which is, by the way, not enough to be particularly useful without further training. I am someone who codes a lot in his spare time and, though I haven't graduated yet, the few employers I've worked at love me because I require very little training and can pull my weight even as a co-op/intern. I know one guy in my year who's being actively head-hunted thanks to various side projects he's worked on outside of class.

      The people they're looking for DO exist, it's just that (in my experience) the vast majority of graduates are not those people. The amount of coding a computer science degree forces upon you isn't enough to make you employable to a lot of places.

    17. Re:Thus demonstrating my assertion by neonKow · · Score: 2

      [sarcasm]I'm glad that before you commented, you read any of the summary, or article, instead of just skimming the title and leaving a couple of snide comments.[/sarcasm]

      This is StarCraft, the RTS game from 1998, not StarCraft II, the very modern game with a giant game engine. Games and code tended to be a bit more skeletal.

    18. Re:Thus demonstrating my assertion by godrik · · Score: 1

      Also they rewrote a linked list data structure out of need (or what they thought was a need) and not out of "hey let's write our own!"

    19. Re:Thus demonstrating my assertion by phantomfive · · Score: 1

      Yeap. Fail for me.

      --
      "First they came for the slanderers and i said nothing."
    20. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      It is a computer science degreee and not a programming degree.

    21. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 1

      If you RTFA you would see that they had that at the beginning, scrapped it to increase the speed of save time and then realized their mistake too late to fix it for release date.

    22. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      Yeah. That's why I after 10 years running my own game company (writing the framework and most of the game code) I left for Google.

    23. Re:Thus demonstrating my assertion by pjt33 · · Score: 1, Troll

      Or, possibly, they're looking for people who code a lot in their spare time instead of only doing the programming required of them in their degree

      No, because as far as HR are concerned the 1000 hours of spare time you spent on your personal project don't count as experience in anything. If it's not for a company, it didn't happen.

    24. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      All your post explains is that you're an idiot. Honestly, just read the damn fucking summary before reaching wild conclusions about shit you have no clue about.

    25. Re:Thus demonstrating my assertion by SplashMyBandit · · Score: 4, Interesting

      > "scrapped it to increase the speed of save time"
      That seems to be a real flaw in the mindset of games (and system) developers. They put in all these hacks thinking it'll shave off little slivers of execution time and overall make big savings when it is not the most significant impact on the assembled system. The time savings are usually negligible compared to bigger optimizations you can do later (using a profiler) and the development time increases (meaning you don't have time to run the profiler since you are too busy hunting down dumb bugs). As the great Don Knuth joked, "Premature optimization is the root of all evil".

      If you are a developer on these forums bragging how you used some trick to save a sliver of time it would be good to take note of this StarCraft experience - since more experienced devs simply roll their eyes when they hear such talk (recognizing such development practices as n00b traps, which we probably were tempted by ourselves at some point in the past). Write the program to be correct first (usually means the most straightforward efficient implementation, rather than the absolutely fastest implementation, should be used). Then, you can refactor (you *are* writing unit/integration tests, aren't you?) to get more efficient, all the while guided by your profiler to prioritize the development time you have remaining.

      nb: the best speed-ups are almost always algorithmic. Code hacks are minor. For example, by sitting down for several hours with a pencil, paper, and google I was able to analytically work out the optical transmission of a multi-band (eg. RGB) light source through and exponential density decay atmosphere using Mie and Rayleigh scattering into a simple analytic expression (for direct and single-scattered illumination) rather than use the integration that many other people use (eg. as published). This allowed me to implement the algorithm in a GLSL shader in real-time and saved on precious Video RAM (eg. no need to precompute and store the integral). Sure, other people have done this too, but my point is that the big speed up for me was to sit down and think rather than make minor code twiddles. Unfortunately, you need to be a good mathematician (using basic calculus and geometry in my case) rather than just a good coder to do this (which I guess may be hard for the poor young schleps that games companies hire and burn out).

    26. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 2, Insightful

      If you actually RTFA, you'll discover that this error was made by fresh-out-of-college newbie programmers working crunchtime with no supervision.

      Fresh out of college newbie programmers that no one is mentoring? My college hires (well, my entire team, but especially my college hires) have every line of code they write code reviewed. Any more senior member of my team would have said "I don't sign off on this checkin until you use common routines for manipulating these data structures". And if they had signed off on it, I would have seen it, and then I would have asked the senior people who signed off on the checkins WTF?

      This is a management failure, not a fresh out of college newbie programming failure.

    27. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      What a clever boy you are! Too bad you hadn't just graduated in 1998 when Starcraft was released with all of this wisdom.

    28. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 1

      In every situation where I have tried for this approach, one of two things happen:

      1. A middle manager demonstrates the "working" software at the 6mos mark, see how much work we have done, and then the senior manager goes "Wow, that's great, lets drop the delivery date from 6 months from now to 2 months!"... and you end up running your ass off trying to get the last critical bugs out before they ship it .. and try to bring up anything and they say "Hey, we seen it working, it's ready!", argue and you'll be out on your ass so fast you won't know what hit you.
      2. Your manager comes to you every day and spends 1/2 hour asking why the game/program is not meeting the minimum speed requirements and memory usage is higher than the target market machine is expected to have and they want progress RIGHT now.... They get really jittery if at the 1/2 way mark they can't demo the first 1/4 of the game/program internally and they soon start with the "well, if you can't do it..." and "we are afraid this isn't going to work, can we add more resources...." and if within a month of two you haven't made that progress, well, it's out on your ass.

      And people wonder why game dev's burn out so fast and work insane hours under idiotic conditions....

    29. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      The *really* crazy thing is that he explains that it's important to have some kind of optimized doubly-fuzzing-whatever-mod-on-a-linked-list so that it's easy to "save game", allowing to "easily" save hundreds and hundreds of units positions etc.

      However back then several games were already using deterministic game engines and only saving player inputs (and the time at which they happened) and the PRNG and then could recreate any game state: for debugging, to offer replay functionality and to offer the "save game / resume" functionality.

      Warcraft 3 does it that way: only saving player inputs in the replay files (which is why a long height-players game where every player has a lot of units fits in a tiny replay file).

      But anyway: they did deliver and it is all that matter. WarCraft 2 was amazing (I was using Kali to simulate a LAN over the Internet to play competitive WC2), StarCraft 1 was amazing and then... WarCraft 3 came and there are still players playing WC3 *today*.

      But, yup, it's amazing to see how much crap they can come up with and yet deliver block buster titles.

    30. Re:Thus demonstrating my assertion by SplashMyBandit · · Score: 1

      > and then the senior manager goes "Wow, that's great, lets drop the delivery date from 6 months from now to 2 months!"
      Well, it is your job as developer (or actually, the project manager's job) to show the work plan you have and point out what has yet to be done. It is mostly a matter of education such folks, and of course, planning (you do develop and maintain a work plan, yeah?). Just because they are senior and a manager doesn't mean you can't patiently explain why they can't arbitrarily move dates - it is in both your interests to politely explain how the project needs to stick to your original budgeted time.

      Sucking it up silently without explaining the features you'd have to cut is not professional - in fact, that is really where developer "experience" comes in, old timers know when a fight cannot be won (which is actually, most of the time), and will politely point out when changes to a schedule or feature-set are risking the success of the project. Project timelines can be shortened successfully but features/scope are always cut/deferred for this to happen.

      I feel that your scenarios are caricatures of how development used to work, rather than what happens when the team has any experience (which is more common now than in the early days of mass software development).

    31. Re:Thus demonstrating my assertion by Bengie · · Score: 1

      Kali.Net.. best $20 EVER!

    32. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      Exactly.

    33. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 1

      How do you write unit tests for a game? Or, less broadly, a physics solver? Reverse IK solver? Spawning algorithms? LOD level calculator? Frustum-culling? Shaders?

    34. Re:Thus demonstrating my assertion by Stiletto · · Score: 1

      "Skeletal?" Is that what "crappy, hacked up code" is called now?

    35. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      With the exception of shaders, the same way you write other unit test, by identifying the edge cases, building up a mockup of the data the "unit" under test is to operate on, feed the unit under test the mockup data, and verify the results. This requires some design at least in your head about how everything should work.

      Remember, unit test dont tell if you if it works, they only tell you if the code does what you expected it to do with certain data.

      With shaders you get a bunch of interns chain them to chairs and ask "does this look good?" repeatedly while you change it.

    36. Re:Thus demonstrating my assertion by Anonymous Coward · · Score: 0

      There are actually a lot of back end and under the hood changes in HotS. They were just rolled out in 1.5 on live servers. In fact they did break a lot of shit that they've been working to fix in the past few weeks.

  7. Re:Slashdot and Wikipedia are for fags. by khallow · · Score: 5, Funny

    {{Citation Needed}}

  8. Causation. Learn it. What really causes the crap? by VortexCortex · · Score: 5, Insightful

    Thus demonstrating my long-time assertion (ever since my stint in the video game biz) that video game developers are crap programmers.

    Broad Generalisations are almost always wrong. There are some game developers, especially those who have experience in other fields of software, which aren't "crap programmers". Video Games are some of the most hardware intensive programs, utilising every major feature and capability that the system supports. Sometimes it's acceptable to break the 'best practices' rules to get a little performance (if the profiler says it's warranted), but I agree there's no reason to be manually managing linked lists.

    Sometimes a 'Lead' programmer will be the worst of them all, and the others must follow the bad example or be made an example of. Let's not lump all game programmers into the horrible coder pile. As you've pointed out, TDWTF has plenty of examples of nightmares from all sectors, not just video games. That the game developers allow studios to get away with "crunch time" consistently instead of firing the dumbasses in charge who purposefully gork the schedule is both a large source of bugs and proof we need a union or better work conditions at least. I can forgive crunch for one project. Maybe even two in a row... but every single game? Yeah, that's either abuse or incompetence. Either way, it's why I only buy (and work on) indie games now. They tend to have better working conditions, even if some of the beginners in the indie market churn out even worse code -- At least they have an excuse in not knowing any better; What's that say about the "pros"? That they're all crap programmers, or that the programmers are forced to write crap code? I put it to you that it's the latter, not the former.

  9. Criminally Insane by Mr.+Underbridge · · Score: 2

    I'm a scientist with a CS minor and some experience doing SW engineering (probably badly) on small projects. Even *I* know you abstract the actual storage and provide some simple accessor/insertion functions to prevent people from actually touching the storage implementation. For a couple of reasons: 1) to prevent goofballs from creating pointer messes, and 2) so that, if you want to, you can completely rip out the actual storage implementation and replace it without breaking anyone's code. I'm sure there are also reasons 3) - Eleventy, but those two are pretty obvious. Not to mention which, it only adds maybe a couple hours (if you're diligent and paranoid) over the short term, and probably saves weeks over the long term.

    Not to mention which, aren't there standard libraries to do this stuff? Did STL not exist back then?

    1. Re:Criminally Insane by Anonymous Coward · · Score: 5, Informative

      STL was around, but C++ compilers were still shitty. You could get internal compiler errors or codegen problems if you tried to do anything complicated with types (like partial specialization). I also doubt that STL was taught in CS degrees then, you had to discover it existed yourself.

    2. Re:Criminally Insane by Anonymous Coward · · Score: 1

      Even today, STL tends to be avoided in game programming. Most STL implementations are pretty well developed and tested these days, but a lot of senior developers are still burned from back when it wasn't. More importantly, there is a lot of need for control over how the memory is managed, especially in memory limited systems like consoles. Think static buffers and memory pools instead of new calls everywhere. STL doesn't (or at least since last I checked) work well within those guidelines.

    3. Re:Criminally Insane by AuMatar · · Score: 2

      Back then most compilers didn't even do templates. We're talking 1996- Borland was still one of the most popular compilers, and if it ever had templates it was the last version.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    4. Re:Criminally Insane by autocannon · · Score: 2

      You're absolutely right. But you have to account for ego. There are developers out there that just don't trust anything not written by them. These guys are self righteous know it alls, and they don't take well to criticism. Thus if you ever do get a chance to look at their code you quickly realize a few things:

      1. No comments
      2. Basic functionality is rewritten all over the place
      3. They produce unnecessarily large sloc.
      4. The code does not handle non go-path well, if at all.
      5. Motherfuckers like pointers....a lot. And think they're so god damn smart that they never ever have to check them for null.

    5. Re:Criminally Insane by Anonymous Coward · · Score: 0

      +1 insightful (actually modded you that)

      I absolutely hate dealing with those kinds of developers.

    6. Re:Criminally Insane by Anonymous Coward · · Score: 1

      You can use any allocator regime with STL - it's part of the standard. The allocator is specified in the container template type. The best reason not to use it was the 1996 era compiler errors for templates; 10-50 lines of template stack trace per error. God help anyone working on that, I don't know how the guy who wrote STLport survived.

    7. Re:Criminally Insane by Anonymous Coward · · Score: 2, Interesting

      Game devs were using Wacom C compiler. C++ wasn't even used much, never mind templates. You had actions overloaded like,

      struct object;
      typedef void (*action_func)(struct object *);
      struct object{
            [object data here]

              action_func action; /* THIS HOLDS YOUR "AI" */

              struct object *next;
              struct object *prev;
      };

      Of course, most devs would abstract insertion and removal and moving functions of data from such an object linked list.

      I suspect more errors occurred when the object was removed from one list, but ended up still live in another list. That was the hack. First the object existed in one area, but they needed another list to cut cycles, so they reused pointers and ended up with using deleted memory.

      The cause of this is not simply "crap programming", but crappy design. Or perhaps "moving target" during development.

    8. Re:Criminally Insane by Anonymous Coward · · Score: 0

      If you use STL's allocation, you are then hit with creation + assignment of objects (at least the implementations I looked at - Visual Studios and Gnu's). If only STL could use in-place new. I'm sure there is a reason why it couldn't, but it ends up being rather expensive.
      The big advantage to STL is that it a) works rather well and b) it is typically all in-line code and modern compilers optimize that very nicely.
      I always tell my developers, use STL first, if, at some future date we determine that the STL is the biggest performance bottle neck, then we will replace it with something we spun ourselves. I'm guessing here, but 80% of the STL collections we use are wrapped in other classes with mutexes etc. So replacement, if it ever was needed, would be easy.

    9. Re:Criminally Insane by Anonymous Coward · · Score: 0

      If you use STL's allocation, you are then hit with creation + assignment of objects (at least the implementations I looked at - Visual Studios and Gnu's). If only STL could use in-place new. I'm sure there is a reason why it couldn't, but it ends up being rather expensive.

      Older compilers often lacked (or failed to consistently apply) the Return Value Optimization. I assume this had gotten better by the mid-2000s, but I've never actually checked. Once move constructors from the C++11 standard are widely supported (adoption of new language/library features shouldn't be as slow as it used to be), writing custom STL allocators that are efficient across implementations should be straightforward.

      - T

    10. Re:Criminally Insane by Anonymous Coward · · Score: 0

      Game devs were using Wacom C compiler. C++ wasn't even used much, never mind templates.

      if you had RTFA (I know, I know...) you would know that Starcraft was written in C++ and the first C++ project ever for many of the programmers working on it.

    11. Re:Criminally Insane by omgthisisstupid · · Score: 1

      Wish I had thought of that for http://scrabblecheat.com/ . Per chance what is the fastest sorting method for key / value pairs. I couldn't ever find a satisfactory one and just defaulted to showing 500 best but then they still have to be sorted to find the 500 best.

    12. Re:Criminally Insane by Anonymous Coward · · Score: 0

      Compiler errors for templates really haven't gotten much better. I've heard Clang has more readable error messages, but gcc 4.7 still gives reams of outputs for the most trivial of errors. I think I remember hearing that 4.8 is meant to clear up some of this. That being said, after programming with the STL for a while, you learn to either recognise some of the more common error output, or ignore it and just look at the line numbers and then figuring out what is wrong yourself.

    13. Re:Criminally Insane by GuB-42 · · Score: 1

      TFA part 2 : http://www.codeofhonor.com/blog/avoiding-game-crashes-related-to-linked-lists

      The author suggests to ditch the STL in favor of "intrusive lists". In intrusive lists the links are part of the data structure. It breaks the data/container separation but provides many benefits in term of performance and reliability.

  10. Ignorance + Ego by Anonymous Coward · · Score: 5, Interesting

    There are certain types of software development that seem to attract people who have a combination of significant ignorance and huge egos. Game development is one such field, and Ruby on Rails web development is another.

    These people often are quite young, and as a result of this often have little to no academic background or formal training of any sort. Although they're quite ignorant, they don't realize this fact. This prevents them from keeping their egos in check, which in turn makes them think they know everything. Believing that they're all-knowing, they never both to seek further education or investigate alternatives, and continue to make the same mistakes over and over.

    Having worked in both the game development industry and doing web development more recently, I do have to say that the RoR programmers are much worse than the game programmers. At least the game programmers usually have some understanding of algorithms, and many have a solid understand of mathematics, even if it's all self-taught. Compare this to the RoR programmers, many of whom refuse to learn about databases, even though they're generally developing database-driven applications. You wouldn't believe how many times I've encountered people like this who don't know any SQL, and who don't even know what database indexes are.

    1. Re:Ignorance + Ego by Bengie · · Score: 2

      who don't even know what database indexes are.

      Or people who kind of do and put them all over the place. Nothing says fun like a clustered index on a GUID with a default fill factor.

    2. Re:Ignorance + Ego by ediron2 · · Score: 3, Informative

      Testify, brother!

      My favorite SQL Prima donna was a guy that sr mgmt thought was a prodigy; they overrode our objections and put him solo on a project. Not knowing basic shit like normalization, his app hinged on queries that make my eyes to water just thinking about them a decade later: if QueryName matches name1 or name 2 or name 3 or name4, then again for every other advanced search field. The pinnacle was the advanced search query. It went on for a dozen pages, several just querying 8 wildcardable keywords against almost all columns. Since everything was one huge flat file of redundant columns, indexing couldn't save it. 'Find me commercial plumbers in zipcode X' often timed out after 10+ minutes and would peg one of 2 cpu's on the E450 we were using.

      Two encounters like that bozo convinced me that Prima donnas are a project-killer sort of risk, even if (like code-smell) you sense the problem long before you can articulate the specifics. (NOTE: primadonna != smart or brilliant or savant).

    3. Re:Ignorance + Ego by Anonymous Coward · · Score: 0

      As bad as that is it's still better than heap table.

    4. Re:Ignorance + Ego by Anonymous Coward · · Score: 0

      The rest buy games from them?

    5. Re:Ignorance + Ego by drinkypoo · · Score: 1

      primadonna != smart or brilliant or savant).

      It also != one word. Stick with words and phrases you know.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    6. Re:Ignorance + Ego by Stiletto · · Score: 1

      +5 Insightful, for basically trying to start a language-war? Really?

      Good programmers are good programmers, and idiots are idiots, regardless of the language or framework they use.

  11. Inexcusable by Anonymous Coward · · Score: 0

    Given the freely available sys/queue.h from FreeBSD, which provides macros for several different list types and the common operations on each, this is inexcusable.

    1. Re:Inexcusable by Octorian · · Score: 1

      Macros I actually used extensively when I was in college, and wanted to use common data structures in C code. Of course I only knew about those macros because I knew people who were very involved in FreeBSD that told me about them. (Though writing common functions for linked-list implementations is something you kinda learn in FRESHMAN level CompSci classes.)

  12. these days: STL and Boost by Anonymous Coward · · Score: 0, Insightful

    These days nobody should be writing there own containers, except in VERY atypical situations that don't arise for most people. There are perfectly good implementations of both intrusive and unintrusive containers in STL and Boost, and if you aren't using them, you are being incompetent.

    1. Re:these days: STL and Boost by CastrTroy · · Score: 4, Insightful

      Yeah, but starcraft was written ages ago. It was released in 1998. Which means they probably started coding it in 1996. Possibly earlier. It was probably based off code from Warcraft which was released in 1992. It wouldn't be a stretch to say a lot of the code is close to 20 years old. Granted, it still gives them no excluse for not writing their own library so they didn't access the data structures 100 different ways, but it's not like standard libraries were avaialble for a lot of this stuff back then.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    2. Re:these days: STL and Boost by Anonymous Coward · · Score: 0

      Yes, agreed - I should have been more clear in what I wrote. I do realize SC was written a long time ago and this wasn't an option at the time. I was mostly trying to contrast to how things are today, not trying to blame them in any way. My fault for poorly communicating.

    3. Re:these days: STL and Boost by Anonymous Coward · · Score: 0

      TFA points out they they *did* have their own library for all that snazzy jazz. Management decided not to use it because they were "two months from release" (for 18 months).

  13. You had to have been there by The+Optimizer · · Score: 5, Interesting

    I was working 'down the street' if you will at the time, as a programmer on one of their direct competitors (Age of Empires), and it's easy to forget the circumstances we all were working under at the time.

    People weren't using Templates in games for a couple of reasons - Familiarity being one, but the state of the code was new, and especially the asm outputted by compilers was often very inefficient which it was not outright BUGGY if you pushed it. Templates were still very new then.

    Also, you tend to forget how slow and limited PCs were then -- Your phone today probably runs circles around not just the machines that games were run on, but the PCs used to develop them.

    The System Specifications "On the Box " for Starcraft were - A Pentium 90 (or equivalent - that could be a 486-133) , 16MB of RAM and Windows 95 or NT 4.0, and a SVGA video card with 512kb or 1MB of VRAM. Think about that for a minute. These were 2d video cards, not 3D. Age had almost identical specs. A full rebuild of AoE on our Dev machines (Pentium Pro) took 15-20 minutes to make.

    It was very normal to worry about saving 2 bytes, or just a few cycles of CPU time back then. So you did everything bespoke by hand, and didn't genericsize much.

    And to be honest. We didn't know then what we know now. The programming practices most of my peers just do automatically today -- we hadn't developed/learned them yet. We did what we could with what we had in knowledge and tools, and shipped complete AAA games for costs in man-hours and dollars that seem ludicrously small today.

    Don't get me wrong, Besides being a lot of work, It was a lot of fun too. One thing I remember was our companies putting each other on the Beta Test list for our upcoming games.

    1. Re:You had to have been there by b4dc0d3r · · Score: 2

      Even 1998, Visual Studio had old STL headers which caused memory corruption, data loss, and crashes.

      Apparently a legal dispute stopped them from providing STL updates for 6.0, and they pointed users at Dinkumware's site for manual patching. I think these were the same as the 1997 VC 5 STL, so problems around 1995-1998 with STL were to be expected.

      It was developed privately and presented as a standard in 1993. HP's 1994 release was the basis for a lot of implementations.

      There were bugs, and they were found and fixed, but a lot of bigger compiler companies licensed other STL providers, making an incestuous mess of versions.

      I never really embraced the STL from that point, using only the patched VECTOR which I could be relatively confident would work without slicing off entries above the first 64k.

      According to wikipedia and supplemental info, here's how the STL spread:

      HP (1994) -> SGI (1997) -> STLPort
      +- probably underpinned Rogue Wave -> Apache
      libg++ > libstdc++
      Dinkum -> Microsoft VC++

      I didn't immediately find info on how much Dinkum or libg++ relied on the original HP implementation, if at all, but Dinkum's STL was out in 1995, which seems like fast turnaround for one guy.

    2. Re:You had to have been there by Anonymous Coward · · Score: 0, Insightful

      If only you had a 5 digit UID to lend any credence to your history in the industry.

    3. Re:You had to have been there by cicuz · · Score: 1

      Juicy stuff, here.. Please write a blog post as well? Would love it, and thanks for the work you did anyway ;)

    4. Re:You had to have been there by Anonymous Coward · · Score: 0

      A 5 digit UID? Maybe you should look at his post again. He joined *before* Slashdot even had UIDs. You did too, but I suspect that you're getting too old and can't remember.

    5. Re:You had to have been there by SplashMyBandit · · Score: 1

      > "It was very normal to worry about saving 2 bytes, or just a few cycles of CPU time back then. So you did everything bespoke by hand, and didn't genericsize much."
      Microsoft were famous for doing stuff like this. I remember some story about changing the bootloader for a 5% speed up when booting a 386 that hampered Windows for a few versions (since they needed to remain as backward compatible as they could all sorts of cruft hung around). This kind of thinking cost them a lot of headaches over the years - and resulted in problems (which grizzled Slashdotters remember) and bad perceptions which no amount of PR money is making go away.

      Saving 2 bytes here and there but being so frantic you miss out on big optimizations is not the mark of a heroic programmer or heroic era. It is the mark of people that were then too new to know that "software engineering" requires thought and planning, not caffeine-drenched seat-of-the-pants hackery.

    6. Re:You had to have been there by Anonymous Coward · · Score: 0

      The hell are you talking about. Quake used QuakeC for the game, and ran on a 486/66 with 16MB. That's the difference between someone who knows what he's doing, and morons who try to do everything by hand in C++.

    7. Re:You had to have been there by QQBoss · · Score: 1

      In the 1995, while working for Motorola, I was the assembly language geek asked to save 1 CPU cycle on a critical code loop that Sega promised a PPC console design win if we were able to succeed. The loop was only 16 lines of assembly code which their geeks felt was already maximally optimized based on their experience with an NEC chip. Later business considerations that were MGMT101 issues and not /. issues saw us lose the design win, but I was successful after about 3-4 hours (saved 2 clocks in the first 8 lines, lost one in the last 8, but a win was a win).

      But even by then, anyone who spent every coding moment worrying about 2 bytes or CPU cycles in EVERY routine was a dinosaur. Spending 3-4 hours to save one clock of CPU time in a loop is rarely going to provide a meaningful ROI.

    8. Re:You had to have been there by Anonymous Coward · · Score: 2, Insightful

      Quake most emphathetically needed a Pentium to run fine. This was because the rendering engine used a trick to do perspective corrected texture mapping, but the trick was not fast enough on anything lesser than a Pentium.

      Still, I do not understand your point. Quake used QuakeC for in-game scripting (the movement/behavior of enemies was written in QuakeC and then compiled to bytecode, to be executed by the actual Quake game engine which was written in C/ASM). The entire game was *not* written in it.

    9. Re:You had to have been there by TheLink · · Score: 1

      Yeah, I noticed they didn't use revision control yet. Did your team do without it as well?

      --
  14. Pfft, Starcraft by Anonymous Coward · · Score: 0

    Myth is still superior in every department.

    1. Re:Pfft, Starcraft by DahGhostfacedFiddlah · · Score: 2

      Wait a second - did you just try to troll fans of a 15-year-old game? For your next trick, maybe you can jump into the Genesis-vs-SNES wars, or go political and claim that Dole's going to kick Clinton's ass?

    2. Re:Pfft, Starcraft by shiftless · · Score: 1

      Never heard of it.

  15. Class Hierarchy by phantomfive · · Score: 1
    Check out this class hierarchy from the code:

    CUnit In case you couldn't tell, a CThingy is a sprite that can be drawn, a CFLigny is some kind of particle engine, a CDoodad/CUnit is some artificial separation of concerns. This is in SC1, btw.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:Class Hierarchy by Anonymous Coward · · Score: 0

      Oh god it's just like MFC.

      Aaaaaaaaaaaaaaaaaaaaaaaaahhhhhhh.

      Oh god even the captcha knows: Atrocity.

    2. Re:Class Hierarchy by Stiletto · · Score: 1

      I never understood the practical purpose of prepending a "C" to each of your class names.

      Today, it serves a very useful purpose: It unambiguously identifies a 1990s-era Microsoftie who can't change his ways.

    3. Re:Class Hierarchy by phantomfive · · Score: 1

      I could tolerate that if their names had more meaning than 'thingy' 'flingy' and 'doodad'. The C is the most meaningful part of those names!

      --
      "First they came for the slanderers and i said nothing."
  16. It's very common with programmers by Sycraft-fu · · Score: 2

    I call it Smartest Motherfucker in the Universe Syndrome. You see it all the time on Slashdot: People who seem to think they are gods gift to development. They'll talk about how amazingly stupid Company X is for not doing thing Y, when it is clear they have NO idea of all the shit that would be involved in that. They berate others for bugs in code, yet their own code is bug ridden, and so on. They are just convinced they are WAY smarter than all those other dumb programmers (and IT people, and managers, etc) out there.

    It's a pretty common affliction and leads to more than a few problems. You are correct that it seems to congregate in some areas. I'd expand the RoR thing (though they are pretty bad) to just "web development" in general. Probably because of the massive market and low barrier for entry, it attracts a lot of people who's knowledge does not match their talk.

    1. Re:It's very common with programmers by Boronx · · Score: 2

      I find giving them a huge task with complicated data structures and having them fuck it up does wonders for their humility.

    2. Re:It's very common with programmers by SplashMyBandit · · Score: 1

      Here's an interesting data point that reinforces your statement. For a long time Sun Microsystems was considered to have the best assembly of engineers in IT (although their sales team was balkanized and not customer focussed, hence Sun's demise, but that is a different store). The Sun engineers knew it, and anyone who knew anything also knew it.

      For a long time Sun was subject to 'Not Invented Here' (NIH) syndrome. Since they were the smartest whatever they didn't seem to look around much since they would always implement the idea better. However, and this is what I think made these guys even greater in the end, eventually Sun realized that despite their impressive talents the bulk of great ideas was not actually in the room with them but actual out in the rest of the World (with customers and competitors), "The smartest guys work for someone else". Sun then started to outreach a bit and incorporated good ideas. Unfortunately, due to the impossibility of getting Sun stuff quickly and easily (their sales teams were ponderous and mental in the Internet Age - it was hard to buy their stuff without going through all the sale's teams hoops; despite the Sun gear being reliable and competitively priced) the company died.

      So, if even the awesome Sun guys can humbly realize that they can learn from others (that is, sometimes others are just as smart or smarter) then perhaps we all ought to as well. ... I'd better follow my own advise I guess ... :)

    3. Re:It's very common with programmers by Anonymous Coward · · Score: 1

      For a long time Sun was just the cheaper Unix solution. Once Linux became the cheaper "Unix" solution Sun was doomed.

      Sun were far from the best. Even Unix in those days was not even viewed as the best, just "good enough".

      There were plenty of other contenders with superior reliability and uptime - just more expensive and hence people bought Sun - since it was cheaper and good enough.

  17. A low UID means ... by Anonymous Coward · · Score: 1, Insightful

    If only you had a 5 digit UID to lend any credence to your history in the industry.

    A low UID means that you know about slashdot a long time ago. It does not mean a damn thing on any other topic.

    The GP has point. There was a balance, even in the mid to late 90s. The GGP overstates things, if you were worried about the overhead of calling a common function you made that function an inline or macro. And the fact that my current slashdot account has a 7 digit UID in no way changes the fact that I actually worked on Starcraft and know Pat Wyatt and his partner in crime Mike O'Brien.

    1. Re:A low UID means ... by jittles · · Score: 1

      A low UID doesn't even mean that. I started reading Slashdot in 1999. My UID is from only a few years ago. The only reason I ever even registered an account was to post on a topic I felt very strongly about. So no, I don't put any stock in UIDs at all.

    2. Re:A low UID means ... by Bengie · · Score: 1

      Ditto, but I would have loved to have the epeen factor. I did have an ICQ number in the 1mil range......

    3. Re:A low UID means ... by jittles · · Score: 1

      Yeah I think my ICQ number was in the 600,000 or 800,000 range. And I was one of the first 1000 people on LinkedIn, too. I can use most of LinkedIn's functionality for free. I guess other people have to pay to add people to their network and such? Crazy.

  18. Re:Slashdot and Wikipedia are for fags. by Anonymous Coward · · Score: 0

    Yet here you are.

  19. Re:Causation. Learn it. What really causes the cra by SplashMyBandit · · Score: 1

    Well, I'm surprised linked lists were being used. For my in-progress game (Java combat flight simulator) I will almost never iterate over lists. Using an (associative) 'map' structure is vastly more efficient at runtime. You can still access the complete set as you would an unordered list if you need to, but most of the time you are trying to find a specific object based on some criteria (which the map is good for). Yeah, sounds like having a green programmer work on a bit of code that was heavily used affected everyone in the team. It is a surprised one of the more senior devs didn't see the problem coming and rectify it - but then most commericial games have insanely ambitious development timelines. Fortunately, mine game does not (since, as an 'indie', I'm not relying on it for my main income; and I'm not burning much capital on it either; slower to market, but guaranteed to be a better base for a long lived product line :) re-using the good code in later versions is where I'll make the real money).

  20. Good read, thank you. by Anonymous Coward · · Score: 0

    That is all.

  21. really? by amoeba1911 · · Score: 1

    Blizzard was never any good when it came to programming. Their games are always extremely slow, so you can tell in the back the code is doing some pretty funky inefficient stuff, and the bugs are a glimpse at the underlying spaghetti code. Blizzard's coding should be taught in classes as: What not to do. They're still horrible programmers: UT3 renders ultra-realistic scenes 60fps flawlessly with all the settings on max, while Diablo 3 struggles to draw some top-down view... and that's just the optimization! Looking at bugs, they have some weird funky bugs, for example pressing two keys simultaneously in Diablo 3 made the wizard completely invulnerable. What kind of crappy coder lets that get in there?

    1. Re:really? by Hsien-Ko · · Score: 1

      Dunno about you, but Starcraft ran slick even back in the day on my slow Pentium. Even the latest Starcraft patch works fine and I can even replay demos at a high timeskip without hitching problems on 100mhz.

  22. hmm by berniemne · · Score: 1

    Hmm strange, I've played the shit out of Starcraft and Brood wars. Single player and LAN, too. And not once it crashed. I think it was stable enough.

  23. Horrible, awful inaccuracy in post. by Dahamma · · Score: 0

    All of these lists were doubly-linked to make it possible to add and remove elements from the list in constant time — O(1) — without the necessity to traverse the list looking for the element to remove — O(N).

    Please explain how a doubly linked list now makes add & remove O(1). The rest of us shlums have been relying on hashtables when we needed O(1) and assumed linked lists of any variety were always going to be O(n) at best...

    1. Re:Horrible, awful inaccuracy in post. by smellotron · · Score: 3, Insightful

      Please explain how a doubly linked list now makes add & remove O(1).

      Suppose you have a collection of unit objects, and your main game loop involves iterating through each of them and performing some time-step (move, regenerate energy or health, cooldown weapons, etc.) Now at any point in the "simulation" that is an RTS game, a single unit decides/discovers that it must be deleted. If you are already iterating over units in a doubly-linked list, it is exactly 2 pointer operations for the unit to remove itself from the master list. If you had used a singly-linked list you would need to spend O(N) time searching for the previous unit.

      Oh, and given that you're already iterating over every single unit in the game, you don't need the random lookup that a hashtable provides. Actually, you probably can't afford the lookup table unless it is already solving another problem for you. CPU cycles and cache footprints matter when you want to push the limits of the hardware.

    2. Re:Horrible, awful inaccuracy in post. by Dahamma · · Score: 1

      Your assumption is you already have the item you want to remove. The quote was "doubly-linked to make it possible to add and remove elements from the list in constant time — O(1) — without the necessity to traverse the list looking for the element to remove".

      Of course you can write code to be efficient with a list if you are not searching the list, and if you have a reference to a node without any context to the traversal, a doubly linked list is a good idea. But your explanation was a specific use case while already using the list for a different purpose, not anything that answered my question in the general case, which was ADD or REMOVE without TRAVERSING. (And yes, obviously adding to the beginning or end can be O(1) in either case so that's not really relevant).

      But anyway, it's a dumb statement (the OP not yours) since it seems pretty obvious where a doubly linked list would be useful. If that's the kind of thing the SC programmers were worried about I'm amazed it ever shipped...

    3. Re:Horrible, awful inaccuracy in post. by Anonymous Coward · · Score: 0

      since you are already iterating over the linked list you don't even need the prev pointer in the list node structure just hold a temp pointer to the previous node in the algorithm and use that to delete the current node in O(1) remembering to update the pointer everytime a link is followed.

      there may be oher reasons you need the doubly linked list. however.

      this is where grabbing an off the shelf algorithm might not be the best option for a particular solution.

    4. Re:Horrible, awful inaccuracy in post. by Anonymous Coward · · Score: 0

      But anyway, it's a dumb statement (the OP not yours) since it seems pretty obvious where a doubly linked list would be useful. If that's the kind of thing the SC programmers were worried about I'm amazed it ever shipped...

      This. I ran into a situation that's pretty much the direct equivalent to the WH40K, err, I mean, "Starcraft", folks.

      In 1995, I was a freshman in high school, had a wealth of programming experience developing... infinite loops in BASIC on a C= 64. And for some reason, was intent on creating my own MUD. Being completely clueless with regard to the deeper mechanics of programming, and of C itself, I figured out within a few weeks that doubly-linked lists were a damned good idea for removal of random elements of huge lists. (Oh, hai, list of 80K mobs!)

      I later went on to do things of such unfathomable brutality with pointers that made the gods abandon this world.

      tl:dr: The Starcraft developers were apparently worried about the same things as a clueless kid who couldn't tell his arse from a bubble sort. Hilarious to know.

    5. Re:Horrible, awful inaccuracy in post. by Anonymous Coward · · Score: 0

      Your assumption is you already have the item you want to remove.

      Considering that the original statement is true with that assumption and false without it, I think it's fairly safe to infer that the assumption does, in fact, hold.

  24. In summary by Anonymous Coward · · Score: 0

    So basically, game developers are some of the worst developers out there. Gee...like anyone really needed to read this article to know that.

  25. Unit limit by Kenoli · · Score: 1

    With twice the number of units of its predecessor — StarCraft had a maximum of 1600...

    Nope. Starcraft's unit limit is 1700.

    1. Re:Unit limit by admdrew · · Score: 1

      Wyatt comments a number of times about his spotty memory (it WAS over 10 years ago), so he probably deserves a little slack on the exact numbers.

  26. this was the 90s by decora · · Score: 1

    associate hash maps were some exotic thing found in unversities. your main tools, turbo pascal and microsoft C++, had no such thing. you would have had to write the whole hashmap from scratch. considering they couldnt wrap their heads around writing linked list functions, i dont think a hash map would have worked out any better for them.

    but people should remember the times. this was when a few MB of RAM was considered pretty damn good, dialup was normal, you went to something called a 'software store' to buy your games, which were stocked right next to books about how to write compression algorithms, and the latest version of PC Paintshop.

    if you wanted to open a graphics context, you had to write the routine yourself, by calling interrupts into DOS and then use hand coded address of the graphics screen (A000:0000 iirc). There was no 'windowing system', there was no Standard Template Library, there was no boost, there wasn't really Python, it was just hack hack hack and get it out the door.

    1. Re:this was the 90s by SplashMyBandit · · Score: 1

      There were some excellent libraries, eg Turbo C and C++ libraries, the BGI etc. Although it has to be said that there wasn't a standard 3D library (well, OpenGL [Doom!] and PHIGs etc were among the standards but not for DOS/early Windows PCs; the first version of DirectX came well after gaming was established and it leaked resources like a cardboard bucket - I remember having 20 player connection slots that accumulated and were never recycled, just awful stuff from Microsoft for those of us that were looking at it).