Page 1 of 1

Suicide Units

Posted: 16 Jan 2014, 02:14
by AmadeusReborn
Hi, me and my friends have been working on our own RTS, and one of the new units we wanted to implement into our existing roster is a light dunebuggy with explosives.

I'm new to the coding side of things in Spring (one of my friends has recently passed the coding/balance stuff to me), so sorry if I'm asking a dumb question, but what would be the best way to implement a kamikaze unit in terms of code? The explosion will likely be triggered via a standard attack order (and probably on death)

as an aside, I should note the unit will likely be produced in groups, so I'm wondering if on-death explosions might be a problem, and how to deal with that too. The buggies aren't exactly meant to be tough, rather they are meant to blend in with much cheaper MG buggies that look very similar.

Thanks for your help! :)

Re: Suicide Units

Posted: 16 Jan 2014, 02:24
by Forboding Angel
Kami unit capabilities are built directly into the engine.

http://springrts.com/wiki/Gamedev:UnitDefs#Tag:kamikaze

Re: Suicide Units

Posted: 16 Jan 2014, 02:34
by AmadeusReborn
Oh awesome!

Thanks for your help! :)

Re: Suicide Units

Posted: 16 Jan 2014, 10:27
by Silentwings
so I'm wondering if on-death explosions might be a problem, and how to deal with that too
Lots of solutions.

1) The death explosion and the 'self destruct' explosion can be different.
2) You can use an armorclass to make the bombs do not much damage to each other (see wiki on armordefs.lua - http://springrts.com/wiki/Gamedev:Main)
3) You can use lua - the synced callin UnitPreDamaged can modify damage dealt on the fly (http://springrts.com/wiki/LuaCallinReturn). This is very useful but shouldn't be overused, its the most expensive way.

Probably more besides but I guess thats plenty for you ;)