A fork for those having trouble getting this to run on Mountain Lion. https://github.com/mckoss/Minecraft
Simple Minecraft Clone in 580 lines of Python
101–110 of 113 posts
Re: Simple Minecraft Clone in 580 lines of Python
#102More than 100 lines of this are textures! Got this error though. Any ideas? OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime, 6): no suitable image found. Did find: /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture
I got it to work on OSX 10.8! slunk's suggestion: `arch -i386 python main.py` got me halfway there You also have to run it with python 2.6 like so: `arch -i386 /usr/bin/python2.6 main.py` If you only have pyglet for 2.7, you will have to install it for 2.6. Installing packages in python for 2.6 will require pip-2.6 which you get like this: `sudo easy_install-2.6 pip` then `pip-2.6 install pyglet` Walla!
Re: Simple Minecraft Clone in 580 lines of Python
#103Earlier quoted context omitted.
Take 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&pag...
If you want to show off the demoscene, try the 64KB prod "Chaos Theory". https://youtu.be/4DjBq2O0XXk
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, official repository: 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.
Re: Simple Minecraft Clone in 580 lines of Python
#104Earlier quoted context omitted.
Totally agree. I remember writing this: 10 PRINT "LESSNONYMOUS" 20 GOTO 10 Seeing actual things happen was awesome. Now we have 3D games, seeing your name over and over wont enthrall, so being able to mod and extend a basic Minecraft world would be an incredible gateway. The way to hook people is exactly like you say. Make a small change, see a huge difference. Suddenly ... YOU HAVE THE POWER!!! 10 PRINT "LESSNONYMOU…
Wow, that just brought back a massive flash from the past. I actually remembered how I felt then I wrote those lines (or something very similar) for the first time. It's a powerful feeling. Thanks for that.
Probably a jerk move in retrospect, but how can you work in a computer store and not play around with the computers?!
Re: Simple Minecraft Clone in 580 lines of Python
#105Earlier quoted context omitted.
If you want to show off the demoscene, try the 64KB prod "Chaos Theory". https://youtu.be/4DjBq2O0XXk
If 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 , official repository: 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 o…
Re: Simple Minecraft Clone in 580 lines of Python
#106Just curious, what is it that makes the performance not so great? Could performance be significantly improved by doing a re-write in Lua, for example? (Probably not... it's probably something in Pyglet itself...) (FWIW, it's choppy compared to Minecraft, which is obviously much more complex and has a greater rendering distance.)
It's rather simple: you are proccessing huge grids of 3D data, it's always going to be less then-optimal unless you write parts of it in languages that can do this fast. (This also includes interaction between blocks if you are going to processing a lot of those.)
Re: Simple Minecraft Clone in 580 lines of Python
#107These 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?
Take 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&pag...
Edit: It would be intresting to see demos like this (4KB / 64KB) for WebGL. Does something like this exist already ?
Re: Simple Minecraft Clone in 580 lines of Python
#108These 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?
I'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 la…
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
Re: Simple Minecraft Clone in 580 lines of Python
#109If someone were to make something like this a step-by-step tutorial/template appropriate for a classroom setting it would be huge. Imagine a class at High School where you start off learning the basics of Python for the first few weeks and the rest of the semester is spent writing the chunks of code into a template that has lots of notes for guidance. I'd image something like : def setDefaultBlockColor(color): # reca…
> If someone were to make something like this a step-by-step tutorial/template appropriate for a classroom setting it would be HUGE. (emphasis mine :-)) That's the first thing I thought. I teach kids to do creative/interesting things with computers. It's hard to get them writing code[0] (it's not a classroom--they come voluntarily and explore what technology topics they like), one of the older (14) kids started out d…
Thankfully we do other things. I was able to use the example of when he learned to fly model airplanes to show why he had to push through the stuff that's just not fun to be able to reach for the good stuff. I reminded him of the work we had to do for him to be able to fly and land solo before he could start on fun aerobatics.
This is why I would suggest simply converting something like this to a tutorial might not guarantee engagement. You need to really think through the "fun and interesting" factor both during and after the course. Not easy.
Re: Simple Minecraft Clone in 580 lines of Python
#110I tried making a Settlers game in Python/PyGame and so far all I have been able to do is generate the board: https://gist.github.com/sareon/5268205 - I've been told I am not properly discretizing the difference between the drawing of the game and the logic of the game which is going to hinder the development of the game.
I have a BSc and an MSc in CS - focusing on NLP and Machine Learning, so I have an idea how to program, just not how to program games like the Minecraft clone or my own Settlers game. I've tried looking for tutorials and resources online and I've followed the InventWithPython which showed me how to make a simple game similar to how I started making my own. Clearly it was inefficient for a larger game.
What are some good resources out there that can help me learn how to make games such as the Minecraft clone or even how to make my own settlers game actually be a useable game?