Author Topic: [Suggestion] More types of smoke / custom smoke  (Read 3275 times)

Offline efrenespartano

  • Commander
  • *****
  • Posts: 748
  • I know a lot about the law and other lawyerings.
    • View Profile
[Suggestion] More types of smoke / custom smoke
« on: April 02, 2019, 08:33:48 pm »
Hi, everyone!

This theme has been dealt with before, but my question arises, would it be very complicated to add more types of smoke?

At the moment, there is only one type of smoke and one type of fire, I would like it to be possible to have more types to represent various environmental damages.

The_Funktasm suggested some possible uses for this new feature.

Ah. Too bad. Would've been interesting to try making stun damage leave a cloying stun damage form of smoke, or for plasma to leave its own form of fire. Or what I really was thinking of, the black fog from the original war of the worlds.

I would use it in particular to fill the battlefield with toxic gases of various colors, each representing a different type of damage (black smoke for the weapons of the Martians of my mod, orange smoke for mustard gas, green smoke for corrosive gas, etc.)

And it occurs to me that we could recreate a highly radioactive area full of green smoke.  ;D

Anyway, I hope it can be implemented and if so, it is not very complicated to add to the code. Thanks in advance!  ;D
« Last Edit: February 14, 2023, 10:41:05 am by Meridian »

Offline mumble

  • Colonel
  • ****
  • Posts: 338
    • View Profile
Re: [Suggestion] More types of smoke
« Reply #1 on: April 07, 2019, 12:54:40 am »
I'm no coder, but I can see multiple major issues here.

First, current setup is very, very simple. There's smoke and fire, fire makes smoke. So the only element combos are air, fire, and smoking fire.

Other things would provide many problems. Ie, what happens if rolling smoke hits rolling radiation? Does one overright the other? Do both exist simoltaniously? Does a mix interact differently? How is this expressed in the ui?

Proliferation is the real issue. Smoke and fire are incredibly easy, because its 2 total elements that work together. Throw fire in smoke, fire smoke, throw smoke on fire, fire smoke. Adding in only 3 extra elements, on a ui level alone, would be a problem. How would you clearly display 5 elements in 1 tile?

Beyond ui, proliferation of such things. Tracking life span of smoke  radiation, poison gas, ect, as they bump into, or possibly mix with each other.

I wouldn't call it impossible outright, since, at least the ui could be changed by flashing through multiple ui elements, but proliferation and tracking all the data might be an issue. Its also a cool idea, but more difficult than you might think.

Offline Stoddard

  • Colonel
  • ****
  • Posts: 485
  • in a fey mood
    • View Profile
    • Linux builds & stuff
Re: [Suggestion] More types of smoke
« Reply #2 on: April 07, 2019, 02:33:40 am »
i'd say any smoke/gas is smoke and displayed as such. You want to know the composition - use relevant hardware, just like the motion scanner. Also invisible smoke so you can have some surprise deaths.

Only thing I'd change is that so smoke does not extinguish fire or vice versa. If that's still a concern.


Offline mumble

  • Colonel
  • ****
  • Posts: 338
    • View Profile
Re: [Suggestion] More types of smoke
« Reply #3 on: April 07, 2019, 03:14:18 am »
You are missing the point. Everything you are asking, multiple "smoke" types, mechanics, motion detector showing smoke (doesn't make sense btw) and other things take time and effort.

Also smoke doesn't extinguish fire, smoke alters fire to be a smoke fire combo on the tile.

And the bit about composition doesn't make sense, certain gases would be very visibly different, but how multiple different types of gasses expanding into each other would be hard to write in a sensible way.

Offline Stoddard

  • Colonel
  • ****
  • Posts: 485
  • in a fey mood
    • View Profile
    • Linux builds & stuff
Re: [Suggestion] More types of smoke
« Reply #4 on: April 07, 2019, 04:47:48 am »
Well thank you, mumble, I didn't realise that after three years digging in the code I'd misjudge the effort that a feature would take that badly.

In case you still don't get it I didn't ask for anything. I only outlined how what efrenespartano asked could be implemented with minimal effort, in my opinion.

Offline dajt

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: [Suggestion] More types of smoke
« Reply #5 on: November 25, 2019, 05:35:24 pm »
I've thought about how to implement this in a memory-efficent manner, since there are a lot of voxels, and we don't want to excessively increase the size of all of them.  Currently every tile has two flags/counters: one for "is this on fire" and another for "is there smoke here".  If we replace both flags with a small index to an array of environmental conditions, index 0 would be "nothing special here", making the common case fast.  Other indexes could be reference-counted for how many tiles they represent (allowing unused indexes to be reused) and specify what conditions (fire, smoke, elerium fire, stun gas, anti-alien gas, fog, rain, tear gas, nerve gas, flooded with water, etc) apply to those tiles, as well as the counters for how long the conditions will last.  Then we'll just need to implement all the code for how those conditions affect units entering the tiles, and how they affect line-of-sight, weapon fire, etc.