adding a second barbarian player

evertebrate

Chieftain
Joined
Mar 30, 2009
Messages
76
Location
germany
if i wanted to add a second (or even third) barbarian player, how would i go about it? i already figured out, that the last player is always designated as barbarian (CvDefines.h), but how does the game know the civilization info for the barbarian player? and at which part of the sdk are the players added to the map? CvInitCore.cpp unfortunately doesn't mention barbarians at all. how is the barbarian player added if there are already max players on the map?
 
Most of the Barbarian data is handled in the exe unfortunately. It was a pretty lengthy process for us to find all the information which needed changed in Fall Further, and even with what we have working now, only the "normal" Barbarians are capable of having cities. If the other 2 ever gain a city then the citybar is messed up, even though the city itself still works fine.

Changes are required all over in the DLL, as well as numerous changes in python. The actual code itself is fairly simple, as long as you discover all the locations in which to place it.

There is another mod-mod for FfH which had implemented additional barbarians in a different manner, he simply placed 2 normal civilizations after the map was generated if there were some player slots still open for them, and then blocked them from diplomacy and scoreboard display. It was possibly easier to accomplish, but probably had quite a few more issues here and there.

EDIT: Oh, and if I recall properly the extra Barbarians also don't show any icons when you tell the strategy layer to point out enemy units for you, but they do still trigger the "Enemies are near" text warnings and the red enemy glow circle effect.
 
that's too bad, because i really wanted the new barbarians to have cities. thanks anyway. maybe i can find a way to add new players even when all the slots are already taken. or at least make the interface look like all slots are taken even when they are not...
i will at least have a look at those two modmods for ffh. do you by chance know what the name of this other modmod besides fall further is?
 
If this is for a scenario, add two extra civilisations and make them Minor Civs at War With Everyone. That way they can have cities and you can never make peace as they can't conduct diplomacy. I know it's not quite Barbarian, but it's close.
 
*bump* :bump:.

I've played a bit around with the civs, and i've seen, that i just can spawn a new civ ingame, and join it with the barbarian team, and the new player will diplomatically be the same like the barbarians -> not accessible, and at war with everyone.
Quite simple idea, isn't it?

Edit: I've spawned the new player directly with a city, so cities are not a problem (okay, it seems so. no idea, what happens, if cities are conquered).

2. edit: With the barbarian civ modcomp, somebody should have earlier thought of it.

3. edit: bah, i guess, that's what Xienwolf mentioned.
 
*bump* :bump:.

I've played a bit around with the civs, and i've seen, that i just can spawn a new civ ingame, and join it with the barbarian team, and the new player will diplomatically be the same like the barbarians -> not accessible, and at war with everyone.
Quite simple idea, isn't it?

Edit: I've spawned the new player directly with a city, so cities are not a problem (okay, it seems so. no idea, what happens, if cities are conquered).

2. edit: With the barbarian civ modcomp, somebody should have earlier thought of it.

3. edit: bah, i guess, that's what Xienwolf mentioned.

Sounds interesting, do you think this could help me in my quest to create a "Pirate Civ" that acts as a barbarian civ, is unplayable, and spawns when two civs discover Astronomy?
 
Sounds interesting, do you think this could help me in my quest to create a "Pirate Civ" that acts as a barbarian civ, is unplayable, and spawns when two civs discover Astronomy?

Are you talking about a LAND Pirate civ or a WATER ship one?

Cause i/RoM have an EVENT that spawns ILLYRIAN Pirates.
 
My plan was to make them primarily ocean-going pirates, but they would have land units to attack colonies or port cities. But the idea would be that they spawned with a city (or capital or base of operations or whatever). Destroying the pirates (and in the process their city) would give some type of bonus to the civ who did it. That was the idea at least. So they would have no ability to expand (can't build settlers).

I guess what I am basically describing is a WATER pirate event that also had a city as well where they could build ships and units. Someone also mentioned that there was a "monsters" modcomp where monsters would spawn from a specific tile/unit/nest. Perhaps I could modify this to suit my needs.
 
Sounds interesting, do you think this could help me in my quest to create a "Pirate Civ" that acts as a barbarian civ, is unplayable, and spawns when two civs discover Astronomy?

Yes, that can be done.
Problem at this point may be, to find a plot at the coast, which is not owned by any civ.

Because i'm lazy: I guess, there's somewhere a pirate civ in the database?
 
I was actually going to make my own Pirate civ, so I can cover that if someone else could figure out the rest. Although I want it to act as a barbarian civ, or slightly more civ-like I guess.

I guess these are the attributes I want for it;

1) I don't want it to have the ability to research tech, although it would be good if it could keep up with the other civs somehow, at least to a respectable degree.

