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.

Author
Message
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Mar 2010 18:49 Edited at: 6th Mar 2010 18:49
I'm making a medieval sort of fps (With a crossbow incase your wondering) and I have torches throught my level. How should I make realistic fire that doesn't just look like a flat plane with an animated texture? I don't want to use the built in particle commands or have to download some plugin.

If it hasn't exploded yet, I haven't touched it.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 6th Mar 2010 19:08
Hmh, there's lots of ways to achieve good torchefire effects. You could for example create a 3D model in the shape of a sharp bulb, texture it with an animated texture (ghosted), and rotate the texture? Just a thought...

Cheers

Slayer rules!!! Yeaaah, man!
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Mar 2010 19:45
Well it won't have good depth.

If it hasn't exploded yet, I haven't touched it.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 6th Mar 2010 20:03
Or, make a model with 3 (or more) planes (crosswise), and texture them with an animated torch-texture? But, since you don't prefer plains, that's not what you wanted, right?
Or you could make your own particle engine to create those torch-flames?

Slayer rules!!! Yeaaah, man!
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Mar 2010 20:08
I'd suggest animating a fire onto a 3d plane and rotating it to face the player. Then having black smoke particles spawn from it.

references:
all value's source engine based games
far cry
crysis
gta IV

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Mar 2010 20:14
I guess I'll go for my own particle engine since I've already made one before.

If it hasn't exploded yet, I haven't touched it.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Mar 2010 20:33 Edited at: 6th Mar 2010 20:35
I've run into a problem already with my new fire particle engine. For some reason, Fire(P).num always equals 0 so it throws up the usual "Object number illegal at line ..." error which is at the
.


If it hasn't exploded yet, I haven't touched it.
Daniel wright 2311
User Banned
Posted: 6th Mar 2010 20:55
I bought this last week and it looks like real fire in game, it is on flate plains but the plaqins wollow the camera making it look real anouph

http://www.thegamecreators.com/?f=sprite_pack_1

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Mar 2010 21:28 Edited at: 6th Mar 2010 21:29

more here

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 6th Mar 2010 22:17
Heres your problem.

Quote: "For P=1 to 5
blah blah blah
Fire(P).num=Obj
blah blah
inc P
Blah
next P
"


You create a for next loop using P as your variable, and you also increment the variable P. That's a big no no.

My signature is NOT a moderator plaything! Stop changing it!
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Mar 2010 22:21
Whoops forgot to rem that out.

If it hasn't exploded yet, I haven't touched it.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 6th Mar 2010 23:58
Well I decided to go for textured planes with animated fire. I have all of the images and they each have alpha transparecy. How do I get them into an animation for the plane?

If it hasn't exploded yet, I haven't touched it.
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 7th Mar 2010 00:35 Edited at: 7th Mar 2010 01:25
posting again in such a small time frame is considered double posting.



Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 01:11
@Link102
I love your .gif. How can I use this in a game? Do you treat it like an animated sprite? What are the diminsions of it?

The fastest code is the code never written.
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 7th Mar 2010 01:19 Edited at: 7th Mar 2010 01:21
It's not my gif, I snatched it off the internet (here).

So after you've plowed trough all the legal issues, you would save each frame of the gif as individual images (cut off about 20px off the bottom, it would look better). And then use the method described in my previous post. Unless dbp has a better solution for this.

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 7th Mar 2010 01:25
Yeah I know but I just really want fire for my game. Thanks for the help. It works now.

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 01:29
Particles look good for fire when done correctly, but is a clock hog. You can ramp it down and still get good fire with particles that's not such a hog, but then it's not so good up close. Good luck! If you find a solution that looks good, please post it here so we can all benifit.

The fastest code is the code never written.
Daniel wright 2311
User Banned
Posted: 7th Mar 2010 01:54
Quote: "posting again in such a small time frame is considered double posting."


unless its like your own thread and no one else cares.

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 7th Mar 2010 02:27 Edited at: 7th Mar 2010 02:28
note that if you are using a particle system increase the yspeed each iteration. Flames are lighter than air.

