[RaRE] RaR Extended: a combined modmod for the RaR modification

This may come as a surprise, but I would need to get your login name in order to add you ;)

I use the name agnat86 as well on sourceforge. Here is a link to my profile: https://sourceforge.net/u/agnat86/profile/

Sourceforge provides a command line to clone and this confuses lots of inexperienced people.

The first part is telling git what to do, the bold part is the URL while the last part is the name of the directory to use. You only need to use the bold part, but many people copy paste the bold and the last part.

Also log in to SF first. You should use an url with your username in front as this is required if you push changes back to the server once you gain access.

I don't quite understand. Logging in to SF does not change the URL that is given there. Do you mean I should wait until you've added me to the project before I clone it and add a new branch, or do I have to put my username into the URL somewhere?
 
Your personal URL should be
ssh://agnat86@git.code.sf.net/p/religionandrevolutionextended/code
Also you have now been added. There is RO and http buttons in the line with the URL. When you have an account in the project, an RW (read/write) option appears. As it turns out, it's hidden when you don't have access to the project.

Http would work too, but it transfers data slower. It's a more inefficient protocol, which is kept for firewall compatibility only.
 
I was asked to come with my idea for my way to improve balance and to limit exponential growth in RaR(E). Maybe we can discuss and work together to implement some of it.

The basic idea is to use petty criminals as negative units (that are making crime instead of just being poor workers).

When a city is founded a "hideout" building is automatically created with two vacant "jobs".
This is the only building that petty criminals can work in - no field work either (like slaves previously not being able to work in the city hall). Petty criminals cannot be removed from the city and will spawn somewhat randomly.
when a petty criminal is inside the hideout it takes some of your materials, gold and consumables each turn (making crime). That way they will upgrade the hideout to larger criminal buildings like a "slum" or gangster mansion etc. They also produce negative "crime points " (skulls) like ff points that when accumulated results in negative events.

The amount of crime and petty criminals that spawn possibly depends on:
• The number of cities you have
• Game difficulty level
• The building development of the cities relative to size. (cities with no building infrastructure are low justice and will therefore accumulate a lot of crime). (This is also a balance feature to avoid extreme expansion (did anyone say the Spanish?))

Petty criminals via learning by doing become more effective specialists-> bandits -> gangsters -> gangster lord etc.

The only way to keep the crime level in control is by making a sherif house (village) which can be upgraded to jail (town) -> prison etc.
When new unit: sherif/ statesman work here they can create justice points which when accumulated allows you to execute ie. delete a criminal from that city.
When you make a prison you can move criminals there and they will actually be productive (making eg. hammers/ cloth/ tools). Slaves could also be productive in the prison if you lack criminals.

This could make the game a lot harder on the upper difficulty levels (needed) as all your goods and gold could get robbed if you play badly.
It should be consistent with American history and atmosphere including death penalty, bandits, train robbery, lawlessness etc.
As I can see it, this does not require completely innovative programming even though there clearly is some stuff to do.
 
Given the complexity of this idea, time spend on making the game more difficult on harder levels would be better spend on teaching the AI new tricks to make it more competent. As difficulty becomes harder, the AI "cheats" and can build faster and such (vanilla concept dating back from civ1). However right now natives benefit more from this than Europeans and at higher difficulty levels, the European AI players do worse due to being held back by natives. It is a stated goal to make the European AI better to solve this problem. However AI code isn't the easiest code to mod and nobody works on it right now AFAIK.
 
You are right that would be a cool thing. To me making some new buildings and units seems like a much more "linear" hence feasible programing task than creating smarter AI.
 
but that is not what you are asking for.

In your plan you have building, units, a spawn mechanic, an auto/locking placement, 2 new virtual yields, UI elements, an execution event with the ability to select a victim, AI code to use it...

That is not even a comprehensive list.

A whole lot more than just making some buildings and units.
 
I like Lethiel's idea about improving criminality, however I agree as well the proposed way to do so is too complex.

Criminality already appears in the game in 2 ways:
- riots: when a city isn't guarded and reaches the population of 5 or so, uprisings will happen.
- fleeing: petty criminals or slaves can leave the colony and become "outlaw".

