Skajaquada
Crazy Engineer
- Joined
- Mar 4, 2007
- Messages
- 134
I've been wanting to make a morale- and routing-system for some time but for the last several months I've been really busy working with and importing models.
Going through the unit-functions with all things like "is great general near", "get terrain", "get hit points" really seem to beg for a morale-system. I was thinking quite simply at the end of the turn, or the beginning, we loop through all units and check things like adjacent enemies, hit-points etc. then determine if the unit should flea.
The first thought I had against the idea is the way Civ 5 works you kind of want units with low hit-points to run away and heal up. I was then thinking is it possible to lock a unit in a routed state? I think so, it's just some variable for how many turns they should be away. Then every turn we check "if is still routed", then give it a hefty negative defence-modifier and maybe only make it run a single hex every turn. The question is just if this would drag the performance down significantly? Is there already a unit-loop I could put my code in?
I could even have a fear-table for all units with lots of things adding to this like low hit-points, adjacent much more powerful enemies, even terrain like jungles. I'm thinking I'll just have a table in LUA like this:
local g_unit_fear_points = {}
Then if I can't bake it into an existing loop I'll just set it like this for built units:
g_unit_fear_points[tostring( unitID )] = 0;
Then add it up differently for different units. I could for example use the RunCombatSim to add more fear-points if it's a pretty scary enemy.
Then of course comes the route-state. I was thinking at the begining of a turn I could check that fear-value, if it's too high the unit becomes routed. It'll then move around, if it's way too performance-heavy to make the unit run away from a enemy it could just be random.
Any thoughts? Anyone seen anything like this in a mod or DLC?
I was also thinking it could be fun doing other stuff, perhaps dialogues could appear like those in BtS giving you different choices. The programming challenge there might be more making some tables and functions that handling those easy.
Another thing that struck me was ripping off Dune (and not just Total War) and make desert-hexes and tundra really dangerous to end the turn on. Would that have any chance of working game-play-wise? I really don't like gimmicks in games though if the morale-system could be worked into something really complex and meaningful I think it could be fun. Then I was thinking morale-promotions and whatnot could reduce the fear to make it like feel part of the game.
Going through the unit-functions with all things like "is great general near", "get terrain", "get hit points" really seem to beg for a morale-system. I was thinking quite simply at the end of the turn, or the beginning, we loop through all units and check things like adjacent enemies, hit-points etc. then determine if the unit should flea.
The first thought I had against the idea is the way Civ 5 works you kind of want units with low hit-points to run away and heal up. I was then thinking is it possible to lock a unit in a routed state? I think so, it's just some variable for how many turns they should be away. Then every turn we check "if is still routed", then give it a hefty negative defence-modifier and maybe only make it run a single hex every turn. The question is just if this would drag the performance down significantly? Is there already a unit-loop I could put my code in?
I could even have a fear-table for all units with lots of things adding to this like low hit-points, adjacent much more powerful enemies, even terrain like jungles. I'm thinking I'll just have a table in LUA like this:
local g_unit_fear_points = {}
Then if I can't bake it into an existing loop I'll just set it like this for built units:
g_unit_fear_points[tostring( unitID )] = 0;
Then add it up differently for different units. I could for example use the RunCombatSim to add more fear-points if it's a pretty scary enemy.
Then of course comes the route-state. I was thinking at the begining of a turn I could check that fear-value, if it's too high the unit becomes routed. It'll then move around, if it's way too performance-heavy to make the unit run away from a enemy it could just be random.
Any thoughts? Anyone seen anything like this in a mod or DLC?
I was also thinking it could be fun doing other stuff, perhaps dialogues could appear like those in BtS giving you different choices. The programming challenge there might be more making some tables and functions that handling those easy.
Another thing that struck me was ripping off Dune (and not just Total War) and make desert-hexes and tundra really dangerous to end the turn on. Would that have any chance of working game-play-wise? I really don't like gimmicks in games though if the morale-system could be worked into something really complex and meaningful I think it could be fun. Then I was thinking morale-promotions and whatnot could reduce the fear to make it like feel part of the game.