Gedemon's Civilization, development thread

About optimization of the table, I knew that I'll had to do it at some point, but it could already reach a million entries in the late game and took more than 10 sec for serialization and check... on a small map.

Now it's back to 0.3 seconds, much better.

Oh, good. I thought my 7 year old MB, CPU and memory were finally bound for the attic :D
 
Note that there is still a lot of lag when scrolling the map during the AI turn, not sure if this can be fixed.

Having fast combat/movement OFF helps a bit.
 
I'll keep some as they are (airport, space port), I think that I'll keep all commercial, cultural and scientific buildings in the city center, but I'd like to be able to expand the city center on adjacent tiles (with a limitation on the number of buildings in a city depending on the number of "expansions")

I'd like to have early military and production buildings in the city center, but also keep the corresponding districts for industrial and later ages buildings.

That sounds about as amazing as everything else in this mod...

Wish I had the knowledge to help you out.
 
Small update on GitHub:

convert Food consumption to the "Population Needs" code
prevent production of Food surplus during Food rationing

The cities growth should be less chaotic with this new code.
 
Any help is welcome of course :)

I have a global vision, some precise ideas, but a lot is still in the design phase. And on the coding side, some things may not be possible until we have DLL access.

As I said, I'm actually looking for feedback on how it plays actually and how some mechanisms may broke (or may be exploited), instability issues (I still have crashes during may autoplay ATM, still linked to city capture I'm afraid) and if the UI is providing enough information.

Discussions on what's planned (and how to implement it) will also help, there is a very rough draft called "concepts.txt" in the mods folder, where I've put ideas, notes about coding and other stuff.

Some are already (and differently) implemented, some won't make it at all, and some will change completely the moment I'll start coding them...

Help on the code itself is also welcome, I'm not a programmer myself, I've learnt by modding since years, and I'm still learning new things every day so I won't get mad if someone told me that parts of my code are dirty hacks (well, not very mad) or why I've done this instead of that

We'll need artists once we start selecting buildings, units, policies, techs, and other stuff specifics to the mods.

Help on UI design/coding, that's really not my thing.

Help on the Artdefines and how to use them for the mod (alternatively I have plan to try to use the ability to add assets on the map using Lua)

Some possible subject to discuss:

health/diseases : I've started collecting ideas on it in the concepts document, I have a rough vision on how to code it, but nothing's fixed yet

slavery : I'm still pondering how to manage it, war prisoners ancient/classic eras, but after that ? slaver civilization capturing civilian units (or raiding cities) to "sell" them (as another resources in the economic background sim) ? Indentured servants when reaching some era, as a first way to move populations (migrations is also a mechanisms to discuss, could be based on needs - also a big subject of discussion - and ability to pay the travel for a population class) ? That also include the ideas of manpower and in later era energy grid...

economy/budget: getting money from import/export, but paying when actually using the resources to train units or create buildings. sliders for budgets ? effects ?

There is really a tons of ideas that I'd like to put in this, I could spend hours writing about them, but then I wouldn't have any time left to code them. Still, discussing them is a good way to anticipate possible problems when actually adding them in the mod.
 
Last edited:
(copied from MP to continue discussion here)

I've taken a quick look through your concepts document. I keep seeing your ideas that are nearly exactly in line with ideas of my own! I'm not sure how much I put in my economy topic idea but I'd like to share what my current idea for that is. I'm not saying you should do it this way, but if you like where my head is at, let me know!

So, you've given populations real numbers and with that, we have so many possibilities. I love that you're thinking about tax rate and you've split the citizens into upper, middle, lower and slave which is exactly what I would have done too.

You did mention that you're not sure what to do with the slaves or how to get them. Here's my idea: because cities have an actual number for their population, it makes sense that settlers have a number as well, so when you produce a settler it subtracts 1000 people from the city to produce the unit. That gives us another possibility though: maybe settlers don't just have to found cities, maybe you can move a settler into a city tile and have them JOIN the city. There is precedence for this: 150+ years ago, I know for a fact that many European countries would advertise for citizens to ship themselves over to the new world to grow the cities. Waiting for population to grow naturally is very slow, and this is a good system to do that.

