Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Particle Autonomy: Another Cellular Program

Author
Message
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Dec 2007 08:41
Yep I'm at it again
I'm hooked on this way of programming, and it's the only thing I've ever been able to do that is procedural.
This program is the first test for what will be an awesome project, it diffuses gas into the surrounding air. The brighter the colour, the higher density of gas is in that cell.

One cool thing you'll see is that even though I've hard-coded a square of gas, it smooths out into a circle!


"You must be someone's friend to make comments about them." - MySpace lied.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Dec 2007 10:06
hmmm... no one seems interested
not even a single view!
maybe I shouldn't have put "Another Cellular Program" in the title.
Who am I talking to?
I'm talking to myself on a forum!!!
Now that's kerazy!

"You must be someone's friend to make comments about them." - MySpace lied.
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 6th Dec 2007 10:43
I'll check it out in few hours when I can get back to the main hub and look at it in db, I personally loved your last program. Keep it up.


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Dec 2007 00:46 Edited at: 7th Dec 2007 01:00
No one commenting? Hardly anyone even looking at it.

My final project will be a "particle" simulation, it will have gas, water and earth particles. The earth can be compacted into stone and I also want to get a working volcano, so heat would have to naturally be produced under layers of stone.
Water can evaporate from heat and freeze in the cold, steam can fall as rain as it cools or as snow if it's really cold.

here's a new version with a sky-blue colour and more accurate colour intensity.

This is only 45 lines of code!!

"You must be someone's friend to make comments about them." - MySpace lied.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Dec 2007 00:13
why is no one commenting?
I thought this was pretty impressive

"You must be someone's friend to make comments about them." - MySpace lied.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Dec 2007 00:22
This is cool!
I've made a real time version! Click the mouse to spray gas into the world.


"You must be someone's friend to make comments about them." - MySpace lied.
Dr Schnitzengruber
17
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 8th Dec 2007 00:31
At the risk of ending your double posting streak, I ran your program and liked it. keep working on it.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Dec 2007 00:44
RGB version! This should come in very handy for the final program.
LMC - Adds red gas.
RMC - Adds green gas.
LMC+RMC - Adds blue gas.



"You must be someone's friend to make comments about them." - MySpace lied.
Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 8th Dec 2007 00:56
Obese-

Your coding skills are improving with each prog you write, I love the procedural animations you have created out of thin screen. Keep it up, you've got fans, just busy ones .


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 9th Dec 2007 15:10
Cool as ever OBese. It is slightly worrying though that before this post, you'd posted twice as many comments as everyone else put together... Possibly you should wait a bit longer before you post complaining that no-one's commented? Maybe next time try leaving it an hour and a half before the first complaint

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Dec 2007 16:31
Quote: "Cool as ever OBese. It is slightly worrying though that before this post, you'd posted twice as many comments as everyone else put together... Possibly you should wait a bit longer before you post complaining that no-one's commented? Maybe next time try leaving it an hour and a half before the first complaint "

Sorry guys, I am a demanding bastard