Those mechanisms seem good to me, however, it's very easy to solve them. Considering riots, you only need one town guard and your riotting problems are solved forever. Your city won't riot again even with a population of 90. Considering fleeing, I generally solve the issue simply by not acquiring units which could flee. Slaves are more of a pain than anything else, so if I happen to get some, I just get rid of them. As for petty criminals, I rarely got some and generally put them at school.


There is maybe room here to make the game more interesting without necessarily adding new concepts.

An idea could be that the bigger the city becomes, the more guards would be needed to avoid riots. For instance 1 guard is enough for a city of 5, but 2 would be required for a city of 15, 3 for a city of 25 and so on (that may be too much but then we can imagine larger steps, that's a balance issue).

Furthermore, the riot problem is currently self-solved. If you don't add guards, the number of rioting turns is limited anyway, and a settler militia can even pop up to curb the issue definitly. Now we can imagine that riots would never just stop without consequences: either it would generate a settler militia, or one citizen (regular or specialist) could turn outlaw. And instead of just fleeing, he would attack chariots (a bit like privateers at sea).

This seems to be more in line with the game athmosphere. If we explore deeper the idea, we could imagine that the outlaws could steal horses or guns and have the profession "bandits", but they would be so as "barbarian" outside colonies, not as your own citizens. Maybe even the simple fact there's a stock of guns or horses in your settlement would increase the probability to generate outlaws, and increase the need for military protection (alright I'm getting far :D).

Of course, the direct gameplay consequence is that the player would be required to distribute more evenly his troops in his settlements. But I'm not sure it's necessarily a bad thing.

What do you think about this approach?
 
Alright, an interesting discussion popped up in the RAR feedback thread:
http://forums.civfanatics.com/showthread.php?p=14184898#post14184898

I'm bringing it here as this is more in line with RARE.

I'm struggling so much to find a school spot for my free colonists that I've been thinking about adding a "search school" button to make them find the nearest free spot. But before asking you to do so, I wanted to know if I was the only one struggling with that issue. And apparently that's the case. :lol:

At some point I proposed a system where you could automate a colonist to "goto school". They should then move to colonies with active schools and fortify. Once a unit leave the school, an automated unit automatically enters the now vacant school slot. The automation should then make the colonists spread evenly between the school colonies.

I never started because ray didn't like the idea. However I'm free to do what I want with RaRE. Thanks for reminding me :)

I have 26 colonies and I already work with a second computer to track my needs of specialists on an Excel sheet.

I would like an ingame "spreadsheet" to remember something like that, but I haven't quite figured out how it should work. Whenever somebody mentions it, I ask "what do you want ingame?" and fail to get any real answer :(

The teaching list is kind of helpful for something like this, but it's not that great for "inter colony education". It's great in case you know you need 2 blacksmiths and one miner at colony A and farmers from all other. I had that requirement and because I paid attention to the pirate, which caused problems when the education was finished, I ended up with 3 miners, no blacksmiths and no farmers. The teaching list solves that problem, but it doesn't help you figuring out which colony needs which specialist.

One other thing about making an ingame solution to the spreadsheet. If it is done right, the AI can use it to figure out what to train and possibly move existing experts around to make better use of them. We would still need to figure out how it should work, but it could make the AI more productive.
 
Alright, I've worked a bit on the concept about how we could automatize a "specialists production" process.


To limitation of the currently existing teaching list is that you often needs specialists that can't be produced within the city (lack of college/university). On the other hand, cities with universities are usually mature and don't need tons of new specialists. Hence the need for an inter-city system.

Here is my proposal, we replace the teaching list by a more general list in which we would define the needs of specialists within the city. I've edited an image to illustrate how it could look like:


click to enlarge


