Select a new civ to play as at the beginning of each era?

johny smith

Deity
Joined
Mar 10, 2007
Messages
2,273
I figured I would just ask if anyone had any ideas on this one. Seeing as there is just too many civs available to add to mods I was thinking about this idea. Basically limit civs per era, but not that each era there is really a brand new civ.

For example perhaps have the Holy Roman Empire only in the Medieval Era then when you reach the Renaissance era you could select say Austria or Prussia. Next in the Industrial Era you could have Germany or Austria-Hungary. Or something like this.

Each new era the player gets a popup to choose what civ they want to play next. I was thinking later if even this could work of adding bonuses for achieving things in the previous era by adding them to the next. I am thinking more of a Roleplay style for the player. Like mini victories along the way. Anyway I wondered if anyone had any ideas on it, or had done something similar already.
 
I forgot to mention you would keep your cities and etc. Just basically swap the attributes to a new civ's attributes. For example new unique units and unique buildings. I should of said that before. I am thinking more of how a civilization changed through time. Like say Roman Republic to Roman Empire.
 
You can't swap the civ/leader itself, that is not provided by the game.
But you can add another civ (if a slot is free), change all the things from the previous civ to the new civ, and kill the old one. I thought, changing is not possible for the human player, but there's a command, which makes that maybe possible.
You would need a new popup for the change, but there's a popup tutorial from kael available, where this is desribed easily (but i guess, the schisma screen from rapture is also a custom popup, so you already know, how to do that).

I have a modcomp on my computer, which does that and is 80% finished, but i don't have the time to work on it for minimum a month :(. Okay, maybe i can put an hour in it this evening, i don't know.
 
:cool: I would love to see what you have. Do you have a popup already? I am very interested in seeing what you have. It does not matter what civs you are using. I could play around with it to customize it more. Thanks ahead of time for anything you can do to make it work.
 
At the moment, the civs/leaderheads are switched dependent on a year number (not era, but that could be changed) to 1 defined civilization/leader, but not for the human (i have to try it out...sigh...so less time :().
The implementation has some issues at the moment:
- The message "Civ XY has been destroyed"
- Open borders are cancelled
- All trades are cancelled
- Either master or vassal status (forgot which one) are cancelled
- I also had a problem with the espionage points, which i've fixed with the unoffical patch, but the reason was my stupid code, i should fix that in a real way.

If i can't do a thing today, i'll attach it here, so you can have a look at it.
 
:goodjob: I mean even what you have done sounds very good. Is it all python or SDK changes as well? I could try somethings on it if you can not work on it, but I have not really tried anything heavy other than screens yet in python. It could be a good learning experience for me. Thanks again.
 
As far as I can see then it would be fairly easy to accomplish what you want. A few simple SDK adjustments should allow changing civ, leader, team etc. by calls to CvInitCore.

Of course there may be other reasons why this won't be quite as simple as it immediately appears, but it is certainly worth investigating.
 
I can use all of the help I can get on it if you are interested. I have not really began work on the code. I just figured I would ask to see if anyone has done it. I am presently surprised that someone has started on it. If anyone wants to give a hand on it I think it would help modding civs a lot to give them a purpose based on the time span that they came about.

I began trying to think out some ideas of a tree on how civs would I guess call it "evolve culturally" although that are not necessary always better. Nor would the links all be there to make perfect historical sense. I was just thinking something better than playing one civ that does not change over 6000 years or whatever.

Well just is an idea at this point. If anyone has any input on the idea I am all ears to it.
 
:goodjob: I mean even what you have done sounds very good. Is it all python or SDK changes as well?

Only python, i'm not good in C++.

I could try somethings on it if you can not work on it, but I have not really tried anything heavy other than screens yet in python. It could be a good learning experience for me. Thanks again.

:lol: and screens are the thing, which i've learned at last. GUI programming is not a thing, i'm very good in.


So, i've again looked at it, fixed some bugs, but the change of the human player doesn't work. It seems, that, when i shift the human to another ID ingame, the AI becomes confused, and the turn is just locked.
Setting one round of AI autoplay seems to fix it, but you know, what happens, if you use that feature without the modded AIAutoplay: Your civ is killed.
Suggestion, what could be tried: Add the BetterAI dll to the mod i've attached, and change this:
PHP:
                                                if pPlayer.isHuman():
                                                        CyGame().setActivePlayer(NewID,False)

to

PHP:
                                                if pPlayer.isHuman():
                                                        CyGame().setAIAutoPlay(1)
                                                        CyGame().setActivePlayer(NewID,False)


Like said above, i've attached the current status, nearly all problems are fixed. Only deal with other civs are not re-established after a change, and it doesn't work for the human (current status: turn lock; old code for preventing this is commented out for testing) [There's also a technical problem with changing all the units/cities {according to this thread, but that can be fixed later}].
To test it, use Ashoka of India (both important) as one player, and play 5 rounds. I've set this: LeaderList.append(["CIVILIZATION_INDIA",-3800,"LEADER_GANDHI",-1]) to test it, so in 3800 bc the indian civ should change to Gandhi (if he's not already leader).

If you look at the code: :blush: sorry, haven't commented very much (okay, nearly nothing), it's messed up a little bit, and at some points more complicated than it has to be (that are artifacts from the work before). But most things should be understandable, it's just moving values from one civ to another one...but this movement is widely spread over the file :/.
For adding an alternative civ/leader choice: I suggest adding a second array for civs/leaders, and let the computer at the beginning of the function do a random descission, out of what array to pick the civ/leader.

I can't code at the weekend, but i'll be only and look in here, if there are any problems.
 

Attachments

that's very creative The_J :)

even though I am a fan of python I would strongly suggest to use SDK for this. If You create a new civ and then copy the information from the old civ you risk to loose a lot of information like warplans, missions and groups of units, etc. Also each time you add a variable to CvPlayer you would have to modify the python file to copy that information. Another issue is multiplayer. In FFH if you create a new player and switch to it as a human the game goes OOS.

why not turn civilization into a variable that you can easily change? just add a CivilizationTypes variable to CvPlayer and modify getCiv in CvInitCore a bit.

good luck with this project, very interesting :D
 
I will try it out and see what I can do. Thanks again.

I hope, it will work :).