I just get annoyed when I post something that I think is cool and no one replies for ages but that's very childish of me.
Glad you like it It's going pretty smoothly so far I'm now starting work on solids and liquids.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Dec 2007 23:08 Edited at: 11th Dec 2007 23:11
This is pretty nice, OBese87!! I decided to have a little fun with this. Can add a nice Fog Fill effect in 3d. I originally had the textures scroll so the mist would move out of view as you rotated the camera, but without a little more planning (like two planes and a texture that is mirrored so there are no seems) it only works ok.
A few things could improve speed (for the 3d thingy) - a smaller bitmap where the fog is drawn (don't use as large of boxes or just uses dots), 16 bit instead of 32.




Enjoy your day.
luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 11th Dec 2007 23:54
Wow that's pretty cool. You always have the best ideas on what to do. I can never think about what I want to make so I end up with alot of random snippets of junk. I think I liked your first one better though, I even rewrote it in java and c++ and did some different things with it.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Dec 2007 18:44
@luke
Thanks

@Latch
That's a cool idea, you could make bundling clouds etc with the effect

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 19th Dec 2007 23:26 Edited at: 20th Dec 2007 01:56
WOW THAT IS AMAZING!!!!!!!!!!!!!!!!! that is the coolest prog Obese!!

I definatly look foreward to the whole Earth - air - Water thing!!!

You could later add in gravitational effects so people could make their own planets in a virtual 2d space!!!


Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 21st Dec 2007 03:23
@obese
ive been tryin to make my own cellular autonomy and gas thing but the program is either not figuring out the state of the cells around the one it is currently or not updating the cells properly. As you are definatly the best at this stuff could you take a look at my code?Ive gone bug hunting and EVERYTHING but i cant find it.




Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Dec 2007 13:43 Edited at: 21st Dec 2007 15:44
@Pixelator
There are two key principles to making a cellular program:
1. The cells in the world act like pixels, they can be switched on/off or given different properties but they do not move. Movement is simulated by transferring properties between cells.
2. In a true cellular program, each cell acts independently and only changes its state based on a set of rules; which usually assess the states of its immediate neighbours.

I'm going to teach you how to make "The Game of Life"; it is the most famous cellular program and will help you understand how cellular rules work.
Here are the rules that will be applied to each cell in our world.
Quote: "
Conway's Rule Set
For a cell that is 'populated':
Each cell with one or no neighbors dies, as if by loneliness.
Each cell with four or more neighbors dies, as if by overpopulation.
Each cell with two or three neighbors survives.

For a cell that is 'empty' or 'unpopulated'
Each cell with three neighbors becomes populated.
"

So our program needs to check the state of the current cell and the states of its immediate neighbours. Once we have analysed the cell and its neighbours we assign the new state to our current cell.

It is at this point that I must explain the importance of a "buffer" world; because we are checking each cell in turn and altering its state, if we only had one version of the world this would corrupt our data. Effectively by changing the state of a cell we are implying that time has passed but all cells are supposed to react at the same time.
To combat this we have two versions of our world: a static buffer world and a display world. The buffer world is analysed and the results are plotted to the display world, once we have completed our analysis the display world is copied to the buffer world and becomes the new buffer.

I'll continue this later, I'm going to write out the whole program first and then dissect it...

[edit]
Here is the program:

The hardest parts to get right are analysing the correct cells and applying the rules.

Have a look through the code and tell me how much of it makes sense to you

Here are some challenges for you:
1. Make a zooming function for the program so we can see the cells up close.
2. Make an editor for the program so the user can select which cells will be "live" at the start.

Once you've got the hang of this we can move on to rules that look at which specific neighbours are "live", then we can have things like gravity

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 21st Dec 2007 18:20 Edited at: 21st Dec 2007 19:40
@obese87

OOOOOOOGGGGGGGGG!

now i get it!!!!!!!!

ill take you up on those challenges, but when i try to test my changes, it pops up a system error that says it cant set the display mode.

Did i broke it?

[edit]

I think i will have to restart my computer. Its gonna take awile longer now because Dark IDE is freaking out() and won't let me save anything.

[edit take 2]

i try and i try and no matter what i do, the fps jumps so slow it is more easily measured in spf( seconds per frame) that is about 10 spf!!! i tried adding

in between the ink rgb(255,255,255),0 and the making of the worlds and then moving the hide mouse to AFTER that.


Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Dec 2007 01:34
I'm to tired to look at anything but the FPS problem is annoying, I don't really know how to speed it up, I might try using a memblock instead of an array as that is sure to speed things up, but I've not got a lot of practice with those.

aluseus GOD
18
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 22nd Dec 2007 01:59
nice man.

alus.portbb.com go there.
Quote: A book. I hate books. book is stupid. I know that I need codes but I dont know the codes -zenicanin14 the 2nd stupidest user in the world
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 24th Dec 2007 23:22
Quote: "I might try using a memblock"


but first i'd have to get 1.2 because my 1.13 is messed up bad


Maryville Game Developers
Visit our website at http://www.freewebs.com/maryville-game-developers/index.htm
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 3rd Jan 2008 03:15
[bump so this isn't forgotten]
seriously Obese, you should make a tutorial

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 4th Jan 2008 18:27
[bump]

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 7th Jan 2008 21:48
[bump]

Do not attack other members in your signature
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 9th Jan 2008 18:20
[bump] does anyone care about this but me?

Do not attack other members in your signature
Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 20th Jan 2008 02:33
just me. sigh.

Do not attack other members in your signature
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Jan 2008 04:05
Quit double-posting Pixelator - it's annoying.

We have things we can do to annoying posters you know...

TDK_Man

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 20th Jan 2008 04:40 Edited at: 20th Jan 2008 04:42
Quote: "We have things we can do to annoying posters you know... "

and i just recovered from my first noob slap too !!!!!
(not including the initial period of waiting .)

Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 20th Jan 2008 20:13
I thnk that was setruple posting actually.


Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 20th Jan 2008 20:55


Where can i find these chips?:
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Jan 2008 15:44
I will post more on this when I'm not so busy

Is there anything else like this on the forums? I couldn't find anything to work from.

Zombie 20
18
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 21st Jan 2008 15:47
Obese, you are quite impressive with db, just wanted to let you know I'm a silent fan of your work, silent in the fact you can't hear me excidetly telling my roomates the next cool thing you made. They got a kick out of CLICK! So please keep it up, you have fans, you just can't hear us .

Zombie


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Jan 2008 04:02
@zombie
wow thanks for the praise man

Pixelator
17
Years of Service
User Offline
Joined: 8th Jul 2007
Location: here
Posted: 24th Jan 2008 03:09
Quote: "you have fans, you just can't hear us "

some of us you can...


Your signature has been erased by a mod. Reduce the size!

Login to post a reply

Server time is: 2025-06-04 01:59:59
Your offset time is: 2025-06-04 01:59:59