When we click on "define specialists needs", a window pop-up with the lists of specialists. For convenient reasons, I would personally go for a grid-like list, a bit like the one used in the worldbuilder (but that's a detail). When we add a specialist, it gets loaded in an order books which would appear a bit like the list of imports and exports (see the screenshot to get an idea).


Now, once a student is trained, a window pops up to make us pick the speciality. I would directly make appear the needs of all cities in that list. Here's a screen to get an idea:


click to enlarge


For instance, below the line "Expert Miner", there would be an extra-line "1 needed in Saint-Louis" so that we would immediately know where the specialists are needed. If we would click on it, not only the unit would become an expert miner, but it would also directly move to the city of Saint-Louis.

If another student is trained, the need wouldn't appear anymore (as one specialist is already on his way). And if we would check the list in the city, we would see that the specialist is indeed on his way. It's only once the specialist arrived in the city of Saint-Louis that it would automatically disappear from Saint-Louis order book.

So for instance, the list could look like this once we check within the city:



Of course this looks simple like that, but I'm well-aware this would require a lot more deep-thinking. But what do you think about the general principle?
 
There is maybe room here to make the game more interesting without necessarily adding new concepts.

An idea could be that the bigger the city becomes, the more guards would be needed to avoid riots. For instance 1 guard is enough for a city of 5, but 2 would be required for a city of 15, 3 for a city of 25 and so on (that may be too much but then we can imagine larger steps, that's a balance issue).

Yes, I can see that working. One concern that I do have, however, is that by linking this to city size, it becomes very similar to how the Health system is working, a feature that was added as well to slow down the exponential growth of colonies. I would suggest to make "criminality" a parameter that is dependent on various factors in addition to city size alone, for example:
- Liberty Bell production (more resentment against the king results in more riots)
- Cross production (religion as a tool to keep bad people in check)
- Food production (hunger riots when food stores are running low)
- Health rate (societal collapse during epidemics)
- The population itself (more specialists --> less criminality, more forced labor units --> more criminality)
- Domestic market (scarcity of certain goods may result in black markets)
- Wars/native raids (attacks on settlements result in people feeling unsafe and taking the law into their own hands)
- Presence of valuable goods in storage (attracts criminals)
- Many colonists joining a settlement in a short period of time (citizens don't know each other --> less community cohesion --> less social control)
- Cultural influence over settlement plot and adjacent plots (when your civilians do not see you as their rightful leader, they are less willing to obey your laws)

Of course, these are just possibilities, but when criminality would depend on factors like these, it would slow down larger settlements in particular without becoming too similar to how Health works.

Another twist might be to add some positive effects to criminality as well, like reducing the cost of hiring pirates and smugglers.

Furthermore, the riot problem is currently self-solved. If you don't add guards, the number of rioting turns is limited anyway, and a settler militia can even pop up to curb the issue definitly. Now we can imagine that riots would never just stop without consequences: either it would generate a settler militia, or one citizen (regular or specialist) could turn outlaw. And instead of just fleeing, he would attack chariots (a bit like privateers at sea).

This seems to be more in line with the game athmosphere. If we explore deeper the idea, we could imagine that the outlaws could steal horses or guns and have the profession "bandits", but they would be so as "barbarian" outside colonies, not as your own citizens. Maybe even the simple fact there's a stock of guns or horses in your settlement would increase the probability to generate outlaws, and increase the need for military protection (alright I'm getting far :D).

Of course, the direct gameplay consequence is that the player would be required to distribute more evenly his troops in his settlements. But I'm not sure it's necessarily a bad thing.

What do you think about this approach?

Bandits could work. One thing I would still like to see in this game is better "Barbarians" on land, like independent native raiders or outlaws from your own colonies.

On the issue of which units are able to turn outlaw, I would suggest to make a distinction there between the different societal classes, similar to how the demand for goods on the domestic market varies among different specialists. I can see a Free Colonist turning outlaw, but a Famous Nobleman would feel weird.

I don't know if it is a good idea to make the strength of outlaws dependent on the presence of guns and horses in their home colony. That might result in too many outlaws not finding any and just wandering around like escaped slaves. A possibility might be to create a new "Outlaw" profession that is only available to colonists controlled by the barbarian player and does not require any yields, which gives them a strength of 2 and the ability to attack so they can harass colonists and transports, while being no match for most military units. This would also create an extra disadvantage in using too many slaves, as this would result in more dangerous outlaws.

Alright, I've worked a bit on the concept about how we could automatize a "specialists production" process.


To limitation of the currently existing teaching list is that you often needs specialists that can't be produced within the city (lack of college/university). On the other hand, cities with universities are usually mature and don't need tons of new specialists. Hence the need for an inter-city system.

Here is my proposal, we replace the teaching list by a more general list in which we would define the needs of specialists within the city. I've edited an image to illustrate how it could look like:


click to enlarge


When we click on "define specialists needs", a window pop-up with the lists of specialists. For convenient reasons, I would personally go for a grid-like list, a bit like the one used in the worldbuilder (but that's a detail). When we add a specialist, it gets loaded in an order books which would appear a bit like the list of imports and exports (see the screenshot to get an idea).


Now, once a student is trained, a window pops up to make us pick the speciality. I would directly make appear the needs of all cities in that list. Here's a screen to get an idea:


click to enlarge


For instance, below the line "Expert Miner", there would be an extra-line "1 needed in Saint-Louis" so that we would immediately know where the specialists are needed. If we would click on it, not only the unit would become an expert miner, but it would also directly move to the city of Saint-Louis.

If another student is trained, the need wouldn't appear anymore (as one specialist is already on his way). And if we would check the list in the city, we would see that the specialist is indeed on his way. It's only once the specialist arrived in the city of Saint-Louis that it would automatically disappear from Saint-Louis order book.

So for instance, the list could look like this once we check within the city:



Of course this looks simple like that, but I'm well-aware this would require a lot more deep-thinking. But what do you think about the general principle?

I think that looks awesome, I like it. If you can make this work, it would be an excellent addition to RaRE in my opinion.:)
 
I think that looks awesome, I like it. If you can make this work, it would be an excellent addition to RaRE in my opinion.:)
Oh wait, unfortunately I'm not a developper. I was only brainstorming for Nightinggale who wanted to get an idea about how a list of needs in specialists could work in-game. We're totally reliant on him to make this become reality.


Yes, I can see that working. One concern that I do have, however, is that by linking this to city size, it becomes very similar to how the Health system is working, a feature that was added as well to slow down the exponential growth of colonies. I would suggest to make "criminality" a parameter that is dependent on various factors in addition to city size alone.
I totally agree with you. It shouldn't be redundant with the concept of health already in use. And I like a lot your list of events which would trigger or increase the probability of an uprising. I like actually everything you proposed. Just like for the first point, we would need Nightinggale's feedback in order to move forward on this.

Bandits could work. One thing I would still like to see in this game is better "Barbarians" on land, like independent native raiders or outlaws from your own colonies.
Yes, I agree. That could be great for the gaming athmosphere. The bad thing though is that Schmiddie was RAR graphist and he has retired of modding now. I'm not necessarily convinced, but here's what I could find after a quick search on the website:
- Old Western Ranger
- Mounted Ranger

 
I'm not sure I like the idea of scaling the need for defense. If you have a city with 25 people, chances are that you want to protect it from raids anyway.

The screenshots look awesome and are of a far better quality than anything I can do for fake screenshots. The last with the text list of the needs is fairly easy to implement once the data for the list is available. The other two aren't equally easy by being just copy paste of some vanilla code. However the precise details of the display is not the main issue here.

If the AI is to use this feature, it should be something, which can set itself while you aren't looking. Say we set in profession XML which unitclass we would want to perform the profession (ore mining->expert miner and so on). Maybe this can be autogenerated, but setting this in XML will use less CPU cycles and I want to avoid making the AI noteworthy slower than it already is.

For each profession:
  1. Number of experts working that profession
  2. Number of experts not working that profession
  3. Number of non-experts working that profession
  4. Shortage of experts for that profession (not counted, but calculated by subtracting 2 from 3)
I'm not sure we need #1, but it might be useful since the game already counts the number of units you have of that type in the new world. Maybe we can skip a lot of counting if we just use the right math on existing numbers.

Schools should then train the number from #4. The teaching list can get a checkbox, which makes it train whatever it can from the list without asking. The popup where you are asked for which profession to pick could be modded into displaying the number.

New automation: unit goes to a city where the expert in question is needed. It disables automation once it reach such a city. Units could start like that if trained by a school where the checkbox is set.

City billboards could display some icon if it could improve production by moving colonists around (expert miner isn't the one mining ore).

One cool feature (which might not be doable) is that whenever you select a new unit/group, city billboards update and displays an icon if the city could benefit from the chosen unit(s). To do this, we would need to locate a function, which is called whenever a new unit is selected.

Once the unit count is done, the numbers can be added to the domestic advisor.


I think it would have to work something like that, at least if the AI should have a chance of benefiting from it.

We're totally reliant on him to make this become reality.
:hide:
 
Thanks Nightinggale for your answer. It seems though we don't have the same understanding of the way the programming would work.

From my php/MySQL background, I was imagining a new table for "needs" which would be created. Then when we define needs, we insert new lines in that table. And the data of that table is altered according to events: a new unit is trained, the unit arrived at destination. I'm developping a bit for the web, and that's how I would do it if someone would ask me to implement a similar idea in a website.

But from what I'm understanding, you don't see such a table. Obviously, you're thinking about calculating things using existing variables.

If the AI is to use this feature, it should be something, which can set itself while you aren't looking. Say we set in profession XML which unitclass we would want to perform the profession (ore mining->expert miner and so on). Maybe this can be autogenerated, but setting this in XML will use less CPU cycles and I want to avoid making the AI noteworthy slower than it already is.

For each profession:
  1. Number of experts working that profession
  2. Number of experts not working that profession
  3. Number of non-experts working that profession
  4. Shortage of experts for that profession (not counted, but calculated by subtracting 2 from 3)
Those calculations are done in-game when we open the "military advisor" screen. In an advanced game (with something like a thousand units), opening that window freezes the game during 5 seconds the time to do the calculations. If this operation is supposed to be performed several times by the player and by each AI, this could significantly slow down the game.

With the use of a table, the calculations required would be significantly reduced, as data would simply be "stored" and picked up. I don't know if there's such a system of table in the game but I assume there is necessarily otherwise how could work things like trade routes? Are all things really calculated all the time? Nothing is never stored?


I think it would have to work something like that, at least if the AI should have a chance of benefiting from it.
If it's possible to generate a table (now I'm sure of nothing), here's how I would do it.

Each city determines its needs of specialists (for instance, the AI could simply collect the professions in the city which are currently not done by a specialist and that's good enough). Then that data is stored in a table which would look like that:
Code:
[B]Specialist	City		On his way[/B]
Lumberjack	City A		0
Blacksmith	City A		1
Tobacconist	City B		1
Carpenter	City C		0

Then, when a specialist is trained, it will pick one between those having "on his way" as "0". We don't really care which one (ideally it would be the nearest city, but probably that value doesn't exist), but once it is trained, then the table would be altered to write "1" at "on his way" and it would immediately go to the corresponding city in which the need was expressed. It wouldn't need to calculate anything again, simply used stored data. And once the unit arrives at destination, the line is deleted.

For the AI, we can imagine that at every turn, it would check the list and only insert a new line if a new unit comes in. The difficulty though is that as I recall, the AI recalculates professions of all its citizens at every turn, but that's another topic.

Anyway, do you understand my table idea? Is such a system of tables used in-game or does it calculate absolutely everything everytime the way you've described?


No please don't! This is getting interesting. :)
 
Note: this post use city and colony interchangeable and they are indeed the very same thing. They are called colonies ingame, but the C++ code is mainly reused from civ4 and they are called cities in the code.

Those calculations are done in-game when we open the "military advisor" screen. In an advanced game (with something like a thousand units), opening that window freezes the game during 5 seconds the time to do the calculations. If this operation is supposed to be performed several times by the player and by each AI, this could significantly slow down the game.
Those calculations are done in python, which is significantly slower than C++. However just the task of transferring the current profession variable from memory to the CPU would be way too slow, meaning it's already too slow even before the CPU starts to calculate.

With the use of a table, the calculations required would be significantly reduced, as data would simply be "stored" and picked up. I don't know if there's such a system of table in the game but I assume there is necessarily otherwise how could work things like trade routes? Are all things really calculated all the time? Nothing is never stored?
The answer to this can be reduced to just a single word: cache
It's more or less as you say. If the calculation results in the same answer each time, the answer can be calculated once and then stored for quick access. The problem in using a cache is that if say the cache is the sum of 1000 numbers, then if any of those changed after the cache was calculated, using the cache would result in an incorrect number, which then results in a bug. This mean the cache needs updating and doing that whenever it's needed and only when it's needed can sometimes be somewhat tricky.

I think the best example of a good cache is one of the first thing I made as a modder. I cached the yield requirements for professions. Vanilla calculates this each time it's needed, with trait and FF bonus and whatever. I spotted this to be slow, calculated it once and for all and the AI reduced the time it needed by 17.5%. The cache needs to be recalculated, but I think it's only when the player gets a new FF and only if a yield cost modifier is different from 0. Really rare event (perfect for a cache), but coding this was far from trivial.

You mentioned traderoutes and particularly that part of the code is actually quite slow. It does in fact loop all of them, look at the city stock and stuff each time a fully automated transports has to decide what to do. I would love to improve this part, but I just don't have any idea how to do it. Caching data would be pointless as colonies change their stockpile way too often.


What we should do about units/professions:
My plan is to figure out how the numbers should be used and how to calculate those. They would be calculated on game start or game load. While the game is running, the numbers would have to be updated, but a partial update can be done. For instance the unit function to change a profession would subtract one of old profession and add one of the new.

If it's possible to generate a table (now I'm sure of nothing), here's how I would do it.

