• (cs)

    The game must not be very good. The better ones kick that up to 11!

  • l1fel1ne (unregistered)

    So if the parents are 3... would that make 1 the great grandparents of 3?

    I think this example is a perfect argument against the use of magic numbers :)

  • Dave (unregistered)

    What's wrong with parents these days?

  • (cs)

    I'd bet that there's more than a few joke variables in that code, like ThisGameSucks = TRUE and so on.

  • dustin (unregistered) in reply to Volmarias

    lol

    Whats the point of comments if your not going to update them.

    Might as well remove them.

  • (cs)

    I see what he did.

    // MUST be set to 1!

    So, 1.

    But, at the same time:

    // QA now insist this is set to 2.

    How do you assign it to 1 and 2 simultaneously? Thusly:

    Params->ParentalLevel = (1 + 2); Params->ParentalLevel = 3;

    Brillant!

  • Sarkie (unregistered)

    Not 12?

  • anon (unregistered)

    For my first post, I really must take issue with your statement that code quality is not of importance in the games industry.

    It is certainly true that code quality is very rarely made a priority in the games industry, but this is a pathological trend, and should not be accepted and dismissed as "the way things are". Nowadays, to fight the ever-increasing cost of developing a competitive videogame, companies are starting to reuse their code, and recycle or adapt the same engine for multiple games. Take the Unreal Engine for example.

    Code quality and maintainability are essential here. Though I admit that standards of quality are likely different than those in the 'real world', the quality of the codebase still has a direct effect on the cost of videogame, and the amount of time and money it takes to recycle the reusable code. The better companies will be taking strides in advancing the quality of code in their videogames because it will directly translate into cheaper and faster projects.

  • whicker (unregistered)

    If the name of that variable has not been anonomyzed, then the situation almost appears to make sense.

    Let's say for testing in-house, it absolutely has to be 1, or it will anger people or completely not work.

    Then QA gets initally involved for whatever reason... because maybe management is concerned about whatever "feature" that enables. (Maybe asking for the parental protection password? Hmm.)

    But finally it comes time to ship, and everyone knows all along it had to be set to 3 in the end, so they did that.

    However,

    As somebody has been taking source code home (along with some company equipment) and needs some reminders on how to get it to run again on development equipment, the comment never got deleted.

    The only wtf is company dynamics.

  • mr_smee (unregistered) in reply to Sarkie

    But this one goes to 11.

  • Jim (unregistered)
    I generally don't publish code from the videogames because I don't believe that code quality is as important in that industry. Short of the occasional patch, once the product is shipped, it's done; there's no ten-year lifespan to worry about.

    I think there's a few programmers of online games in general and MMOs in particular who'd argue your point there!

  • andrey plakhov (unregistered)

    I don't believe that code quality is as important in that industry. Short of the occasional patch, once the product is shipped, it's done

    Man, this is absolutely wrong; contemporary videogame (especially one for PS2 or XBox) is much more hard and interesting to develop than typical business app. First, on PS2 you have 32M memory and no swap file. So, you must manage huge resources like textures very smart and carefully. Second, you typically have no HDD, so every graphics or sound resource you use comes from such a slow-access device like DVD. But your players don't want to watch a "Please wait loading" screen, so you must foresee what resources to pre-load, and how to fit all of them in those 32M. There are tales of esoteric algorithms to perform such a task, and in fact you must really be a guru to use their power. Third, games are realtime apps. Less that 40FPS? Your project not gonna ship. Sometimes a little lag because your AI is a bit too smart and thinks a bit too much? Your project not gonna ship. Last, only one crash bug - and platform holder (M$ or Sony) simply won't allow your game to ship. Hey, how many "serious" apps that never crash do you know?

  • facetious (unregistered)

    For many video games, code quality does not matter post-release. Remember: most video games are on consoles. Games on PCs are able to be patched .. games on the xbox360 are able to be patched .. but in general, the majority of video games are stuck in whatever state they were released.

    If a new version of a game is ever released, it's released as a new title with new features and most likely a new storyline/game dynamic/something else different.

    This is not an industry that requires backward compatibility to MS Word 1.1 for those people using computers from the stone age.

  • David Dunham (unregistered)

    I consider code quality in the game industry MORE important, since we don't have the opportunity to patch! You server guys can just fix a file at any time. We have no practical way to deploy fixes, so it's got to work out the door.

  • Zonkers (unregistered) in reply to anon
    anon:
    For my first post, I really must take issue with your statement that code quality is not of importance in the games industry.

    It is certainly true that code quality is very rarely made a priority in the games industry, but this is a pathological trend, and should not be accepted and dismissed as "the way things are".

    I totally agree with anon here. Usually games have like a 2-5 year dev cycle before initial release anyway. That in itself makes code quality important, otherwise that time can get longer and longer. Not to mention that usually there is some serious refactoring is going on in the process, as hinted at by this WTF.

  • facetious (unregistered) in reply to David Dunham
    David Dunham:
    I consider code quality in the game industry MORE important, since we don't have the opportunity to patch! You server guys can just fix a file at any time. We have no practical way to deploy fixes, so it's got to work out the door.

    .. I'm pretty sure he was talking about the "maintainability" kind of quality... not the "bug-free" kind of quality. The representative line should be a hint as to the type of quality he meant. If it was some obvious bug that would make the system explode three minutes into the fourth cutscene .. well, that's one thing. But it looks like this code would work - it's just horribly documented.

    Hence, the line has no "maintainability" quality.

  • Marcin (unregistered)

    I'm shocked that this is not a #define. That being so, they cannot verify that the parentallevel does not vary through the game!

  • (cs) in reply to Saladin
    Saladin:
    Params->ParentalLevel = (1 + 2); Params->ParentalLevel = 3;

    Brillant!

    Actually,

    ParentalLevel = (1 & 2);

    ..but you get the same result anyway.

  • andrey plakhov (unregistered) in reply to facetious
    I'm pretty sure he was talking about the "maintainability" kind of quality... not the "bug-free" kind of quality

    That isn't right too. Typical videogame takes 2 years and a crew of 5-10 programmers to develop (and a total team of 40 - 150 artists, designers and so on). Isn't maintainability critical in such a case? In fact, when I worked for Nival Inc., we fired programmers which tended to initialize strings directly in code (not from resource files), use undocumented magical numbers, design 100-member interfaces, and produce other unmaintainable constructs.

  • anon (unregistered) in reply to facetious
    facetious:
    For many video games, code quality does not matter post-release. Remember: most video games are on consoles. Games on PCs are able to be patched .. games on the xbox360 are able to be patched .. but in general, the majority of video games are stuck in whatever state they were released.

    This is true, but I believe you are downplaying the importance of being able to patch games and deliver significant functional content in the modern game marketplace.

    If a new version of a game is ever released, it's released as a new title with new features and most likely a new storyline/game dynamic/something else different.

    But most times on the same, albiet modified, engine. Without quality coding on the first game, the second would take much longer to finish.

    The main point is that reusability keeps the same engine in use for 3-5 years, maybe more, and without some quality standards it quickly becomes a mess of spaghetti code that is unreadable, unmaintainable, and effectively unusable for future games.

  • (cs)

    The people who are complaining that gaming code needs to be of much higher quality don't understand what Alex meant. He was saying that once the product ships, no one can go back and change the code. If you ship it out the door and it works perfectly, it doesn't matter what kind of mess your code is.

    As mentioned, this doesn't apply to the few game engines that are re-used or the games that are patchable. But who cares if your code is a mess once it's released. No one can update it anyways.

    I'm not taking sides but that's how I understood the commentary.

  • Simon Bradley (unregistered) in reply to savar

    I presume you meant (1 | 2).

  • Veinor (unregistered) in reply to savar

    Actually, 1 & 2 = 0. You're either thinking of 1 ^ 2 or 1 | 2.

  • Simon Bradley (unregistered)

    Yikes! What's going on? How could I have accidentally posted multiple times before I'd even typed "onomatopoeia"? :D

  • chris (unregistered) in reply to andrey plakhov
    andrey plakhov:
    I don't believe that code quality is as important in that industry. Short of the occasional patch, once the product is shipped, it's done

    Man, this is absolutely wrong; contemporary videogame (especially one for PS2 or XBox) is much more hard and interesting to develop than typical business app. First, on PS2 you have 32M memory and no swap file. So, you must manage huge resources like textures very smart and carefully. Second, you typically have no HDD, so every graphics or sound resource you use comes from such a slow-access device like DVD. But your players don't want to watch a "Please wait loading" screen, so you must foresee what resources to pre-load, and how to fit all of them in those 32M. There are tales of esoteric algorithms to perform such a task, and in fact you must really be a guru to use their power. Third, games are realtime apps. Less that 40FPS? Your project not gonna ship. Sometimes a little lag because your AI is a bit too smart and thinks a bit too much? Your project not gonna ship. Last, only one crash bug - and platform holder (M$ or Sony) simply won't allow your game to ship. Hey, how many "serious" apps that never crash do you know?

    Are you serious? I've seen plenty of games get shipped that are below 40FPS (30FPS is considered a minimum, usually) and drop below 30 at some points. Seen plenty that lag for whatever reason. Seen plenty that completely crash the game, destroy memory cards, or some other strange crash. The bottom line is to get the game out the door and sell some copies. That's generally all a publisher cares about.

  • Look at me! I'm on the internets! (unregistered) in reply to Simon Bradley
    Simon Bradley:
    Yikes! What's going on? How could I have accidentally posted multiple times before I'd even typed "onomatopoeia"? :D

    Obviously you have a stammer

  • SmashAndGrab (unregistered)

    It must be the 'New' pointer math....

  • andrey plakhov (unregistered) in reply to akatherder
    The people who are complaining that gaming code needs to be of much higher quality don't understand what Alex meant.

    Well, if gaming code didn't need quality, this could be a reason. But I did work inside videogames industry (and outside too), and yes it does need good quality maintainable code (eh well except some 19,95 PC games however ;)

    So any hypothetical reason for not-needing-much-quality, including Alex's, will be just wrong, no matter if it looks right. And I tried to explain why there are reasons for opposite too.

  • SomeCoder (unregistered)

    Yes, if I recall correctly from my days when I studied game development, 30 FPS is the minimum needed for the human eye. Any less and it's choppy, any more and it's gravy.

    Obviously getting more is better - to a point. 60 FPS is really smooth...

    Captcha: pinball... FPS don't matter much there, do they!

  • andrey plakhov (unregistered) in reply to chris
    I've seen plenty of games get shipped that are below 40FPS (30FPS is considered a minimum, usually) and drop below 30 at some points. Seen plenty that lag for whatever reason. Seen plenty that completely crash the game, destroy memory cards, or some other strange crash. The bottom line is to get the game out the door and sell some copies. That's generally all a publisher cares about.

    Ok, maybe I was too emotional at that - but Alex started first :) Yes there are so-called budget titles (like that of Activision Value, most of 19$ games, most of PC games, some ported games); some bugs slip through even thorough testing; yes you can trick Microsoft's QA department if you really need to ship or simply don't think about the future; and not everyone in games industry is a Paladin with a Sword of the Righteous. But saying code quality doesn't matter at all is... ehm... plain wrong, and so I wrote all that long comments.

  • (cs) in reply to anon
    anon:
    For my first post, I really must take issue with your statement that code quality is not of importance in the games industry.

    It is certainly true that code quality is very rarely made a priority in the games industry, but this is a pathological trend, and should not be accepted and dismissed as "the way things are". Nowadays, to fight the ever-increasing cost of developing a competitive videogame, companies are starting to reuse their code, and recycle or adapt the same engine for multiple games. Take the Unreal Engine for example.

    Code quality and maintainability are essential here. Though I admit that standards of quality are likely different than those in the 'real world', the quality of the codebase still has a direct effect on the cost of videogame, and the amount of time and money it takes to recycle the reusable code. The better companies will be taking strides in advancing the quality of code in their videogames because it will directly translate into cheaper and faster projects.

    Way to miss the point dude.

  • Kiss me, I'm Polish (unregistered)

    Is this a "hit a penguin with a baseball bat" game? It certainly needs parental control when it comes to the blood splatters.

  • (cs) in reply to savar
    savar:
    Saladin:
    Params->ParentalLevel = (1 + 2); Params->ParentalLevel = 3;

    Brillant!

    Actually,

    ParentalLevel = (1 & 2);

    ..but you get the same result anyway.

    Wrong! 1 is 1 in binary 2 is 10 in binary 1&10 is 1 (binary AND) 1&&10 is 0 (bit-wise AND)

  • WtF? (unregistered) in reply to SomeCoder

    True, in the past, games probably got pushed out the door with an engine that were in a horrible and unspeakable mess. Nowadays, the same engine will be reused in a lot of titles, given a facelift to be used in the next generation of games, where it will live on in quite a few games. Heck, that is how Id software and a few others makes most of their bucks.

    And then we have the MMO market of such games as Everquest, that is still going strong, and probably will still be going a decade after it were released.

    So the days of sloppy game code is over, or the company indulging in such practises is over (Or called EA)

  • Tim (unregistered)

    I work in the videogame industry and code quality is vastly important AND code is re-used from product to product. Just because the name of the title is different and some game play mechanics are different doesn't mean you can't re-use code. Rendering, physics, memory management, etc, is still the same. We also have huge constraints on memory and need to run as fast as possible. Also, most critical of all, we don't get to release daily bug patches to the public (I write for consoles, not PC), so we have to get it right the day we ship. If our code is a mess, we stand no chance of releasing a quality product.

    That said, I had to a quick search to see of today's WTF is from our code base :)

  • A frustrated 3DRealms fan (unregistered)
    there's no ten-year lifespan to worry about.

    Three words:

    Duke. Nukem. Forever.

  • (cs)

    Anyone claiming that quality matters a lot in gaming is kidding themselves, when it comes to PC games. Look at one of the biggest game publishers out there: EA Games. The stuff they put out is pure, unadulterated shit in terms of bugginess/quality (See: Battlefield: 2142) but that doesn't stop them from being successful. The PC gamer market takes poor quality code bent over and begging for more. Why would a company decide that quality matters when they see a shithole like EA Games so successful?

  • Rafasgj (unregistered) in reply to Sarkie

    Nope.

    0x01 | 0x02 = 0x03.

  • Niklas Ulvinge (unregistered) in reply to zlogic
    zlogic:
    savar:
    Saladin:
    Params->ParentalLevel = (1 + 2); Params->ParentalLevel = 3;

    Brillant!

    Actually,

    ParentalLevel = (1 & 2);

    ..but you get the same result anyway.

    Wrong! 1 is 1 in binary 2 is 10 in binary 1&10 is 1 (binary AND) 1&&10 is 0 (bit-wise AND)

    Actually it's the other way around: 1&10 is 0 (binary(bitwise) AND) 1&&10 is 1 (logical(boolean) AND)

  • Glenn Lasher (unregistered) in reply to savar
    ParentalLevel = (1 & 2);

    No. 1 & 2 == 0. 1 | 2, on the other hand...

    Captcha: slashbot. Oh well, I have enough mod points to take care of that.

  • N-state (unregistered) in reply to WtF?

    I was waiting for someone to (finally) make the point about massively multiplayer online and many online games in general today.

    Many of these games are around for years, and are patched periodically, not only to fix bugs, but to also deliver new content and functionality.

    I expect they wouldn't effectively meet their dates if they didn't use good coding practices. Of course, some of the moby slips in the industry are probably indicative of just that - but don't quote me on that.

    Captcha: howdy!

  • Glenn Lasher (unregistered) in reply to SomeCoder
    Yes, if I recall correctly from my days when I studied game development, 30 FPS is the minimum needed for the human eye. Any less and it's choppy, any more and it's gravy.

    Obviously getting more is better - to a point. 60 FPS is really smooth...

    Part of this depends on what you are playing on, of course. If you are playing on a PC, fine. If you are playing on a console, however, PAL televisions display 25FPS; NTSC 30FPS (actually 29.97 -- don't ask). Only when you get into EDTV and HDTV models can you get to 60, and no more than that.

    Of course, this neglects that PAL and SECAM, being interlaced, can produce 50 (for PAL) or 60 (actually 59.94 -- no, don't ask -- for NTSC) fields per second, each of which is a half-frame. done right, it can look okay, but it will never look actually smooth.

    Captcha: quake. How appropriate, eh?

  • Abscissa (unregistered)

    "I generally don't publish code from the videogames because I don't believe that code quality is as important in that industry."

    Wrong! Try working on a project of that scope and THEN try to claim code quality matters less. The code quality typically matters MORE just because the scope is so much larger than the vast majority of IT software.

  • (cs)
    :
    zlogic:
    savar:
    Saladin:
    Params->ParentalLevel = (1 + 2);
    ParentalLevel = (1 & 2);

    ..but you get the same result anyway.

    Wrong! 1 is 1 in binary 2 is 10 in binary 1&10 is 1 (binary AND) 1&&10 is 0 (bit-wise AND)
    Wrong, 1 & 10 is 0: bitwise AND 1 && 10 is 1: boolean AND
    Sorry to put a damper on the argument, guys, but my original post was just intended to be pseudocode, i.e. "1 + 2 = 3." I wasn't paying any mind to what the technically correct operator to use would be.

    Keep discussing it if you're bored though :D

  • (cs) in reply to Glenn Lasher
    Glenn Lasher:
    done right, it can look okay, but it will never look actually smooth.
    Unless you render more frames than the video signal can handle and combine them, giving natural motion blur, which is how cinema movies and so forth manage to look perfectly smooth at even lower frame rates.
  • nobody (unregistered)

    So is this code from the version of Grand Theft Auto that allowed gamers to access sexually explicit material? The parental level was set wrong?

  • (cs) in reply to l1fel1ne
    l1fel1ne:
    So if the parents are 3... would that make 1 the great grandparents of 3?

    I think this example is a perfect argument against the use of magic numbers :)

    // MUST be set to EVERYONE! Params->ParentalLevel = MATURE; // QA now insist this is set to TEEN.

    Yeah, it makes much more sense when you don't use magic numbers.

  • SomeCoder (unregistered) in reply to Glenn Lasher
    Glenn Lasher:

    Part of this depends on what you are playing on, of course. If you are playing on a PC, fine. If you are playing on a console, however, PAL televisions display 25FPS; NTSC 30FPS (actually 29.97 -- don't ask). Only when you get into EDTV and HDTV models can you get to 60, and no more than that.

    Of course, this neglects that PAL and SECAM, being interlaced, can produce 50 (for PAL) or 60 (actually 59.94 -- no, don't ask -- for NTSC) fields per second, each of which is a half-frame. done right, it can look okay, but it will never look actually smooth.

    Captcha: quake. How appropriate, eh?

    Yes, that's true. When I studied game development it was for PC only so... yeah, that's where I was coming from :)

  • snqow (unregistered)

    Maybe it came from this game:

    http://www.youtube.com/watch?v=QQ3M5h_zL3U

    http://www.gamespot.com/pc/driving/bigrigsotrr/review.html

    But I digress, the game I linked doesn't seem to have any QA at all

  • (cs)

    Do all of these video game programmers have some sort of reading disability? Alex's qualifying statement was:

    "Short of the occasional patch, once the product is shipped, it's done"

    Most games (especially console) don't have patches and updates. Most games don't have an engine worth re-using. And any code you can re-use (memory management, wall wireframes, etc) was probably already re-used from a previous game. Once the product is working and ships, it doesn't matter what the code looks like.

    I used to think gaming coders were smart but they're just as easily offended, nitpicky, and whiny as the rest of us.

Leave a comment on “Gaming Ground”

Log In or post as a guest

Replying to comment #:

« Return to Article