Expanded Mercenaries

Made some more progress tonight. Got the Mercenary Class built and passing data to the screen (see screenshot for some mercs that I generated manually in the screen using the merc class).

Eventually I will move the instancing of the mercenary class completely out of the screen and passing a list of mercenaries to it, so that the AI will be able to use the recruit mercenary spell also, through code.

Right now I've changed it so only human players use the expanded mercenary features, and the AI's still use the old mercenary spell.

I should have it ready for initial testing hopefully this weekend.

There will be much balancing to do for costs as well.

progress.jpg
 
This is true. I was thinking that I'd add a call to the event after a random % chance of happening in a city with guild of the nine every ten turns:

Perhaps these percentages:
+1% with the Guild of the Nine
+5% with Guild of the Nine HQ
+1% with a Market
+2% with an Inn
+2% with a Money Changer
+2% with a Smugglers Port
+3% with a Tavern
+2% with a Lanun Harbor
+5% with a Hippus Stables
+5% with the Bazaar of Mammon

+1% for each trade route in the city
+1% for each 3 points of population

+5% if you are running Consumption civic
+5% if you are running Guilds civic
+10% if you are the Hippus Civilization

So a chance of a unique mercenary showing up in a great scenario:
Pop 21, 8 trade routes (max), bldgs, civics, etc

10 + 5 + 5 + 7 + 8 + 5 + 5 + 3 + 2 + 2 + 2 + 1 + 5 + 1 = 61%.

Not realistic, but this just means that they'll show up in the box for 10 turns, not that you can afford them.

I am still building the data storage backend to all of this, and I don't even know if that data is saved when you save/reload....

I like the breakdown of these odds.

Would having an existing merc party also increase the chances of another approaching you as well?

And here's hoping Vehem does add it in. :)
 
It will probably find its way into MagisterModmod whether or not it makes it inot the man mod or FF. (I had planned on implementing it essentially like this for over a year, but found making new screens too intimidating to try yet.)
 
Sample release is up at the 1st post. It is not game ready but will give you a feel for what I am trying to accomplish (if I included all the files correctly in the zip..)
 
Nice, I like it. Its easy and simple to use. Now for a selfish request, if the Hippus are in the game could you add an additional merc that can always be hired from the Hippus armies. By doing this I can get rid of my little Hippus Flavor Mod forever and let somebody else to all the hard work for me ;)

Have you seen the vanilla Mercs mod? It will actually let you put up a unit to sale off to another empire and (IIRC) you can call them back. They could actually have exp points if they were used...?
 
Nice, I like it. Its easy and simple to use. Now for a selfish request, if the Hippus are in the game could you add an additional merc that can always be hired from the Hippus armies. By doing this I can get rid of my little Hippus Flavor Mod forever and let somebody else to all the hard work for me ;)

Have you seen the vanilla Mercs mod? It will actually let you put up a unit to sale off to another empire and (IIRC) you can call them back. They could actually have exp points if they were used...?

Yeah I looked at TheLopez's work (it's included in Rhye's and Fall) and I modeled some of my class structure of what they have done, but I wanted something simpler and easier, as well as a bit more random. I think Unique Mercenaries that I'm adding will be recreateable once they are disbanded or die (think "turned tail and ran") and keep their XP & promotions.
 
Love the idea. Great way to put some of the great artwork that's been done to use. I am fairly sure with all the art sharing that has been going on, nobody will mind you borrowing theirs. Of course, ask anyway. Needless to say, doing all that for unique units will require a lot of new unitclasses. Here's a thought, think it is possible in addition to borrowing some artwork, that you borrow some promotions also? Then you could have units that are not only unique in look and name but also in some of the promotions that they can get. hmmm, maybe make a unitclass_mercenary, and flag the promotions only to mercs then make the units themselves seperate unitclasstypes under that. That would save a lot of civinfo editing to restrict them from just building them. Tie the units also into rare chance biggood reward from marnok. you free them, they owe blood debt kinda thing...............

I could go on like this for hours. My main problem is my dieas for exceed my abilities to create.
 
Love the idea. Great way to put some of the great artwork that's been done to use. I am fairly sure with all the art sharing that has been going on, nobody will mind you borrowing theirs. Of course, ask anyway. Needless to say, doing all that for unique units will require a lot of new unitclasses. Here's a thought, think it is possible in addition to borrowing some artwork, that you borrow some promotions also? Then you could have units that are not only unique in look and name but also in some of the promotions that they can get. hmmm, maybe make a unitclass_mercenary, and flag the promotions only to mercs then make the units themselves seperate unitclasstypes under that. That would save a lot of civinfo editing to restrict them from just building them. Tie the units also into rare chance biggood reward from marnok. you free them, they owe blood debt kinda thing...............

I could go on like this for hours. My main problem is my dieas for exceed my abilities to create.

Oh, I wasn't planning on adding any new art to the game at all (yet). I was going to have the "unique mercenaries" simply be highly promoted mercenaries of various civs' units (or default units)

So you may randomly, get the "Riders on the Storm" Unique Mercenary show up in your city for hire, and they would just be a Mercenary Hippus Horseman with Horselord (whatever that hippus promo is), Combat I, Flanking II, and Air II.

All sorts of interesting combinations are possible, and I won't need to add new art (which is outside of the scope of what I'm trying to do).
 
I could go on like this for hours. My main problem is my ideas for exceed my abilities to create.

Please, share your ideas for unique mercenary names, backgrounds, and promotions. There are lots of units in FFH, so making "semi-unique" mercenary unit ideas should be easy to come up with. And remember, you don't have to regulate yourself to the standard promotions on the units either.
 
So do you think the AI will be able to use this system?