that's very creative The_J :)

Hasn't been my own idea ;).

even though I am a fan of python I would strongly suggest to use SDK for this.

No time at the moment, and not enough C++ skill also :(.

If You create a new civ and then copy the information from the old civ you risk to loose a lot of information like warplans, missions and groups of units, etc.

:please: please say, that you've looked at the code. Because i've really forgotten these things :blush:.

Another issue is multiplayer. In FFH if you create a new player and switch to it as a human the game goes OOS.

I guess, that will also happen here, because changing the active player is a function which is used for hot seat, so it interferes with MP mechanics.

good luck with this project, very interesting :D

Thanks :).
 
:please: please say, that you've looked at the code. Because i've really forgotten these things :blush:.
I have looked at the code. I liked how you solved cities by having one player aquire the cities of the other.

But my point is not that what you have achieved isn't finished, a lot of AI information (and some basic information as well) isn't even exposed to python. How would you tell a unit, that it is cargo of another unit in python? Well, maybe you find a way, but even then there is just so much that can easily be missed.

my post was more meant as an inspiration for johny to try a different approach to this. Maybe your approach is the only possible. But I think in this case it is worth to take a look at different ways that make use of the SDK.
 
I have looked at the code. I liked how you solved cities by having one player aquire the cities of the other.

:confused: why did you like that?

But my point is not that what you have achieved isn't finished, a lot of AI information (and some basic information as well) isn't even exposed to python. How would you tell a unit, that it is cargo of another unit in python? Well, maybe you find a way, but even then there is just so much that can easily be missed.

You're sure right :yup:, but i don't think, that will affect the game very much.
One or two rounds with an idiotic AI should not really be a problem. Will probably affect war, but a government change in real life would also do that.

Unit as cargo: :confused: is that a problem? Would the AI not automatically understand that?

my post was more meant as an inspiration for johny to try a different approach to this. Maybe your approach is the only possible. But I think in this case it is worth to take a look at different ways that make use of the SDK.

The SDK is sure the better solution. No idea, why python should be the only way.
 
:confused: why did you like that?
I wouldn't have thought of it. too bad convert exist only on ffh, else you could have used that for units.

btw, you give every unit UNITAI_GENERAL. instead, you should give them TheUnit.getUnitAIType() but that's probably already on your list.

You're sure right :yup:, but i don't think, that will affect the game very much.
One or two rounds with an idiotic AI should not really be a problem. Will probably affect war, but a government change in real life would also do that.
right, it's better to have something working than nothing at all.

Unit as cargo: :confused: is that a problem? Would the AI not automatically understand that?
well, you can try it, but I am pretty sure the answer is no.

The SDK is sure the better solution. No idea, why python should be the only way.
It might be that adding a new player and then copying information is the only way. time will tell
 
@The_J

I am sorry I was busy tonight and really have not had the chance to test in game. I looked at the CvEventManager though. I am going to run it in game tomorrow and see how your changes work.

@ Everyone
I mean I am pretty sure everything could not be done in python, but that is good start for me to search for possibly ideas. I am going to need some python popups as well for sure.

Of course I was thinking of looking into Revolution for some hints as well. If anyone wants to give more detailed ideas I am listening. I mean that about any of suggestions I made. I would not have high expectations on me accomplishing this, but that does not mean I will not try. Thanks again.
 
I wouldn't have thought of it. too bad convert exist only on ffh, else you could have used that for units.

:think: i think, there's somewhere a convert() command.

btw, you give every unit UNITAI_GENERAL. instead, you should give them TheUnit.getUnitAIType() but that's probably already on your list.