2) It would be great if it could spawn only one or two cities along a coastline, and it would be preferable if this could somehow occur near colonies of other civs or at least near shipping lanes or high traffic areas. Basically I don't want it to spawn out in the glaciers or in the middle of a huge continent with no access to the sea.

3) If it were to have a leader and the ability to negotiate diplomatically it should only be able to make temporary "Cease fire" agreements where it would naturally revert to war after a specific period of time (10 turns maybe), this would emulate bribing the pirates not to attack your vessels and colonies. This ability and the ability to trade maps should be the only options in diplomacy that they should have.

4) The pirates should have ONLY specific UUs. Basically raiding parties, defenders, maybe a type of seige-craft, and of course a collection of ships. But that should be it, well maybe workers too I guess.

5) I want the pirates to be targeted by other civs, so there should be some type of advantage to defeating them (rather than letting them survive because you think it is cool or because it isn't bothering your civ). Perhaps some type of bonus, maybe +1 happiness in each coastal city, or some type of naval combat bonus, or maybe a temporary boost in relations with each civ or a combination of these.

Is any of this possible?
 
I've done some things today, and i'll create a generic modcomp, where you can choose, what civ to spawn, with what a leader, if it should be a barbarian civ, if it should start at the coast or not, etc.
Instead of the pirate civ from StrategyOnly i'll take the Huns civ from cool3a2 (just for the file size), and let some other civs spawn.

Haven't completly thought about all, what you've mentioned.

1) To make it a barbarian civ, it has to be joined with the normal barb player -> team -> they share the technology, and the barbarians do research, if i'm right.
Complete blocking from researching can be done, but would also include the barbarian player.
To keep the civ on the same level, the barb civ could get every tech, which a normal player researches.

But first there's another question: With what techs should the new civ start? I would give them all techs from the civ, which triggert the spawning with their research.

2) At the sea can be done, but will involve some work.
Also here you'll have to think of several things.
For example, it would not be good, if you raze a coastal capital city (-> no culture then there), and the new civ directly spawns besides your stack.

3) Diplomacy is SDK -> not me.

4) That's XML ;).

5) You can give bonuses, if you destroy or capture a city from a special civ, but the AI will not know about it :(.
 
I've done some things today, and i'll create a generic modcomp, where you can choose, what civ to spawn, with what a leader, if it should be a barbarian civ, if it should start at the coast or not, etc.
Instead of the pirate civ from StrategyOnly i'll take the Huns civ from cool3a2 (just for the file size), and let some other civs spawn.

As long as I can create a Pirate civ that is unplayable and spawn it with this that is fine by me.


Haven't completly thought about all, what you've mentioned.

I'll go ahead and do the point by point response thing here...

1) To make it a barbarian civ, it has to be joined with the normal barb player -> team -> they share the technology, and the barbarians do research, if i'm right.
Complete blocking from researching can be done, but would also include the barbarian player.
To keep the civ on the same level, the barb civ could get every tech, which a normal player researches.

But first there's another question: With what techs should the new civ start? I would give them all techs from the civ, which triggert the spawning with their research.

It isn't important that they be teamed together, I guess its better that they don't attack eachother. But mainly I just wanted an independent Pirate civ that basically acted as a barbarian civ in that they are always at war with the other players (unless somehow they make a temporary peace treaty, which I guess you adress later). As far as what techs they start out with. I think they should get the techs of the player that caused the spawn. Ideally I wanted them to spawn when two players research astronomy, but beggars can't be choosers, so whatever you think is best/fair go ahead and do that, or at least tell me how, I'm just a lowly graphics modder after all.

2) At the sea can be done, but will involve some work.
Also here you'll have to think of several things.
For example, it would not be good, if you raze a coastal capital city (-> no culture then there), and the new civ directly spawns besides your stack.

I don't see how this would pertain to pirates. I basically want them to spawn overseas anyway, so there should either only be barbarians around or nobody around.

3) Diplomacy is SDK -> not me.

Figured it would require SDK, it was bound to happen to me sometime. :crazyeye:

4) That's XML ;).

I actually know how to do that already, I just wanted to list everything I hoped to accomplish for this pirate civ.

5) You can give bonuses, if you destroy or capture a city from a special civ, but the AI will not know about it :(.
[/QUOTE]

While that is the case, wouldn't they naturally attack them anyway?

I am still not entirely clear on what exactly your modcomp is going to do. Ideally I'd like to have the barbarians be replaced with "natives" and "pirates." The barbarians in the mid to late eras hardly ever do anything. So I was hoping to use them as natives and pirates and then have random events where a horde would attack civs during the medieval eras. I was also hoping to fuse this with the barbarian civ modcomp so that the "natives" (i.e. old barbarians) would spawn into civs if they went unconquered for too long.

EDIT: the pirates and natives should be able to attack eachother, or at least should be considered to be different civs.
 
As long as I can create a Pirate civ that is unplayable and spawn it with this that is fine by me.

That's no problem :).

It isn't important that they be teamed together, I guess its better that they don't attack eachother. But mainly I just wanted an independent Pirate civ that basically acted as a barbarian civ in that they are always at war with the other players (unless somehow they make a temporary peace treaty, which I guess you adress later).

Okay, i have to explain it:
If you really want a civ, which acts like the barbarian civ (= war with everyone, not accessible via the diplomacy screen), it has to be joined with the normal barbarians, there is no other way. If you want multiple civs, which should be like this, then all have to be joined together in one (the barbarian) team -> no combat between them.

But you could create a "normal" civ, and initially trigger a war with everyone, and give a high diplomacy penalty (-999 or so) to everyone, so that never every any treaty will be signed.

As far as what techs they start out with. I think they should get the techs of the player that caused the spawn. Ideally I wanted them to spawn when two players research astronomy, but beggars can't be choosers, so whatever you think is best/fair go ahead and do that, or at least tell me how,

I don't know, if i understand you right.
When you want, that 2 civs should have the spawning technology, then the new civ would get all the technologies from the second player, who researches it.
That whould be the easiest way, but could also be done with any other player.


I'm just a lowly graphics modder after all.

:lol: nice understatement.

I don't see how this would pertain to pirates. I basically want them to spawn overseas anyway, so there should either only be barbarians around or nobody around.

Yes, you're right but what, if...
- you play pangaea, and there's no island available?
- you play with the earth mapscript? The new civ will probably start in the new world

While that is the case, wouldn't they naturally attack them anyway?

Yes, sure, but not to get the "reward".

I am still not entirely clear on what exactly your modcomp is going to do. Ideally I'd like to have the barbarians be replaced with "natives" and "pirates." The barbarians in the mid to late eras hardly ever do anything.

A bit confused :confused:.
When you want, that the barbarians are natives, why do you not just rename them?

Changing civs (natives -> pirates) is a bit difficult, just because the game doesn't provide that function really.

And if your barbs are lame, then you have to ask why.
- Lack of technology?
- Lack of units?
- Or something else?

So I was hoping to use them as natives and pirates and then have random events where a horde would attack civs during the medieval eras.

You mean like the huns, vandals and philistine events?

I was also hoping to fuse this with the barbarian civ modcomp so that the "natives" (i.e. old barbarians) would spawn into civs if they went unconquered for too long.

Mmmh...i guess, that shouldn't be a problem.
 
Alright, let's see here....

Okay, i have to explain it:
If you really want a civ, which acts like the barbarian civ (= war with everyone, not accessible via the diplomacy screen), it has to be joined with the normal barbarians, there is no other way. If you want multiple civs, which should be like this, then all have to be joined together in one (the barbarian) team -> no combat between them.

I am not saying I want this to be part of the modcomp or anything, but I noticed that (I use Sevopedia) there is a "Minor Nation" flag there. How does that work exactly and how can I turn this into a "Natives" civ if I were so inclined?

Beyond that though, it is perfectly fine if the barbarian civ and the pirate civ are on the same team or do not attack eachother. It isn't entirely important that they fight one another, the main issue I have here is that it is way too easy to expand overseas during the renaissance era/age of discover/age of ships/whatever you want to call it in this game. Since there is no disease and hardly any native attacks (and barely any semblence of an organized raid. To try and go against this I was hoping to create Pirates that actually attack ships and even attempt to attack colonies. This may not be realistic, but I think it would make it difficult to expand overseas.

But you could create a "normal" civ, and initially trigger a war with everyone, and give a high diplomacy penalty (-999 or so) to everyone, so that never every any treaty will be signed.

Are you saying the civ hates everyone else, or everyone else hates the civ? I'd rather have the former start first if this is the route we have to take. Since I don't know how to mod code that well, I can't really tell you what should happen here, whatever works best I suppose.

I don't know, if i understand you right.
When you want, that 2 civs should have the spawning technology, then the new civ would get all the technologies from the second player, who researches it.
That whould be the easiest way, but could also be done with any other player.

Yeah, I guess, like I said before I don't really know how to mod so whichever you think is the most balanced/fair/realistic/whatever should probably be the case. I just think it would be cool to have pirates show up. If there is a leader for the pirates (we already have a Henry Morgan LH out there I think) that's fine, if there isn't that's fine too.

- you play pangaea, and there's no island available?
- you play with the earth mapscript? The new civ will probably start in the new world

That is fine, I rarely play on Pangea or maps with no islands, is there any way for this to only occur if there are islands or some form of similar condition?

Yes, sure, but not to get the "reward".

Hmm, I don't think the reward should be super huge. Maybe just a relations boost or something to that effect.

A bit confused :confused:.
When you want, that the barbarians are natives, why do you not just rename them?

Changing civs (natives -> pirates) is a bit difficult, just because the game doesn't provide that function really.

And if your barbs are lame, then you have to ask why.
- Lack of technology?
- Lack of units?
- Or something else?

They don't really have to be called natives per se. Basically when I refer to natives I mean those barbarian cities that pop up around the map on different islands/continents when you play. The only reason I called the natives was because I was thinking I could maybe flavor their units different than the "other barbarians" (which I will refer to in the next comment you make) so they appear as natives. And before I get any crap about what a "native" should look like I was going to mix a bunch of different ethnicities in each unit mesh group.


You mean like the huns, vandals and philistine events?

That would be awesome actually. But yeah, they don't necessarily have to be these names/tribes/hordes/people/whatever though (for instance I was going to make the Huns into a modular civ later, so it would be a little screwy if they appear as a barbarian horde, and even screwier if they appeared against the Huns :crazyeye: ). There are a lot of situations, at least in my games, where I'm just building up a bunch of armies, and basically there is no war unless I go after anyone because my army is so big. I think it would be cool if a ridiculous horde just appeared out of nowhere to contend with. Or maybe peasant uprisings if you are in serfdom or slavery or something. I know this is a bit ridiculous, and I know it almost resembles Revolution mods or something like that, but I didn't want to go that far. And I think a little more barbarian activity in the medieval and renaissance era is much needed. Also combined with the BarbarianCiv modcomp (the one where Barbarian spawn into real civs) would make this a pretty cool mod without making a huge change from gameplay.

My theory is if you let the barbarians live, you should pay the price and deal with another adversary.

Mmmh...i guess, that shouldn't be a problem.

Wow, that was quick! ;)

