Log In  

Cart #38232 | 2017-03-14 | Code ▽ | Embed ▽ | No License
7

The Falling Sand game has been around a long time, but I didn't see a Pico-8 port.

The reason for that is: it's really hard to get a decent-sized grid to run at full speed on the Pico. This implementation runs a little slower than 15FPS (when running the simulation) on my machine, so it isn't quite as smooth as I'd like, but still pretty playable. In the future, I'd love to post a faster version, but I've hit a bit of a wall with the Lua optimizations I'm already aware of.

If you're not familiar with Falling Sand, the basic idea is that you're simulating a bunch of elements in a grid, where different elements react in different ways - oil floats on water, fire burns wood, plants grow when watered, and so on. It's fun to play around and build things, but there's no goals or progression, really.

Have fun!

P#38233 2017-03-13 22:44 ( Edited 2017-03-14 05:26)

a tradeoff i used for mine (which isn't as complete as i'd like) was to use the sprite sheet to represent where everything was, and then draw everything using sspr, which is much faster. unfortunately, the way i did it limited me to a maximum of eight materials (though i ran out of time to implement even that many before my submission date), and i see you have more.

P#38236 2017-03-13 23:19 ( Edited 2017-03-14 03:19)

Yours is quite fast - I'm pretty impressed! I liked the UI, too.

I couldn't determine if any of your elements react or decay - I think that's where most of my time is spent, as opposed to drawing.

Some of my inner loops are tight enough that the change from calling a custom function to aliasing peek/poke to local variables and calling them with the simplest possible pointer arithmetic was the largest savings, and accounted for half of the CPU time in early testing.

P#38240 2017-03-14 01:26 ( Edited 2017-03-14 05:26)
2

Cart #sand_sim-0 | 2021-05-15 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

My attempt at a sand game.

I will be improving on it and making it more performent.

P#92003 2021-05-15 22:07

Inspired By you'r sim.

P#92004 2021-05-15 22:07

Your not you'r.

P#92005 2021-05-15 22:23

So umsand floats on water

P#92008 2021-05-15 22:50 ( Edited 2021-05-15 22:51)

Oh I forgot to fix that.

P#92034 2021-05-16 10:44

I have found a bug where eventually there will be too many objects on screen and the game will crash. Not sure how to fix it but thought I'd just let you know

P#92122 2021-05-18 12:50

Pico-8 has limeted memory so I'll just cap it off before memory runs out.

P#92362 2021-05-22 16:06

Here's a question for axnjaxn how do you check for neighbouring
particles?

P#92363 2021-05-22 16:07

I knew this could be done at a faster level and higher resolution. Nicely done, @Matcha155.

I think what will really help here is to turn the elements into components. That is no X/Y coordinates are recorded in any of the dots, instead the screen itself is scanned and reacts according to the medium placed upon it.

Doing so you could fill the screen with these elements and there would be no speed change whatsoever.

I did this years ago with my fireball program for instance.

https://www.lexaloffle.com/bbs/?tid=27955

Likely this can also be done at least for wood and water.

P#92364 2021-05-22 16:11 ( Edited 2022-04-19 06:52)

Still I'm starting to use Löve instead of pico-8 and there is no pget method in löve so how do I do it without pget?

P#92365 2021-05-22 16:27

Checking the neighbouring particles that is.

P#92366 2021-05-22 16:29

Oh you use the map right?

P#92382 2021-05-22 18:42

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-02-28 21:29:25 | 0.034s | Q:34