Question about Pirate spawn rates...

demon59

Chieftain
Joined
Sep 11, 2007
Messages
27
Location
Alabama
First off, great work people!
I was wondering if the spawn rate of pirate ships is adjustable in a python or XML file, or is it hard coded? I don't recall vanilla FF having quite this level of pirate activity, when playing without Raging Barbarians turned on. As a casual, builder-type player, I don't really want to play with pirates turned off, but would like to be able to dial them back just a bit from current levels, if possible. Thanks for making FF a much better mod.
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
There is an XML value that can be changed to adjust the number of pirate ships that appear. The number is based on difficulty.

In CIV4HandicapInfo.xml for each difficulty level there is a value called iUnownedTilesPerBarbarianUnit. The higher this value is, the fewer pirates there will be. Doubling the value will cut the number of pirate ships in half (on average - the exact number fluctuates randomly each turn). The current values are 210 for Settler, 180 for Chieftain, 150 for Warlord, 120 for Noble, 100 for Prince, 80 for Monarch, 65 for Emperor, 60 for Immortal, and 55 for Deity. As you can see, Immortal produces twice the pirates that Noble has (since the value is half as much), and Chieftan has 2/3 as many as Noble (since the value is 3/2 as much).

The number is based off of the number of tiles that are not owned by anybody. If you produce more influence and expand your borders the number of pirates will decrease. It looks like tiles owned via starbase and sensor station will reduce the pirate count too (although since a starabse only owns a maximum of 9 additional tiles it would take something like 14 starbases to be sure that the base number is reduced by 1 on Noble speed).

When the average of the players' current eras goes up, the number of pirates also goes up (as well as getting a new list of ships to generate). The base figure calculated via the number of unowned tiles and the difficulty setting is multiplied by a value that is 1 in the first era, 2 in the second, 3 in the 3rd, and 4 in the 4th. There is no way to change this other than modifying the DLL. Since the amount of territory that is claimed increases as the game progresses, the actual spawn rate does not end up 4 times as big in the Far Future era.

I think I just spotted a bug in the DLL code that does this...
 

demon59

Chieftain
Joined
Sep 11, 2007
Messages
27
Location
Alabama
Thank you for the quick reply, God-Emperor. I'll play with these values a bit, and see if I can find an Interesting/Frustrating balance I'm happy with. :goodjob:
 

demon59

Chieftain
Joined
Sep 11, 2007
Messages
27
Location
Alabama
First game I started with 1.65 patch, I played until I spotted the outrageous numbers of pirates, about turn 34 or so. Got disgusted and quit game. :eek: :mad:

Thought about it a bit, though, and decided to actually try another game. Very interesting experience, so far. Forced to play a completely different style from my usual.
There is NO rush to colonize. The pirate swarms force you to build a complete fleet just to get a colony ship to another star system. Since the game started me in a corner, with the nearest system at least 18 or 20 spaces away from my home system, I've also had to build a string of space stations as I go, in order to have any hope of maintaining a connection with my capital. I'm at turn 275, or so, I've built two stations and think that one more will get me to my first colony system. Fortunately, I've spotted another system quite close to that one, so my third system shouldn't be quite so difficult to achieve. I still haven't met a single computer player, so I'm assuming they are having as much trouble exploring and expanding as I am.
This has been a very interesting game, so far. Even though I haven't expanded as quickly as usual, I've been able to develop more of my home system's planets than I normally do, which has satisfied my builder tendencies quite nicely. I intend to keep playing it to see how things work out.

In conclusion, I would suggest that everyone at least give the "bugged" patch 1.65 a try! You might actually enjoy the changes in strategy it forces on you. The developers might actually consider saving a copy of the "bugged" code, and using it to develop a scenario, if you find the time. :lol:

Thanks again folks, for all that you do to keep this game interesting! :goodjob:
 

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
Yeah, pirates in 1.65 are completely screwed up.

Expect a hotfix soon, though (1.651). As soon as I test things...

And, actually I like the "buggy barbarians" scenario idea- perhaps a gameoption?
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
By the way, for those wondering: Patch 1.65 has a bug that causes insanely large number of pirate ships to spawn. This should be fixed in the near future.

I had not really considered continuing my test game. Given the huge number of pirate ships, especially invasion ships, I had assumed that nobody would survive much past turn 50. In that game, at the start of turn 36 there were a total of 428 pirate ships including 252 invasion ships.(a number which is bound to increase, given the currently buggy formula to generate the target number the initial target is probably somewhere around 4250 for a standard size map).