EDIT: and by the way I realize this will be a ridiculous amount of work, and I certainly don't expect all of this to happen, or for you to take time to do all of this. Think of it as more of a wish list.
 
This thread is more work than the programming itself :D.

I am not saying I want this to be part of the modcomp or anything, but I noticed that (I use Sevopedia) there is a "Minor Nation" flag there. How does that work exactly and how can I turn this into a "Natives" civ if I were so inclined?

I have no idea :dunno:.
I know this flag, because in the worldbuilder files you can set
PHP:
	MinorNationStatus=1

but there's no python command for setting it.

I know, that some mods have the option to start as a minor nation, but i don't have an idea, how it's done.


Beyond that though, it is perfectly fine if the barbarian civ and the pirate civ are on the same team or do not attack eachother. It isn't entirely important that they fight one another, the main issue I have here is that it is way too easy to expand overseas during the renaissance era/age of discover/age of ships/whatever you want to call it in this game. Since there is no disease and hardly any native attacks (and barely any semblence of an organized raid. To try and go against this I was hoping to create Pirates that actually attack ships and even attempt to attack colonies. This may not be realistic, but I think it would make it difficult to expand overseas.

You're right, this expansion is quite to easy.
Mmmhh...do you play with raging barbarians? Just because i have no idea, how the "new world" occupated with barbarians with this option.

