Falling Sand


Oh, no! I tested wxSand and now I can't stop :eek: :lol:

It's so much nicer and more feature filled than sdl sand and looking at the source the "scripts" it uses seem very simple (here I thought they were fully programable script it's more like a regular configuration file). Should be easy enough to support.

I've decided that I'm gonna give a stab at porting sdl sand and try to squeese in support for wxSand style scripting, I might as well now that I worked myself up so much about it. Let's hope I pass the exam tomorrow so I don't have to retake it, then I'll start as soon I've set up a proper development environment.
 
Oh, no! I tested wxSand and now I can't stop :eek: :lol:

It's so much nicer and more feature filled than sdl sand and looking at the source the "scripts" it uses seem very simple (here I thought they were fully programable script it's more like a regular configuration file). Should be easy enough to support.

I've decided that I'm gonna give a stab at porting sdl sand and try to squeese in support for wxSand style scripting, I might as well now that I worked myself up so much about it. Let's hope I pass the exam tomorrow so I don't have to retake it, then I'll start as soon I've set up a proper development environment.

Best of luck with that exam :)

Yeah, the scripts arn't too complex, but they open up a huge realm of possibilities, I wrote quite a few mods for WxSand, and you'd be amazed and what other people have come up with in the forums as well. If you did manage to get scripting working, i'll deffo be one of the first to throw a few mods onto the GP2X archive. Did you also check out WxSands saving feature? You can save your current progress as a PNG image and then just reload it, so again another good mod pack possibility.

I'm pretty psyched up about this too now :lol:

Let me know if you need any help with anything. I'd be no good to you for programming, but i'm pretty familiar with the games and the scripting.


Oh, and if you could fix that bias in SDL sand, that would be amazing - one step at a time though eh? ;)
 
Last edited by a moderator:
Ok, so now that I've passed my exam and set up all the tools required I managed to do a basic port of the sdl sand. Though I haven't mapped all the controls yet, at least you can play around in the sand for now. I think I will rewrite some of the code before I map the rest of the controls (it's getting messy) and as I'm not certain how long that will take I thought I'd share this as an appitiser :).

Download it here: gp2x-sand

Don't worry about it being a bit slow, it's still using float arithmatic which is slow on the gp2x, a switch to fixed-point should really speed it up. I was actually suprised it's as fast as it is without any modification.
 
Ok, so now that I've passed my exam and set up all the tools required I managed to do a basic port of the sdl sand. Though I haven't mapped all the controls yet, at least you can play around in the sand for now. I think I will rewrite some of the code before I map the rest of the controls (it's getting messy) and as I'm not certain how long that will take I thought I'd share this as an appitiser :).

Download it here: gp2x-sand

Don't worry about it being a bit slow, it's still using float arithmatic which is slow on the gp2x, a switch to fixed-point should really speed it up. I was actually suprised it's as fast as it is without any modification.

I was just about to send you a PM to see how this was going too. I'm going to load it up right now :D

The streams seem a little big on the GP2X screen, so for now reducing it to half might be a good idea, at least until it can be changed optionally. Obviously some elements are missing right now; Fire, Salt, Plant, and the combination saltwater, which I hope you include as well.

I'm impressed with this, it might be a bit slow, but it's running, and it's stable, and for that's what matters. Great job! :D

Just two small bugs at the moment:

1: There seem to be more than one eraser element, but the others act as walls - one of them works, but there's one before it that acts like wall.
2: You need to wait a moment before you can select another element, otherwise the button press doesn't register.
3: Using minus doesn't seem to work to select elements after you pass eraser or invisible wall. (or at least it seems that way)
 
Last edited by a moderator:
NICE... Solid 1st port. I've been playing a few of these sand games since first reading about it in this thread. I see falling sand in my dreams now...

Really impressed so far, can't wait until the speed is optimized and fire/plant gets introduced. Was and saltwater would be great. I assume that slug thing and the zombies would be asking too much...

Also, it seemed that the elements didn't quite react right, like the oil didn't rise in the water and the sand didn't sink to the bottom. This could just be a speed issue though.

Regardless, its a really solid first effort.
 
NICE... Solid 1st port. I've been playing a few of these sand games since first reading about it in this thread. I see falling sand in my dreams now...

Really impressed so far, can't wait until the speed is optimized and fire/plant gets introduced. Was and saltwater would be great. I assume that slug thing and the zombies would be asking too much...

Also, it seemed that the elements didn't quite react right, like the oil didn't rise in the water and the sand didn't sink to the bottom. This could just be a speed issue though.

Regardless, its a really solid first effort.

Zombies and slugs really slow down the game, and I always saw them as distractions to the experience than fun.

As for oil floating and sand sinking, I don't think they're activated yet, I left some elements in a container of wall and they just sat there - right now it'd really slow down the game anyway I think, probably best sorting that out once the math's been optimised. :)
 
Last edited by a moderator:
Ugh, I didn't even notice that the floating oil/sinking sand was disabled by default, switching it to on by default is just a matter of changing a single line of code, so expect it to be changed in the next release.

Cycling through the elements is a bit dodgy at the moment, it works but seems to require multiple presses sometime. Not sure why this is though.

Not sure if I'll implement zombies and such, the current plan is to get the implementation to roughly that of wxSand. I don't dare to think furthur than that :)

Anyways, I'm currently splitting up the source into multiple files, this requires a litlle more administration than a single file but should make changes easier (don't have to worry about a change in one file affecting any other). Then I'll implement the rest of the controls, well those that will fit on the gp2x's buttons. Also I'll change to fixed-point math. After that I'll make a new rellease.

Thanks for the reports I really appreciate them.

Also, what did you guys think of using L and R to change the speed of the cursor, is it usefull the way it's configured?
 
Ugh, I didn't even notice that the floating oil/sinking sand was disabled by default, switching it to on by default is just a matter of changing a single line of code, so expect it to be changed in the next release.

Cycling through the elements is a bit dodgy at the moment, it works but seems to require multiple presses sometime. Not sure why this is though.

Not sure if I'll implement zombies and such, the current plan is to get the implementation to roughly that of wxSand. I don't dare to think furthur than that :)

Anyways, I'm currently splitting up the source into multiple files, this requires a litlle more administration than a single file but should make changes easier (don't have to worry about a change in one file affecting any other). Then I'll implement the rest of the controls, well those that will fit on the gp2x's buttons. Also I'll change to fixed-point math. After that I'll make a new rellease.

Thanks for the reports I really appreciate them.

Also, what did you guys think of using L and R to change the speed of the cursor, is it usefull the way it's configured?

I thought it was quite useful yes. I didn't really use it though considering the current brush size, as precision wasn't really a big deal, but when we get more elements and the option to change brush size (it should be half the size it is now by default I think, it's way too big right now) it'll be a godsend :)

We also need a pause function, because when we're drawing elements like fire, plant, and other things, we'll want to set up the area first before we set it in motion.
 
Last edited by a moderator:
Not sure if I'll implement zombies and such, the current plan is to get the implementation to roughly that of wxSand. I don't dare to think furthur than that :)
Yeah, after seeing what resource hogs they were, I figured the game wouldn't even run on the GP2X at all. I think if you can emulate wxSand or get close, that would be an amazing feat in itself.

That is runs this well and there is still room for optimization is amazing IMO. Keep up the great work.
 
Last edited by a moderator:
After some closer inspection of the actual physics code, I discovered floats weren't used at all in the main loop it's only used when "painting" particles, e.g not much at all. So switching to fixed-point wouldn't give it a boost in speed. :(

Well I still have some tricks up my sleeves, it'll just be a bit harder to get that extra boost. A well no pain no gain B).
 
After some closer inspection of the actual physics code, I discovered floats weren't used at all in the main loop it's only used when "painting" particles, e.g not much at all. So switching to fixed-point wouldn't give it a boost in speed. :(

Well I still have some tricks up my sleeves, it'll just be a bit harder to get that extra boost. A well no pain no gain B).

Want me to see what I can pull up on how WxSand got a significant speed boost? I remember Oppiette switching to a different drawing method which really sped things up - i'm not sure if it's applicable in SDL or on the GP2X, but it wouldn't harm to look.

Edit:

- New blit-based drawing, should speed up drawing for most situations.

Not sure if that helps or means anything to you, but it sped up WxSand significantly.
 
Last edited by a moderator:
I haven't played gloop but it's a puzzle game while this is more of a simulation with no objectives, so it's not really the same thing. I know gloop has a similar falling particles scheme but does it have different elements that react with each other?

Also the source code doesn't seem to be available so porting it is up to the original author.

After some closer inspection of the actual physics code, I discovered floats weren't used at all in the main loop it's only used when "painting" particles, e.g not much at all. So switching to fixed-point wouldn't give it a boost in speed. :(

Well I still have some tricks up my sleeves, it'll just be a bit harder to get that extra boost. A well no pain no gain B).

Want me to see what I can pull up on how WxSand got a significant speed boost? I remember Oppiette switching to a different drawing method which really sped things up - i'm not sure if it's applicable in SDL or on the GP2X, but it wouldn't harm to look.

Edit:

- New blit-based drawing, should speed up drawing for most situations.

Not sure if that helps or means anything to you, but it sped up WxSand significantly.

