Enhanced hero system

So here's my plan on items. I've read the magic items thread and considered my own experience with RPGs. A couple design goals:
  • FfH is foremost an empire building game. I want heroes to be much more important than they are now (and more numerous) so that the FfH becomes a hybrid TBS/RPG similar to Heroes of Might and Magic, but with the emphasis on the empire-building aspect.
  • The equipment/inventory system should be simple (compared to a typical RPG).
  • The UI needs to be very accessible and noticable.
  • Collecting items should be as fun and rewarding as possible.
  • Items will be responsible for keeping heroes relevant throughout the game.
  • Heroes are differentiated from each other mainly by the items and abilities they have.

With that said, here's the current design:
  • Each hero has inventory slots and a backpack. The backpack can hold an infinite amount of items. Each inventory slot can hold only 1 item.
  • Inventory slots: body (includes arms, chest, legs), head, hands, feet, ranged weapon, melee weapon, and mount.
  • Weapon classes: bow, slashing, blunt, piercing
  • Armor classes: leather, chainmail, plate
  • Other classes: simple (includes weapons and armor that any hero can use), horse riding
  • To use an item, the hero must have the ability to use that item's class. These abilities are called armor and weapon proficiencies. For example, a hero needs Slashing Proficiency to be able to use swords and axes.
  • A hero starts off with certain armor and weapon proficiencies. Like Channeling and Summoning, these cannot be gained by leveling the hero up.
  • The hero can get greater weapon proficiencies by leveling up. Each weapon proficiency of a class beyond the first gives a certain (as of yet undetermined) bonus when using that weapon class. For example, if a hero has Slashing Proficiency, when he levels up (and has some other prereqs), he can get Slashing Skill 1. Haven't decided how many levels of proficiencies there are - in fact, I might abandon this idea.
  • There's only one level of armor proficiencies. It just determines whether a hero can use an armor class or not.
  • There are two types of items: normal items and special items.
  • Normal items are infinite in supply and become available when the tech for it becomes available. Heroes have to go back to cities to retrieve new items (equivalent of upgrading a unit).
  • Special items like Orthus's Axe are typically unique (but don't have to be). They can be obtained from special barbarians (e.g. Orthus) or quests (future work).
  • Special items can be deposited into an item vault at the player's capitol for safekeeping or for another hero to pick up. Some items could also provide nation-wide benefits when stored in the vault.
  • Weapons will give extra strength (like Heroic Strength).
  • Armor will subtract away damage in each combat round. I haven't fully thought out the effects of this, but I know that this would make armor very useful against weaker units.
  • Heroes will start off with much lower strength, typically 1, to compensate for weapon strength.
  • Some weapons also require Channeling or Summoning - these weapons are geared for spellcaster heroes.
  • Items and proficiencies won't be listed as promotions, since that would just clutter the unit info display.
  • There will be an action button called "Inventory" that when activated pops up an inventory screen. Haven't decided how it would look like.
  • Need some interface to transfer items from hero to hero or hero to vault or vice versa.

Implementation details:
  • Items and item proficiencies are promotions. An item has an item class as an AND prereq. The actual item prereqs are OR prereqs, although those prereqs are treated as AND prereqs. Item classes are represented by proficiencies, since they correspond 1-1. I hope there isn't a 256 promotion limit :) If there is - oh well. This is only a temporary solution.
  • FFHItem class is responsible for abstracting out the above details.
  • Haven't fleshed out the UI design. Not familiar with Civ4's UI system, but I think I'll just copy the pick target screen and work from there.
  • If needed, combat mechanics can be modified in onCombatLogHit. The combat odds message can be modified as well. The calculation of combat odds can be ported to Python.

Details very subject to change.
 
Progress report:

Code structure: Implemented a trio of classes to handle items: ItemInfo, Item, and ItemProxy (which is like a handle to an Item; purpose is to avoid needless instantiation of the same item). Implemented a way to store custom data much more efficiently than how I was doing it before - no more worries about storing a bunch of items frequently. Created a pair of classes that would've sped up repr() speed of lists and dicts significantly, but I ended up not using them :/

GUI: Getting the hang of Civ4's screen interface system. Lack of documentation is a PITA. Used the pick target screen as a starting point. Got drag-and-drop working :) Haven't finalized GUI layout and I'm not going to spend time creating an ASCII art mockup of one.

XML: All the inventory slots and proficiencies are in. I also added several test items.
 
Are these items going to become units which can be stored inside a hero or prmotions like Orthus' Axe is today?
 
Er, Orthus' Axe isn't a unit. If you mean a promotion, then yes they will be implemented as promotions. However, they won't be displayed in the unit promotion list since it would just clutter the unit info panel. They can only be seen in the inventory screen.
 
Actually I said "...or promotion like Orthus' Axe?". As units they would be able to be given to other heroes after acquired. By the way, is this already in the system? Which items from the magical items will be in?
 
Oops my bad. Reading diligently isn't one of my strong points :)

Promotions can be given to other units when acquired just as well. Not sure what the point of making items as units would be. In fact, I can't imagine how using units as items would work.

Not sure what you mean by "already in the system". Item transfer after killing enemies? Not in yet, but would be trivial to implement. I have no clue which items I'm going to put in. Once I finish up the system and GUI for it, I can worry about those details.
 
Maian said:
Oops my bad. Reading diligently isn't one of my strong points :)

Promotions can be given to other units when acquired just as well. Not sure what the point of making items as units would be. In fact, I can't imagine how using units as items would work.

Not sure what you mean by "already in the system". Item transfer after killing enemies? Not in yet, but would be trivial to implement. I have no clue which items I'm going to put in. Once I finish up the system and GUI for it, I can worry about those details.

Items as units just means in using cargo to hold and carry 0 movement, capturable "units/objects" around. It has the advantage of not being tired to a unit like promotions are. Which can be handy if you, for example, fireball a unit with orthus's axe. Instead of the axe being lost (as it will be added to the fireball and the fireball will be destroyed) the axe will drop in the tile the creature was killed in wait to be picked up by anyone who comes across it.

This would of course require model art for all the items though it wouldn't need to be animated so it would be realitvly easy.

The big problem with equipment as units is the depth issue. You can only be 1 depth in Civ4, you can have a unit in a unit but no deeper than that. So without an SDK change (which may be significant, I havent looked into why the depth issue exists) you wouldnt be able to load a unit with a sword in his cargo onboard a ship.
 
Ships could have cargo slots for normal units and a seperate cargo hold for weapons and armour (still not sure if this is really possible)...
 
Kael said:
Items as units just means in using cargo to hold and carry 0 movement, capturable "units/objects" around. It has the advantage of not being tired to a unit like promotions are. Which can be handy if you, for example, fireball a unit with orthus's axe. Instead of the axe being lost (as it will be added to the fireball and the fireball will be destroyed) the axe will drop in the tile the creature was killed in wait to be picked up by anyone who comes across it.

This would of course require model art for all the items though it wouldn't need to be animated so it would be realitvly easy.

The big problem with equipment as units is the depth issue. You can only be 1 depth in Civ4, you can have a unit in a unit but no deeper than that. So without an SDK change (which may be significant, I havent looked into why the depth issue exists) you wouldnt be able to load a unit with a sword in his cargo onboard a ship.

Oh that isn't a problem. Items aren't strictly a promotion in my system. Rather they are an actual object that can go on a unit, player, or plot. They only manifest themselves as promotions when on a unit. In a plot, they will manifest themselves as some graphic. I'm not sure how they will manifest themselves in the player's vault. I tried to make items as similar to other Cy* objects, adding a getID() method and a way to obtain an item by its ID. They survive persistently thru game load/saves by being stored in the game's script data.
 
For a hero enhancement, retreating doesn't really fit with what i imagine of heroes (and this system seems like they'd likely be killed shortly after their retreat).

What would really be nice is some hero survivability.
I've mentioned this before (can't remember where), where your hero will be low on health and still be chosen to defend against the next attack despite their low health and the availability of other units to defend with.

I understand the AI now knows not to attack with a hero if they don't have good odds, but what would really give heroes good survivability would be if they weren't chosen to defend if they had low health or bad odds.

Example:
I have a hero and two archers in a tile.
Enemy has 2 rangers
-
1)Enemy attacks and my hero defeats the first ranger, but is lowered significantly in health
2A) [current system] Enemy attacks with other ranger and kills my hero (who even with lowered health had better odds than an archer would have)
2B) [survivability on heroes system] Enemy attacks with other ranger and an archer is chosen to defend (since the hero has low health and the situation doesn't look good), the ranger kills my archer but is weakened. My hero is still alive.

Now, it would be nice if this also applied to high xp units. If i have 2 archers, 1 of which is super high xp, that archer is going to always defend, even when its down to 0.5 health, because its the stronger of the two still. But its also the more valuable of the two, and if im gonna lose one, i want to lose the weaker one.
 
Sounds like Chalid's HP system to me (atleast what I understood of it)... :)
 
Its an urban legend Chalid is spreading. :lol:
 
Sureshot,

I'm definitely going to play around with hero retreating to see whether it improves gameplay or not. The idea is that when you invest so much into your hero, with new items and skills, you'll get very frustrated if your hero dies stupidly, and the retreating is a safeguard against that. Unfortunately, without the items and quests implemented yet, I can't gauge whether the retreating is necessary.

Let me illustrate how retreating currently works (in the development version):

Any unit with withdrawal can retreat. This means horsemen and units with flanking promotions can retreat. The probability of retreating is the same as the probability of withdrawing, but with a twist. Each time the unit retreats, it loses 50% of its withdrawal chance the next time it withdraws. At the start of the next turn, it regains 50% of its withdrawal chance. So if a unit is attacked twice and somehow manages to retreat both of the times, it will start the next turn out with a 50% penalty (100% penalty + 50% regain).

Now the hero part. Heroes start off with a 100% withdrawal bonus. Every attack they make will reduce their withdrawal chance by 50% until the bonus is used up. This also makes the first hero retreat gauranteed. So if a hero with the whole 100% withdrawal bonus attacks, it loses 50% withdrawal for the next withdrawal/retreat. This penalty stays during the opposing players' turns, so if they attack your hero, it will still have the 50% bonus (instead of 100%) to retreat. If the hero had blitz and attacked twice, then the hero wouldn't have a bonus during the opposing players' turns (and regain only 50% of the bonus the next turn).

So to summarize:
- Units have a chance to withdraw and retreat based on their withdrawal probability.
- Each time a unit retreats, it gains a 50% withdrawal penalty. This doesn't happen when a unit withdraws while attacking.
- At the start of the player's turn, the unit regains 50% withdrawal.
- Heroes get a 100% withdrawal bonus. This bonus goes down for both withdraws and retreats, unlike the normal withdrawal probability which only goes down for retreats.

Your hero survivability idea is good, but I can't do anything about that. That's SDK territory, unless a Python hook is implemented. In any case, it's still possible for the hero to die stupidly. The key question is whether it's okay to allow this slight chance of dying in the face of overwhelming odds to win. That's what I intend to test in the coming days.

If it really is too annoying for heroes to die in these cases, there are a couple possibilities I can explore:
- Allow heroes to retreat (current solution).
- Allow heroes to win instantly in battles it has overwhelming odds to win in.
- Allow the hero a chance to win if it actually loses in a battle that it has overwhelming odds to win in.
 
How about the chance for the hero to retreat is based on the percentage chance of them winning? For example, Valin has a 99.4% chance of victory against a maceman. Let's say that the 0.6% chance happened and Valin lost. Now, he has a 99.4% chance to retreat.

Alternately, the chance for retreating could be the victory chance, modified by a certain number, which may change. Let's use +50% as an example. So, in the last example, Valin would have a 100% chance to retreat, because 99.4+50>100. Maybe we could also have it so that it goes down by 25% each time the hero attacks in one round. So, if Valin had just killed an archer, he would still have a 100% chance (99.4+25), and if he had killed both an archer and a crossbowman, he'd have a 99.4% chance again. You might also want to make it so that this modifier can go into the negatives, so that if Valin had killed an archer, a crossbowman, and a warrior before attacking the maceman, he'd have a 74.4% chance of retreating (99.4-25).

Would this be workable/desirable?
 
It would be undesirable, because in a battle whit low odds that your hero defends not because of your choice (he is whit small hp but is still the strongest in the stack) it would be near impossible for him to retreat, which is why this is being implemented, to make heroes harder to kill...
 
Chandrasekhar, concerning your second idea, I already have some form of that implemented. Namely, heroes get a 100% bonus and that bonus is sapped away for every attack they make. At every turn, they regain 50% of the bonus.

Concerning hero retreating chance based on combat odds, I'll have to think about that. One interesting side effect (that I consider positive) is that the ability for the hero to withdraw and retreat makes the hero used more often, even for battles for which the combat odds are barely in the favor of the hero.

Take that into consideration. Some may say that it's unheroic for heroes to retreat. But I can also argue that it's unheroic for heroes to fight wimpy battles.
 
Back
Top Bottom