Granted, it's not really fair to compare anyone to the id software team of the time. But the requirements of the Quake series, basically a BSP renderer that is easy to modify and extend, probably forces it to be extensible and clean.
Many games are held together by duct tape
101–110 of 155 posts
Re: Many games are held together by duct tape
#102Wow a 3440 line switch statement for processing game state! https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_...
For me - and I mostly do frontend apps now - I always advise to go for state pattern instead of complex if/thens. Thanks to the aforementioned article.
Re: Many games are held together by duct tape
#103I recently found myself trying to describe modern software techniques to a layman, who is a carpenter. "Its like this - you're hired to build a house. First, you have to go get someone motivated to harvest the raw materials for you - designs, logic, etc. - which will then be turned into the 'raw wood' that holds up the walls and keeps the roof on. Then, when that person is busy getting the materials cut, you start bu…
Re: Many games are held together by duct tape
#104Earlier quoted context omitted.
You have not worked on bad enough code base. Duplication is a problem as the different implementations inevitably drift and get repeated bugs, but simple reduplication results in the rather known problem of RavioliCode( ) of thousands low cohesion functions. Which ends up unreadable thus bug prone and slow to develop. Use of the right patterns or rather paradigms reduces amount of code in general, thus reducing dupli…
'You have not worked on bad enough code base.' You know, it is a bit pretentious to read a few sentences that someone wrote and then conclude a lot about what they know or do not know. And I actually do know what ravioli code is. I think ravioli code is mostly a good thing. Also the people on the c2.com page are not uniformly negative about it. Not all code should be ravioli code but in a project with complex require…
Preferable state is high internal cohesion and low coupling. Most code is opposite. Ravioli is when you trade high coupling without introducing cohesion, which is structure. Typical state after dumb refactor rather than rework.
Simple extraction of functions does not get you anything (if done well within a module, maybe increases cohesion), while making them reusable modules trades reduced cohesion for increased coupling, which is bad.
If you deduplicate too much you suddenly cannot change anything simply... As every place that got deduped is now coupled to one implementation. Once you need some special care, you get to replicate it again oftentimes.
Only true primitives are really worth it to not replicate and parts of code that won't change. (Ask the crystal ball again.)
See if deduplicaton gets you any of useful high level designs, like MVC, event-driven, reactive, message based. Without overarching design, you end up with a mass of locally useful ones that together are incompatible thus requiring lots of different, unique glue code.
The big mistake people do is to equate design patterns with code patterns. Which is what the silly GoF book did a lot. For example "fire and forget background parallel tasks" is a design pattern. Reactor (executes Strategies to deal with Events) is one while Singleton or Context are not. Event also is not. Etc. Generally anything that doesn't actually structure anything is a code pattern.
Re: Many games are held together by duct tape
#105I run a small MMORPG and I'm considering open-sourcing the whole thing but the code is a complete mess. The source code of VVVVVV is a work of art in comparison. What holds me back are 1. I'm ashamed to reveal the monstrosity 2. I'm afraid the code is too messy for anyone to be able to make contributions 3. it will make it much easier for hackers to find exploits. It's a shame because I think the game would be really…
I was working on something similar (small mmo) a few years back and would have killed for at least one example that had been shared. Part of this was to see how they did gongs, part of it (more importantly to me) was to know that there were other crazy people out there doing the same thing!!
What is a "gong" in this case? An actual (in-game) gong? :)
Re: Many games are held together by duct tape
#106Ex-Game dev here: shipped many titles on console (AAA and some zzz titles). When comes time to shipping a game, the crunches, pressure and overall stress is through the roof. Most everything goes at that point: duct tape, hot glue, bobby pins and toad spit. And if you disagree with management over these 'not so best practices' (in order to ship faster...) they will find someone to do it and you could be out of a job.…
Re: Many games are held together by duct tape
#107Earlier quoted context omitted.
> and that if you wanted to increase the FPS you could plug in more mice I am having trouble imagining what sort of event handling bs this might be taking advantage of... I am too vanilla a coder at this point in my life.
I'm not a game dev, but rough guess: the framerate is artificially limited to some 'sane' range by the equivalent of a short sleep() which is cancelled by an input event. More devices, more events, more chance to prompt the next frame early?
Re: Many games are held together by duct tape
#108As a counterpoint, the Quake -> Quake 2 -> Quake 3 original open source releases are remarkably clean. Quake 2 in particular is very minimalist and the game was developed in something like 10 months. Granted, it's not really fair to compare anyone to the id software team of the time. But the requirements of the Quake series, basically a BSP renderer that is easy to modify and extend, probably forces it to be extensib…
Re: Many games are held together by duct tape
#109Ex-Game dev here: shipped many titles on console (AAA and some zzz titles). When comes time to shipping a game, the crunches, pressure and overall stress is through the roof. Most everything goes at that point: duct tape, hot glue, bobby pins and toad spit. And if you disagree with management over these 'not so best practices' (in order to ship faster...) they will find someone to do it and you could be out of a job.…
Example: Product which ran part of our business for the last 15 years, is the worst code I have seen in my entire life. I have seen better code written in a state university. However, it did its job and generated a lot of money in the process.
I think delivering glued/hacked code happens in many places.
Re: Many games are held together by duct tape
#110Wow a 3440 line switch statement for processing game state! https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_...
And it works! I learned a lot about preventing magic with this here: https://gameprogrammingpatterns.com/state.html For me - and I mostly do frontend apps now - I always advise to go for state pattern instead of complex if/thens. Thanks to the aforementioned article.