• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Morale System (willing to pay $200)

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
request canceled

If someone can pull off an excellent morale system that is able to run 600+ units smoothly, I'd be willing to pay them $200.


I've really wanted a Morale system for a long time and I've never been able to pull it off :\. When I've taken the integrals of the iterations required, it's always just blown me away >.<.


Morale values for units should be able to be set by specific unit, unit type, or unit type of player. When they are with other units, the morale value increases based on the other unit bonus morale values (what they give off). This increase is based on the distance between the two units (greater distance means less effect).


Morale values should have these properties (unit specific, unit type specific, unit type player specific)


morale degradation over distance for allies
morale degradation over distance for enemies
morale bonus to allies
morale bonus to enemies


The actual morale value of a given unit should be relative to the enemy units surrounding it. If it is completely by itself, it should have a morale value of 100 (not enemy units). If it is by an enemy unit, that morale should go down depending on the bonus the enemy gives off and the bonus the unit itself gives off. For example, if the unit had 600 morale bonus and it was facing a little rabbit that gave off 1 to enemies and 3 to itself, that unit would have 100 morale still and the rabbit would have 0 morale (run away).


The equations should produce desired and realistic results.


Don't handle cases where the unit has nowhere to run and fights with everything they have. Leave this up to the map maker to do (for example, they might want to have a Charge ability or something).


There should be a morale settings function that changes a unit's bonuses based on the morale they have. This should be called whenever the unit's morale is changed that way bonuses can be applied.



The system must be able to run smoothly with 600 units across the map with room for other systems to run without blowing the map up.


My previous designs called for maintaining a balanced Kd-Tree, but the iterations required to do that are just immense.


Trying to do this simply by using things like groups or group enumerations will not work. If you do that, wc3 will die with hardly any units. You must try to think of the absolute most optimal way to do this, otherwise you won't hit that 600 mark.


This does require a lot of programming experience and creativity. Simple things like linked lists will not work.


I've again been trying to do this for a very long time and I've yet to succeed : (.


You will only get the $200 if it meets the feature requirements and the running speed requirements.


The first person to successfully complete this request will get the $200.


I may cancel this request if warcraft 3 dies as there would no point in having the resource then. Even if I move on from Warcraft 3 and Warcraft 3 is still going pretty strong, I'll still pay for the benefit of others =).


Also, be sure to make the code very readable (comments, documentation with method headers etc) so that I can possibly disseminate it later and move it to another language/game whenever =).


Must have PayPal to get the money.
 
Last edited:
Level 7
Joined
Dec 3, 2006
Messages
339
This is kind of a nutz request in itself. I mean most people either can't or can barely handle 600 units on a map let alone any kind of system unless they are simple models like rabbits but still even 600 rabbits could lag out a bunch of people.
 
Level 4
Joined
Aug 17, 2011
Messages
119
okay, not exactly what you are looking for, but I was thinking about maybe useing mana as a permanent "morale buffer/reservoir " for a melee i'm kinda making.

Give all units permanent mana shield at game initiation and then make all morale effects increase/decrease mana. (assuming that low morale can not kill you... it should work quite well and should not be to hard to do...) obviously, you'll also lose the whole mana concept in the game and you will have to set spells to timers instead of mana requirement...
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
You should also be able to set morale bonus that one unit gives off to specific units, for example, a troop commander to the units in that troop ; P. This'll give off more realism =). A troop's morale will drop almost to 0 when they lose their troop commander where as the general army would only suffer the hit of losing that troop (pretty small).
 
Level 8
Joined
Apr 26, 2011
Messages
403
Morale system :

Morale values should have these properties :
morale bonus to allies
- positive armor aura

morale bonus to enemies
- negative armor aura

morale degradation over distance for allies :
- unit have more than 1 positive armor aura
- each aura have difference range & difference armor bonus
- all of them have same icon (so they won't stack) eg
- +5 armor aura with 100 range
- +3 armor with 300 range
- +2 armor aura with 500 range
- +1 armor aura with 1000 range

morale degradation over distance for enemies
- unit have more than 1 negative armor aura
- each aura have difference range & difference armor bonus
- all of them have same icon (so they won't stack) eg
- -5 armor aura with 100 range
- -3 armor with 300 range
- -2 armor aura with 500 range
- -1 armor aura with 1000 range

unit specific: difference unit have difference aura (use difference aura icon for stackability)
unit type specific: you can set target type under world editor (summon, air, land etc)
unit type player specific: you can set target player under world editor (allies or enemy)

if it is completely by itself, it should have a morale value of 100 (not enemy units):
- default armor for unit is 100

For example, if the unit had 600 armor bonus and it was facing a little rabbit that gave off 1 to enemies and 3 to itself:
- that unit would have 100+ armor still, and the rabbit would have less than 0 armor, so the code will decide Rabbit should run off.

How to select unit :
- select all unit with buff_a , buff _b or buff_c etc (very fast)



There should be a morale settings function that changes a unit's bonuses based on the morale they have. This should be called whenever the unit's morale is changed that way bonuses can be applied.

- select unit with certain buff icon, and applied bonus base on total "armor(morale)"


What happen if the game have combat system ?
- just change the game constant for armor - damage reduce to 0 (so armor won't have any effect on combat)


This does require a lot of programming experience and creativity. Simple things like linked lists will not work.

- simple aura like above do work, it doesn't require lots of work and most important is: it is fast !

It is not perfect system yet, but it work after minor tweak, eg :
- if you don't like +armor stat, you can set it to +0 armor, then calculate how much "morale" they have (base on how many buff icon they got or how many group they belong to).


----------
edit: you keep adding more requirement

You should also be able to set morale bonus that one unit gives off to specific units, for example, a troop commander to the units in that troop ; P. This'll give off more realism =). A troop's morale will drop almost to 0 when they lose their troop commander where as the general army would only suffer the hit of losing that troop (pretty small).
- Troop commander have +100 armor aura :) while average unit have +5 aura
- if troop command die, it spawn dummy with negative aura on allies
 
Level 8
Joined
Apr 26, 2011
Messages
403
That won't work as you wouldn't be able to set the unit bonuses for specific units etc >.>

every second, loop through every unit, read their "armor value", then changed their "custom value" base on armor value.


now you can read "custom value" to find out their morale, and applied unit's bonus base on this morale value
 
Level 7
Joined
Apr 1, 2010
Messages
289
hmm, i came up with a flee system(units would run based off of their health and the number of allies nearby vs enemies), but it was triggered when ever a unit was damaged, so it wasn't running constantly. I will try to come up with something.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
In the very best design I came up with that updated kept a balanced Kd-Tree, the iterations necessary to generate the Kd-Tree alone for a large number of units was enough to kill the map : |. I pretty much think that this task is impossible.


Also, this would be used in large scale RTS. Think of 120 units per player, meaning easily up to 1200 units.
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
i put 600 units on the map, and my wc3 lags already with all that combat o.o

and btw, you are wrong, auras can be made stackable.

i made a zombie map, with each zombie around 255 radius, their defense increase by 1,
and decreases 3% movement and attack speed for each zombie on 255 radius
(it counts how many zombies are there.)

10 zombies = +10 defense, -30% ASPD and MSPD

if the zombie is alone, he won't get any bonuses.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Uh huh, but #1, you can't use armor rating as that messes with the gameplay. You'd have to use an aura that gave 0 bonuses. How are you going to retrieve the total morale like that? You can't : |


Next, like I said before, you wouldn't be able to change the morale value that specific units give off********, I'm not saying have, I'm saying give off. Also, you wouldn't be able to change the range degradation.


The first thing I tried was auras for this system and I quickly realized that they wouldn't work.
 
Nes, here's a good solution:
Assume there are 450 units
0.03125 seconds pass - iterate through the first 100 units
0.03125 seconds pass - iterate through the next 100 units
0.03125 seconds pass - iterate through the next 100 units
0.03125 seconds pass - iterate through the last 50 units

This should be good enough ;)
It may have some overhead though, but I'm sure it would be faster than looping through all the units at once.
 
Status
Not open for further replies.
Top