Exotic Unit Pack - Mod Collaboration Thread

Appreciate any text you can provide. I added most of the civilopedia data when building the mod, but there are a handful of units still missing info. I wouldn't worry about it much. As long as all the information about the unit, building, promotion, etc., is available, that's really good enough - enough for a player to understand exactly how to use the capability without further documentation.

The main things to check are the validity of the entries that are already there. I did a lot of cut/paste on the mod, and it's easy to overlook not having changed something on the new pasted addition.

Understand about the school thing. No worries there, either. The main thing any testing right now accomplishes is basically the most important thing: is the mod FUN to play? Does it add things that aren't there normally? Getting text fixed and making sure the mod is stable is of course important as well. But to me, I'm much more interested in how you're like it, and if not, what can we do to make it more fun to play.
 
Ah, I see.

Currently, the mod's pretty fun to play with. Opens more possibilities, and adds a little more sense to the game. Like, if you had elephants, can you not see the potential in battle? You could use them, but oh wait. You're not playing as a certain civ. Same thing with camels.

Oh, speaking of elephants, I think it makes more sense to have the Battle Elephants upgrade into the Howdah rather than the Siege Elephant. The Battle Elephant is melee, and so is the Howdah, so I think that makes some more sense.
 
Odd you mentioned elephants as part of the appeal of the mod. My son popped over this weekend and took a look at what I'm working on. Like you, he's heavily distracted by finals, and ready for a break from all the pressure. The main thing that caught his eye, after looking at all of the new units, was? Yep, elephants! :lol: I think his quote was, "Yeah, everybody likes elephants!" He has a couple of civs that he likes to play, and none of them are Carthage, Siam, or India. So, I think you're on to something with these new units.

I'll make the change about the battle elephant upgrade. Makes more sense.

Am starting the merc function code this morning. Never done pop-up windows in my mods, so this is new ground for me. Have some good examples, so I'm hopeful it won't be a complete pain. Will let you know how it's going later. Thanks for all the input. Definitely helps.
 
OK, so far, so good... Have figured out how to generate the popup and how to get data fed into it. Next steps are to build the iterative logic to actually cycle through all the player's units (simple), determine if a contract needs renewing and deducting funds if needed(simple).

After that, I have to the two "notifications" to build - which is basically a cycle through the units and warn about an upcoming contract expiration, and to actually remove/notice if insufficient funds available to renew. Basically a few lines of LUA I've used before, which is easy, but in the past, I've encountered a situation where the notification will print 3 times in a row - looks bad and will have to be fixed, IF it pops up.

Finally, I'm going to have to do a little homework on the math involved in science based on game speed. I've been using the example of "if there are 50 turns in a unit's life cycle, then there are 25 turns in a contract." But at different game speeds the life cycle might be half that. Ultimately, I'll need a different/better scale for each speed, and that will take a little homework, once I get the "graphics" part of the function done.

Here's what the screen shot of the pop up looks like at the moment. I'm using the in-game unit of Mech Infantry as my test unit, as it's usually not available til the end of game. The Exotic Units mod is a bit largish and slows down mod load/unload quite a bit. I'll incorporate the function into EU once it's done.

upload_2017-12-12_17-4-53.jpeg
 
Update: the basic merc function seems to be working as intended. I've tested it using different scenarios and it seems to allow contract renewal, unit disbanding, and forced disbanding when insufficient funds are on hand. It displays the proper notification icons on the right side of the screen when it's supposed to. Have some screenshots below. For testing, I was using the Scout and Mech Infantry as Mercenary units - to make sure the function could process the proper units. There's only one minor issue left to fix: at the start of the turn, the camera pops over to the last unit a player moved, instead of the first Merc unit to process. If there are several merc units to process, the camera works properly for 2 .. n units. Minor nit, but it's consumed way too much time already....

