A *possible* modmod for HR

Thyran

Chieftain
Joined
Nov 1, 2010
Messages
13
Location
Finland
Greetings.

First of all I'd like you to know that I am NOT a modder. The following simple ideas to change Xyth's History Rewritten mod are only to make it possible to play this pretty heavy mod with lower spec computers. Since I refuse to do my "duty as consumer" and buy a new computer I might as well start this project. :p

I’d like to do as many changes as possible myself and hence learn something for a change. So if you can provide any useful tips how to do these following changes, please do so. Also if you see something which is out of reach of regular modding, point it out.

1.)
The first and foremost idea is to add a bunch of unit limits to the game to avoid the game from "exploding" to your face in terms of lagging. To make this more sensible I'd like to make these limits as a part of the the gameplay in very involving manner.

Everyone starts the game with one scout and a settler no matter what difficulty you play. (read on, explaining soon why)

To make this “unit limit” as part of the gameplay I decided to create a some sort of national military maintenance pool. The pool would consist of resource points which would determine how many certain units could be available to your nation.

All military units consume base deployment cost of 1 food point. They might as well consume other resource points like bronze, iron, horse, aluminium or such. You can aquire these resorce points by securing resources and trading with other civilizations. Every resorce pit would give you 5 points of its own type. And of course with “resource pit” I’m referring to regular resources seen on Civ map.

For an example for having 10 knights you would have to have at least 2 sources of horses, 2 sources of iron and 2 sources of any food types. All these resource points (10 each of them) are now considered used in national military maintenance pool. If you have still one iron mine lying around, you could still afford 5 maceman or such. Since food is the most easy resource available for you this would mean that you would always have some crap units as regulars in your army.

