BlackRainZ

Need to know if something like this is possible to code (experienced modders please take a look)

Need to know if something like this is possible to code (experienced modders please take a look)

I am trying to come up with some creative way of making the larger units for my mod idea (100 and 300) to work in a balanced way. 100 and 300 man groups do a lot of damage and lowering weapon damage breaks other things. So I was thinking if something, like what I suggest below, is possible then maybe I can make it work better:

 

 

Somehow make it so that units do less damage based on unit size. Maybe I could add some code to the CoreUnitGroupingTypes to make them do less damage.

 

Somehow make it so that units do less damage (maybe by percent) to champions and monsters. 

 

 

Or if anyone has a better idea on how I could balance it then I would appreciate ideas.

61,390 views 43 replies
Reply #26 Top

I have tried with UnitStat_Attack_Pierce as well and it didn't seem to do anything but let me check again to make sure when I have time.

Reply #27 Top

I do still want to try to get this to work but I was just thinking. Why am I killing myself over this when perhaps it doesn't need to change. In reality, one hero should not be able to take out 100 or 300 soldiers on their own anyway. In a pitched battle where 100 or 300 guys are surrounding 1, no matter how strong, the hero is going to lose terribly so perhaps I shouldn't change it at all. Might even make for some interesting play. Heroes will still be good against monsters and smaller groups of men but with real armies you can't just send out your heroes without backup. What do you think about that

Reply #28 Top

There is an ancient spell that decreases all damage done by 100%, and then charges you that much mana.   I'd look there for the code on how to decrease the incoming damage.

Combine that with weapons that do damage / figure, and you should be golden.  I understand your frustration,  however snapping at folks attempting to help you often a good way to dissuade them from making further attempts. 

Reply #29 Top

Emmagine, thanks for your intentions to help me, but I was annoyed because it seemed in your first post that you had no real idea what I was trying to do and were basically telling me not to do what I was trying to do. I really don't like when people try to help others when they do not know what is going on or how to help them. Sorry if I was rude. This time you did give me an idea though, thanks. Anyway:

 

I figured out how to make it work. I now do not have to do all the changes I was doing to weapons and armor, etc. The only thing is though that auto battle is going to be messed I think. So I have actually found a pretty simple way to do what I have been (and Heaven has been) trying to do, I think. I only tested it a little but it seemed to be working. It is also easy enough to alter the numbers to see what works best.

Reply #30 Top

Black, from what I understand you wanted to balance the game around bigger armies.

A few pointers- in most fantasy books, in order to take out a dragon, 1 of 3 options will come into play:

1) The whole village will band together to kill the dragon (usually because it attacks the village). The village usually ends in ruins, regardless of the dragon state.

2) The city sends a band of knights to kill the dragon.

3) Send adventurers to kill the dragon. Note that those who manage to kill them are proclaimed heroes.

In all of the 3 cases, we can see that 1 Dragon>=A whole village (~300 armed, untrained men)= A band of knights (~50 highly trained men)=A hero.

From what I can see, your main issue is not army vs army, but army vs single. You could fix this by giving the champion high armor (it's the kind of people who wear the legendery breastplate that they found in the dragon's lair), and some damage reduction.

The biggest issue is the formula for damage- attack^2/attack+def. It means that you have to increase your defense exponentially in order to receive the same amount of damage.

A possible solution for this might be to use 2 different kinds of armor systems- one magical and one physical. Champions are immune to physical but suffer from fire, and units the other way around. Then, the champion takes 90% reduced fire damage (so 30 instead of 300 base) and you can give him extra defense. Or you can give the champions a lot of armor(or lots of hp), but it might look stupid.

Another option, is to give your single-units a lot of dodge, and give truestrike to all units. The idea is, in order to hit the champions the units will have to use a less-damaging ability.

Hope this help!

Reply #31 Top

Thanks Raledon. I found a way to make unit damage considerably less though. I can now make units damage be  minus any percentage I want. So a group of 300 men wielding a 7 dmg spear would normally do somewhere around 2100 dmg but if I make it minus 90%, they will only do around 210 damage or less. Even less damage if someone has armor. They will still do a lot of damage but it is 300 guys after all. Heroes will also be able to do a lot of damage to them, they just wont be able to take a lot of hits. Magic of course will be even more important.

 

Also, it is true that Dragons will destroy villages of people and a few heroes can take out a dragon but a Dragon can lay waste to many enemies at one time. Heroes don't have that raw power to lay waste to hundreds and hundreds of men. It is why heroes always avoid large groups of enemies and usually only fight smaller groups of enemies unless they have an army of their own. So, yes, a few heroes will take out a dragon because their damage is focused on it but they wont be able to take out an army.

Reply #32 Top

I suppose that's kind of my point.  You were apparently not getting any where with your previous direction.   My second idea was simply an alteration to my first.   You're correct I wasn't aware you had a second thread discussing the same topic, but that wasn't through any fault of my own.   That was not mentioned anywhere in this topic.   No one ever has any idea what problems you are running into until they discuss it with you.   If you still feel that your annoyance at me was justified, I shall avoid commenting on your posts in the future, as we obviously have different perspectives on what we want when we ask for help.