Well blitting would indeed be faster than putting the one by one (or two by two as I've optimized it to do now). Not sure how it would be managed though. Guess I'll have to read up on the source of WxSand.

I think I'll focus on handling the controls more flexibly for now, so it will be easier to map the controls properly.
 
Last edited by a moderator:
This took longer than expected due to unexpected computer failure (and hot summer days not really meant to be spent coding :p) but GP2X Sand v0.2 is out now, get it while it's still hot here.

Floating/sinking is now implemented, all the buttons on the GP2X are now in use, default settings are improved and there's a slight speed-up of 3-5 FPS. The major changes to the source code structure that took up the most time aren't visible to the user, but will help to make future changes. Also the source code has also been released, if anyone is interested in it.

For the next release I'll be improving the actual particle logic so expect a speed-up and new elements: fire and plant.
 
This took longer than expected due to unexpected computer failure (and hot summer days not really meant to be spent coding :p) but GP2X Sand v0.2 is out now, get it while it's still hot here.

Floating/sinking is now implemented, all the buttons on the GP2X are now in use, default settings are improved and there's a slight speed-up of 3-5 FPS. The major changes to the source code structure that took up the most time aren't visible to the user, but will help to make future changes. Also the source code has also been released, if anyone is interested in it.

For the next release I'll be improving the actual particle logic so expect a speed-up and new elements: fire and plant.

Great stuff Hammy Lite, downloading as we speak :D

Edit: One bug of sorts with sinking elements : they don't even out, sort of just grow upwards like a spike - this means with a container of oil and water, they don't move to float on another another, but just kind of stay where they are - elements that can sink need to behave like elements always do - the ability to spread out.

To give you an example; draw a V shaped wall in the middle stretching outwards and watch the elements pour into the middle, instead of sand continuing to roll down and pile up in the middle underneath the water, the water acts like a wall that the sand can't pass, so it doesn't sink realistically. It's as if elements will sink downwards, but not at an angle. Sand should still move the same way it does normally but under water. You can actually draw a straight line of sand in water without it collapsing downwards like it should. It's like Sand doesn't have gravity when it's below an element with a lower density.

:)

Like the new controls though, they're a lot better now then they were - also the ability to change pen size, great B) I've just tested the sinking properties of elements, and it's nice that sand sinks slower in oil, quite realistic.

Smaller Bugs:

1; In the bottom right corner, you can see some flickering sand, I have no idea why that is
2: The cursor will stop at the top of the screen or the left of the screen, but it doesn't have boundries at the right and bottom, it just goes beyond the screen - would it be possible to just wrap the cursor instead? So going off on the left will bring you to the right, going beyond the screen at the bottom will bring you to the top, etc.

Just a suggestion, fixing those two boundries would be fine ;)
 
Last edited by a moderator:
Has Hammy had time to fix the bugs? I'd like to try this. I recall thinking the game looked stupid when a friend linked me to an Internet version years ago - two hours later...
 
Has Hammy had time to fix the bugs? I'd like to try this. I recall thinking the game looked stupid when a friend linked me to an Internet version years ago - two hours later...

He's fixed some of the ones that were present in the first release - element selection has been fixed and is now mapped to A.
 
Last edited by a moderator:
One bug of sorts with sinking elements : they don't even out, sort of just grow upwards like a spike - this means with a container of oil and water, they don't move to float on another another, but just kind of stay where they are - elements that can sink need to behave like elements always do - the ability to spread out.

To give you an example; draw a V shaped wall in the middle stretching outwards and watch the elements pour into the middle, instead of sand continuing to roll down and pile up in the middle underneath the water, the water acts like a wall that the sand can't pass, so it doesn't sink realistically. It's as if elements will sink downwards, but not at an angle. Sand should still move the same way it does normally but under water. You can actually draw a straight line of sand in water without it collapsing downwards like it should. It's like Sand doesn't have gravity when it's below an element with a lower density.

:)

Like the new controls though, they're a lot better now then they were - also the ability to change pen size, great B) I've just tested the sinking properties of elements, and it's nice that sand sinks slower in oil, quite realistic.

I've noticed this as well, the particle logic is pretty much unchanged since SDL Sand and it had the same problem. The particle will get a overhaul for the next release so this might get fixed in the process.

Smaller Bugs:

1; In the bottom right corner, you can see some flickering sand, I have no idea why that is

Me neither, I don't have this problem when running GP2X Sand om my computer so it might be a problem in hardware accelerated SDL. I'll check the forums for a solution or a library update.

2: The cursor will stop at the top of the screen or the left of the screen, but it doesn't have boundries at the right and bottom, it just goes beyond the screen - would it be possible to just wrap the cursor instead? So going off on the left will bring you to the right, going beyond the screen at the bottom will bring you to the top, etc.

Just a suggestion, fixing those two boundries would be fine ;)

Hmm.. wrapping might be nice, should be at least be an option in the future. I think I shut of the bouderies when I was looking for a bug and forgot to turn them back on. It'll be fixed in the next release.
 
Last edited by a moderator:
screenshot018oh.png
screenshot027vj.png


screenshot036gl.png


:D

I would take better ones, but that timed screendumper program isn't that good :(
 
Back
Top