Loading...
  OR  Zero-K Name:    Password:   

Infinite Fire?

8 posts, 954 views
Post comment
Filter:    Player:  
sort
12 years ago
Hopefully I'm doing this right... (new to forums!) :)

So I spectated a game (http://zero-k.info/Battles/Detail/59794), and everyone noted that fire burns infinitely (or close to) underwater.

Observe the napalm bombers and inferno nukes. Coms cried while burning to death under water.
+0 / -0
12 years ago
Rafal then shows us how it's properly done. :)

http://zero-k.info/Battles/Detail/59800
+0 / -0
Skasi
12 years ago
Yes yes, already known. Find out if it's ZK or engine and if the later report at http://springrts.com/mantis/

(zomg, just had to copy paste this!)
+0 / -0
12 years ago
This bug is with the ZK mod. unit_is_on_fire.lua

Saktoth's reversion has changed:
AddUnitDamage(unitID,t.fireDmg*CHECK_INTERVAL,0,t.attackerID, t.weaponID )

to:
AddUnitDamage(unitID,t.fireDmg*CHECK_INTERVAL,0,t.attackerID, t.weaponDefID )

t.weaponDefID in this one is nil (not initialized)


The bug happens due to the AddUnitDamage SyncCrtl triggering the callin UnitDamaged. t.weaponID in the current stable is derived from the original weapon that set the unit on fire (it's the same as the weapon).

Since the weaponID is passed to AddUnitDamage, which triggers UnitDamaged, this weaponID ends up in the weaponID parameter for the callin. Since the original weapon passed the
---- if (flamerWeaponDefs[weaponID]) then
check, this weaponID passes as well. Which triggers the setting on fire code again, refreshing the endFrame timer -> results in units burning forever.

Sak's reversion changed weaponID in the AddUnitDamage to "nil" essentially and flamerWeaponDefs[nil] isn't true, thus it doesn't trigger and units stop burning forever.


One way to fix it would be to check if the unit is already on fire and then check if the damage received from the callin is exactly
fireDmg*CHECK_INTERVAL
and the attackerID and weaponID is identical to the one already remembered.
If those are all true, it doesn't run the check.

This would only prevent units being hit by the same attacker, with the same weapon, dealing exactly the same damage as one tick of fire damage... from being put on fire that frame; which can be rare enough to be ignored.
+0 / -0

12 years ago
Zero-K v1.0.3.2 is out, using rafals fire bug fix. If there are any further problems, the previous version i reveted to worked fine as well (but was apparently bad lua and may have caused problems for endgame stats?).
+0 / -0


12 years ago
Huh, apparently that kind of recursion was prevented in the old engine version or I just wasn't pay attention.
+0 / -0


12 years ago
The only related engine change is:
(from 86.0 changelog)

- distinguish damage-types for Unit{Pre}Damaged when weaponDefID < 0 (2966)
weaponDefID -1 --> debris collision
weaponDefID -2 --> ground collision
weaponDefID -3 --> object collision
weaponDefID -4 --> fire damage
weaponDefID -5 --> kill damage

They probably fixed UnitDamaged to be called in every case, which includes being called by AddUnitDamage.
+0 / -0


12 years ago
The majority of changes are not in the changelog.
+0 / -0