While barbarian units do tend to hold off from attacking systems (mostly) at first, once the attacks started in earnest I fully expected everyone to be wiped out in just a few turns.

Have you advanced to the second era yet? Once half of the players have made it then the number of pirate ships will increase, with the target number being doubled, and they will get delta destroyers and delta invasion ships and battleships...

I may give this a shot just to see how long it takes to get myself wiped out, or if I can survive longer than all the AIs and win by pirate assisted conquest.
 

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
With the changes from the bug thread on a Standard Wormholes map (with AI Autoplay, therefore era scaling is probably inaccurate):

-Turn 50: 22 barb units
-Turn 100: 22 barb units
-Turn 150: 20 barb units
-Turn 200: 16 barb units
-Turn 250: 12 barb units

Didn't go any farther than that. Lots more are spawning, they're just getting wiped out (the map is lit up with Enemy Unit pointers).

Are those numbers better? Well, obviously, but do you think there are too few barbarian units?
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
That sounds a lot better. I would guess that this shows reasonable numbers - 22 is 3.67 per player and the later 12 is 2 per player. That sounds like a good place to start.

I'm not too concerned with the exact number, as long as it seems pretty reasonable. It can be tweaked via the XML if it turns out to be to low or too high, as long as the DLL is working properly.

One thing that could be done in the future is to add a tag to the era info to specify a multiplier for each era, instead of hardcoding the progression. This would allow greater control over the progression and allow for an era of increased pirate activity or turning it down (or off) at some point (more for mod-mods than FFP itself).
 

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
That sounds a lot better. I would guess that this shows reasonable numbers - 22 is 3.67 per player and the later 12 is 2 per player. That sounds like a good place to start.

I'm not too concerned with the exact number, as long as it seems pretty reasonable. It can be tweaked via the XML if it turns out to be to low or too high, as long as the DLL is working properly.

One thing that could be done in the future is to add a tag to the era info to specify a multiplier for each era, instead of hardcoding the progression. This would allow greater control over the progression and allow for an era of increased pirate activity or turning it down (or off) at some point (more for mod-mods than FFP itself).

I like that idea.

I'll release the 'hotfix' (replacing the current patch download) with the changes, then.
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
In playing out a Pirate Hordes game with 1.65 I noticed something. Not a bug, just a behavior I had never noticed before.

Initially the hundreds and hundreds of pirate ships were quite passive. They even avoided my star system - when the borders expanded I could see pirate ships scurrying away from it. Every once in a while one wandered into visual range then moved away. I had known that they behaved like this for a while in the early game (the barbs in regular BtS do it for a while too). A very small number of them are more aggressive - these may be pirates spawned from wreckage, or perhaps just some small random factor.

What I noticed is something that triggers them into their feeding frenzy of attacking the star systems in their typical suicidal manner. I happened to build the world wonder that grants a golden age (the Founders Monument). The instant the golden age happened, the pirates all turned and attacked me. I know it wasn't just the building of a world wonder since I had already built the Military Science Academy, so it must have been the golden age. It looks like a large percentage of the pirate ships in the game are headed straight for me, although at least a few are attacking other systems because Lukas van Reuther got wiped out entirely. I had thought that barbarians were passive until some number of turns had gone by, but it looks like the first golden age triggers their switch from ambushers of units to attackers of cities (there may be some turn timer as well, and possibly some other conditions too).

At this point, I'm not sure if I'll ever be able to get a colony. My golden age has ended and the hordes are still pouring into my star system. I have a construction ship I built specifically to build a starbase for defensive purposes between my home star and the first colony location (which is pretty close), but I don't think that is possible either - too many pirates. The Avowers managed to crank out 3 colonies, one of which they have lost (I think it was the one where religion was founded because they probably founded it but none of their 3 remaining systems has it). Things could get even uglier since I expect the pirates to advance to the second era sometime soon (both the Avowers and I are in the second era already), giving even more pirates with better ships.

Anyhow, it has been interesting and quite different than the usual game.
 

demon59

