3 ms·
The best thing about this is the open issue claiming it's "Too much like the real Terraria source code." [1] :) This bring back a lot of memories. Way, way bac
by avenoir 9y ago
The best thing about this is the open issue claiming it's "Too much like the real Terraria source code." [1] :)
This bring back a lot of memories. Way, way back in the day i wrote a clone of Battle City [2] in XNA with a half-decent AI. I had intentions to learn and use some OOP patterns. I ended up with a handful of monstrous classes and generally a clusterfuck of spaghetti code. But... i learned a lot about AI and path searching algorithms and, best of all, it worked. I think i still have this code sitting on a disk somewhere. This makes me want to throw it on Github.
Thanks for sharing!
[1] https://github.com/raxod502/TerrariaClone/issues/2 https://github.com/raxod502/TerrariaClone/issues/2
[2] https://en.wikipedia.org/wiki/Battle_City_(video_game) https://en.wikipedia.org/wiki/Battle_City_(video_game)
- TeMPOraL 9y agoHoly shit. Be sure to read the issue. It turns out it's not really a joke - someone in the know points out that Terraria's code is basically the same quality, if not worse...
- sciolistse 9y agoYou used to be able to decompile Terraria into perfectly readable code, since its c# and they didnt use an obfuscator. The code base was atrocious, but it is impressive that they got something working, and pretty fun, together as quickly as they did. These days there are a fair amount of production Unity games out that you can extract full sources for.. Can make for a fun read sometimes.
- rootw0rm 9y agooff the top of my head Rimworld comes to mind
- Kuraj 9y agoIf I remember correctly, the author of Terraria was also just learning C# as he went on with this project. It's a huge success story in my book.
- Too 9y agoI think Unity forces you into a pattern that you are not used to, this can easily get you out of your comfort zone resulting in very funny architecture before you get used to it. The concept of GameObjects, Components and MonoBehaviours and best practices for how they should be composed isn't exactly obvious. Eg when adding two components of the same type to a GameObject it's hard to know which one of them is which (eg two colliders: one for triggers and one for physics) so instead you add two sub-Gameobjects each with that component attached and use gameobject.GetParent() to modify the parent. Is that best practice or not, i don't know, i just did it and it works but it certainly feels strange.
- taw55 9y agoBloody Hell, that code “snippet” just keeps on giving. Makes me feel a bit better about that tightly coupled ball of mud I barfed out last week. Lol.