Pocket Burning Sand (Open Source)

colin9876

Active Member
Licensed User
Neil there were some horrendous inefficiencies like Textboxes being filled with same text in the middle of the main loop. Anyway it probably got in a mess because of the way it evolved.

Im still working on it but heres a improved version

Can u find me a Sand icon from somewhere and swap it with the tap one and then zip it back to me?
 

Attachments

  • OpenSourceEfficient.sbp
    5.1 KB · Views: 270
Here is the complete folder zipped. Dunno if this will correct your problem. This work on my PDA.

Here is a sand, salt, oil and fire icon. in bmp.
 
Last edited:

colin9876

Active Member
Licensed User
Agrahams Hash!

Is a hash table something that maps big numbers down to small ones? Sounds a bit mathsy for my brain

How can a large number e.g.255x255x255 possibilites be mapped down to 1,2,3 etc is a quick time?
 

agraham

Expert
Licensed User
Longtime User
Is a hash table something that maps big numbers down to small ones? Sounds a bit mathsy for my brain

How can a large number e.g.255x255x255 possibilites be mapped down to 1,2,3 etc is a quick time?
Tust me it can! You don't need to know the details anyway, you just use it. It is one of the collection classes provided in the .NET Framework. I won't even try to explain this. Google for ".NET hashtable"
 

neilnapier

Active Member
Licensed User
Longtime User
Once liquids and gases are perfected, along with interactions then moddability is the next issue. So there is no need to do lots of elements now.

Also I have noticed thatit only takes about 1/5th of the screen to be liquid to slow the game to a near stop. I know it has been made amazingly fast compared to the original but does anyone have ay ideas of improving it (not necissary but just asking)
 

neilnapier

Active Member
Licensed User
Longtime User
If you want to see all the icons, look at my attachment. I have altered all the icons of BS2 using a resizing program.
 

colin9876

Active Member
Licensed User
First Hash now Speed lol!

Neil I have a cunning plan to speed things up - pixels that are stuck or moving v slowly will go into a secondary list that is only updates every second, while the fewer fast moving ones will be in the primary ticker.

Anyway can u do me a favour. Ive added the sand icon.
Can u compile this into a device EXE for me, and zip it back - Im not on a pc here so cant do it - Thanks
Ive made it more streamlined and am interested to see how much faster it is compiled
 
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
Here you go... All nice and compiled.

EDIT: Didn't see your last post... will re do that.

EDIT2: Done.

EDIT3: Is their a way to change density and Weight of the liquids so the fall through the less dense and fall faster?
 
Last edited:

neilnapier

Active Member
Licensed User
Longtime User
Sorry about the double post but: Would using a newer version of BASIC4PPC (ie 5 or 5.8) effect the speed of the program.

Also Erel are you just the admin of this or are you the creator of the program as you seem to know more about the functions than anyone else.
 

colin9876

Active Member
Licensed User
thanks

Thanks Neil, Yes eventually there will be two more parameters in the library
pgravity() will be added to the y coordinate rather than just 1. So u could have -1 for gasses going up, 1 for falling material, and say 0.5 for slow falling material.

I will ask AGraham for this when weve finalised how the collision parameter will be done. So just hold on for that one.

Anyway got the whole thing much faster by having two arrays. Pixels get moved to the slow/static array if they havent moved. I check the oldest (nth) pixel before and after a call to the bithandler and move it to the slow array if the x&y didnt change

The slow array gets moved every 5th tick.

By the way, how did u get on re working out if u have a C# compiler that can do dlls? Im interested to know what software AGraham uses - maybe we could get the same one as him?
 
Last edited:

colin9876

Active Member
Licensed User
Compiled version suprisingly good

Neil, Ive been playing with the PPC compiled version u posted and it is amazing weve got to this stage! It runs ok with 200 pixels moving! Which is an achievement!
I think with the faster B4PPC v6 compiler, and the slow, and fast array tweak we will crack this!
Nice work everyone! We havent even had to employ unpalatable pixel doubling!

