1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Legendary Headstart

Discussion in 'Civ5 - Mod Components' started by sman1975, Apr 27, 2018.

  1. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    The Legendary Headstart Mod adds a variety of bonuses to all major civs at the start of the game. The intent is to provide a richer variety of playstyles, based on the sometimes legendary head starts these bonuses sometimes provide.


    There are 18 bonuses in all – some of which are much more powerful than others:

    1. Faith: Adds Faith - if the game starts before the Industrial Era, otherwise adds Gold. Can also spawn 1-2 Great Prophets. Adds an appropriate melee unit, then adds the "Faster Healing" and "Foreign Lands Bonus" to existing combat units.
    2. Science: Adds 1-3 free Technologies, more for later Era starts and easier difficulty levels.
    3. Gold: Significant amount of Gold added to treasury
    4. Culture: Adds 1-3 free Policies, more for later Era starts and easier difficulty levels. Adds gold if no cities exist.
    5. Happiness: Golden Age progress boost; additional starting Happiness
    6. Great People: Adds 1-3 Great People (of your choice), more for later Era starts and easier difficulty levels. If there is no city, a gold bonus is awarded.
    7. Infrastructure: Adds 1-3 extra Workers, more for later Era starts and easier difficulty levels.
    8. Expansion: Adds 1-3 extra Settlers, more for later Era starts and easier difficulty levels.
    9. Melee Units: Adds 1-3 Melee units, more for later Era starts and easier difficulty levels.
    10. Mobile Units: Adds 1-3 Mobile units, more for later Era starts and easier difficulty levels.
    11. Ranged Units: Adds 1-3 Ranged units, more for later Era starts and easier difficulty levels.
    12. "Peace" Focus: Adds 1-3 extra Settlers and 1-3 extra Workers.
    13. "War" Focus: Adds combat units, similar to #9, and #10 and/or #11.
    14. "Commerce" Focus: Adds smaller amounts of Faith, Gold, Culture, and Golden Age progress


    New Bonuses (V3) :

    15. Trade Baron: Adds 1-3 Trade Routes and/or 1-3 Great Merchants
    16. Cornucopia: Grants Pottery if not discovered and builds a Granary in the Capital, if one has not already been built. Adds 10-30 food to the capital.
    17. Heraia: Adds 2-5 population to the capital. Adds 25-40 food. Spawns 1-3 Settlers if the civ has no cities.
    18. Armilustrium: Adds Walls to the capital, 50% chance of adding a Castle, and 1 Great General. If the civ has no cities, 1-2 Great Generals will spawn.


    Please note that these bonuses are applied at the beginning of the human player's 2nd turn. This provides all civs the chance to build a capital so they will be capable of getting the full benefits of all the Legendary Bonuses.

    Additionally, the benefits are adjusted, based on game difficulty, speed, and starting Era. Generally speaking, when the mod adds units, it randomly adds 1-3. It adds more units if the game starts in a later Era, or if you are playing at an easier difficulty level.


    The mod uses 5 possible methods to decide which bonus a civ will get:

    1. Completely Random: this means that a civ could get any one of the 18 bonuses. (40% chance)
    2. "War" Priority: the civ will get a bonus from a list of #9, #10, #11, #13, or #18. (10% chance)
    3. "Peace" Priority: the bonus will be selected from a list of #1, #2, #4, #5, #12, #16, or #17. (10% chance)
    4. "Commerce" Priority: the bonus will be either #3, #7, #8, #14, or #15. (10% chance)
    5. Leader Flavor: the bonus will come from whatever Flavor is the highest for that civ's Leader. If there are more than one flavors with the highest number, the mod will select a random flavor with the highest value. (30% chance)


    Download link: https://forums.civfanatics.com/resources/legendary-headstart.26828/

    STEAM link: https://steamcommunity.com/sharedfiles/filedetails/?id=1371724041


    Please note: the mod is quite stable, but is still in BETA form. Please let me know if you're seeing any problems or have any suggestions. Thanks!
     
    Last edited: May 20, 2018
  2. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    New version (V2) posted. Few minor fixes, but biggest change was to add "tons" of debug print statements for a few players who were experiencing CTDs. Hopefully, reviewing the logs will help pin-point where the exact problem is.

    Let me know what issues you're having or any other suggestions to improve the mod. Thanks!
     
  3. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    This sounds like really a neat concept! I have a few suggests I came up with on the fly, as well:
    • Commerce: 1-3 extra caravans / trade routes, depending on era (this doesn't have to replace the current Commerce focus)
    • Food: 1-3 extra population in the capital, depending on era
    • Defense: free defensive buildings in the capital, depending on era. A citadel appears adjacent to the capital after it is initially founded
    You also mentioned to that player should ensure that they have a city built before choosing their Great Persons. A possible workaround to this issue (I think) would be to wait for the player to found their first city, and THEN give them their GP's.

    I think a fun option would be modularity--a method for the player to receive more than one bonus. I have to yet to try this mod out, but it sounds like a fun way to spice up the game!
     
    sman1975 likes this.
  4. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    @MariusMagnus - your icon has a big red hat, but at the moment, I'm doffing my hat at your suggestions! :worship:

    The first two are inspired, and will almost certainly appear in V3... The "defense" one is a little more difficult, as when the bonuses are awarded, by definition, the player will have no cities built (it fires off before the player presses the "Begin your journey" button) - so it's not always a good idea to plant citadels if the player moves the initial settler 20 tiles to the west..

    It is possible to add functions that monitor progress on subsequent turns, but this is taking the mod in a different direction than I'd originally wanted. I wanted the mod to quite entirely before the player played the first turn, in hopes this would improve compatibility/stability to the mod. The mod was supposed to be completely "self-contained" which means it starts and wraps up before turn 0 starts, and hopefully can no longer cause problems after it quits actively functioning. Adding the "citadel" after turn 0 starts is a step backwards from this intent. I'm wondering if I spawned 1-2 Great Generals instead, if it would accomplish more or less the same goal?

    Same issue for Great People. Monitoring X turns after game start (until a player finally builds a city) is introducing opportunities for crashes later on. I'm really trying to draw the line in the sand where the mod is 100% "done" before the game starts.

    The "modularity" you mentioned is actually contained in the "focus" bonuses, although it probably is kind of hard to see initially. There are 14 bonuses total. But bonuses 12-14 are amalgamations of earlier bonuses. For example, bonus 9 is a melee unit. Bonus 10 is mobile. Bonus 11 is ranged. However, Bonus 13 is 0-3 units of each (melee, mobile, and ranged)! It is possible to actually receive 9 total units - appropriate for the game start age. Which, obviously, could be game changing. Same for "peace" and "commerce" focuses. These bonuses (12-14) are actually the "legendary" bonuses that make the mod name more appropriate.

    Still, all-in-all great suggestions! Keep 'em coming!:clap:
     
  5. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    Gotcha. Hm, Great Generals could work as an alternative, but I doubt the derpy AI :crazyeye: would use them properly, but that's more of a complaint of an entirely different problem beyond the scope of this mod. For bonuses that spawn units, would it be possible for civs to receive their unique unit instead of regular ones? It's probably more effort than it's worth, but it's inspired me with a "legendary start" idea for a bonus that mixes war and culture:
    • Multicultured: small amount of culture. Receive 1-3 unique units not available to your civ (if any are available), based on era
    EDIT: I've accidentally stumbled across an exploit. Reloading the game for the initial start turn will cause everyone to receive another bonus on top of their current one.
     
    Last edited: Apr 30, 2018
  6. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    I'm sure the AI would abuse the GGs in most cases, as it does with all civilian units. But, early in the game, when most civs are spread far apart, but a city state is usually someplace close, maybe they would use them to build a citadel here and there to make it not too OP for the human player. I could also add a check for an AI playing civ, and change the bonus to an extra unit, etc.

    Yes, I know about the exploit. It works quite well... :crazyeye: But, remember - when you give yourself lots of bonuses, all of your opponents get lots of bonuses too... :lol:

    Seriously, I played around with a few ways to fix this, but none of the approaches were all that elegant. This problem is basically caused by the lack of a city at game start. I've got a "dummy policy" approach working, but I don't really like it much. I'll keep playing with different ways to solve the exploit, and if I find one, it will probably go into the next version. However, I believe that awarding multiple bonuses to all of your opponents will probably disincentivize most players from abusing the exploit...

    Awarding the UU for a given civ is certainly doable, but requires the code to cross-reference 3 different database tables, then make a tie-breaker determination in some instances (e.g. in Classical Era, Rome gets a Legion and Ballista). Not hard, but adds more code than I'd originally wanted. However, if the number and complexity of bonuses continues to grow, this is probably something that should be added.

    I very much liked the idea about adding some "exotic" units along the lines of your multiculti suggestion. That will probably go in the next version as well. Every Era (except the Info) has at least 1 UU land unit that could be selected. I'm avoiding naval units in case someone is playing a land-locked civ and/or map. I'm sure I can easily add a list of about 20 different units scattered through the timeline that would introduce some color to the game.

    Appreciate all the suggestions - I think they'll make the mod much better and more useful to players. I'd originally conceived it as a simple little add-on to provide some variety to how you start a game. Adding more and better bonuses could make it actually a nice way to breathe some fresh-life into the game.
     
    MariusMagnus likes this.
  7. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    Dummy policies could work, but it would definitely get problematic once you get up to the double digits of active major civs. Have you tried giving each player a dummy technology and just checking if they have in initialization? Also, another option would be to include something like TableSaverLoader, in case you haven't tried it yet.

    I've been messing around with this and a few other mods for a while now and I really digging it! I've dedicated myself to two marathon games now: in one I managed to get a chariot archer that got upgraded to a crossbowman (one of the mods I have changes the unit upgrades around), so not a bad start! :D Great work, and I look forward to seeing where you take this!
     
    sman1975 likes this.
  8. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    Just ran into a crash. I had a few other mods enabled, but this one seems to the culprit. The crash happened during turn processing of a new game, consistently during player 10's turn. Upon realizing this, I investigated the lua log and found player 10's bonus to be faith. What I believe is happening is that since player 10 is receiving their faith bonus before the start of their turn, it makes them eligible for a pantheon right out of the gate. The AI seems to attempt to choose their pantheon before they found their first city, which I found out from previous experiences causes the game to crash.
     
    sman1975 likes this.
  9. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    @MariusMagnus - that's a good catch, however... I've tested all of the bonuses quite a lot in development and never had a single crash (which is unusual for my programming abilities... :crazyeye: )

    I suppose I'd have to look at the numbers of how much faith is required to select a pantheon, then ensure the bonus is under that threshold. Odd, during testing, I tried several different game speeds, difficulty levels, and map sized, but next saw this...

    OK, back to the drawing board... :wallbash:


    EDIT: looking at the Defines table, I see this key: RELIGION_MIN_FAITH_FIRST_PANTHEON. It is set to 10, which looks like the Faith cost of the first pantheon is 10, with an additional 5 Faith required for all subsequent pantheons.

    I'll need to think about how to nerf the Faith bonus or raise the value of the above key (probably a bad idea).

    If I nerf the bonus, I'd really like to add something else to make the bonus more, uh, bonus-y... Any ideas how to make the bonus "legendary" if the Faith amount is lowered to 9?
     
    Last edited: May 16, 2018
  10. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    I was able to recreate the crash - by forcing all AI civs to receive the Faith bonus. Crashed like a charm for player 2...

    So it seems your diagnosis is the correct one, so I'll need to figure out a different bonus along the Faith axis. Or perhaps drop Faith from the list altogether...
     
  11. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    Would it be possible to give your starting combat units a promotion that generates faith from kills? That's really all I can think of as an alternative. A great prophet MIGHT work, since you wouldn't have a pantheon to found a religion yet, meaning you could just save it or build a holy site. That said, it most likely won't take that long to get a pantheon, so it's probably a bit OP.
     
  12. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    Man, you're full of great ideas! Adding the promotion is pretty easy, but it doesn't quite feel like enough. May need to look at another buff to add to the mix.

    Just for the fun of it, I think I'll also test spawning a GP - to see how it all behaves. It's basically "guaranteeing" a religion at game start. I mean, I know it's OP, but I'm trying to think if that's toooooo OP or not.

    Will also look over your previous comments, and work up a change list on V3 - which I suppose I need to work on now, since there is a proven CTD- causing bug...

    EDIT: one thing... A few of your suggestions, and a possible fix for the Faith error - require moving the bonus awarding to the end of turn 0 or the start of turn 1 (relative game turns, not actual - so later Era starts will be fixed as well). I'll have to test that quite a bit, but believe it's pretty straightforward.

    I'd hate to leave some of these great suggestions on the cutting room floor. You know, you really are pretty good at this stuff. Do you do any modding?
     
    Last edited: May 16, 2018
    MariusMagnus likes this.
  13. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    Yes, I've made a few custom civs over the years, but I've never published them, since I mostly did them for my own enjoyment.

    I'd also like to say that this mod gave me an idea for a similar one, where your civ receives bonuses based on your leader traits and starting location, I.E. if you get coastal start and you have a high production flavor, then coast tiles yield extra production. Something like that. I haven't fleshed it out yet, but I think it'd be fun to try out.
     
    Last edited: May 16, 2018
  14. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    Unique Buildings for each civ is probably the easiest way to do that. Basically setting up a new building that works like the Lighthouse- adjusting for whatever yield improvement and what terrain type.

    There's also a Trait table (Trait_ImprovementYieldChanges) that allows you to assign better yields to a trait based on tile improvements, and a corresponding one for unimproved 'Features' (Trait_UnimprovedFeatureYieldChanges).

    All of these are ideas, to include this mod, are ways to make the "starting position" vary more widely between civs than it currently does. Which, to me at least, provides a richer gaming experience.
     
  15. MariusMagnus

    MariusMagnus Chieftain

    Joined:
    Mar 12, 2018
    Messages:
    18
    Agreed. Variation is the spice of life, after all. I'm thinking of also making it so the civ will (initially) only excel at its starting bonus. So, a civ that receives production bonuses in coastal cities will receive production deficits in land-locked cities. The way to get around this is to diversify your cities (continue to build land cities), and as you gain culture / unlock social policies, the production deficit will begin to disappear.

    Another idea is to increase/decrease bonuses based on how you're settling. If you continue to settle along the coast, you're bonus for coastal cities will grow larger. However, so will your deficit for land-based cities.
     
  16. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    Sounds like a solid design.

    I've got the crashing problem fixed in V3. Currently, it awards all bonuses at the start of human player's game turn 1. As the AI builds cities immediately, anything tied to having a city (like a home city for a religion/pantheon, etc.) should no longer cause a crash. In the test version of the mod, it now checks for a city - and if the player has one, he gets the faith points. If he does not, he gets a Great Prophet spawned instead. It probably only applies to the human player at the moment, but if for some reason the AI didn't build a city on turn 0, they would get it too.

    The reason it's set up this way is I was thinking about adding 3 variations to the "Faith" bonus: faith points, initial units with the "faith from kills" promotion (adding a scout), or the GP spawned. Will play around with the approach during testing to see if it's any good.

    Another reason to move the bonuses to turn 1 is many of the suggestions you mentioned earlier just aren't practical without a city already built. Am working on adding them now.

    Work continues...
     
  17. Nutty

    Nutty Chieftain

    Joined:
    Mar 9, 2011
    Messages:
    3,107
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    The AI *usually* settles right away. And mods can change the usually part. I suggest using GameEvents.PlayerCityFounded(), then check City.IsCapital() and apply the bonus *then*.
     
  18. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    Thanks, @Nutty! You always have such good advice.

    I'm looking at the bonuses, both in the mod and the ones I'm planning on adding, and making sure which ones need a city built first, and which ones don't. So far, the Faith bonus is the only one (I believe) that requires a city first. I've tested the first 4-5 bonuses (by forcing them on the AI to see if the game crashes), and so far so good. Hope to finish the rest of them today, so at least I'll be sure that the way the bonuses are constructed do or do not cause CTDs.

    I've also moved the actual awarding function to the start of player 0 game turn 1 (vice "Begin your journey" at game start). This should take care of most of the problems, because as you say in almost all cases, the AI should at least have 1 city by then.

    But to take it further, for the bonuses that require a city, I'll add the checks you recommended, and then award some kind of generic "add gold" bonus if no city exists.

    Good stuff. Thanks!
     
  19. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    @Nutty & @MariusMagnus - I'm almost done with the updates, but I started thinking... :satan:

    The mod is called "Legendary" after all, so... How do you think most players would feel about buffing the bonuses quite a bit - I'm thinking ~300%? It might be OP, but most civs would get at least some kind of competitive bonus, so they'd all be, more or less, even?

    Will experiment with this, but I'm really starting to warm up to the idea. Please stop me if it's a dumb thing to do. Thanks!


    Summary of V3 changes so far (most are tested, but will continue to tweak these for a couple of more days):

    - Buffed most bonus awards, to make them more, uh, "legendary…."

    - New bonuses:
    15. Trade Baron: Adds 1-3 Trade Routes and/or 1-3 Great Merchants

    16. Cornucopia: Grants Pottery if not discovered and builds a Granary in the Capital, if one has not already been built. Adds 10-30 food to the capital.

    17. Heraia: Adds 2-5 population growth to the capital. Adds 25-40 food. Spawns 1-3 Settlers if the civ has no cities.

    18. Armilustrium: Adds Walls to the capital, 50% chance of adding a Castle, and 1 Great General. If the civ has no cities, 1-2 Great Generals will spawn.


    - Changed bonus awarding from start of game turn 0 to the start of human player game turn 1 – allows for more software checks to be added to prevent crashes, but also allows a wider variety of bonuses.

    - Changed Faith bonus (#1): it now has a small chance to award a Great Prophet instead of Faith. If no city is in the empire, there is an even smaller chance of a Great Prophet spawn, or gold being awarded. It also spawns an extra melee unit and gives all combat units the "Extra Healing" and "Foreign Lands Bonus" promotions.

    - Removed portions of the Faith bonus, which was causing CTDs if AI tried to found a pantheon before they have a city built.

    - Added check for capital city before awarding Great Persons. If no available, player will get double gold bonus instead.

    - Added better variety of Notification types – more tailored to the awarded bonus.

    - Corrected a formula in the "Happiness" Bonus (#4) which was not awarding the right amount of Happiness. Increased Happiness bonus amount.

    - Fixed a few typos



    Also would greatly appreciate any other suggestions you might have to add to the mod. Thanks, again!
     
    Last edited: May 19, 2018
  20. sman1975

    sman1975 Chieftain

    Joined:
    Aug 27, 2016
    Messages:
    532
    Location:
    Dallas, TX
    Here are the new bonus values for the previous 14 bonuses in the mod:

    1. Faith: Adds Faith - if the game starts before the Industrial Era, otherwise adds Gold. Can also spawn 1-2 Great Prophets. Adds and appropriate melee unit, then adds the "Faster Healing" and "Foreign Lands Bonus" to existing combat units.

    2. Science: Adds 1-3 free Technologies, more for later Era starts and easier difficulty levels.

    3. Gold: Significant amount of Gold added to treasury

    4. Culture: Adds 1-3 free Policies, more for later Era starts and easier difficulty levels. Adds gold if no cities exist.

    5. Happiness: Golden Age progress boost; additional starting Happiness

    6. Great People: Adds 1-3 Great People (of your choice), more for later Era starts and easier difficulty levels. If there is no city, a gold bonus is awarded.

    7. Infrastructure: Adds 1-3 extra Workers, more for later Era starts and easier difficulty levels.

    8. Expansion: Adds 1-3 extra Settlers, more for later Era starts and easier difficulty levels.

    9. Melee Units: Adds 1-3 Melee units, more for later Era starts and easier difficulty levels.

    10. Mobile Units: Adds 1-3 Mobile units, more for later Era starts and easier difficulty levels.

    11. Ranged Units: Adds 1-3 Ranged units, more for later Era starts and easier difficulty levels.

    12. "Peace" Focus: Adds 1-3 extra Settlers and 1-3 extra Workers.

    13. "War" Focus: Adds combat units, similar to #9, and #10 and/or #11.

    14. "Commerce" Focus: Adds smaller amounts of Faith, Gold, Culture, and Golden Age progress

    ---------------------------------------------
    Am testing now, and hope to wrap it all up tomorrow. Will publish here and Steam soon thereafter...
     

Share This Page