I apologize for the intrusion,

 

Emmagine 

Reply #33 Top

Originally I only asked a question to see if something was possible, that was all. You said that I was going about things the wrong way and told me something completely different to what I was looking for. I don't want to argue and I am not looking to create a situation where we are at odds so let us stop the arguing and why not move discussion to the other thread. Perhaps you have some ideas on things you would like to see to increase immersion.

Reply #34 Top

Or if anyone has a better idea on how I could balance it then I would appreciate ideas.

 

I answered the question asked.   You're correct, no need to argue.  Good luck with your mod.

Reply #35 Top

I'm pretty sure what you're looking for is UnitStat_CombinedAttack, look up Syphon Strength spell, it should be similar to what you're doing.

Edit: bah, should have finished reading, nvm.

Reply #36 Top

The damage % reduction to trained units is a good idea for more than just the obvious reason of removing insane numbers - an entire body of men can not simply swing at the same time at the same target. Two armies clashing shouldn't be over in a matter of seconds, it's going to turn into a slogging fest. That being said, you will want to consider giving every weapon type retaliation otherwise swordsmen will carve up anything in melee, but it will also simulate the value of flanking.

I wonder if there's a way to make the damage % be based off maximum unit numbers. If a troop has lost 50% of its men it should still do the same amount of damage as when it is at 100% troop strength because (assuming the formation holds) the same number of men are still on the front line. Perhaps not a perfect 1:1 formula, you'd want some increasing returns in troop losses to damage done to simulate loss of morale or a shortened line with their comrades being slaughtered.

Just something to think about, I guess.

Reply #37 Top

I am not sure if it is possible to do max damage even when soldiers in a group have died. I haven't ever thought to look into it.

 

 

Reply #38 Top

It's possible.

If you say that UnitDamage=((TroopCount*TroopDamage)/(MaxTroopCount/TroopCount))*TroopCountDmgChng (do note that the first part is the original formule) the unit will always cause max damage.

The second part is, if we want that the unit will deal less damage- we use the ability to change units stats if they are below certain health (old kraxx talent that gives extra defense/attack), and give it TroopCountDmgChng=(TroopCount/MaxTroopCount)*N.

If N=2 and it applies on 50%, the unit will deal 100% till it gets to 50%, and then every troop dead will reduce the damage.

This will work, as long as the game actually agrees to do the math properly.

Reply #39 Top

Can you give me an example of what the full code might look like

Reply #40 Top

The original code had a part where I originally multiplied by 0... Thats a bit confusing indeed. I've changed the math a bit.

UnitStat_MaxTroops - I expect this to be the amount of max troops the unit can have. If this doesn't work, you should create a stat and assign it based on group size. It might need to be changed to UnitOwner, I'm not sure.

UnitOwner_GetTroopCount - Current amount of troops.

 

The math assume that the unit gains 2 arbitrary stat <N> when under 50%, using the <WhenUnderPercentHitPoints>50</WhenUnderPercentHitPoints> line. (It starts with 0)

In this code I'll assign it as a full strength modifier from 50-100%, and every % drops in count past that will count as 2% reduction in strength (so 0-50% will have 0-100% power).

The value in the end goes to the code part you made (What code do you use, BTW? I'm curious) to reduce unit damage by a set %.

<Calculate InternalName="TrpCnt" ValueOwner="TargetUnit">
<Expression><![CDATA[UnitOwner_GetTroopCount]]></Expression>
</Calculate>

<Calculate InternalName="MxTrpCnt" ValueOwner="TargetUnit">
<Expression><![CDATA[UnitStat_MaxTroops ]]></Expression>
</Calculate>

<Calculate InternalName="Calc1">
<Expression><![CDATA[[MxTrpCnt]/[TrpCnt]]]></Expression>
</Calculate>

Use Calc1 as value if you want the unit to always deal maximum damage.

<Calculate InternalName="DmgChng1">
<Expression><![CDATA[1/[Calc1]]]></Expression>
</Calculate>

<Calculate InternalName="N" ValueOwner="TargetUnit">
<Expression><![CDATA[[UnitStat_ArbitraryStat]]]></Expression>
</Calculate>

<Calculate InternalName="DmgChng2">
<Expression><![CDATA[[DmgChng1]*[N]]]></Expression>
</Calculate>

<Calculate InternalName="Calc2">
<Expression><![CDATA[1-[DmgChng2]]]></Expression>
</Calculate>

<Calculate InternalName="Value">
<Expression><![CDATA[[Calc1]-[Calc2]]]></Expression>
</Calculate>

 

A small note- N range is correspondent to the amount of health you wish the unit to start getting weakened by. It should be equal to 1/num%, so for 33% it will be 3, for 20% 5, etc.

Reply #41 Top

I see, thanks. I think the way I have it now might be fine but if I change my mind I will try this out.

Reply #42 Top

you are welcome

Reply #43 Top

Omg I would love to play this mod :p

How did you succeed to set party of 300 units ? I cant even set them more than 8 ^^

 

This mod looks to be dead, I hope im wrong :(