- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The game must not be very good. The better ones kick that up to 11!
Admin
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 :)
Admin
What's wrong with parents these days?
Admin
I'd bet that there's more than a few joke variables in that code, like ThisGameSucks = TRUE and so on.
Admin
lol
Whats the point of comments if your not going to update them.
Might as well remove them.
Admin
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!
Admin
Not 12?
Admin
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.
Admin
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.
Admin
But this one goes to 11.
Admin
I think there's a few programmers of online games in general and MMOs in particular who'd argue your point there!
Admin
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?
Admin
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.
Admin
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.
Admin
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.
Admin
.. 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.
Admin
I'm shocked that this is not a #define. That being so, they cannot verify that the parentallevel does not vary through the game!
Admin
Actually,
ParentalLevel = (1 & 2);
..but you get the same result anyway.
Admin
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.
Admin
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.
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.
Admin
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.
Admin
I presume you meant (1 | 2).
Admin
Actually, 1 & 2 = 0. You're either thinking of 1 ^ 2 or 1 | 2.
Admin
Yikes! What's going on? How could I have accidentally posted multiple times before I'd even typed "onomatopoeia"? :D
Admin
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.
Admin
Obviously you have a stammer
Admin
It must be the 'New' pointer math....
Admin
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.
Admin
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!
Admin
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.
Admin
Way to miss the point dude.
Admin
Is this a "hit a penguin with a baseball bat" game? It certainly needs parental control when it comes to the blood splatters.
Admin
Admin
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)
Admin
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 :)
Admin
Three words:
Duke. Nukem. Forever.
Admin
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?
Admin
Nope.
0x01 | 0x02 = 0x03.
Admin
Actually it's the other way around: 1&10 is 0 (binary(bitwise) AND) 1&&10 is 1 (logical(boolean) AND)
Admin
No. 1 & 2 == 0. 1 | 2, on the other hand...
Captcha: slashbot. Oh well, I have enough mod points to take care of that.
Admin
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!
Admin
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?
Admin
"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.
Admin
Keep discussing it if you're bored though :D
Admin
Admin
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?
Admin
// 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.
Admin
Yes, that's true. When I studied game development it was for PC only so... yeah, that's where I was coming from :)
Admin
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
Admin
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.