Chieftain
Joined
Sep 11, 2007
Messages
27
Location
Alabama
Almost to turn 400, now. Just managed to found my number 4 system. As I approached the star, pirate aggression seemed to pick up a bit. They've started attacking my systems and space stations a bit more often. I'm seeing mostly Destroyers (up to Omega class, now), with a few Battleships (up to Deltas) and occasional Invasion ships and Planetary Defense ships. I've adopted the tactic of using squadrons to damage any Destroyers nearby. I don't usually try to take them out, just get a hit and move to the next undamaged one. This way any that do attack, do so at lower strength. Seems to have worked, so far I haven't lost a system or station, and my "Colonization Fleet" actually managed to take 6 or 7 consecutive attacks from damaged Destroyers, in a single turn, without losing my Battleship. I've been keeping systems garrisoned with 3 P.D. ships, but they haven't really been needed, so far, due to the non-aggressive behavior noted by God-Emperor. You really have to keep your systems built up, financially, to support the number of ships and stations needed. I still haven't met any of the A.I. players, although I did get a notice that an "unknown city" had reached Legendary Influence status, and they have beaten me out on one or two Wonders.

I think a scenario, or simply an "Insane Barbarians" option would be worth the effort, since it requires such a complete change in play style. I'll keep playing a bit longer and post any new behaviors or new strategies that work for me, just in case this evolves from a "bug" to a "feature". ;)
 

TC01

Deity
Joined
Jun 28, 2009
Messages
2,216
Location
Irregularly Online
Because it's a DLL change to do it properly a gameoption would be needed anyway... otherwise a scenario would require a new mod folder.

But, if a modmodder wanted to make a scenario based around it, that would be completely possible.

I think I'll go with God-Emperor's "Pirate Hordes" as the name... or maybe "Buggy Barbarians".
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
I played that game some more. The pirates did eventually return to a more passive mode, although they are not quite as passive as they were - they have tried to enter my territory and sever the "roads" a few times, and 3 or 4 ships have attacked the star systems (nothing like the 10 to 20 that were attacking each turn during the frenzy, or would have been if I hadn't been thinning out the invasion ships by attacking them before they could attack so as to reduce the collateral damage). I think what triggered the end of the frenzy was them advancing to the second era, although around that same time they captured two systems from the Avowers including their capital. Via bomber recon I can see that they took a system from the Red Syndicate. I knew who it was based on the name, but a while later a Syndicate battleship wandered over close enough to get contact before the horde destroyed it. The Forge likewise made contact a while after that (also just before the exploring battleship was destroyed by repeated attacks from pirate delta destroyers). Halis also wandered by and I didn't see their battleship get destroyed, although I have to assume that it was destroyed not too many turns later.

I'm not sure how, but the Avowers have colonized at least one more system (the only 7 planet system I have seen in this game - it's quite nice and could support a working population of something around 32 if all the extra population buildings were to be built everywhere they can be) and also went and retook their original capital, probably only about 10 or 12 turns after the pirates got it.

After the pirates calmed down from their suicidal frenzy I built a starbase about half way to the closest star system and then started a colony there (not a great system, but it is only 7 tiles away and does have a health resource on a planet in the 3rd influence zone - grain, I think). I have built a second starbase on top of an asteroid field with oil in it, and built the extraction facility and connected it to my trade network, and am about to launch a fleet to colonize another star system, off on the other side of the oil by several tiles, that has more population potential then my first colony and has wine in the second influence range. Currently it is, I think, just a little after turn 275. The turns do tend to fly by most of the time because frequently all there is to do is a little recon and a couple of attacks with squadrons, which goes pretty quick.

I have to admit that this game is strangely enjoyable. Probably at least partially due to not having expected anybody to have survived this long. Currently it looks like the Brotherhood is the only civ that has been completely wiped out. The Avowers and Syndicate are managing to stay about 2 to 3 techs ahead of me so far, I think this is largely because they appear to be trading techs with each other, but I have nobody to trade with (I have no techs they don't, and the Forge and Halis have no techs I don't, unless one of the other two have recently given them some techs for some too small amount of money).
 

Nachytsm

Chieftain
Joined
Aug 9, 2010
Messages
15
Hey, guys. I was wondering, on a similar topic, is there any way to remove the ten XP cap from Pirate/bandit units? I notice they did this in the Dune mod, and when I play the game I always like having lots of pirates and the like everywhere- but because I rarely go to war with other colonies, and when I do it's rather short lived, my units never get very high on the experience chart. So... if the Pirates could give more than just ten XP I think it'd be neat. Maybe at the cost of removing the 20% bonus against them?

By the way, I've been searching the forums for a way around this, but I haven't been able to find one, so... I figured rather than start a new thread, I'd ask here.
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
It't controlled by a setting that it normally defined in GlobalDefines.xml in the Assets/XML fodler. But FFP doesn't sue this file, instead it uses a file called GlobalDefinesAlt.xml which overrides values found in the other file.