Each city determines its needs of specialists (for instance, the AI could simply collect the professions in the city which are currently not done by a specialist and that's good enough). Then that data is stored in a table which would look like that:
Code:
[B]Specialist	City		On his way[/B]
Lumberjack	City A		0
Blacksmith	City A		1
Tobacconist	City B		1
Carpenter	City C		0
C++ allows organizing memory precisely like we want and we could implement a table structure if we like. However I would prefer a simple array structure. It's a list of number and it has one number for each profession. If you want to know how many lumberjacks you have, you look up lumberjack and say it's the 7th in the xml file, then you read the 7th number. It's easy to code and extremely fast at runtime. When the "key" is location, there is no need to search and no need to read data to detect that's not the one you search for.

Your example with "already in city" and "on his way" could be implemented as two arrays. It could also be one, where each element is two numbers. For now, we could call the data structure tables and pretend some SQL design if you think that's easier. It will not be 100% like that when implemented in C++, but that's not important right now.

I think the easiest solution to handle is to store the arrays in the city object. This will automatically create one list for each city. It would likely be a good idea to have a similar list in the player object, which stores the combined values from all cities.

For the AI, we can imagine that at every turn, it would check the list and only insert a new line if a new unit comes in. The difficulty though is that as I recall, the AI recalculates professions of all its citizens at every turn, but that's another topic.
I'm thinking of modding the AI profession selection code to do something like this:
  • loop though all units in the city with the profession in question
  • if one is found, which isn't an expert, kick the unit (A) out of the city
  • insert expert into the slot left free by A
  • tell A to find best profession
If no unit is found or the unit isn't an expert, use the current code to determine a profession.

I think this would be an improvement. However it's not perfect and it would require some thinking, like don't place a blacksmith as a blacksmith if the colony is out of ore.

Alternatively finding the best profession would include the ability to kick out an inferior unit. There are multiple ways to handle this issue and it's a problem I will leave for later.
 
C++ allows organizing memory precisely like we want and we could implement a table structure if we like. However I would prefer a simple array structure.
Yes! An array! :goodjob:

This is precisely what I had in mind. The SQL tables we use in php/MySQL are nothing else than bidimensionnal arrays. Now of course, C++ is a core code. Php is only a dumbed-down version of C++ for people like me, very convenient though for web services. I don't doubt we can organize things more efficiently in C++.

I think the easiest solution to handle is to store the arrays in the city object. This will automatically create one list for each city. It would likely be a good idea to have a similar list in the player object, which stores the combined values from all cities.
Yes, I agree that's the way to go. :)

I'm thinking of modding the AI profession selection code to do something like this:
  • loop though all units in the city with the profession in question
  • if one is found, which isn't an expert, kick the unit (A) out of the city
  • insert expert into the slot left free by A
  • tell A to find best profession
If no unit is found or the unit isn't an expert, use the current code to determine a profession.
I see your point.
Indeed, that could improve the way the AI manage its colony. Considering it's a lot of work with potentially strong consequences withing the game. It's important to get an idea about what would be the necessary steps for this.
 
I think this would be an improvement. However it's not perfect and it would require some thinking, like don't place a blacksmith as a blacksmith if the colony is out of ore.
Unfortunately it's more complicated than that.

Several months ago, I've done some testings and that's what I observed. The AI won't be interested in assigning the profession "lumberjack" to a lumberjack. I think that's because lumber doesn't make enough money, so instead of producing 10 lumbers, it's more profitable to produce 5 sugar canes. There is a XML parameter which "guides" the AI in the strategic importance of yields, but if you change it to make lumber more important, then the AI will do exactly the opposite and produce lumber like a freak. Tobacco planters would then be used to produce lumber instead of tobacco.

As I told then, I believe the problem is that the AI doesn't care about the value of the yield once transformed, it takes it for what it is and that's all. On the other hand, the Human player appreciates the production of raw yields only according to the transformed yield that it would allow to generate.

As such, when as a Human we found a city, we consider it important to produce 6 lumber because that's what a carpenter can change into hammers, but producing more lumber doesn't have any interest for us. We actually adjust our production of lumber according to our transformation capacity into hammer. I believe that's exactly what is missing for the AI: the ability to judge the 6 first units of lumber as being more important than the extra units of lumber it could produce. The ability to produce raw yields for the purpose of transforming them.

Do you see what I mean?
But maybe that would be uselessly complicated. :dunno:
 
We have two problems:
  • AI avoids certain professions as it fail to see how it benefits from the yield
  • AI doesn't exploit the bonus from experts because when it decides on a profession, there is no code to say which unit to perform the profession. Because of that the unit becomes a semi random one
It's two problems and we should have two solutions. Our human mind trick us and tells us they are related, but they are entirely different issues from a programming perspective.

Your solution with stockpiling lumber isn't that bad. We could do the same to raw materials. If the colony stockpiles 6 cotton, the AI might see the point in weaving and so on. I'm not sure 6 is the correct number, but that's a minor detail. RaRE has the ability to set minimum required yields to what the production requires. If a building requires 20 tools, the colony wants 20 tools. The AI benefits from this and will not move tools away if they are needed for the current construction. As it turns out, the RaR AI wouldn't mind selling all the tools to Europe and then stall building production due to lack of tools.

M:C has a system where this minimum takes buildings into account. 2 weaver slots and 3 cotton for each makes 6 cotton. If it is set to stockpile for 5 turns, it will stockpile 6*5=30 cotton. In fact it will even import from other colonies if set to do that, which would allow having prime cotton in one colony feeding a textile mill in another. The idea is that the AI should handle yield management way better, but I can't remember ever making the AI stockpile for more than the default 0 turns. I sort of left it half finished and a player only option right now.
 
On another note, I use a little technique which considerably helped me to manage my chariots: rename them according to their mission!

Thanks to this, a simple mouse hover is enough to figure out what the cart is doing. If the cart mission is stopped by a danger, then a quick glance on its name is all I need to figure out what mission should be reattributed. And similarly, if all of a sudden I see a cart in an area it is not supposed to serve, I can immediately check and correct the mistake.


The only problem is that I need to open the world builder in order to give a custom name to my units (I haven't figure out how to do it otherwise). Hence the idea of a little modification: maybe we could add a button "rename" which would allow to do so directly in-game.

I don't know if that would require a lot of work, but at least the idea looks much easier than reshaping the AI. :D
 
In vanilla, if you hover the mouse over the unit type name in the bottom right (when it's selected), the popup tells you that you can click to rename. If you do, you get a text field you can enter a name in. I think it works in RaR/RaRE and I think it is what you ask for.

It's a good idea btw. Naming transports to make them more unique. Not needed if you use fully automated, but quite useful for manual setup.
 
[*]AI doesn't exploit the bonus from experts because when it decides on a profession, there is no code to say which unit to perform the profession.

That is not correct.

There is code to determin the best unit for a certain profession.

If AI does have the choice between the corresponding Expert Unit for a Profession and another Unit, it will choose the Expert Unit for that Profession.
There is logic to find the ideal Unit/UnitClass for a Profession.

Also, AI will judge by amounf of output a Unit can produce as well.
So it will also figure out that a Free Settler is better than an Indentured Servant for example.
And it will figure out, that a Expert Hunter should better hunt, than do fishing, if both professions are available.

Thus it will not completely stupidly waste Experts in other Professions.
(Might still happen occasionaly if the Experts Profession is valued very low or simply not available in the city or a city nearby.)

The code for determining the Unit to use for a Profession is actually not that bad.
AI is simply not as good as a human Player when employing its Expert Units because it often values the Professions too low. :dunno:

Second big problem for AI is, that it does not really know how to handle Experts that it currently cannot employ.
AI is simply not able to develop its strategy proactively. It is heavily reacitve.

So it will not create a city in a suitable place to exploit the Experts specialty or build corresponding new buildings just to make good use of Experts.
Human Player will make such strategic decisions of course.

Third big problem for AI is, that it is not really good at hiring / buying / training Experts.
That is probably the part, where improvements could be done with quite reasonable efforts.
 
Top Bottom