Menu

#9 Hunter-Prey promotions

1.0
closed
Archid
None
2015-02-02
2015-01-19
Archid
No

Add promotions that are designed to be used against the main unit species:
Human, Mutant, Ghoul & Animal

Also promotions that are designed for the 3 main unit categories:
Military, Security, Operative

When these apply in combat is currently hard-coded in the dll and this should be moved so that the definition of the effect of the promotion should be defined in XML.

Need to have a flag that determines which species and unit category a unit is and a way of automatically assigning them without having to add them in to every unit. For the species this could be tied to the Civ, or in the case of animals to the barbarian creation code in the dll. For the category we need to determine a strategy.

Discussion

  • Lib Spit

    Lib Spit - 2015-01-20

    Hunter/Prey and Mil/Sec/DOps Promo vs Promo Code:
    The thing I liked about this code, even though it was hard coded, is that it was really easy hard coding. 1 place, copy/paste, edit, add required promos in xml.

    So I could do a lot without much effort (or ability), and I could do it without having to use or replace certain other elements of the unit.

    So I could add in concepts like species, and anti species, as well as the 'sub' classification of unit role, without having to change the combat type.

    So I guess if it was switched to a pure xml feature, something like the ability (either in promo or unit xml)(I think I prefer Promo, because it allows for more flxibility, as you can potentially gain it later rather than it being stuck on just certain units) to apply a bonus vs a promotion, that way we can still use the promos to apply certain strengths/weaknesses/species/types/subsets, etc. and adding in new subsets is as easy as adding a new promotion.

    A Plan to add in promos based on Civ (such as Ghoul for Ghouls) is not the best plan moving forward. (even though this is how it is now because I am too lazy to do the proper leg work).

    This is because I have plans to introduce 'racial mixing/purity' options so for example ghouls could potentially work with humans and vice versa.

    Also the Super Mutant faction will and does make use of Humans. In Fallout One, The Master(Super Mutant Leader) Used humans as a 'front' for his plans via the 'Cathedral' these were Human priests that spread his message, as well as hired mercs for security.

    May also want to expand race and sub set, such as robots moving from combat type to a 'racial' subset, so that we can introduce robots to range, melee, etc. combat types.

     
  • Archid

    Archid - 2015-01-27

    [0fe7d1] Added the concept of race to units.

    Races are defined in a new XML file with their own properties. note any additions to this file must be reflected in CvEnums.h. At present there are only 2 new properties on top of the base properties, these are RaceAttacks and RaceDefences. These tags define a combat bonus that units of this race have when attacking or defending specific races. This allows the concept of things like racial enemies or natural defences that some races may have against others, or even other members of their own race. Two examples are included in the CIV4RaceInfos.xml file

    The races defined are:

    • RACE_ANIMAL
    • RACE_DEATHCLAW
    • RACE_GHOUL
    • RACE_HUMAN
    • RACE_MUTANT

    A units race comes from either the UnitClassType (optional) or Civ (mandatory) xml files. When a unit is created a check is first made on the UnitClassType for a racial definition, if there is no definition at that level then the racial type of the Civ of the owner is applied. Each of the existing Civs has its default unit racial type defined along with the UnitClassType of each of the animals.

    Promotions have been extended with the same tags as the Race types so RaceAttacks and RaceDefences can be applied as well. All the existing Hunter/Prey promotions have been updated to use the new tags.

    The AI knows about the new promotion tags and puts a greater value on promotions that impact other races rather than its own, e.g. a Ghoul puts more value on a promotion that impacts Humans than it does on a promotion that impacts other Ghouls. This may give an unfair advantage to the Ghouls & Mutants, but probably not enough to introduce too much imbalance.

     

    Related

    Commit: [0fe7d1]


    Last edit: Archid 2015-01-27
  • Lib Spit

    Lib Spit - 2015-01-28

    That all sounds awesome.

    The only problem (and it is mostly my fault from leaving the 'lazy' implementation in), is that I want there to be the possibility for races to recruit other races.

    Reading it for a second time I think you may have catered for this, it just means that I have to create specific race units for other races to use.. I think.

    Example a human mercenary with human defined in his racetype, so that Ghouls and Mutants can recruit the human.
    OR
    A Ghoul/Mutant Mercenary with their race defined in unit. So Humans could potentially recruit ghouls and mutants.

    Is that correct?

    The Unit type takes precedance over the Civ Type..

    Can I remove the mandatory CIV definition from the civ xml?

    Because we already have specific units created as super mutants to define their race by, I don't want every unit (normally human) to automatically be a super mutant for the super mutants.

    If that makes sense...

    Are you going to essentially copy the system to make a 'classification' system too, for the Military/Security/DOps concept.

    Also, could you add a robot race type?

    I think it would be good to move robots from a combat type to race type, that way we can have robots with different combat types, but still maintain certain units abilities to kill robots using the new tags.

    It sounds really good though, well done!

     
  • Archid

    Archid - 2015-01-28

    Added the concept of unit categories

    These have their own xml file, CIV4UnitCategoryInofs.xml, and work in a similar way to races with respect to the ability to have attack/defence modifiers against each other. Promotions also have the same attack/defence modifiers for unit categories. The following have been created:

    • UNITCATEGORY_MILITARY
    • UNITCATEGORY_OPERATIVE
    • UNITCATEGORY_SECURITY

    The modifiers from the original source code have been added to the new info files so they work automatically once a unit has been assigned a category.

    For testing I have given the Scavenger (UNIT_SCOUT) the UNITCATEGORY_MILITARY category and have made the PROMOTION_MILITARY promotion available to UNITCOMBAT_MELEE types so that it can be added in the Worldbuilder to these units. The unit info popup shows the change in modifiers.

    Neither the Race or the UnitCategories are in the PlatyPedia yet so these will need to be added at some point

    With regard to the race bonuses the definition in the UnitClassInfo file overrides the civ so this can be used for mercenary units. It may be better for me to also allow the tag in the UnitInfo, which will override the UnitClassInfo. This will allow you to use a UnitClass of UNICLASS_MERCENARY with Ghoul, Human & Mutant unit type variants, each with their own race.

    The Race tag in the Civ is only used to define the default unit race recruited by this Civ, so if Mutants recruit humans rather than other mutants, then you can set it that way.

    I'll add Robots to the races now and push a new dll up as it a really quick thing to do

    [6091b0]

     

    Related

    Commit: [6091b0]

  • Lib Spit

    Lib Spit - 2015-01-28

    To clarify on the last few lines, currently, we have a bunch of 'undefined' race units, like a soldier, defender, whatever.

    For humans, these would be humans.
    For ghouls, these would be ghouls.
    For Mutants, I want them to remain Human, not become default super mutants.
    We have seperate Super Mutant Units that will (more or less) only be available to SMs.

    Am I right in thinking that in the current setup, the undefined units would be given super mutant race automatically by the civ settings?

     
  • Archid

    Archid - 2015-01-29

    Added Robots to the list of races
    Added a race tag to units
    Added an additional tag to Civs <DefaultRecruitRaceType> to determine the race of any units trained

    A units race is determined by the first 'hit' in the following order:

    1. UnitInfo -> RaceType
    2. UnitClassInfo -> RaceType
    3. CivilizationInfo -> DefaultRecruitRaceType
    4. CivilizationInfo -> RaceType

    The only time this order is not used is for the free units that are granted when the game starts. These units will always use the CivilizationInfo -> RaceType

    This allows the Super Mutants to train humans by default

    [eb5ffd]

     

    Related

    Commit: [eb5ffd]

  • Lib Spit

    Lib Spit - 2015-01-29

    Fantastic!

    I think this one is finished then.

    I haven't had a chance to test it and actually see it working.

    I need to sit down and work through all the xml to get everything reapplied in the new forms.

    Then sit and test test test... man I miss my old tester team, they were awesome!

    But I think we can close it and then if bugs emerge, we can open a new ticket.

    As a concept I think it is done though!

     
  • Archid

    Archid - 2015-01-29
    • status: open --> closed
     
  • Archid

    Archid - 2015-02-02
    • Milestone: --> 1.0
     

Log in to post a comment.