Next steps: I've been researching the Science/Research formulae in order to come up with a handful of heuristics that will be used to drive the old "Contract length/cost to hire-rehire" question we've been discussing. Have a few ideas, but they'll need further testing. Maybe another day or so. Once those are in place, I can fairly quickly complete the AI merc processing. That should be quick, as it uses those heuristics in a semi-random set up.

After all this is up and running, I can integrate the test mod into the larger Exotic Units mod, which I can turn over to you for testing. I'm hoping this can be done in the next few days.

Last thought - I have a couple of old "automatic naming" functions that could be added to the mod - that assigns nicknames to merc units when they're built, e.g. "Merrill's Marauders," etc. It adds a lot of color to the game, and should be a quick cut/paste to add to this one. Just a thought.

upload_2017-12-14_14-43-58.jpeg upload_2017-12-14_14-44-12.jpeg upload_2017-12-14_14-44-28.jpeg upload_2017-12-14_14-44-43.jpeg upload_2017-12-14_14-44-57.jpeg
 
Last edited:
I don't think the camera is that big an issue. At least, not to me. But if others are gonna use this mod, it might be for them, so . . .

Hey, I think that's a pretty good time, considering break is about to start.

I like the automatic naming system, actually. I think that makes it more interesting. Like, you hire a group of people that call themselves . . . "Artemis' Archers," or something. That could be cool, honestly.

Also, did you think about my question about the horse archer units? Like, as non mercenary units. I know the Huns and the Mongols have something similar, but still. I think people should be able to do horse archery if they have horses nearby. Just a suggestion.
 
There are two basic naming functions - one for land units, another for ships. The ships are a basic sampling of named ships throughout history, especially the age of sail.

Land units are a bit different. There are 4-5 different ways to name land units, but the vast majority of names come from a random name matching function that has 50+ "adjectives" and 100+ "nouns" - like our "Merril's" + "Marauders" mentioned earlier. Not too sophisticated but due to the magic of combinatorics, there shouldn't be too many duplicate unit names floating around.

New non-merc horse unit? No problem! I have good models for both Huns and Mongol units. If there are any other suggestions, let me know - especially in the "prereq tech/obsolete tech/promotions/nearest analogous unit" area - helps me build the unit much more quickly. I'd prefer to keep with the "4 units per class" approach - to keep peace with the picture straightener in me... Maybe the Sioux? Will look for another suggestion and let u know when I find one.
 
So long as you don't burn yourself out, haha!

I was thinking we could name them skirmishers. Available at Mathematics (I think that makes sense. You'd want to be able to calculate a horse's speed when shooting arrows from its back), and then upgrade to a Heavy Skirmisher. I think they can be available at Gunpowder, and have muskets rather than bows or crossbows. And, if you can, make them ranged still.

There's only 2 ideas I had, currently.
 
Unit namer is done. Works pretty well, with one small issue for the morning: the unit tooltip (what shows when the mouse hovers over the unit) isn't updating properly. There's a straightforward way to fix this that I've used before, but I'm looking for something more elegant (one that doesn't need to replace a core game file - which makes the mod incompatible with any other mod that needs to replace that same core file. It's a moderate risk, but for a very small benefit - so maybe not worth it.).

Anyways, a little sample of what the units look like - remember Scouts and Mech Infantry are my surrogates for merc units while I'm testing the merc function code:

upload_2017-12-14_18-29-16.jpeg

FYI: Ship names avail ~ 1140. Adjectives=127. Nouns = 97.

The possible combinations quite extensive. Will help keep duplicate unit names down to a very low possibility.
 
The function will use the name of the city in which it spawns, and if for some reason (maybe a city state gift?) the unit doesn’t spawn in a friendly city, it will use the capital’s name. The unit is supposed to be a local “levy” of sorts.
 
After much trying, there simply is no "painless" way to update the unit's tooltip with the newly assigned name. Only way I've been able to get it to work is replace the game's "UnitFlagManager.lua" file with a newer version that allows the tooltip change. This will cause a conflict with other mods that do the same thing (RED, EUI, VoxPopuli, CBP, ContextualUnitName, UI-EditUnitNames, and probably a few more). So, I think I'll just leave it it is and call it "good enough."