Well, I was going to write two different sets of logic, one for a human player, one for the AI. The AI will use it just like it uses the mercenary logic now - if there is an enemy unit close by, buy a mercenary. It could be fleshed out later too.
 
Progress Report

Finished the code which will generate random promotions for a unit. I have built it to ignore techs (except for TECH_NEVER), so mercenaries will get promotions like Woodsman II and Guerrilla II. I've created a "promotion weighting" system for the automatic selection of promotions based on unit type.

Essentially, each unit starts with no promotions, and a list of promotions that they are allowed to take (generated by python based on unit info and the current promotions that they have). The code then selects a promotion from that list based on its weight.

For example, if I have a hunter, the system starts by looking to see what promotions he starts with. Since he has none, it only shows the basic promotions (Combat I, Drill I, Woodsman I, Guerrilla I, Flanking I, Mobility I).

One of these promotions is selected from the list at random (a 6-sided dice roll). Then a number is generated from a 100-sided dice roll, and if that number is smaller than the weighting placed on that promotion, it will be added to the list. So on and so forth until the unit has the requested number of promotions.

With our hunter, I have set Recon Units promotion weighting as such:
Combat I, Woodsman I, Guerrilla I, and Mobility I to the weighting of "80", and Drill I and Flanking I to the weighting of "50".

On the average then, Recon Units will start with the higher weighted values somewhat more often than the others.

First promotion chance, on the first go-round:
Combat I = 1/6 * 4/5 = 2/15
Woodsman I = 1/6 * 4/5 = 2/15
Guerrilla I = 1/6 * 4/5 = 2/15
Mobility I = 1/6 * 4/5 = 2/15
Drill I = 1/6 * 1/2 = 1/12
Flanking I = 1/6 * 1/2 = 1/12

Chance we go onto the second round: 1 - (7/10) = 3/10

I'm no wiz but I think theres something about computing the limit to arrive that the chance for each. (round 2 the chances become 2/15 * 3/10, round 3, 2/15 * 3/10 * 3/10), etc.

A basic look indicates that those items with a weight of 80 have a 19% chance of being chosen, while those with a weight of 50 have a 12% chance of being chosen.

I created a little OpenOffice Calc sheet to help compute weights so I can arrive at some general numbers. Note that weights will have a greater effect if there are less promotions to pick from (since the random chance of selecting the promotion to compute a weight probability is even).

Of course, once the unit gets a promotion, it all gets even more complicated, but I'm not too fussed about it.

Weighting will focus on the following promos for each random unit type.

Melee - Combat, City Raider
Ranged - Drill, Combat
Recon - Woodsman/Guerrilla/Mobility
Mounted - Flanking, Combat, Drill
Disciple - Combat, Demon Slaying, Undead Slaying
Arcane - Spells
Naval - Flanking, Combat
Siege - Barrage

The number of promotions that mercenaries get will be based on city size, culture level, buildings, etc. Units will cost 20 gold more initially for each promotion.

And I think I can use the PyPerTurn attribute of the promotion XML to perform reduce the gold of the player with the mercenary.
 
Progress Report

More bugs ironed out. I still need to code the logic which prevents later tier units from being hired until at least one civ in the game has the appropriate technology.

I am also going to code the upkeep costs in as a formula:

Initial Cost = Unit Hammer Cost + 10 gold * unit level

Upkeep Cost = celi(Unit Hammer Cost / 100) + floor(unit level / 2)

So a unit that costs 100 hammers to build and is level 6 will cost:
Inital = 100 + 10 * 60 = 160 Gold
Upkeep = 1 + 3 = 4 gold / turn

Notice that as mercenaries get more powerful, their cost to keep around grows.

Also, Initial and Upkeep costs are doubled for Arcane Units.
 
Alpha 2 is linked in the first post. It's semi-playable. Still have some python errors to iron out. I updated it for 0.33 patch a.
 
Nyxkin! I love nyxkin ...
Nyxkin (Svartalfar Horse Archer) called "Night Shadow" with Drill 2-4, hero, -10% - -50% city strength, +5 - +30 forest strength, cannot get any promotion via experience; cost: much, gpt: much... ((: - rare apperance, she doesn't like cities very much ... (that's only unrealistic idea - imbalanced, but with some changes it could be fine)

What about hireable animals ? (:

Maybe would be nice, if, for example, after 100 turns you have no longer to pay gpt ... (just idea)

By the way, it will be randomly generated units and promotions or there will be predefined units ? or both?
 
Nyxkin! I love nyxkin ...
Nyxkin (Svartalfar Horse Archer) called "Night Shadow" with Drill 2-4, hero, -10% - -50% city strength, +5 - +30 forest strength, cannot get any promotion via experience; cost: much, gpt: much... ((: - rare apperance, she doesn't like cities very much ... (that's only unrealistic idea - imbalanced, but with some changes it could be fine)

What about hireable animals ? (:

Maybe would be nice, if, for example, after 100 turns you have no longer to pay gpt ... (just idea)

By the way, it will be randomly generated units and promotions or there will be predefined units ? or both?

There's a random Nxykin in there now :-) but I'll add the "Night Shadow" unique to the list.

The plan is to have both. In alpha v2 there units are randomly generated based on probability weights. In general, there is usually about a 70% chance that any one unit will be a "default" unit with the mercenary promotion. Another 15-20% chance that it will be a "default" unit with a racial promotion (orc, elf, dwarf, dark elf). And then < 1% chances for a unit of a different civilization. Look in the python files in the "Mercenaries" directory, I filled them with some comments about how the probabilities work (I will write full docs later).

The unique mercenary mechanic is not in place yet. My plan is to simply have unique mercenaries be units with promotions not available via normal upgrade routes, or just very highly promoted units.

One thing about this, if you get 5 or 6 high level mercenaries, they can start costing you a goodly amount of gold / turn...
 
Back
Top Bottom