Gedemon's Civilization, development thread

This dude making Civ 7 here. I think the most amazing part is that the tribe start effectively overhauls what yields are important to your empire, balancewise the game now scales up in complexity differently. You could easily create many more new systems and have them flow from concepts introduced in this basic starting stage. Also building new villages is a good way to get people used to building districts for cities, and also upgrading each one to a city basically lets you start bigger when you become a full civ. Also the villages could be integrated into compatibility with City Lights and New Frontier's Barbarian Clans. Military units having a loyalty and lifetime and needing food also makes combat a real challenge, but rewards being organized and striking at the right time.
 
Last edited:
I'm cleaning a bit the Units flag tooltip/icons, to move some information from the main flag tooltips to the icons tooltips, as I needed some space somewhere for the Ethnicity data (and prepare Loyalty)

As for Health, it just an UI value for now, without gameplay effect (yet), as I'll need to code intergroups relations first.

upload_2021-5-13_22-10-31.png


upload_2021-5-13_22-10-46.png


upload_2021-5-13_22-10-55.png
 
I've also added a bit of info on the AI units flag tooltip, to debug custom AI operation

upload_2021-5-13_22-16-44.png


The French and the Samogitians AIs have been fighting over the Village on the right since some time, the small offensive operation seems to work.

This kind of information would be nice to have (once formatted) in relation to spying, but then the humans are not using operations, which made me think: why not ?

In the context of the mod, why not being able to set a virtual operation (like capturing a Village) and affect units to that operation. Those units could gain a bonus (longer draft time for example) as long as they follow the operation (checking if they are near or getting closer or the operation target) until it ends either from a turn timer (meaning operation failed and morale loss for involved units) or by capturing the village.

AI units in real operations should get the same kind of bonus, without checks, as it won't try to cheat...

On a larger scale, I like how Old World propose multiple goals from which you may pick one to gain "victory points", an operation like that one could be one of the early goals for the human players.
 
Game looks very exciting :)

Few observations after playing 135 turns (I know not supposed to be played beyond first city);
- Cities are really hard to grow; maybe coded that way for now.
- Barbarian villages seem to be impossible to destroy and they just keep coming back even if I keep a unit in the village new enemy unit gets created anyway in village as well.
- Farms can be pillaged; slaves takes and then enemy seems to able to use those pillages farms same way as conquered villages and build roads to them; interesting if as intended
- Is it intended that slaver workers cannot be used for improving plots?
- Fighting enemy village (not barbarian) is quite hard as they always seem to spawn 6-9 new conscript units in one turn, kind of like it as makes it much harder.
- Edit: [Computer players are extremely slow to create cities; out of 7 only 3 had just recently created city around turn 135] <-- Looks like no cities at all. I created my first city at turn 36.

Added pictures showing enemy units overlapping each other.
 

Attachments

  • Unit_overlap_01.png
    Unit_overlap_01.png
    1 MB · Views: 146
  • Unit_overlap_02.png
    Unit_overlap_02.png
    903 KB · Views: 118
Last edited:
If you want to test gameplay with cities, you better use the Preview version:
https://github.com/Gedemon/Civ6-GCO/releases/tag/v0.2-preview

Quick answers anyway:
- units should not spawn in occupied villages, looks like a bug
- slave workers only collect resources, you need builders to build improvements
- AI don't even try to create Settler/Cities in the current code

For the other points, I don't even know of those interact with the current version of the mode, I've not looking at that yet.

ATM I'm coding the framework for inter-culture "Relations", and inter-civilizations "Interests".

"Relations" being the way to calculate how an ethnicity will interact with a Civilization (including its own), for Stability/Loyalty mechanisms.

For example, a preview the current mod's Table ("Happiness" being not coded yet)
Spoiler :

Code:
    <!--
        Culture relation modifier include the own player culture, as it represent people relation to a nation
        Used to define Homeland stability and Units loyalty
        It's a variable value (change by summation of modifiers each turn) with a balance tendency to 0 (= neutral)
       
    -->
    <CultureRelationModifiers>
        <Row RelationModifierType="RELATION_MODIFIER_SEPARATIST"            BaseValue="-15"    />
        <Row RelationModifierType="RELATION_MODIFIER_NATIONALIST"            BaseValue="5"    />    <!-- "Nationalist" = own Culture Group -->
        <Row RelationModifierType="RELATION_MODIFIER_FOREIGN"                BaseValue="-5"    />
        <Row RelationModifierType="RELATION_MODIFIER_BROTHERS_IN_ARMS"        BaseValue="0"    SetValue="10"    Decay="1" />
        <Row RelationModifierType="RELATION_MODIFIER_ATTACKING_BROTHERS"    BaseValue="0"    SetValue="-20"    Decay="1" />
        <Row RelationModifierType="RELATION_MODIFIER_BALANCE"                />                    <!-- percentage of total removed/added to tend toward 0 -->
        <Row RelationModifierType="RELATION_MODIFIER_GLOBAL_HAPPINESS"        />                    <!-- should we have this ? -->
        <Row RelationModifierType="RELATION_MODIFIER_HAPPINESS_DIFFERENCE"    />                    <!-- difference between own and another civ global value -->
        <Row RelationModifierType="RELATION_MODIFIER_NATION_INTERESTS"        />                    <!-- variable modifier based on international relation -->
    </CultureRelationModifiers>


"Interests" as in "Nations have no permanent friends or allies, they only have permanent interests" is the value that will be used for Diplomacy evaluation between Civilizations.

As you can see in the table above, that value will also affect inter-culture relations.

Potential Interests Table (only "Pillaged Villages" is coded yet, for testing the framework, and that one may better fit "Relations", I'll see if I can code an "Occupying Village" modifier instead)
Spoiler :
Code:
    <!--
        Diplomacy Interests are international relations, which are mostly different than interculture relations, with a few overlap
        International relations can change quicker than interculture relations
        Used for Diplomatic interactions
        It's a fixed value (summation of modifiers)
    -->
    <DiplomacyInterestModifiers>
        <Row InterestType="INTEREST_TRADE_ROUTE"/>
        <Row InterestType="INTEREST_TRIBUTE_PAID"                    BaseValue="-5"    />    <!-- when active (paying a tribute) -->
        <Row InterestType="INTEREST_TRIBUTE_RECEIVED"                BaseValue="5"    />    <!-- when active (receiving a tribute) -->
        <Row InterestType="INTEREST_SEND_DELEGATION"                BaseValue="5"    />
        <Row InterestType="INTEREST_AMBASSY"                        BaseValue="10"    />    <!-- when active -->
        <Row InterestType="INTEREST_OPEN_BORDER"                    BaseValue="5"    />    <!-- when active -->
        <Row InterestType="INTEREST_OPEN_MARKET"                    BaseValue="15"    />    <!-- when active -->
        <Row InterestType="INTEREST_DEFENSIVE_PACT"                    BaseValue="25"    />    <!-- when active -->
        <Row InterestType="INTEREST_NON_AGRESSION_PACT"                BaseValue="10"    />    <!-- when active -->
        <Row InterestType="INTEREST_COMMON_FRIEND"                    BaseValue="5"    />    <!-- per friend (RelationType) -->
        <Row InterestType="INTEREST_COMMON_ENEMY"                    BaseValue="10"    />    <!-- per enemy (RelationType or Denounced) -->
        <Row InterestType="INTEREST_FRIEND_OF_ENEMY"                BaseValue="-15"    />    <!-- per friend -->
        <Row InterestType="INTEREST_ALLY_OF_ENEMY"                    BaseValue="-25"    />    <!-- per ally -->
        <Row InterestType="INTEREST_TERRITORY_GIVE"                    BaseValue="5"    />    <!-- per tile (decay -1/turn) } when it's part of a demand or peace treaty, it won't count when part of a deal. -->
        <Row InterestType="INTEREST_TERRITORY_TAKEN"                BaseValue="-5"    />    <!-- per tile (decay +1/turn) }  -->
        <Row InterestType="INTEREST_OCCUPY_TERRITORY"                 BaseValue="-2"    />    <!-- per tile (occupied territory = tile captured with still a majority of the previous owner culture) -->
        <Row InterestType="INTEREST_OCCUPY_TERRITORY_FRIEND"        BaseValue="-1"    />    <!-- per tile -->
        <Row InterestType="INTEREST_OCCUPY_CITY"                     BaseValue="-20"    />    <!-- per city (occupied city = city captured with still a majority of the previous owner culture) -->
        <Row InterestType="INTEREST_OCCUPY_CITY_FRIEND"                BaseValue="-10"    />    <!-- per city -->
        <Row InterestType="INTEREST_TERRITORIAL_INTEGRITY"            BaseValue="10"    />    <!-- when active -->
        <Row InterestType="INTEREST_RESEARCH_AGREEMENT"                BaseValue="10"    />    <!-- when active -->
        <Row InterestType="INTEREST_SAME_SIDE_IN_WAR"                BaseValue="50"    />    <!-- when active -->
        <Row InterestType="INTEREST_DECLARATION_OF_FRIENDSHIP"        BaseValue="50"    />    <!-- when active -->
        <Row InterestType="INTEREST_INFORMATION_FROM_SPY"            BaseValue="25"        Decay="1" />
        <Row InterestType="INTEREST_INFORMATION_SHARING"            BaseValue="10"    />    <!-- when active -->
        <Row InterestType="INTEREST_RESOURCE_ACCESS_BONUS"            BaseValue="1"    />    <!-- per resource type when active -->
        <Row InterestType="INTEREST_RESOURCE_ACCESS_STRATEGIC"        BaseValue="3"    />    <!-- per resource type when active -->
        <Row InterestType="INTEREST_RESOURCE_ACCESS_LUXURY"            BaseValue="3"    />    <!-- per resource type when active -->
        <Row InterestType="INTEREST_RESOURCE_ACCESS_EQUIPMENT"        BaseValue="5"    />    <!-- per resource type when active (or use % of equipment desirability instead ?) -->
        <Row InterestType="INTEREST_EMBARGO_BONUS"                    BaseValue="-2"    />    <!-- per resource type when active -->
        <Row InterestType="INTEREST_EMBARGO_STRATEGIC"                BaseValue="-5"    />    <!-- per resource type when active -->
        <Row InterestType="INTEREST_EMBARGO_LUXURY"                    BaseValue="-10" />    <!-- per resource type when active -->
        <Row InterestType="INTEREST_DENOUNCIATION"                    BaseValue="-100" />    <!-- when active -->
        <Row InterestType="INTEREST_AT_WAR"                            BaseValue="-200" />    <!-- when active -->
        <Row InterestType="INTEREST_BREAK_DELAYED_DEAL"                BaseValue="-25"        Decay="1" />
        <Row InterestType="INTEREST_BREAK_TERRITORIAL_INTEGRITY"     BaseValue="-20"        Decay="1" />
        <Row InterestType="INTEREST_BREAK_DEFENSIVE_PACT"            BaseValue="-100"    Decay="2" />
        <Row InterestType="INTEREST_BREAK_NON AGRESSION_PACT"        BaseValue="-200"    Decay="3" />
        <Row InterestType="INTEREST_BREAK_EMBARGO"                    BaseValue="-20"        Decay="1" />
        <Row InterestType="INTEREST_BREAK_OPEN_BORDER"                BaseValue="-20"        Decay="1" />
        <Row InterestType="INTEREST_BREAK_DOF"                        BaseValue="-50"        Decay="2" />
        <Row InterestType="INTEREST_REFUSE_TO_DENOUNCE"                BaseValue="-10"        Decay="1" />
        <Row InterestType="INTEREST_REFUSE_TO_REMOVE_EMBARGO"        BaseValue="-25"        Decay="1" />
        <Row InterestType="INTEREST_REFUSE_TO_STOP_DOF"                BaseValue="-15"        Decay="1" />
        <Row InterestType="INTEREST_REFUSE_TO_STOP_DEF_PACT"        BaseValue="-10"        Decay="1" />
        <Row InterestType="INTEREST_REFUSE_TO_STOP_OPEN_BORDERS"    BaseValue="-10"        Decay="1" />
        <Row InterestType="INTEREST_REFUSE_TO_STOP_OPEN_MARKET"        BaseValue="-10"        Decay="1" />
        <Row InterestType="INTEREST_REFUSE_TO_GIVE_GOLD"            BaseValue="-10"        Decay="1" />
        <Row InterestType="INTEREST_PILLAGED_VILLAGE"                BaseValue="-60"        Decay="3" />
        <Row InterestType="INTEREST_KILLED_UNIT"                    BaseValue="-10"        Decay="2" />
        <Row InterestType="INTEREST_LOST_UNIT"                        BaseValue="-10"        Decay="1" /> <!-- when loosing a mercenary unit -->
        <!-- spy actions -->
        <!-- opposing governments  -->
    </DiplomacyInterestModifiers>


I plan to also add values to represent "Power" and "Trust" (nothing coded here)
Spoiler :

Code:
    <DiplomacyPowerModifiers>
        <Row PowerType="POWER_ARMY_SIZE_TOTAL"/>
        <Row PowerType="POWER_ARMY_SIZE_LOCAL"/>
        <Row PowerType="POWER_NUMBER_CITY"/>
        <Row PowerType="POWER_TERRITORY"/>
        <Row PowerType="POWER_POPULATION"/>
        <Row PowerType="POWER_TRIBUTE_GIVEN"/>
        <Row PowerType="POWER_VASSAL_TRIBES"/>
        <Row PowerType="POWER_VASSAL_CIVS"/>
        <Row PowerType="POWER_DECLARE_WAR"/>
        <Row PowerType="POWER_KILL_RATIO"/>
        <Row PowerType="POWER_TECH"/>
    </DiplomacyPowerModifiers>

    <DiplomacyTrustModifiers>
        <Row TrustType="TRUST_BREAK_TREATY_ENEMY"             BaseValue="-10"        Decay="1" /> <!-- (maybe use % rate of decay instead of fixed value) -->
        <Row TrustType="TRUST_BREAK_TREATY_NEUTRAL"         BaseValue="-25"        Decay="1" />
        <Row TrustType="TRUST_BREAK_TREATY_FRIEND"            BaseValue="-50"        Decay="1" />
        <Row TrustType="TRUST_BREAK_TREATY_US"                 BaseValue="-100"    Decay="2" />
        <Row TrustType="TRUST_DECLARE_SURPRISE_WAR_ENEMY"     BaseValue="-5"        Decay="1" />
        <Row TrustType="TRUST_DECLARE_SURPRISE_WAR_NEUTRAL" BaseValue="-25"        Decay="1" />
        <Row TrustType="TRUST_DECLARE_SURPRISE_WAR_FRIEND"     BaseValue="-100"    Decay="2" />
        <Row TrustType="TRUST_DECLARE_SURPRISE_WAR_US"         BaseValue="-200"    Decay="3" />
        <Row TrustType="TRUST_RESPECTED_DEAL"                BaseValue="1"    />  
        <Row TrustType="TRUST_RESPECT_TREATY"                 BaseValue="1"    />    <!--/turn with treaty (reset to 0 when breaking a treaty with us)-->
        <Row TrustType="TRUST_RESPECT_DELAYED_DEAL"         BaseValue="2"    />    <!--/deal (reset to 0 when breaking a delayed deal with us)-->
        <Row TrustType="TRUST_RESPECT_DELAYED_DEAL_OTHER"    BaseValue="1"    />  <!-- /deal(reset to 0 when breaking a delayed deal with another civ)-->
        <!-- Spy Action (Caught) -->
    </DiplomacyTrustModifiers>


I've also started to work on the UI feedback for inter-culture relations (basically "smiley FontIcons" based on the current calculated value, Civ5 style IIRC the source), I'll need to make a new Diplomacy panel, maybe based on the CS panel, I'll see.

upload_2021-5-16_22-36-1.png


upload_2021-5-16_22-37-43.png


  • The Kish population is very angry as I've pillaged the village in the North twice, there is also the negative "Foreigners" modifier, and there was no positive modifier to counter that (they are the highest population in my central village from forced immigration, not affecting relation ATM)
  • The Tokharoi are happy, we're "Brother in Arms" (triggered when an ethnicity is >10% in any unit) since the start of that game, which counter the "Foreigner" modifier.
  • The Indian are very happy, that's the "Nationalist" relation modifier effect (and there is no lack of "Needs", aka "Happiness" coded at this point that could counter-balance it)
  • The Akkadian are neutral, they are controlled by the Barbarians, and even if I pillaged two of their villages some turns ago (there is a decay applied), we're since "Brother in Arms" when I had the Swordsmen as Mercenaries, and I didn't use it to attack their other units (which would trigger the "Killing Brothers" negative modifier)
  • Independents are angry, as a result of the "Foreigner" modifier. I may remove that modifier for that case, IMO independents should be mostly neutral, while Separatists (not coded yet) will have a bigger negative modifier.
 
Last edited:
Update

Code:
- add code to handle Relations (inter-cultures) and Interests (inter-civilizations) modifiers
- bug fix : error displayed in some cases (related to pillaged villages counter) on Migration action
- bug fix : the automated evaluation string generator (returning a string from a given value in an interval like "good", "bad", "average", ...) was failing in some case
- bug fix : get the correct PlayerID from a CultureID
- UI : add/rework some FontIcons
- UI : clean/move some of the unit's flag Tooltip info to 3 separate Tooltips
- UI : units names shows mercenary information
- UI : show central settlement direction using a FontIcon on satellite Villages banners
- debug : show current custom mission info when available in the flag's Tooltip of AI units

I'm interested in testing the new code, if you get error message in the Tribe phase (ie before creating a Settler/City), please report it with the Lua.log if possible, TIA.
 
hotfix
Code:
- bug fix : refresh data (available treasury and recruitment cost) on diplomacy screen for mercenary units on (re)selection
- bug fix : reset production on ownership change for Villages
- bug fix : get the correct population value when getting migration to a repaired village (prevent the central village to lose all its population)
- bug fix : reset the previous PersonnelType ("Recruits" or "Standing Army") when ending a Mercenary contract ("Recruits" were incorrectly changed to "Standing Army")
- bug fix : reset the Recruits turns left when ending a Mercenary contract
 
Nice to see you back, this "second phase" is looking pretty promising right from the start, you're doing a wonderful job really.

I hope it's not OT, but would you be interested in reactivating the brainstorming topics with up to date info and dev concepts? I loved them, and I think something like that could help users to better understand your designs and maybe give the project some more traction in the community.
 
Had a quick test run of the latest build. No errors to report, but my testing wasn't that rigorous.
The only thing I noted is that disbanding workers didn't seem to add the slaves back to the village. Additionally, workers (comprised of slaves) were 100% my nationality and 100% loyal... not a bug, but amusing on my part.
That's all for now.
 
Nice to see you back, this "second phase" is looking pretty promising right from the start, you're doing a wonderful job really.

I hope it's not OT, but would you be interested in reactivating the brainstorming topics with up to date info and dev concepts? I loved them, and I think something like that could help users to better understand your designs and maybe give the project some more traction in the community.
Maybe, I'm still a bit in the dark for the best modding platform for the project. I hope it will be a bit clearer after HK release.

And I'd prefer to not involve too many people while I don't know more myself.

But yes, I may open more threads, but maybe directly in Ideas & Suggestions, as I did for the Tribe gameplay presentation, I'll post links here if that happens.

Had a quick test run of the latest build. No errors to report, but my testing wasn't that rigorous.
The only thing I noted is that disbanding workers didn't seem to add the slaves back to the village. Additionally, workers (comprised of slaves) were 100% my nationality and 100% loyal... not a bug, but amusing on my part.
That's all for now.
Yes, I'll remove the ethnicity/loyalty UI for slave units, they are irrelevant.

It seems that Events.UnitCommandStarted is not called anymore since the last Civilization patch, I'm pretty sure it was working in March when I added the code to handle manual disbanding of units...

new update
Code:
- AI : create multiple copy of each custom AI operation types (as a player can only have one operation type running at a given time)
- AI : update the AI unit script to use an available copy of an operation type already running, mostly used by the Barbarian player (#63) that controls multiple tribes and can now launch multiple simple/short offensive operations on nearby villages at the same time
- AI : update the AI script to allow an unit to be added to an existing running operation instead of creating a new one with the same target (used to group units going home in the same operation)
- balance : spread cultures around villages on map initialization (end of loading may freeze a bit longer, I'll try to use co routines if possible to avoid that)
- bug fix : correct initialization of "non-player" tribal villages
 
thanks for the log, I'll post a hotfix later

(the mod's may still try to launch an operation type already existing for a player ATM, which cause that freeze/crash)
 
hotfix
Code:
- crash fix : when a check says we should abort an operation, really, really don't launch it.
- AI : when units think they've reached their target while they are in fact adjacent of it (because of the limitation of the exposed methods available, it's technically a "rally point"), try to force a (final) move on it.
 
need more info and logs, which maps exactly ?
 
just tried to load the Giant Earth, no crashes, but the initialization takes a very long time with map population.

and each turns takes minutes to process at that size.
 
I've taken a small break to look back at the population mechanisms again.

I knew I was going to need to have access to the source code so that it could run compiled (ie faster), but even then, I'm afraid the current implementation would use too much time to process.

Yet I don't want to go back to population in city/settlements only, I've always disliked the fact that the land doesn't have any population in civ games before a settler decide to use its action on a plot...

If I want to have population existing outside of cities and moving around, while I can't process each tile each turn, there is 2 solutions: process a tile every x turns (I don't like that one for multiple reasons), or group tiles in one entity. Yes, I've just reinvented the concept of "Region" :o

What the code do for tiles (calculating push/pull values, ethnicity percentages, ...), it could do for regions and run much faster (depending on regions sizes)

But then, that give me another reason to wait for HK release and determine its modding capabilities before investing coding time into this.
 
Last edited:
Are you using the Plot property Methode a lot in your Mod? In case you do:

If it's initialized a lot between Turns, especially when it's called by many Events, it slows down the Time between Turns immensely (causing big Lags). To decrease that, I save the data, that's compiled by the code, with the Game's "WriteCustomData" Function. And call the needed data everytime the Plot Property has to be refreshed with "ReadCustomData", so that, for example: if the code has the task to give the Property a value of x, it checks if the Plot already has a property received and what value it is. If yes and it is the same value the code wants to assign to the plot, then it ignores it (doesn't assign the property, hence doesn't require Time to write the data), if not, then it assignes a Property to it, and save that data/information, again with "WriteCustomData", for the next time the same plot getting the property refreshed.

it can be a tidious work if you're using that methode for many and different things, and not very optimal, but it's better than assigning the same property every time the code gets called, saving the Time that it would have needed for doing that.
 
Back
Top Bottom