Page 1 of 1

Dealing Different Damage to Different Units

Posted: Tue Mar 10, 2015 4:20 pm
by PerseusSpartacus
Hi, I have a big question about the capabilities of Stratagus' engine. Is it possible for a single unit type to do different amounts of damage to different types of other units?

So, say I have three kinds of units: a Pikeman, an Archer, and a Knight. Would it be possible for the Pikeman to do, say, 8 damage to the Knight and only 4 damage to the Archer?

I have noticed that the game does define 'BasicDamage' and 'PiercingDamage' separately, but I have no idea what these do, especially since I see only one type of Armor.

Note that I am looking only at Aleona's Tales, so I have no idea what the differences are between it and other Stratagus games.

Re: Dealing Different Damage to Different Units

Posted: Tue Mar 10, 2015 5:41 pm
by Andrettin
PerseusSpartacus wrote:Hi, I have a big question about the capabilities of Stratagus' engine. Is it possible for a single unit type to do different amounts of damage to different types of other units?

So, say I have three kinds of units: a Pikeman, an Archer, and a Knight. Would it be possible for the Pikeman to do, say, 8 damage to the Knight and only 4 damage to the Archer?

I have noticed that the game does define 'BasicDamage' and 'PiercingDamage' separately, but I have no idea what these do, especially since I see only one type of Armor.

Note that I am looking only at Aleona's Tales, so I have no idea what the differences are between it and other Stratagus games.
Yes, it is possible to do that. cybermind did something like that in his Doom Wars, for instance. In fact, the damage formula can be entirely redefined through Lua =)

Re: Dealing Different Damage to Different Units

Posted: Wed Mar 11, 2015 2:12 am
by cybermind
Just take a look into Doom Wars documentation (located in /doc/doc_en.html from the Doom Wars directory), I have described there all information about damage type system of Doom Wars. The damage calculation formula is located in /scripts/stratagus.lua file (SetDamageFormula function).

Re: Dealing Different Damage to Different Units

Posted: Wed Mar 11, 2015 2:42 am
by PerseusSpartacus
Thank you so much. This really defines how I will approach the design of my game, so it helps a lot to know what I can do.

Re: Dealing Different Damage to Different Units

Posted: Wed Mar 11, 2015 5:41 am
by PerseusSpartacus
cybermind wrote:Just take a look into Doom Wars documentation (located in /doc/doc_en.html from the Doom Wars directory), I have described there all information about damage type system of Doom Wars. The damage calculation formula is located in /scripts/stratagus.lua file (SetDamageFormula function).
Sorry to be a bother, but the download for Doom Wars is just way too big for my internet connection, so is there any chance you could give me the relevant code for this? I would be eternally grateful.

Re: Dealing Different Damage to Different Units

Posted: Wed Mar 11, 2015 7:15 am
by Andrettin
PerseusSpartacus wrote:
cybermind wrote:Just take a look into Doom Wars documentation (located in /doc/doc_en.html from the Doom Wars directory), I have described there all information about damage type system of Doom Wars. The damage calculation formula is located in /scripts/stratagus.lua file (SetDamageFormula function).
Sorry to be a bother, but the download for Doom Wars is just way too big for my internet connection, so is there any chance you could give me the relevant code for this? I would be eternally grateful.
Here are the two files:
https://dl.dropboxusercontent.com/u/173 ... oc_en.html
https://dl.dropboxusercontent.com/u/173 ... atagus.lua

Hopefully cybermind won't mind me posting them here.

Re: Dealing Different Damage to Different Units

Posted: Wed Mar 11, 2015 3:53 pm
by PerseusSpartacus
Thank you so much. I'm sure I'll need more help in future, but what you've given me so far has been huge - literally game-changing, in fact.