Are you saying the civ hates everyone else, or everyone else hates the civ? I'd rather have the former start first if this is the route we have to take. Since I don't know how to mod code that well, I can't really tell you what should happen here, whatever works best I suppose.

Can both be done, but i don't see a difference for gameplay (only for the human).
Any argument for one side?
There's nearly no difference for programming that, so i'll just do, what somebody thinks is better.

Yeah, I guess, like I said before I don't really know how to mod so whichever you think is the most balanced/fair/realistic/whatever should probably be the case. I just think it would be cool to have pirates show up. If there is a leader for the pirates (we already have a Henry Morgan LH out there I think) that's fine, if there isn't that's fine too.

Also when the civ is a barbarian civ, it'll have a leader ;), you'll just not be able to see him/contact him.

That is fine, I rarely play on Pangea or maps with no islands, is there any way for this to only occur if there are islands or some form of similar condition?

What would be a similar condition?

Technical: Err...no idea.
I don't know really, what "Areas" in civ are, maybe it could be done easily with them. If that doesn't work, the check for an island could become quite huge on a pangaea map.


Hmm, I don't think the reward should be super huge. Maybe just a relations boost or something to that effect.

Any concrete ideas?

That would be awesome actually. But yeah, they don't necessarily have to be these names/tribes/hordes/people/whatever though

-> You should maybe add some events ;).
The python code for these events is not that complex, and can be changed to the right prerequisites easily.

There are a lot of situations, at least in my games, where I'm just building up a bunch of armies, and basically there is no war unless I go after anyone because my army is so big.

You should try a higher difficulty level ;).


Wow, that was quick! ;)

EDIT: and by the way I realize this will be a ridiculous amount of work, and I certainly don't expect all of this to happen, or for you to take time to do all of this. Think of it as more of a wish list.

The amount is not that big ;), because i have 4 spawning civs in my mod, so i've already done the basics.
Only making it generic needs some work.
And the wishlist is good, normally i'm lacking ideas ;).



The hardest part is already done.
I've created a function, which will place a civ, which you have to mention, with a leader (can be mentioned, or a random one from the civ) at a point, where a number of civs (has also to be mentioned) has a special technology.
The civ will only appear, if it's not already present ingame.

We've already discussed about the technologies, but i guess, the number of cities should also be variable, and how much units should the civ have? I would say, 1 worker and 5 defense units per city, 2 ships per coastal city.
And how big should be the amount of gold? I suggest just 100 gold per city.

I'm also thinking of making this customizable by XML, because with all the parameters, it'll maybe become a bit confusing in the XML, but i've never dealt with reading XMLs with python, and i don't know, if the python version from civ supports comfort functions for XML (i've asked a fellow student, and he says, that there are XML functions, but he doesn't know, when they were included). -> This will take a moment.
 
:)


I've added the technologies, the defensive units, and the gold today, also the number of cities can now be changed.
Now i only need the naval units, and after that i'll go for the xml part.
I've looked at it, and the integrated python interpreter doesn't have the standard libraries for xml :mad:, instead some others, which i haven't looked closer at.

Edit: I've asked google now, the ingrated xml modules are quite old, but the description is avialable.
 
Back
Top Bottom