Éa, a fantasy mod for Civ5 -- teaser thread

Perhaps I'll revert back to an enforced archtype if game testing tells me that I need to. For now, the system as described is already built (just not filled in yet), so that is what you will see in the first release.

On UI and transparency:

The "civ name" is displayed as it should be in the Diplomacy List screen (I swapped civ and leader so civ is the larger text). All of the traits will appear here too, both for yourself and opponents. These will just be icons for tier 1, 2, 3, 4 and then mouse-over each one shows its effect. So you can see how many traits and exactly what they are for each player. (The "effect" help text won't be in initial release for reasons described below.)

The entire list of acquired traits will be in the pedia, eventually, sorted by tier and perhaps also by theme (since there will be so many). However, it's a pain to constantly rewrite help texts as the mod is balanced, and balancing will certainly require adjustment to these trait effects. So you won't see actual help text in the initial alpha release, either in the pedia or the Diplo List trait mouse-over. Instead, you will see something like "h1", "h2", etc. These will refer to a list of traits (triggers and effects) that are kept up to date in the mod thread. When things settle down a little, I'll add the real help text into the mod.

On the name thing: I feel really strongly about this. I don't want a lot of forgettable names for things. I think this is a big problem in Civ5, especially with the policy system. I've played more hours of Civ5 than I care to admit. But I don't remember what "Collective Rule" is, or what it does, or why. I'm trying to avoid this in my policies. But I see the same problem arising in my trait system, so I'm just not going to name them at all.
 
For now, the system as described is already built (just not filled in yet), so that is what you will see in the first release.
Fair enough.

On UI and transparency:
Sounds fine.

On the name thing: I feel really strongly about this. I don't want a lot of forgettable names for things. I think this is a big problem in Civ5, especially with the policy system. I've played more hours of Civ5 than I care to admit. But I don't remember what "Collective Rule" is, or what it does, or why. I'm trying to avoid this in my policies. But I see the same problem arising in my trait system, so I'm just not going to name them at all.
I don't understand how no name at all is better than a potentially forgettable name.

I also think that the problem with policy names is that they have a tenuous connection to their game effect. People can't see "collective rule" and understand what kind of bonus that will give. Whereas they can pretty easily figure out Piety or Commerce or Rationalism., and I find that people do remember the names of the policy trees.
I'm not arguing for a name for every individual bonus, but a name for broad Archetypes of traits.
It would be pretty easy to remember/figure out what Horselord, Conqueror, Seafarer, Colonist, Defender, Scholar are going to do.

Whereas it is going to be pretty hard to remember what Ikkos, Fir Bolg, Hod and Lagad do, unless these names get a fair amount of flavor build around them, such as with UUs and UBs. The reason that people remember the FFH names (Lanun, Doviello, Balseraph) is precisely because they are strongly tied to a number of unique aspects and in-game art and flavor.

*edit* Those archetype names could also be tied into diplomatic text or leader names, so that they might be Rufus the Conqueror of the Ikkos.
 
I also think that the problem with policy names is that they have a tenuous connection to their game effect.
That too. I think this is a general problem in Civ5. A lot of the links between names and what things do feel weak.


I'm not arguing for a name for every individual bonus, but a name for broad Archetypes of traits.
It would be pretty easy to remember/figure out what Horselord, Conqueror, Seafarer, Colonist, Defender, Scholar are going to do.
I may do this for the sole reason of sorting things in the pedia. But no civ will be constrained except by their own actions.

Whereas it is going to be pretty hard to remember what Ikkos, Fir Bolg, Hod and Lagad do, unless these names get a fair amount of flavor build around them, such as with UUs and UBs. The reason that people remember the FFH names (Lanun, Doviello, Balseraph) is precisely because they are strongly tied to a number of unique aspects and in-game art and flavor.
UUs and UBs tend to be very weak flavorings. They were stronger in FFH because there were more (and more different) UUs and UBs, and then whole added mechanisms related to civ (not to mention religion, which did let you "customize" each archtype to a large extent). I think flavoring by my system will be as strong or stronger in most cases. A civ that goes for Architecture and its prereqs (e.g., Sophronia) will be very different than a civ that goes for Beast Breading and its prereqs (e.g., Âb). You have never seen the tech tree used as a civ-specialization mechanism (FFH didn't do it except in a very minor way). It's not just one or two UUs/UBs. It's darned near all units and buildings. You are underestimating the effect here.
 
UUs and UBs tend to be very weak flavorings. They were stronger in FFH because there were more (and more different) UUs and UBs, and then whole added mechanisms related to civ (not to mention religion, which did let you "customize" each archtype to a large extent). I think flavoring by my system will be as strong or stronger in most cases. A civ that goes for Architecture and its prereqs (e.g., Sophronia) will be very different than a civ that goes for Beast Breading and its prereqs (e.g., Âb). You have never seen the tech tree used as a civ-specialization mechanism (FFH didn't do it except in a very minor way). It's not just one or two UUs/UBs. It's darned near all units and buildings. You are underestimating the effect here.
I can imagine that hypothetically we can get a fair amount of flavor from the AI, because a civ that becomes the Ikkos will research lots of cavalry techs and will act like a barbarian raider, a civ that becomes Galway will research lots of archery techs and use lots of those units, and so forth.

But there won't really be any flavor for the human player when playing those civs, because the human can still research whatever techs they want, and the Name trait abilities don't seem to have particular synergies with any particular strategy.
For example, suppose I become the Fir Bolg, which gives me mildly higher yields from pasture improvements. How is that going to change how I play? It really isn't. It is a minor bonus that happens in a generic fashion; it won't really choose what tech path I pursue, what kind of army I build, whether I build cities tall or wide, whether I go for techs or policies or something else, etc.
I am likely to play a game as Fir Bolg in an almost identical fashion to a game played as Cruithni (which benefits camps).
Some of the other Names have slightly more specialized bonuses (eg free building in every city bonuses will encourage more of a Wide playstyle), but they're still mostly fairly weak and unlikely to encourage any particular playstyle or theme.

So it isn't clear to me that there is much flavor value from the different civs for the human, which in my view is even more important than flavor from the AI.

Whereas a game played as Khazad will tend to feel very different from a game played as Lanun, and similarly a game played as Germany will feel quite different to a game played as India.

If techs are the main means of customization, then I'd try to think about how to tweak the Name bonuses so that they encourage you to undertake a particular future tech path. For example, maybe they could reduce the cost of researching particular future techs that were in the same theme?

*edit*
Another possibility would be to add an actual UU or UB to the various names, particularly one that required a higher level tech to the triggering one.
So Fir Bolg from animal domestication could get a UB that further boosts pastures from the Animal Breeding tech.
The Archery civ could get a UU replacement for the unit that comes with Bowyers.
etc.
 
But there won't really be any flavor for the human player when playing those civs, because the human can still research whatever techs they want, and the Name trait abilities don't seem to have particular synergies with any particular strategy.
For example, suppose I become the Fir Bolg, which gives me mildly higher yields from pasture improvements. How is that going to change how I play? It really isn't. It is a minor bonus that happens in a generic fashion; it won't really choose what tech path I pursue, what kind of army I build, whether I build cities tall or wide, whether I go for techs or policies or something else, etc.
I am likely to play a game as Fir Bolg in an almost identical fashion to a game played as Cruithni (which benefits camps).
Some of the other Names have slightly more specialized bonuses (eg free building in every city bonuses will encourage more of a Wide playstyle), but they're still mostly fairly weak and unlikely to encourage any particular playstyle or theme.

There is certainly room for improvement in some of these. Some were, to be frank, done in a rush with the idea that they can be adjusted later. At the moment I have to prioritize other things needed for release. However, any alternatives suggested here will be considered. I expect this is an area where there will be a lot of individual changes after release (though the overall vision and objective is much less flexible).

But keep in mind: My vision is not for enforced archtypes. The names and what they mean is supposed to be fluid from game to game. You should associate Vincha with metal and melee units. However, beyond that, it is going to vary from game to game. In one game they may be more cultured, in another more research-focused, and in another maybe pure conquest. Vincha are one of the few civs that can even be Heldeofol. If you play for a while (or dig around in the AI code), you will gain some expectation of how the AI usually plays this civ. As a human player, you can play them according to your own vision of what they should be (hence the tier 2, 3,... traits).

I am not trying to replicate the Civ5 or FFH civ system here. That is not my intent. If it was, there would be no reason to do it differently. So don't judge it purely on how well it replicates those.

On civ-specific UBs/UUs: My system supports these. There will never be exactly one UB and UU per civ (one of Kael's best pieces of advice is to avoid these sorts of patterns). But there will be some. The only reason I don't have them now is lack of individual art resources.
 
done in a rush with the idea that they can be adjusted late
Ok, that seems sensible for now. Absolutely these kinds of things can be revisited later; I think the only thing worth doing now is just considering that there should be some way to make the player have a thematic feel when playing as a particular Name.

I am not trying to replicate the Civ5 or FFH civ system here. That is not my intent. If it was, there would be no reason to do it differently. So don't judge it purely on how well it replicates those.
I'm not, but most successful strategy games have different flavors/themes for the different players/races. And those that don't tend to be less interesting. One of the biggest advances in Civ5 over Civ4 and Civ4 over its predecessors was increasing the degree of faction differentiation.
There is a risk that by removing any kind of actual factional differentiation, the factions get boring because there is no incentive for the player to change how they play to fit the faction.
 
One of the biggest advances in Civ5 over Civ4 and Civ4 over its predecessors was increasing the degree of faction differentiation.
There is a risk that by removing any kind of actual factional differentiation, the factions get boring because there is no incentive for the player to change how they play to fit the faction.

I have a slightly more mixed view of this. Ever since Civ3, I always thought that these differences should be more emergent rather "hardwired". That's just personal preference, of course. Now in fantasy, I think there is a lot more justification for "hardwired" racial differences. And I'm using this for Heldeofol vs Man. But I'm pursuing a different vision for how civilizations within a race become differentiated.
 
all civs can slash-and-burn from game start (chopping for production requires bronze working).

I like this.

Any ideas on how this could be implemented within Civ IV framework? :)
 
Previous Info Posts:
Heroes and other Great People
This is the heart of Éa, more important in subsequent mod development than the "emergent civ" mechanisms described previously. This system will start off modestly in phase 1 with only 5 classes analogous to the 5 GPs from base (Engineer, Merchant, Sage, Artist, Warrior) but will expand eventually to include 9 classes with about 30 subclasses. These include everything from Pirates to Prophets to Politicians to Paladins. The origin of this system goes back to this post in April 2010 (hence my tentative release date in the OP, which will mark exactly 2 yrs of planning and implementation). Please don't interpret this as an attempt to make an RPG, which is not how these will play out. The idea is that a civilization's great people (past and present) provide a key defining flavor for a civ, as important as its buildings and wonders.

GPs do almost everything in Éa. They build wonders, establish trade routes, craft epics, lead armies, and become leaders of your civilization. Each has a name and unique 2D art (and by phase 3, experience, promotions and unique characteristics). There will be ~100 at release, probably expanding to >1000. The term "Great Person" is used in this mod to denote any significant individual (as opposed to multi-individual units like "infantry" or "workers") though in future development you will see great people that aren't really "people" in a strict sense. Although they are represented by units on the map, they are quite different than other units in many ways. For example, they can violate the 1-unit-per-tile rule and can even enter foreign cities. The sections below explain their general operation.

Phase 1 Implementation
The system and specific classes (and later subclasses) are going to role out in a kind of gradual way. Even in phase 1, you will see mechanisms that you might not have thought possible in Civ5 without dll (for example, a merchant "building" a trade mission in a foreign capital). But much more will come over ongoing mod development. The following sections describe how it works and what you will see in the initial phase 1 alpha release.

How many? Empire size and specialists have no influence on number of great people. You do have some mild influence on this through policies and by crafting the National Epic, but not a lot. A few individuals appear when specific conditions occur (e.g., adopting some policies or "first kill" for Heldeofol). However, most great people will arise from (or offer to join) your civilization on a random basis throughout the game. The number of great people present in a civilization at any time typically will be around 3 - 5 on a standard map (losing one increases your chance of gaining another, but of course you lose the use of a GP for some time). You will not gain any GPs before your civilization takes a name, though some "naming events" give you a GP simultaneous with your civ's naming (e.g., Sophronia takes its name from the great stone mason Sophronisca, who emerges within the first civ of Man to discover Masonry).

What kind? The player can strongly influence class for randomly appearing great people. Some civs have a specific affinity for a certain class and are more likely to generate that class (see *'s in Civs and Traits). The other two important determinants in phase 1 are experience points (XPs) and specialist points (SPs). All XPs gained by any means (even free xp from unit building bonuses) promote the appearance of Warriors. SPs are acquired by assigning specialists, and are tallied on an empire-wide basis (there are no “great people bars” in city screens). Note that specialists do not influence the number of significant individuals generated, only the type. Specialists, specialist yields, and the classes they promote are:
  • smith (+4 production) -> Engineer
  • trader (+4 gold) -> Merchant
  • scribe (+4 science) -> Sage
  • artisan (+4 culture) -> Artist
Players accumulate points toward each class which determines the relative probability of appearance for one class over another. The Great Person will offer his/her services to the empire, which the player can accept or decline. In either case, accumulated points toward that class disappear. (This allows marginal effects to accumulate and eventually generate a specific class if the player continues to refuse unwanted GPs.)

What do they do? Well...almost everything. Before we get to that, a few concepts need to be covered:
  • Joining. Great People can "join" other units or cities, and this is necessary for some actions or effects. Warriors join specific military units to act as generals (conferring benefits to all nearby units). Engineers join workers allowing them to build Wonders and other Great Constructions on land tiles. Merchants join cities (domestic or foreign) to establish trade houses, trade routes and trade missions. GPs "disappear" from the map when joined, but don't worry about finding them: GPs have there own "selector arrows" in the Unit Panel UI that make this very easy. Joining is not necessary for all Great Works. For example, an Artist can craft an Epic while in a city or while wondering about the countryside.
  • Cost. Many but not all Great Works (including Wonders) have an additional cost, usually production or gold. For production, this works by diverting up to ⅔ production from the nearest city, then ⅔ from the next nearest city, and so on until [total cost / turns to build] is taken. Gold is taken directly from the treasury. If the empire cannot support the cost required on a turn, then build time may be delayed (chance of no progress on a turn is proportional to the shortfall).
Additional notes:
  1. Everywhere you see "mod" below, substitute the number 10. This is a placeholder for a variable number that will be introduced in phase 2.
  2. Asterisk followed by a resource means that nearby (within 3 tiles) improved resource will reduce production cost by 20%.


Take Leadership
Any GP can take leadership if your civ has no current leader (this is an "action"), but they must be near the capital to do so. Leaders confer class-specific effects on your empire as a whole. To receive this effect, the Leader must stay near the capital (exceptions: a Warrior leader may leave the capital area but only if at war; an Engineer leader can be in another city if constructing a new palace).
  • Engineer +mod% production in cities; -mod% production cost for all wonders and great constructions
  • Merchant +mod% gold from all city sources, including yields and trade routes
  • Sage +mod% science
  • Artist +mod% culture
  • Warrior new units have mod xp; mod% chance per turn per unit for 1xp gain; +mod% combat and ranged strength for all units.


Take residence in City
A GP can "take residence" in a city when they are not performing other actions. This is sort of the default thing to do if you don't have anything else to do at the moment (for example, you are waiting for a tech to enable a wonder). This action will confer a class-specific effect on that city identical to those shown above for Leader effect, but only for that city. Only one GP can have residence in a particular city at any one time, but the residence effect is cumulative with leader effects. The Leader himself/herself may take residence (in the capital, of course) if not performing other GP actions (the capital will then have 2x effect from that person).

Minor Actions
  • Establish Trade Route (Merchant; 100g; 8 turns in a foreign city or city state) Automatically connects to largest available domestic city. Trade Route gold yield equals the smaller city's current size applied at both cities (stopped during war plus 10 turns). +1% for each 10 turns that the trade route is in place. Note that conquest of either city destroys the trade route, which must be re-established from scratch.
  • Build Fort (Warrior joined to infantry; 8 turns)
  • Train (Warrior joined to any military land unit) +1xp / turn for joined unit


Great Constructions
All take 25 turns and divert production cost from nearby cities (as described above).
  • Foundry (Engineer with worker; 500p; Forge) +mod p on this tile.
  • Fortress (Engineer with worker; 500p; Construction) +mod% defense/attack from this tile. Build on owned or unowned tile (the latter becomes owned). Note that this may have diplomatic consequences (possibly dire) depending on proximity to any foreign cities.
  • Palace (Engineer in city; 300p; req: Architecture) +mod(current leader effect). Moves capital to this city. Can build once per civ.
  • Academy (Sage in city; 200p; req: Logic) -mod/3% Knowledge Maintenance. Can build one per city.
  • Festival (Artist with worker; 100p) +mod% c on this tile. (uses trade post graphic ;))
  • National Treasury (Merchant in city; 300 p) +(mod/2)% gold earned on treasury per turn applied at this city. Can build one per civ.


Wonders
All are unique and take 25 turns to build. Any GP currently building a wonder prevents all other GPs from starting it. Although these are "tile improvements", they generally apply effects in a nearby city (i.e., they don't need to be "worked"). Production cost is diverted from nearby cities as above.
--Note: I'm only listing a few of these now. Expect about 15 at initial release.
  • Stânhencg (Engineer; 200 p; *stone) 4c; +mod%c in nearby city; free monument every city
  • Megálos Fáros (Engineer with workers; 300p; Masonry, Sailing; *stone) 4c; +mod% gold from all trade routes in all cities. Built only on coastal land tile.
  • Hanging Gardens (Engineer with workers; 300p; Irrigation) 8c; +mod% growth all cities
  • Uuc-yabnal (Engineer with workers; 300p; Masonry, Slavery policy; *stone) 4c; +5 x mod% work rate for all slaves (these are a support-free version of workers).
  • The Long Wall (Engineer with workers; 500p; Construction; *stone) 4c; mod x 10% chance that enemies loose one movement point each turn within your borders
  • Clog Mór (Engineer with workers; Machinery) 4c; -mod% purchase cost all buildings
  • Da Bao'en Si (Engineer with workers; Architecture; *marble) 8c; +mod happiness
  • Great Library (Sage with workers; 300 p; Writing, Scholasticism policy) 4c; -mod% research maintenance.
  • Kolossós (Artist with workers; 300 p; Bronze W.; *copper) 8c; +mod% str/rng for all military units (land and sea)


Epics
These take 25 turns, but there is no cost deducted from cities or empire. Epics don't exist in any particular city (an Artist can move around freely while "building" these). Once finished, they are permanently owned by the civilization as a whole.
--Note: there will be more of these at release.
  • National Epic (Artist; req: Literature) Increases number of GPs at any time by about mod/20; one per civilization.
  • Heroic Epics (Artist; Drama) +mod/3% str/ranged combat all land units; a civ can make one of these for every Warrior that has passed away (each is named after the hero).
  • Song of Éa (Artist; Music) +mod% c all cities; unique (as a Wonder).


Other Great Works
All take 25 turns. Some have cost as described above.
  • Trade Mission (Merchant in foreign capital; 300g) increase all trade route yields with this civilization by mod%
  • Establish Trade House (Merchant in domestic city; 300 g) increase all trade route yields to this city by mod%
  • Research (Sage in city with Academy) Up to mod x n research points toward any single tech, without deduction for research maintenance; n is your civ's average total research per turn over the 25 turns not counting research maintenance.
  • Magnum Opus (Artist; Aesthetics) +mod c per turn. Each individual Artist can make exactly one of these.
 
Sounds cool.

Divorcing GPs from specialists seems a bit weird. If specialists don't give GPs, then they're basically just the same as working tiles; no difference between an engineer and working a mine. That seems like a problem.
So it would be interesting to see a bit more on what specialists are for, if they don't support GP production, and how you affect the rate of GP generation/what type you get.

If you're using great people for trade routes; does that mean no more trade routes via road connection? Or are there two different kinds of trade route?

Wonders as tile improvements; are these vulnerable to unit capture or pillaging while being worked? Probably best if units can't stop it directly (ie the great person disappears when you start building the wonder, rather than having them build it like a worker), but maybe pillaging slows construction by a few turns?
 
Sounds cool.

Divorcing GPs from specialists seems a bit weird.
Divorced from number, yes, but not class. If you want to make sure you get an engineer, you will need to build a forge and assign a smith. Or you can just take what you get. (I might modify this system later so specialist have a mild boost on #, but it won't be more than a small boost.)

If you're using great people for trade routes; does that mean no more trade routes via road connection? Or are there two different kinds of trade route?

Two different kinds. I'm leaving the core system as it is. The trade routes that merchants establish (and later boost via trade houses and trade missions) are between civs. You can have one for every pair of cities. There is not limit except for the opportunity cost (it takes a merchant some time to establish one). It may seem a little powerful but remember that most cities will be smallish in Éa -- trade routes will probably only be worthwhile to connect each of your "big" cities with "big" cities of other friendly empires.

Wonders as tile improvements; are these vulnerable to unit capture or pillaging while being worked? Probably best if units can't stop it directly (ie the great person disappears when you start building the wonder, rather than having them build it like a worker), but maybe pillaging slows construction by a few turns?

The tile wonders work much like any other improvement except they can't be replaced (but they can be pillaged which removes effect ... yes I'll have to add some AI for this eventually). If building is interrupted, it can be resumed later just as any tile improvement. An Epic is different. Although you see a "progress bar" like an improvement, the "progress" is actually stored in the individual rather than tile, so progress is lost if the individual is captured. The "city builds" (like trade routes) are different in their own way. They show progress bars again, but "progress" is stored in a special variable unique to the city and creating civ (so another merchant could pick it up again in this city).

On capturing, if an engineer is joined to a worker, and that worker is captured, then the worker is lost but the engineer will escape to the capital. Something like this happens for a warrior attached to a military unit (acting as a general). I have a somewhat different system in mind for later, but this is how it is coded for initial release.
 
Seems it will be a really LUA-heavy mod... Coding in LUA in a way that makes the AI really use all the features is lots of work, so I really appreciate what you've done so far, and what you're going to do in the future, even without seeing the mod. Such kind of modding is far beyond my capabilities, so I'm going to use the original mechanics where possible (at least at first, the DLL code has to be released at some point, making some more radical changes easier, as with the DLL we'll have access to "deeper layers" of the game, and also I'm much better at C++ than at LUA). I'm going to use LUA only for some special things that are important for my vision of the mod and can't be done without it, like granting Settlers to players.

As for specialists, I'm going to have many different kinds of them in different buildings, some providing not only one type of yield, but a combination of them, some giving GP points and some not, and some buildings giving GP points without the use of specialists - anyway, I think the original GP mechanic is good and I want to keep it, but the types of GP will be different, and some of them will be combat units.

Ahriman said:
Divorcing GPs from specialists seems a bit weird. If specialists don't give GPs, then they're basically just the same as working tiles; no difference between an engineer and working a mine. That seems like a problem.

Well, I don't see a problem here - some types of specialist slots can be just another place to work for the population without giving any other effects (this is not the case in this mod, where they influence the type of GPs that appear). It's normal that some people work in the countryside, and some in the city, and it doesn't mean the the ones working in the city must be more suited to create GPs.
 
It's pretty heavy Lua, yes, but I enjoy that. After Civ4 Python modding, Civ5 Lua is an utter joy. It's not that Lua is better than Python. It's the way they are implemented. In Civ4, a function couldn't "remember" anything between turns (never mind on game exit/reload). This was a horrible limitation because you had to recalculated everything every time you needed it. For example, if you were doing stuff with unique features, you had to cycle through every tile and find them every turn before doing anything. No need for that kind of nonsense in Civ5. In fact, there are very few places in my code where I "iterate through" stuff that I don't need. The result is that my (now 4000+ lines) Lua code runs in 0.3 sec per turn, faster than my old FFH modmodmod with perhaps 300 lines of Python. There are definitely places in my code where dll C++ will speed things up, but most of it is so fast that there won't be any need for it.

On the AI, I knew from the start of planning that I'd need total control of tech/policy choices to make my "emergent civ" system work (with AI civs appropriately specialized). The dll isn't going to help me much here because the core flavor system just isn't up to what I need.

Once I got AI tech/policies working, I was more confident on other AI stuff. The Wonder builds above are controlled by core AI as "normal" builds. The Epics and Trade related stuff is where I'm working now. The functions are there for human, but it is going to take me a few weeks to get the AI to do anything with this. It's not too bad though. Basically, if the AI has a merchant, it will look at all possible actions, calculate a benefit/cost figure for each (lots of approximations here but that's what humans do) and then do it (I. move to tile. II. call LuaDo function that already works for human player).
 
Some very technical modding info about "actions" and spell implementation

For anyone interested, I'm darn near done with all of the "infrastructure" for a complete spell system. You won't see any spells at initial release, but the underlying table/Lua structure is there. The reason I'm doing this now is that it provides a nice generic way for me to handle non-spell actions that the mod needs now. This is how I'm implementing many of the GP actions described in the last info post, including joining, take leadership, take residence in city, craft epic, establish trade route and others (though many "tile constructions" are just ordinary "Builds").

Technical details (some of this is file comment text, so very technical):

The EaActions table (added as an OnModActivated)
This holds all special "EaActions" (which can be spells or not) and all of their "generic" reqs and effects. EaActions are separate and different than core game "actions" although they can exploit the same UI. The table row tells the game where/how to display the button for the player UI: as an "Action", "SecondaryAction", "Build", "Spell", "CityAction" or "CivAction". The first three use the current UnitPanel UI (only these will be functional at game release). "Spell" will use a separate UI but is still a unit action. The last two will use different UI and are not unit-based at all. The table can specify any number of generic reqs (UnitType, PromotionReq, TechReq, etc.) and generic effects (SpawnUnit, AddBuilding, etc.).

EaActions.lua file
This processes generic table reqs/effects and can add non-generic, action-specific reqs/effects. It is organized into two parts: there are three top-level generic functions, TestEaAction(), DoEaAction() and FinishEaAction(), followed by optional action-specific Test<action>(), Do<action>() and Finish<action>() functions. The top level functions carry out all of the table tags for each EaAction (generic reqs and effects), then call the corresponding action-specific function if one exists (or move on gracefully if it doesn't).

Most useful arguments (unit, player, plot, x, y, city, etc.) are localized at the file level so they can be passed among functions (these will be calculated in the top level TestEaAction() function no matter what we are doing in this file). Action-specific functions are referenced in a table (indexed by eaActionID) and called from the corresponding top-level function.

TestEaAction(eaActionID, unit, [testX, testY]) has optional testX, textY arguments that tell us where to test the action; if not supplied then unit x, y are used. The Test function is always called by the Do function automatically before actually doing anything (returns false via the Do function if it can't be done). Calling the Test function directly has different useful purposes for human and AI. For human player, it determines whether the button should be shown (MapModData.boolean1), what tooltip text to show (MapModData.text1), and whether the button should be enabled (MapModData.boolean2 and 1st return argument). For AI, in addition to telling us whether the action can be done (1st return arg), it also returns a "proxy value" (2nd return arg) that is useful for AI to attempt to determine the "value" of a hypothetical action. As an example, it returns base gold times civ trade modifier for EAACTION_TRADE_ROUTE. Using testX, testY arguments allows us to carry out this test even at a distance from the unit (for example, cycling through all foreign cities to find the most valuable target to have a merchant establish a trade route). The underlying calculation is sometimes useful also in the human tooltip text. In the trade route example, part of this calculation is used in setting the tooltip text so that you see base gold value when establishing a trade route. The top level TestEaAction() can handle a lot of different generic table requirements like unitType, level, city, etc. Anything more specific can be added as an action-specific Test<action>() function.

DoEaAction(eaActionID, unit, [targetX, targetY]) attempts to carry out the action, either at targetX, targetY (if provided) or at the unit's x, y. It always calls the Test function first to see if action can be done, returning false otherwise. For an "immediate" action (with TurnsToComplete = 0) all of the effects are done by Do functions (either the top level DoEaAction() or an action-specific Do function if it exists). For an action with TurnsToComplete > 0, the DoEaAction() function is called repeatedly each turn until progress equals TurnsToComplete (for AI, this calling happens at start of turn so the AI can't do something else; for human player at the end of turn so he/she can), at which time DoEaAction() calls FinishEaAction(). The top level DoEaAction() can do a lot of different generic table effects like "SpawnUnit", etc. Anything more specific can be added as an action-specific Do<action>() function.

FinishEaAction(eaActionID, unit, [targetX, targetY]) is only called from DoEaAction(). It is only used if TurnsToComplete > 0 and the action is now "finished". There are a lot of generic table effects that can happen in the top level function, for example adding a building to a city. Anything more specific can be added as an action-specific Finish<action>() function.

****************

With all of this in place, it is trivially easy to add a "Fireball" spell (that is, if someone provides the art) and to hook it up to some external AI processing (actual AI is done elsewhere, but the Test functions will return a value proxy). The top level TestEaAction() will test any generic table reqs (e.g., unitType, promotionReq) and then call a specific TestFireball() function. The action-specific TestFireball() function provides tooltip info (for human player) and a "value proxy" for the AI. The top level DoEaAction() can generate a UNIT_FIREBALL based on the generic table tag "SpawnUnit". There is not even a need for a specific DoFireball() in this example, but there could be if (for example) you wanted to run a specific visual or sound effect (although those will probably be added later as a generic table effects anyway).

Alternatively, this could be programmed to behave more like a "ranged effect" with TestFireball() making sure we have a valid (and valuable for AI) target and DoFireball() triggering the effect. (this way is easier from an AI perspective because it is one-step and we don't have to count on the UNIT_FIREBALL to do something)
 
So, what are specialists for? They're a bit dull if all they do is shift which type of great person you get.
I think it is very important that specialists be differentiated from working tiles.
I prefer a system like that of vanilla, where you get lower short-term yields from specialists (eg 2 hammers rather than 3) but then they contribute to a payoff in the long run (generation of a great person). I'm sure there are ways of having specialists be an investment in a long-term payoff of some kind without using the great person mechanic; possibly you could still use the GPP mechanic but then have that generate something else (not a great person, which you're using differently).
Working tiles is important because they reward map control, and because they make terrain quality matter.
There is a risk that if specialists give good yields, then it becomes optimal to just build farms everywhere, to build cities anywhere that they can get enough food, to pack your cities in tightly, to focus like crazy on maritime city states, and run everything off of specialists.

What is the idea behind making great people random, rather than based on player actions?

Well, I don't see a problem here - some types of specialist slots can be just another place to work for the population without giving any other effects (this is not the case in this mod, where they influence the type of GPs that appear). It's normal that some people work in the countryside, and some in the city, and it doesn't mean the the ones working in the city must be more suited to create GPs.
It is a problem. It is very dull if they both do the same thing, and it is problematic if space and terrain has no meaning because you can get everything from specialists. Terrain should matter.
Yes, it is ok if great people don't produce specialists, but IMO they still need to do something more than just produce yields.

If building is interrupted, it can be resumed later just as any tile improvement
So the great person has to actually sit there for 25 turns, like a worker, building the improvement?
That strikes me as something that the AI might be really bad at, particularly at defending the great person sufficiently in wartime.
 
There is a risk that if specialists give good yields, then it becomes optimal to just build farms everywhere,
This only applies for an agriculturally-focused civs. This kind of civ will be able to support a lot of specialists (limited by slots of course) if they are willing to sacrifice the extra growth (which is sometimes a good idea). Others will struggle to support one or so per city. Either will be able to promote a specific GP class with these specialists, but their immediate "yield effect" is meant to be more or less the same as an improved (but non-resource) tile. Ignoring the GP selection effect, you are right that working a mined hill is identical to having a smith specialist (of course both hills and specialist slots are finite, so that might determine which one or what combination you use).

On maritime city states: there aren't any mechanisms in the game that will give you #f x #cities, so this is not a real issue. There are some mechanisms that can give you #f, distributed among your cities.

What is the idea behind making great people random, rather than based on player actions?
:confused:
Spoiler :
What kind? The player can strongly influence class for randomly appearing great people. Some civs have a specific affinity for a certain class and are more likely to generate that class (see *'s in Civs and Traits). The other two important determinants in phase 1 are experience points (XPs) and specialist points (SPs). All XPs gained by any means (even free xp from unit building bonuses) promote the appearance of Warriors. SPs are acquired by assigning specialists, and are tallied on an empire-wide basis (there are no &#8220;great people bars&#8221; in city screens). Note that specialists do not influence the number of significant individuals generated, only the type. Specialists, specialist yields, and the classes they promote are:
  • smith (+4 production) -> Engineer
  • trader (+4 gold) -> Merchant
  • scribe (+4 science) -> Sage
  • artisan (+4 culture) -> Artist
Players accumulate points toward each class which determines the relative probability of appearance for one class over another. The Great Person will offer his/her services to the empire, which the player can accept or decline. In either case, accumulated points toward that class disappear. (This allows marginal effects to accumulate and eventually generate a specific class if the player continues to refuse unwanted GPs.)
So the great person has to actually sit there for 25 turns, like a worker, building the improvement?
That strikes me as something that the AI might be really bad at, particularly at defending the great person sufficiently in wartime.
As said above, the worker will be captured but the engineer will escape to the capital (this is sort of placeholder logic for something different in a later phase). The AI already has a tiny bit of logic for guarding workers (not very good, true). I may add some AI here or just wait for core AI improvement (which might come via someone else's dll AI mod, eventually).
 
Ahriman said:
It is a problem. It is very dull if they both do the same thing, and it is problematic if space and terrain has no meaning because you can get everything from specialists. Terrain should matter.

I agree that if there are lots of specialist slots that give you everything you normally get from terrain, it's a bad thing. The number of specialist slots should be very limited (I'm not planning any building that gives more than one slot, and many specialist buildings will depend on local terrain or resources, so the terrain will matter when it comes to types of slots that you get), and specialists shouldn't give better yields than good terrain tiles (improved resources, GP improvements, natural wonders and other special sites etc.) - the yields should be comparable to normal improved terrain, and worse than that when they produce GP points. There can be even a few slots that give you food (for example Bakery giving a Baker slot, producing some food and gold and no GP points), but not many of them.

Yes, it is ok if great people don't produce specialists, but IMO they still need to do something more than just produce yields.

I think the idea of specialists producing GP is good, but if not all of them do it it's not a problem for me. I'm not sure if I like Pazyryk's idea of them influencing only the type of GP, and not their number - when you get a GP it's always a good thing, influencing their type is important for "customizing your game experience", but less so for your chance of success (if the game is well balanced), so the real value of specialists in this system are only their yields.

There is a risk that if specialists give good yields, then it becomes optimal to just build farms everywhere, to build cities anywhere that they can get enough food, to pack your cities in tightly, to focus like crazy on maritime city states, and run everything off of specialists.

This is a valid balance concern, I think the best solution is small number of specialist slots - if the city is too big, you'll only get dull "unemployed" citizens giving 1 hammer.
 
For a variety of reasons, I have to keep GP number under control. There is a balance issue of course (GPs are powerful), but even worse, there are only a finite number of GPs in Éa. This is because each has a unique name and portrait and eventually unique characteristics. There are >100 at initial release (and >1000 eventually), but it is still finite. Keep in mind that I did say that the player has influence on number. But not a lot.

If you haven't noticed, this is a "rubber-band mechanic" (i.e., it can benefit a small loosing empire as much as a winning empire). We don't want too many of those, of course, but I think heroes and great people is an area where a small empire on the brink of extinction can be allowed to stand out. (They don't actually do better, so maybe calling it rubber-band is incorrect. But it will feel like they have more because they have more relative to empire size.)

There are only 2 - 3 possible GP slots per type, and realistically a player can only get maybe 5 or so total. One (per type) is from an early building, and the others are policy-dependent or mid- to late buildings (no single player will get all or very many of these). But really the bigger issue in Éa is food. It's not easy to have the surplus to support these.
 
I'm struggling to think of a name for a particular policy branch. This is the branch for those that want big populations, massive land conversion to support them, a larger proportion of population in cities (i.e., ability to support more specialists). It kind of represents an Agricultural Revolution, starting with increased productivity from farms, leading to an aristocratic class (not everyone has to work the farms) and city growth, and ultimately leading to Industrialism. Most of the effects are designed to encourage land improvement and large population. (You might think, who wouldn't want that? But the alternatives will be pretty attractive too. Its polar opposite is another branch, which I won't name now, but think of elves living in harmony with nature with smaller populations but very powerful boosts to compensate.) So what do I call this branch? I currently call it Agrarianism, but in fact, the technical definition of that is almost the exact opposite of what this branch does (same for Agriculturalism). I don't like Agricultural Revolution. Some other policy branches that will be in initial release are: Militerism, Scholasticism, Commerce and Slavery. I thought of Urbanism but that doesn't sound right. It's possible I will stick with Agrarianism because it sounds right even though it is technically not. But an alternative would be nice.
 
Back
Top Bottom