What you need is to add a definition for BARBARIAN_MAX_XP_VALUE to GlobalDefinesAlt.xml that has a vlaue higher than 10.
So, make the end of the GlobalDefinesAlt.xml look like this:
Code:
	<Define>
		<DefineName>FF_PALACE_BUILDINGCLASS</DefineName>
		<DefineTextVal>BUILDINGCLASS_CAPITOL</DefineTextVal>
	</Define>
	<Define>
		<DefineName>BARBARIAN_MAX_XP_VALUE</DefineName>
		<iDefineIntVal>22</iDefineIntVal>
	</Define>
</Civ4Defines>
Use whatever value you want to use other than 22. Using 999 would be practically unlimited.

I've often considered increasing this to match the 15 that it currently has for MAX_EXPERIENCE_AFTER_UPGRADE (which is higher than the regular BtS value of 10). Given my experience in the insane pirate version, I'm more inclined than ever to consider this. I have some ships that have killed at least 30 pirate ships in that game so being limited to 10 prestige from them has been a little irritating - especially after having lost a ship or 2 that should have been up at 20+ instead of down at 10 (they might have survived if they had had another part upgrade or two).
 

Nachytsm

Chieftain
Joined
Aug 9, 2010
Messages
15
Awesome, thank you! I agree, that's what made me think about it in the first place. I had a Battleship getting trashed from every direction after capturing a Barbarian city, and he stayed capped out at 10 xp. If only they had gotten more, the next round wouldn't have seen them blown out of orbit...

In addition to that, I was also wondering if there was a way to make it so that Bombers and, more noticeably Starbases, got XP/Prestige from killing stuff with their attacks? The enemy never attacks with enough forces to actually reach the starbase and attack it, and usually they just try to ignore them anyways.
 

God-Emperor

Deity
Joined
Jul 18, 2009
Messages
3,551
Location
Texas
There is no really easy (i.e. XML setting) way for them to get xp from attacking ships, although it could be done the DLL or almost certainly even in Python.

Starbases currently only get XP when a ship attacks them (unsuccessfully, of course) or when they intercept a squadron, but not from their ranged attack. In the pirate hordes game I've had 2 starabses gain promotions from suicidal destroyer attacks (one was a stack of 4 delta destroyers plus, I think, 2 others that were not in the stack all attacking on the same turn - that got that particular starbase 2 promotions) and I think there was one battleship that attacked one (the BB was already badly damaged, of course).

Squadrons currently can only get xp from fighting other squadrons, so it only happens from an interception by a fighter squadron - interceptions by destroyers or starbases apparently can't get the squadron any xp since it can't result in inflicting any damage on the intercepting unit. (I don't think barbarians are allowed to build squadrons of any sort in systems they have captured. Hmmm... I just checked - they are not prohibited from building Q-Squadrons, so theoretically they could do so, except that I doubt that they ever get the techs that are necessary unless the Time victory condition has been turned off and the game is past its usual end time. So unless that unlikely event happens you can't get any xp for your squadrons from fighting pirates.)
 

PsiCorps

FF: Babylon 5 mod team
Joined
Dec 30, 2007
Messages
1,425
Location
Britain
Squadrons currently can only get xp from fighting other squadrons, so it only happens from an interception by a fighter squadron - interceptions by destroyers or starbases apparently can't get the squadron any xp since it can't result in inflicting any damage on the intercepting unit. (I don't think barbarians are allowed to build squadrons of any sort in systems they have captured. Hmmm... I just checked - they are not prohibited from building Q-Squadrons, so theoretically they could do so, except that I doubt that they ever get the techs that are necessary unless the Time victory condition has been turned off and the game is past its usual end time. So unless that unlikely event happens you can't get any xp for your squadrons from fighting pirates.)
TheLopez has done a ModComp that enables Squadrons to get experience from missions but it was aimed at standard Civ not FF or FF+, so you would need to look at that and merge it into your mod. XP cap for Barbs can be increased (B5 Mod currently has a Cap of 100) in the GlobalDefinesAlt by adding in
Code:
	<Define>
		<DefineName>BARBARIAN_MAX_XP_VALUE</DefineName>
		<iDefineIntVal>100</iDefineIntVal>
	</Define>
Changing the iDefineIntVal to whatever cap you want to set.
 
Top Bottom