Jump to content
  • 0

Fire Spreading


adasiok

Question

I have lately wondered how to make fire more realistic in a Doom mod...

 

Thus I must ask,

How can I achieve spreading fire? Not only fire spreading in random places but also burning the wooden terrain just to give it a realistic feel. For now in my mod you can have fire in a wooden house but it just disappears after time instead of burning the house down. It is most likely complex, but it's never stupid to ask.

Share this post


Link to post

10 answers to this question

Recommended Posts

  • 0

One of the trickier things about trying to do this in Doom is that the environment and the stuff in it are handled very differently.

 

If you wanted to make some of the terrain destructable, you'd need to make your burnable materials into objects, so that it can have health and be destroyed - but objects are 2d sprites in 3d space, so you'd need to find a way to make it look like walls and floors, and not imps or medkits. (Maybe voxels could work?)

 

The level geography itself is just made of lines which are more or less permanent.  You could affect them with triggers and play with the textures, but you'd need to build those effects into levels, and it would probably involve some elaborate scripting.

 

Either way you're looking at a whole bag of different skills and a lot of work to make that effect, even on a pretty small scale.  That isn't a reason not to try, but the way to start would probably be with smaller projects that build up a set of skills/tools that can get you there.

Edited by Burgish_Nilwert

Share this post


Link to post
  • 0

Freeform destructible Terrain was a big deal from Red Faction in 2001. Fire spreading realistically was a big deal in Far Cry 2, which was released in 2008.

 

While it's true that lots of people have done amazing things with the doom engine and modern source ports, unless you're willing to do a SUBSTANTIAL amount of code work, I would suggest considering if trying to cram those square pegs into the round hole of a game code-base written in 1993 is feasible.

Share this post


Link to post
  • 0
35 minutes ago, Stabbey said:

Freeform destructible Terrain was a big deal from Red Faction in 2001. Fire spreading realistically was a big deal in Far Cry 2, which was released in 2008.

 

While it's true that lots of people have done amazing things with the doom engine and modern source ports, unless you're willing to do a SUBSTANTIAL amount of code work, I would suggest considering if trying to cram those square pegs into the round hole of a game code-base written in 1993 is feasible.

 

The OP is literally asking how possible it is, so your suggestion is redundant.

 

@adasiok it would help to know what port your mod is targeting, since vanilla is highly restrictive and needs a lot more trickery to accomplish certain things. However, even with ZScript shenanigans it will be pretty tough to make something look like its burning down. Getting the fire to spread is plausible, you could just have the fire object spawn more of itself (be careful though, could get out of control fast).

 

If you made the walls of the house out of 3d models instead of sectors, you could then have the wall objects get hurt by the fire. Making some crazy script that lowers sectors when there's fire on them could also be a possibility, but probably even more of a headache for something that won't look very convincing.

Share this post


Link to post
  • 0

To make a single puddle of fire spread I would have a central fire which would expand via sprite, likely propagating via A_SpawnItemEx to make similar items within a vicinity of a central spawner. the damage would be done via explosion radius based on the sprite widths.
To achieve a good effect within a burning building, it would have to be one of a range of tools. 
Animated wall textures with xybillboarded flames could possibly look decent.

I'm still a basic code chimp though.
I dont have the skills for anything super fancy.

Share this post


Link to post
  • 0

I am not confident that destructible terrain is possible in the Doom engine, but it should be possible to change textures with some ACS scripting. It would help to know which source port you are targeting. Given the "modding" part of the question ZDoom is a strong contender but it's never stupid to ask.

 

Looking through the ZDoom ACS action specials, I do not see a way to change a sidedef's textures completely, but it is possible to change the offset:

 

https://zdoom.org/wiki/Line_SetTextureOffset

 

It would be possible to define a texture twice as wide as needed with one half being the normal texture, the other burnt. At some point change the offsets to display the burnt half.

 

If you are using ZDoom with UDMF, you have similar options for floors and ceilings with the scale+panning functions. Here is one:

 

