Dealing Different Damage to Different Units

Post Reply
PerseusSpartacus
Posts: 8
Joined: Tue Mar 10, 2015 4:11 pm

Dealing Different Damage to Different Units

Post 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.
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Dealing Different Damage to Different Units

Post 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 =)
User avatar
cybermind
Posts: 110
Joined: Sat Dec 31, 2011 11:43 pm

Re: Dealing Different Damage to Different Units

Post 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).
PerseusSpartacus
Posts: 8
Joined: Tue Mar 10, 2015 4:11 pm

Re: Dealing Different Damage to Different Units

Post 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.
PerseusSpartacus
Posts: 8
Joined: Tue Mar 10, 2015 4:11 pm

Re: Dealing Different Damage to Different Units

Post 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.
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Dealing Different Damage to Different Units

Post 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.
PerseusSpartacus
Posts: 8
Joined: Tue Mar 10, 2015 4:11 pm

Re: Dealing Different Damage to Different Units

Post 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.
Post Reply