We may have to question if that means a settler should have more or less than 1000 people or if that number can vary over time. However, it makes sense that if a city grows in population very quickly, that would be bad: doubling your population overnight is a nightmare for public infrastructure, housing, etc. Basically, if you try to use settlers to grow small cities quickly, that should generate amenity problems. Theory-wise I expect you could keep track of the population your city can support and based on how fast cities grow naturally, you can decide the margin of error for that number, meaning if cities grow at like idk 5% population per turn, the city would be able to support mayber 10% more people than it currently had without amenity problems. If the amount of people it could support was too low, it would increase gradually (during which time you'd have amenity problems).

Now, this is where slavery comes in: when you raze a city or make peace with another civ, either side can ask for slaves from any of the cities that the other player owns. The slaves are sort of a resource that you can assign to your own cities or trade to other players for gold (the African slaves brought to the new world were bought from African countries. The countries that sold the slaves got them from enemy tribes that lived in-land: when one group defeated the other, they would take all the warriors of the losing tribe as slaves to take away their military strength. They then sold the warriors as slaves to Europeans).

Slaves don't create amenity problems for a lack of infrastructure. On the other hand, they don't provide any taxes either. I'm not sure how you plan to handle taxes.

While I'm here, I guess I can talk about my thoughts on taxes: each type of tile improvement can have jobs for the three classes of people: low, middle and high. For example, a farm might have 95% jobs for low income and 5% for high income. This seems likely for earlier or middle eras where peasants would often work land owned by a noble. Mines may have 70% lower class, 25% middle class and 5% higher class. I imagine that mines have more management, people that direct the miners by telling them where to dig and when to support the walls. Unlike farming, mining requires cooperation and so there must be people assigned to coordinate it.

If the tiles you work determine the types of jobs that are available, that can help determine the class structure of the cities. The total "wealth" (not sure how to calculate it, but likely related to sources of wealth like tiles and trade) is divided among the population. Each class produces more taxes than the classes below them. Even though slaves don't get paid, they DO subtract from the total wealth of the city (so if all your lower class jobs were done by slaves, there WOULDN'T be more money for everyone else, because they'd still count for that) because even though the labour is free, they aren't able to buy anything or own anything which is also a source of taxes.

In summary, my goals are to have a class system that is determined by the types of jobs that people work in, and therefore how much money cities can generate. If we are able to replicate the industrial revolution properly, taxes will go up significantly when that happens because cities won't have to work as many farm tiles to produce enough food. Instead, those citizens can work in districts such as factories which have a higher wealth for each worker and therefore generate more wealth for the city. The other goal is to implement slaves in a way that works well with the class system: slaves can only perform low-class jobs but can be used to quickly increase the tiles small and new cities can work without waiting for cities to grow naturally.

I'll try to avoid new actions (like joining a new city) at this point because of the AI (to code), the (absence of) network command and the need of a new UI element (to code)

But yes Settler will take personnel (who are drafted from a city population) and materiel corresponding to a size 1 city when its build.

Migration of population (when available in renaissance eras ?) could be done along trade routes like the resource in the actual version, but with a transport cost (like the resource, again, but this time to determine if a population type can migrate), it could be "forced" using projects, converting a ratio of the lower class to indentured servants (slaves) moved to a new city with a (less important) conversion rate from slave to lower class in the destination city.

"Needs" will replace amenities to determine stability.

City growth is based on birth/death rates, both based on needs (actually only food and housing)

I have a kind of social stratification model coded, based on buildings only, I plan to have it changed by policies and eras, but your point about the improvements is very good, especially as food is a primordial resource in the early game now. Your point about industrial revolution is also interesting, I can see it working with using "citizen" slots as in the base games (where one citizen works one tile) to calculate how much people works where, and give more (middle/upper class) citizen slots to industrial and later buildings

I plan taxes for Upper and middle class only, the "wealth" of the city is determined by the social stratification, with a lower ratio for lower classes, the lower the wealth, the lower the cost of production in a city, which means that a city with a lot of slaves (with the lowest ratio in wealth calculation) will produce units/buildings at the lowest cost (but generate less income from taxes)
 
I've spend 5 days trying to solve the crashes on city gift/deletion/capture, that's enough. I'm afraid the source code won't be released anytime soon, but with it that the sort of things that could be solved in a few minutes with debugging tools...

The only temporary solution I can think off is to completely prevent any city capture until a Firaxis patch solve it (I usually don't send the automated report when developing mods, but this time I've done it after every change I've made trying to solve this on my side)
 
If it makes any difference, I believe I saw AI player cities change hands in an earlier version of the mod. It would have been a couple of weeks ago, before you started removing districts. I'd have to check to be sure.
 
There may be multiple causes, I'm doing multiple autoplay on small maps/fast speed a bit more civs than default to force crashes ASAP.

Could be districts, could be new buildings, could be new yields, I've had test games working fine without all of those, reintroducing some ATM to isolate the sources of crashes (and the crashes on quit/reload that may be yet another issue)

There is also new errors in the log with the new calculations for needs in my current code, and then cities ending with no population classes, I'm tracking that too.

I'll try to update both autoplay and this mod (with a few error checking) before the end of the week end so you can launch tests games on your side too.
 
Update on gitHub, I'd really like to know if this one is working without any crashes...

deactivate some parts of the mod to prevent crashes on city gift/capture and crash on quit game.
add more debug check
a few bugfixes

also updated Autoplay so that it can be stopped from this mod when a city is captured or when some specific errors are detected to check the logs:
https://github.com/Gedemon/Civ6-AutoPlay
 
I've run several hundred turns (standard speed) on auto without a crash. City capture is happening.

Autoplay is frequently interrupted by diplo screens (blank) that require attention (esc) and manual restart of autoplay. Is there a toggle in the autoplay lua for the break? I had wanted to let it run unattended and look at the log later. I'm having lot of trouble restarting autoplay, figuring out the toggle state etc, but I'm new to it.

Also, what should I be looking for in the log?
 
Just look for "error" in lua.log, if there is none, everything's fine (it has just stopped because a city was captured) , if not I'd like the full log and maybe a save (preferably the oldest autosave, try to set its number at 10)

For those tests, if possible, try to run them without DLC so that I can reload the save...

No problem when saving reloading? (I use F5/F6 a lot for that)

TIA
 
Ok, no errors then. Haven't tried save/reload yet.

I did continue a game manually (from autoplay) and was able to recapture cities and also have them returned in a peace deal.

edit: save/load looks ok, so far

edit: I should mention, there are some of these... "ERROR: ActionPanel received mismatched blocking types"... which I would guess are related to unit stacking and class actions. I upgraded some warriors to Immortals (unique Persian melee class with ranged attack) which were stacked with archers at the time. It was a little goofy until I moved them to separate tiles, after which they could no longer stack. No ill effects though.
 
Last edited:
Thank you !

I've just uploaded a new version on gitHub, the only thing it does is adding new yields to the database (without using them), I had a crash on the second city capture, can anyone confirm ?
 
Crashes confirmed in 2 other sessions, new update on gitHub:

add custom yields tables to prevent crashes on city capture/gift

Should be crash free, if possible I'd like confirmation on your side, I'd like to move on, TIA :D

You'll see 3 buildings in the city production list named TEST_REQ1, TEST_REQ2 and TEST_REQ3, they are just here for testing the bases for the build restrictions, you (and the AI) should not be able to have it, tell me if you see one constructed.
 
Ged, these TEST_REQ* buildings don't show up in the list. Nor can I find any reference to them via the tuner, or by searching the contents of the mod folder. I do see the yields added to gameplay.xml though. Last commit was 53161d9... the yields are the only change.

I'm not getting any crashes though.
 
My bad, the latest version wasn't uploaded...

I'm really interested in the result of your test with the yields, how many city were captured?

No crash on saving/loading?

Can you try to give cities in late game?
 
I have a game going now, no autoplay. Still early, but so far so good.

I'll try gifting. I noticed in the last version that 'cede' wasn't an option.
 
Top Bottom