![]() This lets them not break things when they interact with falling sand particles. Changed conway and wireworld cells to subclass off of Element instead of Automata.made with py2exe: fallingsand.zip (Note: this version lst updated on ).These are in the fallingsand.py file right inside the main loop. Mouse scrollwheel plus ctrl changes the temperature.Mouse scrollwheel alone changes the brush size.+, - increase/decrease the paintbrush size.F5/F9 are quicksave and quickload respectively.This video shows a "glider gun" from conway's game of life The water then evaporates upwards to a cool spot and cycles. This video shows water running down a hill (made of insulator, so it doesn't affect the water) into a hot spot. Then it shows how water evaporates when it gets hot, and plant growing into water. ![]() Then how temperature affects different elements (lava and stone). This video shows paintbrush size changes and framerate changes. It should be easy to add any other types of cell also. The game also uses easygui and pgu, but these small utilities are bundled together with the software. You should be able to get it running on 3 again by coding an absolute path to the theme folder near the top of fallingsand.py It ran on python3 until I had to make some tweeks to get it working with py2exe for the windows executable. The game runs in python 2.7 and the only dependencies should be pygame and tkinter. Trying the same thing with number=10 and you can see that some serious rewrites would be needed to make that jive, although I can definitely see it being faster if done properly. I also tried using the multithreading module on the loop that calls cell.act() for each active cell. I did some tests with pypy (just on the sandbox simulation / no gui or pygame, etc) and saw about a 70% speed improvement on a heavily loaded (~1800 active particles) sandbox. I don't know if this is just because of the way I designed the system, or if it is because of python. It doesn't run as quickly as the compiled falling sand games you can find on the previously mentioned sites (such as wxsand). I would love to hear any ideas on how to speed things up more. ![]() I spent a lot of the development time trying to increase speed and made quite a bit of progress, but I feel like I've hit a wall with the current architecture. There are a couple other pygame falling sand clones, but they don't run as smoothly as this one seems to. As I was working on it, it started becoming more arbitrary and is now a kind of generic cellular automata engine. My version runs in python using pygame and has gone through quite a few changes since the last time I shared it. (Jump to the bottom if you are looking for downloads)įalling sand games have been around for quite some time and you can find many at. I've done quite a bit more work on my falling sand game and I'm proud to present the results here. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |