sman1975
Emperor
"Merlin" is the project name for a Scenario Management Engine (SME) that adjusts Civ5 performance and behavior, altering the game so that it performs like it was designed to fight a 50-100 turn war/deathmatch, instead of building a civ that goes from stones to stars over 6000 years.
It really isn't a scenario, per se, but rather a tool that serves as the foundation to quickly create a brand-new scenario that will test a human player in ways that scenarios built that use normal Civ5 behavior simply can't.
This Merlin Scenario Engine (MSE) will be a highly-portable library of tools that allows a person with even limited modding skills to construct a playable scenario that will better focus on war goals rather than tech or culture or tourism. You would be able to copy the mod to your own computer, open it in ModBuddy, change the ModID, then make just a few changes and the result would be a top-quality scenario where the Ai puts up a very good fight.
Additionally, I'm developing an Excel worksheet that has several tabs to collect data. A non-computer person could fill out these data into the Worksheet, so that I could quickly implement that person's vision for the new scenario. There are several tabs, asking questions about playable civs, diplomacy, maps, etc. These data are needed to construct a meaningful, immersive scenario.
Basic structure of the SME is completed, and the first playable scenario is being developed using MSE. Each new scenario will cause a bump in the SME version number, since I expect the MSE will never really be a completed project - evolving/improving with each new scenario.
===============================================================================================================================================================================================
Key Features of the "Merlin" Scenario Engine: Merlin provides many processes as part of its design. It seeks to improve AI civ performance so they put up a more challenging gaming experience. It uses several different processes to provide these features:
Scenario Initialization
“Road to War”
Special Turn Requirements – Things that happen only once per turn ( on player zero's turn - the human player who set up the game - even if they're no long in the game).
Routine Turn Management – Things that happen every turn for every major civ:
Victory Conditions -- What ends the game?
Events: These are the wild-card things that can happen at any point in history. The catastrophic events only happen once per game (except for storms at sea). Other events happen a few times per game, but not always to the same civ:
===============================================================================================================================================================================================
Scenario Development Using the "Merlin" Scenario Engine:
- Merlin is a nickname for a large library of database changes and LUA code (similar to python/C# that Civ5 uses to perform many of its function) that are designed to modify the game engine's normal function. The goal is to force AI civs to act like they're in a fight for their lives over the next 20 "years" and not focus on a tourism victory 4000 years from now.
- Merlin consists of 2 basic parts: the "core" SME, which shouldn't be altered once it's locked down. And the "scenario" part of the mod. This is the section that contains all the changes required to bring a scenario to life. The way it interacts with the core SME is defined and controlled. This helps greatly improve the reusability of Merlin, while also improving game stability.
- So, to create a new scenario, you would need to complete a design of what it would look like: when does it take place? Who is involved? What are the circumstances around it that decide who wins? And so on. There is a spreadsheet available to help collect these data which will greatly speed up new scenario requests. At first it can look overwhelming, but a slow review of the tabs should be manageable for most experienced players.
- When the scenario design is completed, bringing that content into the "scenario" part of Merlin is a straightforward job of database updates and customized LUA code. Using existing examples of Merlin scenarios will save a great deal of time, especially if the functionality is similar to existing scenarios.
A key point to remember: a scenario isn't a Civ5 game anymore. The Civ5 game engine tries to guide a civ from stone tools to the stars. It makes a lot of decisions based on economics, culture, diplomacy, technology, tourism, etc. Scenarios contain far fewer game turns to accomplish things, and are generally concerned with moving an army from point A to point B and kill everything there. This requires torturing Civ5's normal game processes, and some of the tools available to do this are coarse and don't work as well as anyone would like. So, SME will conduct this abuse, doing the best it can, but the results won't perfect. I'm aiming for a "good enough" outcome where the AI puts up a fight that looks like it could have been done by a rational, thinking human player.
MSE Roles:
- Scenario Designer: This is anyone who wants a new scenario, and is willing to complete the Scenario Design Worksheet (q.v.). They will populated this worksheet as best they can, then submit it to the Scenario Developer. Computer skills (beyond basic Excel) are not needed to perform this role. Even deep Civ5 knowledge isn't required. But a certain grasp of history will help a great deal on providing the best possible data to the Developer, so he can create the best possible scenario.
- Scenario Developer: The MSE is constructed so that a person with even limited Civ5 modding skills could develop a deep, well-performing scenario from scratch. About the deepest skill required would be minimal familiarity with ModBuddy, and the ability to modify a few LUA scripts, and add some unique units to a mod. If you can do that much modding, you should be able to use SME quite easily. It is a library of tools you would use as a foundation to the new scenario/mod, and build scenario content on top of that foundation.
- Scenario Approver: As MSE will be a "branded" product, I will be the final approver of all scenarios under the SME brand. Obviously, the moddiquette being what it is, I can't prevent anyone from plagiarizing liberally from it (heck I do that a lot too), but I would ask in advance the people recognize and acknowledge SME in their mods if they're using it. It's more than vanity here, as I'm expecting a TON of errors, comments, suggestions to come out on SME scenarios, especially early on, and I'd like to collect this incredibly valuable feedback in one place, so I can use it to improve the evolving engine in the future.
Normally, especially early on, I expect that I will be both Developer and Approver on all MSE-derived products. As time goes on, and if this mod proves useful and popular, I wouldn't be shocked if other modders decided to take a stab at building new scenarios using MSE. At that point, the roles will alter slightly, but I'll still be happy to collaborate with any Developer using SME.
These posts (#1 - #24) are works in progress. I'll update them frequently as MSE develops.
As the discussion develops below, it's important to keep track of a couple of terms. When you see the term "scenario start" it is talking about what happens when you start the scenario for the first time ever (Game Turn 0, or what happens when you press the "Begin Your Journey" button that pops up at the bottom of your Dawn of Man screen). The term "game start" is more specific, and talks about that happens every time you begin your game (specifically loading a saved game, even if that happens on game turn 0).
I'm using discord as a daily collaboration tool. If you want to participate in the discussion, please join us there: https://discord.com/channels/361641784696373248/783755251088883722
OK, here we go.....
It really isn't a scenario, per se, but rather a tool that serves as the foundation to quickly create a brand-new scenario that will test a human player in ways that scenarios built that use normal Civ5 behavior simply can't.
This Merlin Scenario Engine (MSE) will be a highly-portable library of tools that allows a person with even limited modding skills to construct a playable scenario that will better focus on war goals rather than tech or culture or tourism. You would be able to copy the mod to your own computer, open it in ModBuddy, change the ModID, then make just a few changes and the result would be a top-quality scenario where the Ai puts up a very good fight.
Additionally, I'm developing an Excel worksheet that has several tabs to collect data. A non-computer person could fill out these data into the Worksheet, so that I could quickly implement that person's vision for the new scenario. There are several tabs, asking questions about playable civs, diplomacy, maps, etc. These data are needed to construct a meaningful, immersive scenario.
Basic structure of the SME is completed, and the first playable scenario is being developed using MSE. Each new scenario will cause a bump in the SME version number, since I expect the MSE will never really be a completed project - evolving/improving with each new scenario.
===============================================================================================================================================================================================
Key Features of the "Merlin" Scenario Engine: Merlin provides many processes as part of its design. It seeks to improve AI civ performance so they put up a more challenging gaming experience. It uses several different processes to provide these features:
Scenario Initialization
- Scenario Options: Merlin offers scenarios many different options, which can easily be included in the scenario.
- Civ5 Options: Merlin has the ability to change normal Civ5 game options as desired. These can aslo easily be included in the scenario
- Diplomacy: sets up diplomatic relationships between major and minor civs as defined by the scenario
- City Management: changes production in all cities to something militarily relevant – either to units or military buildings. Saves players from spending a lot of time on the first turn setting city production. Merlin’s choices can easily be changed if desired, but that is at the player’s discretion.
- Major civ handicaps are defined. Not all civs in a scenario are equal. Some are more efficient, some are in disarray. The relative performance potential is defined by a “handicap” system for each civ. It’s also possible to adjust these handicaps if that civ is being played by a human player (generally in a downward direction, so they’ll receive less bonuses from Merlin).
- Merlin has the ability to change the strategic resource availability on the scenario map – to make it richer or poorer or completely random, based on the scenario design.
- Merlin can also set up any religions needed by the scenario, including assigning beliefs, holy cities, etc.
“Road to War”
- Diplomacy: performs necessary declarations of friendships, denouncements, city state relationship adjustments, etc. – as the game prepares for the main war event.
- Since a scenario usually doesn’t start at 4,000 B.C. some free gold, culture, and science are provided to all civs at scenario start, so players can structure their civs according to the playstyles and tastes – as if they’d been in charge of the civ for centuries. The amounts of this “free stuff” is adjustable for each civ, and human players can be awarded different amounts if desired.
- Free strategic resources, free buildings, and specific techs can also be awarded at this time.
- Merlin uses a scenario-defined process to award free units to civs early in the game, before the main war starts. The numbers of these units depend on the civ handicaps defined by the scenario, and adjusts for human players (usually lower).
- This “initial mobilization” is based on formulae, and are somewhat randomized. It is also possible to spawn specific units in specific numbers at specific places on the scenario side of Merlin.
Special Turn Requirements – Things that happen only once per turn ( on player zero's turn - the human player who set up the game - even if they're no long in the game).
- Once per turn, Merlin performs several bookkeeping tasks to keep the scenario performing to design.
- It checks to see if any of the “standard” victory conditions provided by Merlin have been met. It also checks to see if any scenario-specific victory conditions have been satisfied. If it finds this to be the case, it will declare victory for the winning civ and end the main war.
- Many, but not all, of Merlin’s functions don’t continue into “just one more turn” time.
- Merlin also checks to see if the main war should be starting on this game turn. If it is, then Merlin will declare the necessary wars, and adjust all diplomatic relationships as defined by the scenario.
- Those initial “bonuses” described in the “Road to War” section can be awarded on any game turn before the main war starts, depending on scenario requirements. If they are set to be awarded after game turn 0 (the game’s “true start”) then Merlin checks to see if this is the proper game turn, then awards those bonuses if so.
- After the scenario has been won, and Merlin declares victory, it forces a “King’s Peace” on all civs. All wars are ended and units begin making their way to friendly territory. For the next 6 turns, no wars are possible. However, after those 6 turns have passed, Merlin removes the “perma peace” restriction, and wars can be started and stopped according to normal Civ5 rules. Think of it as the start of a new Cold War.
- Every few turns, Merlin will “bless” a single civ with a particular event (q.v.). It’s at this point of the turn execution that Merlin decides which civ will be the “lucky” one to experience this event. Most of them are fairly benign, but there are a few that can do some serious damage – and usually at the worst possible time!
Routine Turn Management – Things that happen every turn for every major civ:
- Once Merlin performs that once-per-turn tasks, it focuses on tasks that it must perform every turn for all major civs. It determines many of the data it will require to perform these tasks then collects those data. It determines if the active civ has too many units out of supply, and other things it will need later.
- If the active civ is the “lucky” one mentioned earlier, Merlin will determine which event that civ will experience. It then implements those effects and informs the player about the results.
- Merlin offers various “routine events” every 6 turns or so. These can be a “savings bond” event that provides extra gold. It could be a free Great Person, or “industrial espionage” which yields progress towards discovering your currently researched tech. It can also spawn “home guard” units near some of your cities if the main war is still going on. If the “local revolutions” option is selected, it’s also possible a city might revolt and join the enemy if the war is going very badly (usually defined by a lost original capital city and most of the original cities lost as well).
- If there are any specific requirements relating to religion, it is at this time Merlin will perform those functions – as defined on the scenario side. As religion is so closely tied to the particular scenario, there’s not much Merlin can do without using the scenario side to complete it.
- Merlin then checks to see if any other “scenario custom” diplomatic events are required for that turn. These can be things like “Civ A declares war on Civ B” or “Force a ceasefire” etc. These events are on the scenario side as well.
- Campaign Management: this is one of Merlin’s core functions. This is the part of the library that determines what cities will be attacked next by AI civs. It is part of a plan defined in the scenario. This prevents AI civs from letting units wander pointlessly across the map. There are several nuances relating to campaign management (what campaign should be chosen? How long has it been going on? Is it successful? Should it be abandoned and a new campaign chosen? Etc.) It’s enough to remember that this part of Merlin decides the military focus for the AI civ through campaign management functionality.
- Reinforcements: Merlin periodically gives free units every few turns (defined by the scenario). This is to make up for the fact that most cities on scenario maps are shells and haven’t been in existence for centuries. They also won’t have the right mix of buildings that would suit the civ player’s normal style. So, a few free units helps provide forces that normally couldn’t get trained in the short time-frame of a scenario. Of course, AI civs get different amounts, based on their handicaps, and human players can and should get less.
- At this point, Merlin looks to the scenario side to see if there are any special unit spawn requirements for that game turn. And if so, spawns the units.
- Movement Directives: This is the other side of the coin from Campaign Management. That earlier section determines what the objective city is for military operations, this part of Merlin actually orders various units towards that city to attack it. There are many factors that go into decided what units get these orders, but it is usually a large box somewhere near that objective city.
- Scenarios can define a list of "core" cities for each civ - a civ's own cities it must possess before any offensive campaigns can commence. If any core cities have been conquered, Merlin will direct forces towards those cities to liberate them.
- If there are any scenario-specific movement directives for this turn, ones not related to Campaign Management, Merlin will implement those as well.
- If any civs are at peace, Merlin will occasionally attempt to involve them in the main war – and look for civs that have diplomatic problems with this war-shirking civ. It will then occasionally force a declaration of war on the civ by other civs that don’t like them. This helps prevent the “step back and let everyone else destroy themselves first” strategy. If a war is forced on a civ, their enemies will receive a nice tranche of free units near their borders to cause immediate trouble.
- At this point of turn management, Merlin tries to assist AI civs, to perform tasks they should be doing, but often neglect. If any units can be upgrade, Merlin will upgrade them (but it will charge the correct amount of gold to do so). It will also look at what the active (AI) civ’s cities are producing. If it’s not militarily related, it will change the production to something that is (usually units, but sometimes military buildings). So, no Zoos will be constructed while fighting an existential war. If the AI civ is hoarding a lot of gold, Merlin will use that gold to buy units and/or military buildings.
- Merlin will take a quick look to see if any puppet cities aren’t producing anything. If their build queues are empty, Merlin will change that to convert production into gold.
- Every few turns, Merlin will conduct an evaluation of the current Campaign. If it determines it has gone on too long without success, it will select a new Campaign, based on various criteria.
- Every few turns, Merlin will look at a civ’s cities to ensure the “city focus” is set to “Production” – so it’s producing as many hammers per turn as possible. And to make sure it’s not focusing on “Growth” or some other nonsense.
- Merlin performs these functions for ever major civ every turn until a victory condition is declared.
Victory Conditions -- What ends the game?
- There are several ways to define victory – depending on the scenario. Here are some:
- Scenario that has a defined number of turns. Once the final turn is reached, Merlin will look at the “scenario score” and declare a winner. The scenario score is generally a percentage of “current population vs. original population.” So, if a civ has 10 cities with 10 population each, they start with 100 population. If during the game, they conquer a few cities and on the final turn have a population of 130, then their score will be 130. If they lose a few cities and their population is only 75, then their score will be 75. The civ with the highest score will be declared the winner.
- Complete Kill: this game will continue until all a civ’s cities are conquered and every last unit is killed. If a civ has 2 enemies, then both will need to be defeated this way.
- Capture capital. If a civ captures all its enemies capital cities, it automatically wins.
- Capture all cities. If a civ captures all its enemy cities, but there are still units left, it will win.
- Subjugation. A little complicated, but basically does a civ own the enemy’s original cities so that they now rule over what was 67% of the enemy population at game start.
- Scenario Specific Victory. Whatever the scenario needs to define victory and can be coded is put here.
Events: These are the wild-card things that can happen at any point in history. The catastrophic events only happen once per game (except for storms at sea). Other events happen a few times per game, but not always to the same civ:
- Catastrophic events: Black Death, Maunder Minimum, Storms at Sea, Supervolcano
- Negative events: drop in city state relations, droughts, earthquakes, great fires, floods, evil opens, plagues, rebellions, treasury raids, wandering monsters
- Positive events: boost in city state relations, free promotions, free resources, great harvests, free great people, a jubilee, a free tech award, a grand tournament.
- Some events are a response to in-game events: If enabled by the scenario, when a city is lost, a small number of “partisan” units will spawn around it. Which means it gets harder to hold cities, and the old “only use destroyers and no army” types of invasions won’t work any more.
- Merlin allows for scenario-defined unit naming convention that will rename units as defined by the scenario, to help improve the immersive qualities of the scenario
- Fog of War: Merlin allows you to adjust the game's visibility features, so you can see more of what's going on in the game. While, this may not be historically accurate at all times, it is sometimes fun to see what other civs are doing. There's a convenient popup reached through the "Additional Information" menu button. You can easily adjust the settings to seeing everything on land tiles, everything on sea tiles (except subs), or seeing everything everywhere. Once the map is revealed, it cannot be "un-revealed." However, if you haven't saved the game you can reload a previous version to revert to the old rules of visibility.
===============================================================================================================================================================================================
Scenario Development Using the "Merlin" Scenario Engine:
- Merlin is a nickname for a large library of database changes and LUA code (similar to python/C# that Civ5 uses to perform many of its function) that are designed to modify the game engine's normal function. The goal is to force AI civs to act like they're in a fight for their lives over the next 20 "years" and not focus on a tourism victory 4000 years from now.
- Merlin consists of 2 basic parts: the "core" SME, which shouldn't be altered once it's locked down. And the "scenario" part of the mod. This is the section that contains all the changes required to bring a scenario to life. The way it interacts with the core SME is defined and controlled. This helps greatly improve the reusability of Merlin, while also improving game stability.
- So, to create a new scenario, you would need to complete a design of what it would look like: when does it take place? Who is involved? What are the circumstances around it that decide who wins? And so on. There is a spreadsheet available to help collect these data which will greatly speed up new scenario requests. At first it can look overwhelming, but a slow review of the tabs should be manageable for most experienced players.
- When the scenario design is completed, bringing that content into the "scenario" part of Merlin is a straightforward job of database updates and customized LUA code. Using existing examples of Merlin scenarios will save a great deal of time, especially if the functionality is similar to existing scenarios.
A key point to remember: a scenario isn't a Civ5 game anymore. The Civ5 game engine tries to guide a civ from stone tools to the stars. It makes a lot of decisions based on economics, culture, diplomacy, technology, tourism, etc. Scenarios contain far fewer game turns to accomplish things, and are generally concerned with moving an army from point A to point B and kill everything there. This requires torturing Civ5's normal game processes, and some of the tools available to do this are coarse and don't work as well as anyone would like. So, SME will conduct this abuse, doing the best it can, but the results won't perfect. I'm aiming for a "good enough" outcome where the AI puts up a fight that looks like it could have been done by a rational, thinking human player.
MSE Roles:
- Scenario Designer: This is anyone who wants a new scenario, and is willing to complete the Scenario Design Worksheet (q.v.). They will populated this worksheet as best they can, then submit it to the Scenario Developer. Computer skills (beyond basic Excel) are not needed to perform this role. Even deep Civ5 knowledge isn't required. But a certain grasp of history will help a great deal on providing the best possible data to the Developer, so he can create the best possible scenario.
- Scenario Developer: The MSE is constructed so that a person with even limited Civ5 modding skills could develop a deep, well-performing scenario from scratch. About the deepest skill required would be minimal familiarity with ModBuddy, and the ability to modify a few LUA scripts, and add some unique units to a mod. If you can do that much modding, you should be able to use SME quite easily. It is a library of tools you would use as a foundation to the new scenario/mod, and build scenario content on top of that foundation.
- Scenario Approver: As MSE will be a "branded" product, I will be the final approver of all scenarios under the SME brand. Obviously, the moddiquette being what it is, I can't prevent anyone from plagiarizing liberally from it (heck I do that a lot too), but I would ask in advance the people recognize and acknowledge SME in their mods if they're using it. It's more than vanity here, as I'm expecting a TON of errors, comments, suggestions to come out on SME scenarios, especially early on, and I'd like to collect this incredibly valuable feedback in one place, so I can use it to improve the evolving engine in the future.
Normally, especially early on, I expect that I will be both Developer and Approver on all MSE-derived products. As time goes on, and if this mod proves useful and popular, I wouldn't be shocked if other modders decided to take a stab at building new scenarios using MSE. At that point, the roles will alter slightly, but I'll still be happy to collaborate with any Developer using SME.
These posts (#1 - #24) are works in progress. I'll update them frequently as MSE develops.
As the discussion develops below, it's important to keep track of a couple of terms. When you see the term "scenario start" it is talking about what happens when you start the scenario for the first time ever (Game Turn 0, or what happens when you press the "Begin Your Journey" button that pops up at the bottom of your Dawn of Man screen). The term "game start" is more specific, and talks about that happens every time you begin your game (specifically loading a saved game, even if that happens on game turn 0).
I'm using discord as a daily collaboration tool. If you want to participate in the discussion, please join us there: https://discord.com/channels/361641784696373248/783755251088883722
OK, here we go.....
Last edited: