4 ms·
He wrote Liberal Crime Squad [0] which is GPL. If LCS is any indication, the code in DF will be a horrible mess. [0] https://sourceforge.net/projects/lcsgame/
by pengaru 6y ago
He wrote Liberal Crime Squad [0] which is GPL.
If LCS is any indication, the code in DF will be a horrible mess.
[0] https://sourceforge.net/projects/lcsgame/ https://sourceforge.net/projects/lcsgame/
- nitwit005 6y agoThat style seems similar to a number of other terminal games. I think it's just the natural pattern to grow more and more switch statements and arrays if you expand your game without major refactoring. At one point I tried to edit Nethack to make it impossible to die. It was kind of shocked by all the random checks strewn throughout the code.
- LanceH 6y agoA dwarf can only dig deeper.
- Trasmatta 6y agoThanks, just spent some time browsing through that source. At first I was going to say it didn't look too bad, but then saw some comments from someone named Chris Johnson that everything used to be contained in a single game.cpp file. The current state of the source honestly doesn't look too bad. Some large and scary case statements and functions, but that's not always a terrible idea in game dev, and it looks to be well commented. But I'm not sure how much of that is thanks to Tarn or other people that have cleaned up the source. That being said, LCS came out in 2004, so presumably Tarn has improved over the years.
- genocidicbunny 6y agoFrom my understanding, Tarn first and foremost focuses on making the game fun (and Fun) rather than making the code well-organized and clean; I seem to recall some interview or maybe forum post where he made that clear. In practice that likely means that the code is not all that well organized and planned out. Doubly so if he and his brother have been the only ones who have touched it -- there's a lack of outside influence that would drive one to clean up their code. I of course have not seen any of the source code for DF, so I this is purely my own hypothesis.
- Trasmatta 6y agoYeah, agreed. The Dwarf Fortress code might look like a mess to an outsider, but the only thing that really matters is that it works for Tarn. A codebase that will likely only have one contributor ever doesn't need to be written to the same standard as codebases with many contributors. (I believe Tarn does all the programming and Zach does creative work / writing -- somebody correct me if I'm wrong.)
- flatline 6y agoAnd yet I have seen other code bases become true unmaintainable messes after so long a time, even by their creators. DF works remarkably well. I know he has gone through a few large refactorings in the past out of necessity. I doubt the code is pretty or easy to follow, but I also doubt it’s bad in many ways that code can be so.
- p1necone 6y agoThe fact that the game has been seeing continuous development of relatively complex new features for this long means the code can't be too horrible. Perhaps very idiosyncratic and particular to Tarns personal preferences, but certainly not unmaintainable (this is just an assumption though).
- bregma 6y agoI have maintained a fork of LCS. The code is unspeakably horrible. It's like its been run through an obfuscator. It requires a hardened, dedicated developer who has developed life-long immunity to code cooties to hack it.
- larzang 6y agoHe did start out as an academic/scientific programmer, so yeah.