Neil v5.8 is the fastest so far, which version of B4ppc did u use for the compile?

Agraham, can an array of strings$ be passed? could just have a list of what it reacts with & what it changes to in a sequencial string?
Also can this fixed array be passed in the initial call to the library in App_start so it doesnt have to go across each time?
 
Last edited:

colin9876

Active Member
Licensed User
Hash, Speed ... now we need Uppers!

Things steaming ahead, literally now Ive got gasses.

AG, Can u put parameter pgrav() in, (Value -1 to 1)
and where it had py(i)=py(i)+1 put
if pgrav(i)<0 And rnd<-pgrav(i) then py(i)=py(i)-1
else if pgrav(i)>0 and rnd<pgrav(i)then py(i)=py(i)+1


gasses will have pgrav(i)=-1
slow falling feathers pgrav(i)=.3 etc

[rnd denotes random number between 0 & 1 ]
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Im interested to know what software AGraham uses - maybe we could get the same one as him?
Told you back in post #41 of this thread. Visual Studio 2005.

Agraham, can an array of strings$ be passed? could just have a list of what it reacts with & what it changes to in a sequencial string?
Yes but it is probably not a good idea. You should parse your rules once and pass them in an easy to apply format (like the arrays of properties of each particle) rather than parsing them each time you want to use them.

Also can this fixed array be passed in the initial call to the library in App_start so it doesnt have to go across each
Yes - that's one of the reasons why constructors (new) take parameters. It is an efficient way to pass static data to an instance of an object.

Also Erel are you just ...
Erel runs (and I think owns) the company "Anywhere Software" that produces Basic4PPC. He architects the product and owns the copyright in it.
 

colin9876

Active Member
Licensed User
Can u add the gravity please?
V2.07 all programed up for it

Niel - new tap icon on left is fire - can u add fire icon. Also all ur icons are white, can u get an editor to color this red etc
This version adds gravity array, sreen updown switch, Fill/Unfill, Pensizes with seeding, avoids seeding pixels on top of colors, + optimisations
 
Last edited:
All image in the /img folder are default BS2 images. They are black and white by default as it is the main color of Burning Sand. And also element like Fire should have a deathrate, this mean that after x time, the pixel will die to what you tell him to die. So for the fire, it would die to clear. But steam for example would die to water, so steam go up, and when reach the deathrate, then transform to water.
 

colin9876

Active Member
Licensed User
ok thanks Joe, I implemented that with the rules fn I've got.

e.g orange flames rising with g=-.5
sometimes it won't move up a pixel & so orange will be at its current poition
Rule(orange,orange)=(0.1,blac)
I.e 10% chance of turning to black each time it doesn't move.(it will not move 30% of ticks with g=-.5 and spread=2)

Things coming to a halt without the gravity implemented in the lib ... AG?
 
Last edited:

agraham

Expert
Licensed User
Longtime User
This has gravity and a radically different low-level way of drawing on the bitmap. It is as fast as you will get on the device under the Compact framework and you should really notice the difference. It needs .NET 2.0.

In the PBSv2.07a I have added mousedown detection so it doesn't draw continuously on the desktop.

The arrays are far too large for the device and now occupy 640Kbytes which may risk some devices running out of memory. A factor of 10 less should do for a device as you can't get that many pixels on the screen at once.
 

Attachments

  • BitmapHandlerDll.zip
    5.6 KB · Views: 251

neilnapier

Active Member
Licensed User
Longtime User
I will add the icons. The icons are greyscale for the reason that Joe said, it is traditional. Why didn't you use the ones from the zip though?

The clear screen still doesn't work and neither does the line pens. I will sort the pensizes for solid but I am not sure how the liquids and gases would be done.

Also the fill and pensizes information at the bottom isn't necisary and so can be removed to speed up the game.

The gravity thing is good.

EDIT: the graity thing works untill you draw fire then draw a liquid. The gravity reverses when you press the fire so the water falls upwards.
EDIT2: you set water and a negative graviy.
 
Last edited:
Top