No, it wasn't, i've also totally forgotten this :blush:.

well, you can try it, but I am pretty sure the answer is no.

:confused: really? That's annoying :(.
Why do you guess that?
Do you think, that the flushed missions will lead to a recalculation of the descission, which will fail here? Or any other thoughts?

It might be that adding a new player and then copying information is the only way. time will tell

But also that would be better done in the SDK.

@The_J

I am sorry I was busy tonight and really have not had the chance to test in game. I looked at the CvEventManager though. I am going to run it in game tomorrow and see how your changes work.

Well, after seeing through Sephi's comments, what i've all forgotten, i think not very good :D.

@ Everyone
I mean I am pretty sure everything could not be done in python, but that is good start for me to search for possibly ideas. I am going to need some python popups as well for sure.

One generic popup, which is filled with different text, should be enough, i think.

Of course I was thinking of looking into Revolution for some hints as well. If anyone wants to give more detailed ideas I am listening. I mean that about any of suggestions I made. I would not have high expectations on me accomplishing this, but that does not mean I will not try. Thanks again.

Oh, i expect a little bit :D. As senior modder, you should be able to do some things here :).
 
:confused: really? That's annoying :(.
Why do you guess that?
Do you think, that the flushed missions will lead to a recalculation of the descission, which will fail here? Or any other thoughts?
When I added pirates (land units plus ship spawning) I had to tell them to get on board or else they would drown.;)
 
One generic popup, which is filled with different text, should be enough, i think.

Well perhaps to begin with. I just will have to see. I was thinking maybe later making them unique with you get a bonus for such and such from the last era. Or something that requires you to change your civic or religion in order to become a certain civilization. But they are just ideas at this point.

Oh, i expect a little bit :D. As senior modder, you should be able to do some things here :).

:lol: Senior modder. Can I get a pension? Really though I am more of virus that hack other's work. I am not that talented with any of the particular code. I can merge with the best of them I think :lol:. I am more talented with art than anything. So that is why I say if someone wants to charge into the SDK it may be better because I am going to be slow at it.

I know in Revolution I could perhaps customize the text so that the civilization's name changes. So I am questioning how far this could get with changing the civilization completely. I would rather change the civilization and drop in unique tech trees for each. So the possible combinations would be ridiculous on the tech trees, and plenty of space to have a unique tech tree to trigger changes to the civilization.

Anyway I am going to take my time on this. I was hoping as well if anybody else has any suggestions on which civilizations should be placed in the game. I was thinking somewhere between 2 and 4 choices of civilizations to change to per era possible.
 
When I added pirates (land units plus ship spawning) I had to tell them to get on board or else they would drown.;)

Uh, not nice.
But shouldn't be a really big problem. When cycling through the units, a simple check for unit domain, plot, and other own units on the plot shouldn't be a problem.

But another thing: When i gift a caravell with a missionary on it to another civ, the missionary will not drown -> there must be somehow somewhere a mechanic for that.

Well perhaps to begin with. I just will have to see. I was thinking maybe later making them unique with you get a bonus for such and such from the last era. Or something that requires you to change your civic or religion in order to become a certain civilization. But they are just ideas at this point.

But good ideas :cool:.

:lol: Senior modder. Can I get a pension? Really though I am more of virus that hack other's work. I am not that talented with any of the particular code. I can merge with the best of them I think :lol:. I am more talented with art than anything. So that is why I say if someone wants to charge into the SDK it may be better because I am going to be slow at it.

But you can do all these things, you have a big project here, you're good in some areas, so you are a senior modder ;).

I know in Revolution I could perhaps customize the text so that the civilization's name changes. So I am questioning how far this could get with changing the civilization completely. I would rather change the civilization and drop in unique tech trees for each. So the possible combinations would be ridiculous on the tech trees, and plenty of space to have a unique tech tree to trigger changes to the civilization.

Also good idea, but maybe too much at the moment. Maybe also to confusing and not good playable -> not a good point to start with.

Anyway I am going to take my time on this. I was hoping as well if anybody else has any suggestions on which civilizations should be placed in the game. I was thinking somewhere between 2 and 4 choices of civilizations to change to per era possible.

I think, what you suggest is too much. 34 civs with 4 choices per 4 eras are just too much. Even CivGold does not have that much civs.
The HRR can be used in different ways, also austria/hungary has some choices
Russia: Russia, USSR, Kiew, etc
Germany: Federal Republic, Democratic Repulic, 3. Reich, Prussia, and the time with the Emperor:
Wikings: Wikings, Denmark, Norway, Sweden
Amerika: North/South
China: Feudal/Communist China, Taiwan (?)
Anglo-Saxons -> Britain/Scotland/Wales -> UK
Rome: Rome/Italy
Ottoman/Byzanz: Ottomans, Turkey, Byzanz
 
Back
Top Bottom