Am currently running a series of LiveTuner simulated games at various game speeds, to gather data to be used later in determining a reasonable "contract period" for the merc units (and therefore price to hire). Have ran 3 Quick, Normal, Epic, and am on my 3rd/last Marathon game - collecting science performance data for each one. Will continue the data reduction/analysis to come up with some "best guess" data to develop good heuristics on how to initially set up contract length for each unit.

This is definitely one of the things you'll have to look at when you get to test the merc function. Basically, are the merc units a "good value" - price versus performance? They need to possess this value so they can compete against normal units. Otherwise, they won't be used and at that point, why are they here? The trick will be to adjust the "best guess" data based on testing to a place where it "makes sense" - and leaves the merc units competitive.

Will have data collected/reduced today, and start plugging in the numbers into the mod tomorrow for initial testing. I don't think this part will take very long.

After that, I'll start on the ranged cavalry unit class you mentioned earlier. I think that will be pretty quick as well.

With a little luck, I think the actual V1 will be ready for your testing before the end of the week end.
 
Will make sure to keep that in mind when testing.

I forgot to mention, I was playing around with the mod, and the barbarians ended up actually using the Rabble unit. I don't know if that means the AI will as well, but it's a start, I think.
 
Last edited:
As a testing measure, the barbs and the city states can use ALL of the units in the mod. Before going final, I'll "override" those units to prevent the minor civs from using them. I'm trying to get as many of these units as possible in the game to test for stability. But so far, I don't think there are very many problems in that area.

The good thing about your seeing them is that the "flavors" are looking good - and if the Barb AI is using it, the major/minor civs should too.
 
Update. After much slogging though over 10k turns of game data, I came up with several formulae to calculate merc hiring costs. Unfortunately, none of them worked predictably without the need for creating large meta-tables that required significant overhead setting up and using. The nice, useful LUA methods (like determining when a different player discovered a certain tech) that would have made this simpler just don't exist.... :wallbash:

Currently, everything is set up and working correctly with the exception of initial procurement of the merc unit. The merc function checks which units need a "contract expiring in 5 turns" warning, processes hiring/disbanding units as we discussed previously.

Next step is to get the original procurement of the units themselves working properly. I'm trying hard not to touch the CityView.lua code (which shows the City View UI) which would significantly hurt compatibility with other mods.

So, I"m experimenting with greatly lowering the "Cost" of the units so they can be purchased normally, but at about 1/4 the original purchase price. The merc function will then manage their life cycle after they show up initially through normal game mechanics.

The part of this approach that is unknown is how the AI will treat the "very cheap" units that have such good combat strength numbers. It will take some adjusting these numbers, as well as the flavors, to make sure the AI doesn't simply decide these units are too good of a bargain to pass up then never build more normal units. Am hoping to get to this testing later today. Assuming I can get all this to work (not exactly a sure thing), the function is more or less ready to release.

Couple of things I've seen in JFD's merc mod: the ability of the merc units to "desert" and "rebel." Deserting simply means the unit disappears (they took the money and ran). Rebelling means they turn into a red Barbarian unit wherever they were on the map. Both of these are simple to implement, but the triggers need a bit of thought. Was thinking about applying a straight %, say 5% per turn chance of either event - then adjusting them higher or lower. For instance, if you're in the minus on gold income, maybe a few extra percent chance of desertion, capped at 10%. For rebellion, maybe use global unhappiness to add a few extra percent chance, also capped at 10? The hard part is establishing these numbers. Putting them into code is pretty straight forward.

Anyways, a little behind schedule at the moment. Life getting in the way... :lol:
 
Wow, that sounds like a lot of work. I don't know, though.

I don't know where I stand with the "desert" and "rebel" functions. It would be realistic, but . . . I don't know. I guess we can see after how they work out. Although, if you are going to implement it, I think the chances of either happening should be pretty low.
 
Back
Top Bottom