https://zdoom.org/wiki/Sector_SetCeilingPanning

 

With UDMF you can use wall textures on floors and ceilings, and can pan them for the same effect. Otherwise, you may be able to set up some clever trickery with disjoint sectors where you use the "floor lower to lowest adjacent, change floor flat" special where one half of the sector is outside the map and next to a sector with a burnt texture. Set it up so a floor lowers by one unit, barely perceptible, and switches to being burnt.

 

Another option which may work if you don't need continuity between before and after: build two copies of an area and use silent teleports so the player leaves the area, returns, but visits a different copy with different geometry and textures. If you want the player to be inside a burning building while it is falling apart then this probably will not work, however.

Share this post


Link to post
  • 0
22 hours ago, magicsofa said:

 

The OP is literally asking how possible it is, so your suggestion is redundant.

 

 

Providing an answer to a question is not redundant.

Share this post


Link to post
  • 0
On 4/11/2023 at 7:35 PM, magicsofa said:

 

@adasiok it would help to know what port your mod is targeting, since vanilla is highly restrictive and needs a lot more trickery to accomplish certain things.  

 

Latest GZDoom compatible only

Share this post


Link to post
  • 0
23 hours ago, Stabbey said:

Providing an answer to a question is not redundant.

 

The first post acknowledged that it may be too complicated, to which you reply "consider if it is too complicated." That is redundant, and also not much of an answer. You could just say that it's too complicated and better yet, explain why, instead of this weird parable about other (totally irrelevant) games. Also, GZDoom code was not written in 1993. 

Share this post


Link to post
  • 0
On 4/11/2023 at 9:22 PM, Taco Tuesday said:

Looking through the ZDoom ACS action specials, I do not see a way to change a sidedef's textures completely, but it is possible to change the offset:

 

https://zdoom.org/wiki/Line_SetTextureOffset

 

It would be possible to define a texture twice as wide as needed with one half being the normal texture, the other burnt. At some point change the offsets to display the burnt half.

 

If you are using ZDoom with UDMF, you have similar options for floors and ceilings with the scale+panning functions. Here is one:

 

https://zdoom.org/wiki/Sector_SetCeilingPanning

 

With UDMF you can use wall textures on floors and ceilings, and can pan them for the same effect. Otherwise, you may be able to set up some clever trickery with disjoint sectors where you use the "floor lower to lowest adjacent, change floor flat" special where one half of the sector is outside the map and next to a sector with a burnt texture. Set it up so a floor lowers by one unit, barely perceptible, and switches to being burnt.


While this is all pretty cool trickery, if you were to use ACS, it would probably be better to just use the ACS functions (that you probably missed), which let you directly change wall and floor textures:
 

https://zdoom.org/wiki/SetLineTexture
https://zdoom.org/wiki/ChangeFloor
https://zdoom.org/wiki/ChangeCeiling
https://zdoom.org/wiki/ReplaceTextures


I think in ZScript there might even be a way to change textures without having to tag sectors and lines, but I'm not that well-versed in zscript, so I'm not entirely sure of it...

Share this post


Link to post
  • 0
On 4/14/2023 at 1:32 PM, Worst said:


While this is all pretty cool trickery, if you were to use ACS, it would probably be better to just use the ACS functions (that you probably missed), which let you directly change wall and floor textures:
 

https://zdoom.org/wiki/SetLineTexture
https://zdoom.org/wiki/ChangeFloor
https://zdoom.org/wiki/ChangeCeiling
https://zdoom.org/wiki/ReplaceTextures


I think in ZScript there might even be a way to change textures without having to tag sectors and lines, but I'm not that well-versed in zscript, so I'm not entirely sure of it...

 

Thank you so much! I absolutely did miss those functions. I was going off of this list:

 

https://zdoom.org/wiki/Action_specials

 

Now that I think about it, it makes a lot of sense that the "action specials" has to be an incomplete list because ACS does more than "traditional linedef actions, but in a script."

 

I looked around a little bit and there are some pretty useful functions in the complete list of ACS functions that I previously missed.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...