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.

Code Snippets / NewB Makes Fire! Burns the Competition in 56 lines of Code!

Author
Message
Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 19th Aug 2005 15:20
ok I did not originaly write the code, I found it here as an old post (from 2003) that was supposed to be a plasma thing, well I did not see the plasma but when I started to play with the code I did start to see fire. so I spent a little time tweaking and this is the effect so far. I looked around and did not see any other fire like this so I thought it would be a good post.
now I am a NewB at this Dark Basic stuff (I write in vb) so I have No Clue how I did this and why it works, but it is cool and I have some updates in mind for it very soon, so please feel free to check it out and post your comments and suggestions so I can start to learn more about this. I would welcome someone to come and comment the code better to show me what these functions are and how they can be manipulated. but if not I will figure it out anyway.

Happy Coding!

Oh, yea - I found that by taking the numbers in the Grid Size and also some of the other Numbers and changing them can have Radical Effects on the output of the program and can result in some excellent effects! (the numbers in the 5th to lastline at the end of the line that starts with "Box" control the dot size(currently big squares)if you change the numbers from "box refx*4,refy*4,(refx*4)+4,(refy*4)+4" to "box refx*4,refy*4,(refx*4)+3,(refy*4)+3" then the dots get smaller, and so on... this is a cool way to make the fire look like it's on an LCD Panel, change the last numbers to "2" and it is even cooler! but when you make the dots round they start to loose the "Plasma" effect look that this code has.(which could be made better if someone explains to me how to use more than 256 colors.)

anyway Enjoy
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Aug 2005 17:10 Edited at: 19th Aug 2005 17:10
Bah, damn source attach is still goosed.

You'll have to post it here in code brackets, using the button above the gas-mask wearing smilie - just copy the code from DBPro, click 'Code' then paste it then press 'Code' again to close the brackets, it'll put it in a folding snippet thingy:



Rich should just get rid of the code attach section .


Van-B

Put those fiery biscuits away!
Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 19th Aug 2005 18:20
ok lets try this again



ok and I went ahead and added a small option at the begining to ask for dot size and this way you can see the difference created by the size.
Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 19th Aug 2005 20:58
tried reposting a couple hours ago but have not seen it come up yet, so here is the code again with a few adjustments I made since first try. now you can choose dot size at start, menu with options 1 to 6. (1) being the smallest dots and (5) being the largest (6) is a random shot from any of the first five (seems like sometimes it actually makes them size 6 which is a cool effect also.)



hopefully you will be able to see this and give me some feedback on it!

Thanks
Lukas W
22
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 20th Aug 2005 16:33
hey that is a pretty cool effect. but slow: 17fps


Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 20th Aug 2005 20:29
yea, it does seem kinda slow, especialy at the begining, but like I said I have no clue how to speed it up yet, any suggestions are welcomed! I will add the newest revision I have of the code in this post so check out the changes, and let me know.

it has a couple of options that I added that will change the program when run, just to see how the effects can change. I am sure it's no faster but it is still cool!
Jukuma
22
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 22nd Aug 2005 00:42 Edited at: 22nd Aug 2005 00:44
nice code, but a littele slow. if you write on bitmaps use
the command "lock pixels / unlock pixels" before.

i found an old firecode of me, look

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Aug 2005 10:40
That's good m8. (Jukuma).
It looks like a sun (when using red-yellow comb)

Immunity and Annihalation makes Immunihalation...
Mono
21
Years of Service
User Offline
Joined: 23rd May 2005
Location:
Posted: 22nd Aug 2005 16:29
Ok, i have a firecode, too

Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 23rd Aug 2005 22:19
ok very cool fire! and nice and fast too! but has a contrived shape and look, does not flow as free as my slow fire( but looks way better visually!) if you could make that fire more free form like mine it would be the Pefect Fire code!

remember I am totaly new to this and have no idea what I am doing yet. I would really like it if someone took the time to comment any of these codes and explain what does what and why, all I can do is reverse engineer the code and see what happens, and Wow have I seen some crazy variations from this method. but I still dont understand it (some things seem too easy)
Jukuma
22
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 24th Aug 2005 22:38 Edited at: 24th Aug 2005 23:21
@mono[s]
this doubles the fps rate?



[href]
http://www.gamedev.net/reference/articles/article222.asp
[/href]

that is the origin way, next step is tries an error ...
Mono
21
Years of Service
User Offline
Joined: 23rd May 2005
Location:
Posted: 24th Aug 2005 23:32
Hi!

@Jukuma:

Nice & interesting code, but it drops my framerate from 476 to 330?!?!?


@Angry kreyon:

Hard to explain (i'm not english ), but i try it:

1. you have a array with the image size (BUFFER())
2. you have a array with the colorpalette (PALETTE() )
3. drop some random spots with number ~250-255 (white in colorpal.)
at the bottom line from array 1. (SET_SPOTS)
4. scan the array-lines and increase from 255 to 0 and scroll up (CALC_BUFFER)
5. draw the image: the numbers of array 1 is equal to the colorvalue
from array 2 (eg: 255=white 128=yellow 80=red 0=black) (DRAW_BUFFER)


I made it with memblocks, because you can't use DOT on images (for using as a texture). But you can also use DOT for drawing directly
on screen, but as Jukuma said: Don't forget LOCK PIXELS & UNLOCK PIXELS.


Oh, and try:
set object texture 1,2,0
after MAKE OBJECT PLAIN.....



HTH,
MONOS
Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 25th Aug 2005 16:01
MONOS - Thanks So Much for attempting to Explaine, it does help and I am starting to get the hang of this. slowly but surely. I guess I just got used to Visual Programming, so I always want a visual map of my objects and such, I will have to learn to do without. - Thanks Again and I will keep watching to see what else I can learn.
DrewG
20
Years of Service
User Offline
Joined: 25th Aug 2005
Location:
Posted: 25th Sep 2005 08:02
Okay I tried this in a DBP trial and it looks awesome. Umm, possible to mod it to work for DBC?

Games I am releasing:
Dragon Stone I : Journey to Achilles Dungeon - 2006?
Lukas W
22
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 26th Sep 2005 12:52
by the way isn't Phaelax or some other old skool dbc coder "the original author" to this? or am i completely wrong

Angry kreyon
20
Years of Service
User Offline
Joined: 19th Aug 2005
Location:
Posted: 26th Sep 2005 23:35
@Sony - yes I am sure with Very little work this could be ported over to classic,I'm not sure but it might run the way it is.(i dont have classic so I don't know.)

@Lucas W - in case you started at the bottom of this post, here is the very first line at the top : "ok I did not originaly write the code, I found it here as an old post (from 2003) that was supposed to be a plasma thing,..." - I didn't think at the time to look at who made it, but I do not try and take credit for the original code Ever! (unless it truly is mine.) most of the time I find it's easier for me to take pieces of code from other projects and make something new from them. usually about half way throught the project I have twisted the code around so much it's almost mine, but still I always try and make sure that people know that the code was there before and I only made changes, after all I am just a Hacker! (oooops now I have to kill you!!! *LOL* )

when I have the time I will list some of the Modifiers I have found in this code to make some real cool effects!
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Sep 2005 06:34
nice snippets from everyone. I updated my code to use memblocks and create a texture instead of drawing points, no speed improvements.


Deadly Night Assassins
Lukas W
22
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 27th Sep 2005 13:16
lol at phaelax.!

well err.. Angry(?) Kreyon. no harm done, and i was just asking.
thanks for that info anyway

Specters
20
Years of Service
User Offline
Joined: 30th Sep 2005
Location: idaho
Posted: 6th Oct 2005 09:09
I totally agree with what Sony put. Can some find out how to make it work for DBC, you would definetly get credit in my final RPG game I am making in DBC, I have an idea for what I will use it for. Thanks in advance. Oh and if you don't have DBC, just download the trial.

Current Project : Legend of Lantis

Login to post a reply

Server time is: 2026-06-11 16:16:24
Your offset time is: 2026-06-11 16:16:24