[Ah almost forgot the explanation. Scouts are not considered military units so they wouldn't consume any points.Will propably add a base unit limit for them to avoid AI using them as basic defending militia.]

[I believe I first have to reach unit missionary in documents and study how the unit limit has been made for that unit. Then I can start test-limiting some units and create a code. Still need some advices though]

Any comments so far? I will add more to this post (and edit first message) but so far I'd like to hear your opinion about this idea. I do realize there will be a lot of issues to be taken care of after altering the base gameplay this much.

Edit: Changed 3 to 5 after doing some math.

Regards: Thyran
 
I've been thinking about something like this myself actually ever since Civ5 was announced. Though I don't Civ5's concept of 1 unit per tile, I do like it how units survive longer and can only be produced in limited numbers.

I did some experimenting with restricting active units by resources but quickly ran into some pretty big problems straight away. Units that can be built with copper OR iron are problematic but the bigger issue is that Civ4 doesn't have a concept of a particular resource belonging to a particular city; instead they belong to a city network, of which a civ can have several. The city network aspect of the game just isn't exposed to modding in a useful way.

However, the biggest, ugliest problem is the AI. A change of this magnitude will confuse the AI considerably unless it is coded to understand it. Almost all of the AI is handled in the .DLL which is sadly unmoddable on Mac. Python can be used to a certain degree (Inquisitions AI for example) but the irony here is that Python scripting is very slow, especially when attached to AI decision making. Basically the slowdown caused by all the new AI code would probably be cancel any performance benefit you might get from implementing it in the first place :(

On the bright side, I think food upkeep should be possible to do. I'm not sure if it would a 'fun' mechanic though, as it would slow down a civilization's economy quite dramatically. I'd have to think about the repercussions of this some more, hopefully others could post some insight too.

Finally there is an alternative option that I've been quietly mulling over for a while. I could probably make a simple unit limit based on city size. For example, a city can have 1 military unit for every 2 population it has, or similar. This would have a similar effect to what you propose and shouldn't require an economic rebalance. It would still require a bit of AI coding in Python but not so much that performance would suffer significantly.

I'm out of time at the moment, but I'll post more on this topic tomorrow.
 
How about you modify the UnitMilitaryCost or whatever of the units so that they drain your gold? And maybe you could incorporate the Mercenaries modcomp (Under the modcomps forum, first page). The AI uses it where I've seen it (Unfortunately, that was in RFC, where they made the dll into an application.)

And, with the food thing, civs that were barbaric at some point and amassed hordes of soldiers should get a discount. (Mongolia, Hungary, whoever else)
 
I just clarified my thoughts by editing my 1st post.

Xyth:
...ran into some pretty big problems straight away. Units that can be built with copper OR iron are problematic but the bigger issue is that Civ4 doesn't have a concept of a particular resource belonging to a particular city; instead they belong to a city network, of which a civ can have several.

If the military maintenance pool could be slapped over city network would that solve the problem? The copper or iron problem can be averted by making iron mine to produce 5 iron plus 3 copper and changing axemen and spears to copper-only units. Not really a solution though.

I also though a bit of how the AI would react. Since I really had no clue I thought that the AI could cope with it somehow. Actually the reason why I started to think this whole unit limitation at the first place was seeing too many useless offencive forces composed mainly by battering rams. First I thought that sieging units should be limited by the number of your cities and then started to compose this solution around it.

Your simple and also quite genious idea could also solve the problem since everyone would face the same problem at the beginning of the game and would be forced to build a scout or two. Still I would prefer the original idea since it magnifies the need for getting more resources in the game.

Edit:
JarlaX: Increasing upkeep cost would be one good solution here. I had really bad experiences with the mercenary button in RFC (crashes and freezes) so I can't really see it as an option here.
 
How about you modify the UnitMilitaryCost or whatever of the units so that they drain your gold? And maybe you could incorporate the Mercenaries modcomp (Under the modcomps forum, first page). The AI uses it where I've seen it (Unfortunately, that was in RFC, where they made the dll into an application.)

That mercenary modcomp is an awesome concept and I was hoping to include it in HR. Unfortunately it's very old, written before the SDK existed, and it's doing a lot of stuff in Python that Python really isn't optimal for. It completely breaks multiplayer and considerably slows down AI calculations. It's also quite glitchy.

And, with the food thing, civs that were barbaric at some point and amassed hordes of soldiers should get a discount. (Mongolia, Hungary, whoever else)

I would handle that a situation like that via civics, with the appropriate leaders having a relevant favourite civic. In fact I'm thinking of ditching the Mercenary Army civic I have atm and replacing it with some sort of 'Horde' civic.

If the military maintenance pool could be slapped over city network would that solve the problem? The copper or iron problem can be averted by making iron mine to produce 5 iron plus 3 copper and changing axemen and spears to copper-only units. Not really a solution though.

The problem is that anything to do with the city network functionality is not exposed to xml or python and can't be modded easily without the SDK. Completely ruling it out on Mac.

I also though a bit of how the AI would react. Since I really had no clue I thought that the AI could cope with it somehow. Actually the reason why I started to think this whole unit limitation at the first place was seeing too many useless offencive forces composed mainly by battering rams. First I thought that sieging units should be limited by the number of your cities and then started to compose this solution around it.

Because I've made siege units able to attack from range (and thus no longer suicide units) I think the AI values them much higher than they ideally should. I've been thinking I should increase their gold upkeep and possibly their build cost to see if that helps. Battering Ram spam is a definite problem.

Something else I've been thinking about is if I limit the number of units that can be built (however we decided to do it) I could then give most units a moderate withdraw chance, say 20%. This would theoretically make quality of units (via promotions, which I also want to expand at some point) matter a bit more than just quantity. I'm also pondering the implications of giving ranged units such as archers single tile ranged attacks and collateral damage but I'm still very undecided on that.

Your simple and also quite genious idea could also solve the problem since everyone would face the same problem at the beginning of the game and would be forced to build a scout or two. Still I would prefer the original idea since it magnifies the need for getting more resources in the game.

I'd really like to see resources made more important somehow, the way Civ5 handles them is one of the few aspects that I really like about that game. I'll keep researching and experimenting to see if something is possible.

Overall I'm definitely keen to make some changes to the military aspect of the mod along these lines. I think the safest way to approach it is to keep any changes reasonable separate from the economy to begin with, just so we don't end up breaking it in the process. I won't make any such changes in 0.8, but once that's done we can start trying something out. In the meantime keep the ideas and coming, this is an excellent discussion.


EDIT: Just read your edited first post, some comments:

Your resource points idea sounds like a smaller and tidier version of what The Lopez is doing in his stockpiling mod. He's using the SDK for it though, which we cannot use. I like the idea but, once again, getting the AI to understand it is probably going to be nightmarish, if possible at all. The major problem is that for us Mac modders the AI is effectively hardcoded to think it only needs resources to build the units. We can't mod how diplomacy or the city network works at all. The AI will still happily trade excess resources to other players because we've got no way of telling it that they still need them to maintain their army.

Missionaries are 'national units', you can set in the xml quite easily how many of a particular unit a civilization is allowed. The disadvantage of this system is there is no way to make it scale by number of cities or such. So while you could set a limit of, say, 5 Battering Rams per civilization, they'll all be available from your first city and even if you have 30 cities you still cannot build more than 5 of them across your entire civilization.
 
First off, I love the mod, and like the new ideas being batted about.

Not being a modder, this may be dumb suggestion:

Could the unit limits come from limits within buildings? i.e. Stables are required to build mounted units, and 'x' number of mounted units per resource available is built into the stable.
 
Back
Top Bottom