It will create a much better illusion.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Mar 2010 02:49
Quote: "Unless dbp has a better solution for this."

Load the gif as an animation, play it to image, then texture the plain with that image.

My signature is NOT a moderator plaything! Stop changing it!
NightX
17
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 7th Mar 2010 06:34
If you want nice looking fire, just make a dosen of plains with a smoky 20% transparent boomerang figure, coloured a red/orage and rotate it and stuff, it you look at magic particles. they do that. its a great effect.

Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 7th Mar 2010 13:21
Quote: "Load the gif as an animation, play it to image, then texture the plain with that image."


See that's the curse of migrating from dbc.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 15:34
@Mobiius
Is there a way to make it transparent? I've tried this code:


The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 7th Mar 2010 17:55
Hawkblood try


If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 18:09
No good. I have a black cube with the fire on it--not transparent.

The fastest code is the code never written.
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 7th Mar 2010 18:48
ghost object on 1

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 19:46
@Link102
That makes it transparent but not very good-- it's all transparent including the flame!

The fastest code is the code never written.
Link102
21
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 7th Mar 2010 19:54 Edited at: 7th Mar 2010 19:55
try
Quote: "ghost object on 1
fade object 400"


fool around with the fade value and be sure to read the help files

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 20:02
This gives the best result I have found:

Still not quite right, but loads better!

The fastest code is the code never written.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Mar 2010 22:00
You really need a few plains (of differing sizes and locations) all playing the flame animation, all ghosted. (Or use the set alpha mapping on command.)

My signature is NOT a moderator plaything! Stop changing it!
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 7th Mar 2010 22:00
Well now that I have the torches down. I have a normal map shader (Evolve's) and I'm using it for lighting. It uses a vector position for the light position. How do I make multiple lights? Do I have to load the shader twice and apply each shader sepperatly to each object or can I just use multipe vectors. The problem of loading the shader for everly light source will murder my fps since I got quite a few torches.

If it hasn't exploded yet, I haven't touched it.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Mar 2010 22:01
You need to re-write the shader to support multiple lights, and it will probably kill the FPS yes. (If you use too many)

My signature is NOT a moderator plaything! Stop changing it!
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 7th Mar 2010 22:55 Edited at: 7th Mar 2010 22:56
I don't know anything about shaders so if anyone wants to make it support multiple lights with multiple vectors it would be very much appreciated or if there is any other way for multiple lights.


If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 7th Mar 2010 23:29
Green Gandalf has something that you might be interested in. It uses some kinda light map to do the lighting with a bump effect. This is the version I got off this board. It's worth looking in to.

The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 8th Mar 2010 00:05
Is that the one ive seen in your game that you've been posting problems about lately?

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Mar 2010 00:11
No. I'm using Evolved's shaders.

The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 8th Mar 2010 00:14
Than how did you get those multiple lights?

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Mar 2010 00:23
I'm using multi-pass lighting. Here's a link to the latest of my code:
http://forum.thegamecreators.com/?m=forum_view&t=166885&b=5

The download for the multipass lighting is:
http://www.evolved-software.com/shaders/Shaders_Lighting.html
I downloaded the first one "MultipassLighting.zip" and used the "(2) Normal Maping" example. I modified it to handle 8 total lights at a time and I killed the flashlight function.

The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 8th Mar 2010 03:25
Well I have that shader but could you post a simple code example for that please because the example that comes with it is a lot to pick through. I just want a bare minimum example.

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Mar 2010 04:03

You need that first.

You should always set the ambient to some low level. (scale is 0.0-1.0)

Load and texture your meshes and set the effect

Make all the lights.

Here's where it gets tricky:
You would (could) do this every frame. You HAVE TO do this each frame for every moving light.

I hope you can make sense of that code.... It's kinda straight forward, but hard to explain...(?)

If you are going to have a large level with lots of lights, you can still use this. The side scroller only needed this code because you can only see a maximum of 8 lights (including the player) at one time.... (my .fx variation uses 8).
On another project I use 9 instances of the .fx and assign objects within each of the 3x3 grid to the appropriate .fx. As the player moves around, the area he can see moves along the 3x3; each time changing which are being used.... The player can only see the 3x3 so that's not a problem. For a FPS, you would need to come up with another method, but the concept is the same-- only show the player what they need to see. Going to bed now....

The fastest code is the code never written.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 8th Mar 2010 15:22
As it has been mentioned, it can be done with a 3D object.Time ago, I made something like that with the old Darkbsic.I adapted the code for Dbpro.In this animation, it goes slow, but in the game work fine.
Download demo code.




cheer.

learning every day
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 8th Mar 2010 21:24 Edited at: 8th Mar 2010 22:05
I got it all working now but allready just 2 lights bring my fps from 70 down to 30 when I am in the same room as the lights.

If it hasn't exploded yet, I haven't touched it.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 8th Mar 2010 21:26 Edited at: 8th Mar 2010 21:27
EDIT: accidental post

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 9th Mar 2010 16:54
Quote: "from 70 down to 30 "

That stinks! What are you system specs?

The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 9th Mar 2010 21:56 Edited at: 9th Mar 2010 21:56
My computer is about 4 years old.

Windows XP
Intel Core 2
6320 @ 1.86GHz
1GB RAM
NVidia Quadro FX 550

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 10th Mar 2010 02:52
Yea, it is kinda old.... Not the slowest PC I've seen. It probably runs most games well enough. My game has no optimizations at all, so I'm not suprised that someone would have a significant fps hit.

Is 70hz your normal refresh on your PC? That seems odd.... I've never had a card that pushes 70hz. The standard is 60hz.

The funny thing is that my monitor jumps to 75hz when in a normal resolution like 1024x768, but my card still spits out 60hz. So I got a weird wavy look to my display.

Try changing some of your settings on your card.... Most of the time I just have it set to application preference. This is something that I don't think I can control within my game because DBP does it for me.

Thanks for trying it out.

The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 10th Mar 2010 23:00 Edited at: 10th Mar 2010 23:04
Well the funny thing is that when I run the demo that comes with it, it has 3 lights and the fps is 60.
And my normal refresh rate is 70hz

If it hasn't exploded yet, I haven't touched it.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 11th Mar 2010 00:54
Are you sure your using [(2) Normal Mapping] ?
Change the resolution:

It might help....?

I'm not sure what to tell you..... Try the other shader applications in that directory to see if you get better results. All my PC's run it fine; I get 30fps on my slowest and 60 on the others. My slowest is about 5yo.

The fastest code is the code never written.
NightX
17
Years of Service
User Offline
Joined: 3rd Apr 2009
Location: Australia, QueensLand
Posted: 11th Mar 2010 08:43 Edited at: 11th Mar 2010 08:44
You can make evolve faster by making a timer in the loop to update evolved every 10-30ms. You can also change some other ones that will speed it up TONES.

I did this with the Deferred shader. by Evolved.

Also as i said before to speed it up, is to set the size of the render thingo, its default i think is 1024,768. but you can change it half of that, and it will look badder, but it will be MUCH faster.




Here is some results by changing this --

FPS:318 : Deferred_SetUp(1024,768,512,8)
FPS:450 : Deferred_SetUp(800,600,512,8)
FPS:520 : Deferred_SetUp(640,480,512,8)

Now with the last value to 1, (the detail of shader shadows ect)

FPS:380 : Deferred_SetUp(1024,768,512,1)
FPS:500 : Deferred_SetUp(800,600,512,1)
FPS:550 : Deferred_SetUp(640,480,512,1)

this tests above have been with normal mapping and me being CLOSE AS to a rotation cube. Now when i move away, i get over FPS:950

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 11th Mar 2010 22:01
Well I turned of vsync and now my fps is 55. I guess I fixed my problem.

If it hasn't exploded yet, I haven't touched it.

Login to post a reply

Server time is: 2026-07-27 05:27:55
Your offset time is: 2026-07-27 05:27:55