8 ms·
These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 5
by nsxwolf 14y ago
These seemingly "big" games written in a handful of lines of code always make me feel very, very stupid. I know if I made this, I could easily imagine writing 50,000 lines.
How do people do this? How do their minds work?
- brooksbp 14y agoIt's all about standing on the shoulders of giants.
- nsxwolf 14y agoWell, that's certainly true when we're talking about the underlying 3D graphics libraries, IO, etc. But it seems like there's still a lot more to the rest of it, and that it shouldn't fit in 500 lines of code. This one really gets me as well: http://www.mojang.com/notch/j4k/l4kd/ http://www.mojang.com/notch/j4k/l4kd/
- tripzilch 14y ago> it shouldn't fit in 500 lines of code. Talk to me about "shouldn't" when we start breaking the Shannon-limit or other hard information-theoretical limits :-P
- kaoD 14y agoTake a look at the code, it's not THAT hard when you have the right tools (language, libraries, knowledge...) though it's quite awesome nonetheless. IMHO the game actually shows how powerful Python + Pyglet (OpenGL actually) are. Wanna get your mind blown even harder? Check some 4kb demos[1]... and that's binary size! No JVM/Python runtime supporting it. [1] http://www.youtube.com/results?search_query=4kb+demo&page=&utm_source=opensearch http://www.youtube.com/results?search_query=4kb+demo&pag...
- nwh 14y agoIf you want to show off the demoscene, try the 64KB prod "Chaos Theory". https://youtu.be/4DjBq2O0XXk https://youtu.be/4DjBq2O0XXk
- kaoD 14y agoI had to draw the line somewhere. If I could show the WHOLE demoscene...
- guiambros 14y agoIf you want to really show off the demoscene, try Farbrausch - fr-041. It's comparatively very big (179KB), but impressive how they were able to squeeze so much stuff there: video http://www.youtube.com/watch?v=wqu_IpkOYBg http://www.youtube.com/watch?v=wqu_IpkOYBg, official repository: http://j.mp/11ETcY0 http://j.mp/11ETcY0. If you want to dig deeper, Farbrausch published most of their material and tools last year including the source code for fr-041. Search for farbrausch on GitHub. But I must say, it's pretty hardcore.
- n2dasun 14y agoThat is so incredible.
- ditoa 14y agoWhile demoscene stuff is seriously impressive most are using a shit load of DirectX to do what they do in such a small size. They are not bare metal demos.
- kaoD 14y agoObviously. You can't program the GPU without driver interfaces (DX/OGL). (DirectX + 4kb) vs. (OpenGL + Python + Pyglet + 500LOC) = 4kb vs. (Python + Pyglet + 500LOC) Long are gone the days when you could manage the framebuffer yourself :) Specially if you want to run the demo in modern OSes.
- estebank 14y agoI still remember how I was blown away when seeing .kkrieger[1][2] for the first time, introducing me to the potential of procedural assets in games. [1] http://en.wikipedia.org/wiki/.kkrieger http://en.wikipedia.org/wiki/.kkrieger [2] http://www.youtube.com/watch?v=2NBG-sKFaB0 http://www.youtube.com/watch?v=2NBG-sKFaB0
- kaoD 14y agoYeah, it's really awesome. Check werkkzeug3, a demotool for procedural asset generation by the .kkrieger team (Farbrausch). It's in Farbrausch's GitHub with many more demos/demotools https://github.com/farbrausch/fr_public https://github.com/farbrausch/fr_public
- crazysaem 14y agoI think its most impressive to actually run the demos themselves. On this site are some good examples: http://awards.scene.org/archive.php?year=2011&cat=9 http://awards.scene.org/archive.php?year=2011&cat=9 Edit: It would be intresting to see demos like this (4KB / 64KB) for WebGL. Does something like this exist already ?
- waterlesscloud 14y agoExperience. Code a lot. Write games a lot.
- IsTom 14y agoActually this demo lacks any of big or mid-sized features (as in implementation) of Minecraft, such as infinite world, terrain generation, mobs, mechanisms (pistons/redstone).
- iuguy 14y agoYou must be great fun at parties.
- chinpokomon 14y agoMost "Doom clones" just showed static maps and lighting too. They aren't really games at this point, the are just demonstrating the techniques to create some aspect of the game, usually a world view like in this project. Within this project you see voxels with textures, rudimentary world building, and interaction with the world controlled by the direction the camera is looking. I think that is sufficient to call it a "Minecraft clone." This still has a ways to go before it can be called a game, but that wouldn't make it less interesting as a teaching aid.
- easytiger 14y agoThat's because its not a game is a proof of concept
- r0s 14y agoThe code I invent myself is almost always a big mess. When I'm working seriously, I research the answer to the problem. This produces slower results, better code. The other trade off is I'm not working from direct memory or skill, so co-workers have less respect for me, even if "my" solution is better than theirs. This makes me functional years ahead of my experience, but belies a true understanding of the concepts. As I methodically catch up with myself over time, this is less true.
- tripzilch 14y agoI'm exactly the opposite. Whenever I see a project consisting of 50,000 lines of code, I am amazed that somebody had the stamina to bite down and actually write all that code. I could never imagine myself writing 50,000 lines, I'm way too lazy for that. Fifty-thousand lines? You could write a universe in that, with a high-level language like Python (or in assembly, a smallish planet). Semi-kidding aside, it's part laziness and part DRY-principle. I hate writing code twice, even if it's two chunks with similar functionality. If they are so similar (in an abstract way), there's probably a reason for that, and I try to capture that reason into my code by unraveling the similar parts from the specific parts. That usually makes it smaller. Can you imagine what happens if those 50K lines (comments/white-space aside) all implement nearly unique functionality? Those 64k demos linked upthread are what happens. I'm going to guess those are 100K-250K lines C++ [1], maybe? But then, a prize-winning 64k probably does a little bit more than a basic partial Minecraft engine :-P Since you're asking "how do their minds work?", maybe I can get a little bit obsessive over this optimizing (wouldn't call it OCD--that would trivialize the disorder), but I do really get a slight "mind itch" if I notice code with duplicate functionality. [0] Sometimes it doesn't. But often there's other advantages, too. If that's not the case either (or I'm on a deadline), I grit my teeth and write the duplicate code, but I try to make it really obvious that it is duplicate. That way at least it'll compress well :P [1] Not even the 4K demos use pure assembly any more, compiler tricks and exe packers have become amazing in the past decade since I stopped making them. Not counting the external procedural/generative design tools/Werkzeuge, btw.
- octo_t 14y agomost 50 KLOC projects were not written by one person, but rather by lots and lots of them. For example the scala compiler + standard library: find src -name "*.scala" | xargs cat | wc -l = 244,601 git log --format="%an" | sort | uniq | wc -l = 149
- redblacktree 14y agoWhen first learning Python, I was amazed at how my code would shrink. That is, I would write something in the first, most-obvious way that occurred to me. Then, recognizing patterns, I would refactor it down to something smaller. Usually this repeated a few times, until the 100ish lines of code I wrote turned into 10 or 20. Python gives a programmer a lot of help in reducing redundant code. It makes C#/Java/etc. feel really tedious with all of the boilerplate code you end up writing. tl;dr: DRY
- moron4hire 14y agoCode size has no relationship to game world size. Interactions are the unit of size for games. If you pay attention to what is going on in this video, it is actually very "small".