Supply Lines development thread

Kailric

Jack of All Trades
Joined
Mar 25, 2008
Messages
3,100
Location
Marooned, Y'isrumgone
Alpha Testing Download:View attachment Supply Line alpha 0.31 BtS 3.17.rar

First test files are ready so If anyone would like to test this out and give some feed back that would be cool.

Right Now the rules are thus (Note these are not permanent rules just what I have coded so far):

Rules:

1. There are now 4 levels of Supply explained below
2. New Zone of Control promotion available with Combat III. Units need this to perform ZoC missions
3. When ZoC is active units who can fortify begin to do so. If selected the tiles to the North, South, East, and West will be highlighted around the unit, this is the Zone of Control.
4. If an Enemy Unit or one of yours Units attempt to enter a ZoC they will be halted, a Bombard effect will then play and you will receive a message.
5. Those 4 ZoC tiles are also cut off from the Trade Network, Heal Supply, and can not be worked by Enemy cities.
6. if you Ctrl Click a Unit that is ZoC all ZoCs within 6 tiles will be shown as well. This is in for testing at the moment, I will add some others means to do this as Ctrl clicking also groups units in the same tile.
7. Units who can perform ZoC missions will automatically start ZoC in their Center Tile and only center tile when they are fortified in enemy territory.
8. ZoC when used in Enemy Territory allows your units to heal faster and use enemy roads for trade and supply.
9. Units not connected directly to a City must be within 10 turns movement to receive adequate supply.
10. Air Units or Scouting units can not do ZoC
11. Can not do ZoC while in a City, and ZoC does not effect City squares.
12. Units within 2 spaces of a City always have Supply, this is not a "feature" of the mod but caused by some of the default code that I haven't worked around just yet. Look at it like Supplies can be smuggled out within two spaces :)
13. Tiles effected by ZoC act as Friendly Territory to the unit performing the ZoC

Notes on AI usage: The AI does not understand how to take advantage of these rules at the moment. When the main rules get more finalized I can add in AI to use them. As a handycap for the AI for the moment, the AI does not need the ZoC promotion to use ZoC. Also, any AI units fortified in Enemy Territory will have ZoC in effect.

Levels of Supply:

1. Direct connection to a City: Full Heal
2. Friendly Territory Clear Path to a City within 5 turns: Full Heal / 2
3. Friendly Territory Clear Path to a City within 10 turns: Full Heal / 4
4. Enemy Territory or no Clear Path within 10 turns: No Heal (Actually, atm, you may still heal if in Enemy Territory and have a clear path)


Modding

The button for the new Zone of Control has several versions as I was trying to find a good fit, if you don't like the one in the game there are 3 more you can check out. They are in the Supply Line\Assets\XML\Units file.
Just change this line in the CIV4MissionInfos file:<Button>XML/Units/ZoneStripesSwords.dds</Button> to what ever button graphic you want to use.

Things to Add

1. AI using all the new rules
2. Forts act as a supply source

Original Post:
Spoiler :

I am looking into creating a modcomp that simulates supply lines and below I have jotted down some of my thoughts. If anyone else has some ideas on this please feel free to post.

1. Heal rate is slowed if not connected to City/Fort or other supply lines source, and completely stopped if in Enemy territory and not connected.

2. Enemy units fortified along roads have a "zone of control" effect that cuts off supply lines to joining opposing cities. That way you don't have to "pillage" your own roads so to speak, just station troops along the route to stop the supply. But if troops are needed elsewhere you do have the option to pillage.

3. Using "zone of control" players can "besiege" a city, cutting off its supply lines. Thus starving them out. Cities can even surrender if they are starved for long enough. Owners of "besieged" cities can attempt to send in spies with supplies or attempt to get reinforcements into the city by breaking through the "zone of control", or by "paradrops", etc..

4.Other mods such as the Unit Fuel Mod by Grey Fox could fit into this as well.

Thats a start on some ideas for now...
 
Good ideas all, Kailric.

But consider #3 if there aren't many cities in the game. It could lead to a situation where all units for a civ are out of supply, or all cities are sieged. If the city is logically the supply source, then you can't really siege it. If the "countryside" is what (abstractly) generates the supply to be distributed from cities, then units could arguably resupply themselves from the countryside... I guess what I asking is: Where does supply come from? Only the capital, or all cities (including vassals).
 
Good ideas all, Kailric.

But consider #3 if there aren't many cities in the game. It could lead to a situation where all units for a civ are out of supply, or all cities are sieged. If the city is logically the supply source, then you can't really siege it. If the "countryside" is what (abstractly) generates the supply to be distributed from cities, then units could arguably resupply themselves from the countryside... I guess what I asking is: Where does supply come from? Only the capital, or all cities (including vassals).

Well logically if a Civ was powerful enough they could besiege all opposing cities, thus starving them into submission. This would just be a different way to attain victory instead of sending countless suicide units to wear down defenses.

Naturally all raw resources would come from the countryside or from trade with other cities, then produced into a finished product or supply resource within the city to then be sent out to armies as "supply". But if a city is besieged it no longer receive resources from the countryside or from other cities or can send out resources.

Units out in the field that can gather raw resources and turn them into supply (Medic Promotion), should be able to heal themselves but at a slower rate then if they had a direct supply line coming to them. If in Enemy territory obtaining raw resources would be even more difficult as the locals would not be as cooperative and the Owner of the land that is being invaded would assume to do what ever it takes to prevent the Enemy from obtaining fresh supplies, such as burning their own crop fields, or "Pillaging" their own roads, bridges, and such.

There is also munitions, fuel, and arms that need to be resupplied to more modern units. These things would seldom be found around the countryside and would need to be gotten from a "supply line". Without the resupply the Unit would continuously weaken. Thus such a unit without resupply could have a low heal rate plus have their "attack power" or damage per hit reduced to simulate their lack or firepower. A marine without ammunitions, batteries for radios, and such would only be as effective as an ancient swordsman in terms of firepower.

This is one concept I wanted to bring to my S&TW mod where the battle is taken to the field more than just units stock pilling in cities. In actual history most battles was fought in the field and only when all other options was taken that armies would then hold up inside cities. In my mod I want to make it so that the AI will consider defending the city radius as a high priority, thus sending out units to prevent pillaging. In games I "besieged" cities before and sent lone units around to pillage the countryside unhindered while the enemy just left tons of units defending inside the city. That to me just didn't seem logical.

Thats just some more ideas, but I am no definitive expert on logistics by no means so if anyone can help shed some light on the actual mechanics that can be represented in the game then by all means do so.
 
sounds very nice. I was hoping someone would create this one day, so I didn't have to.... I really need supply lines represented in the American Civil War mod I'm working on. Good luck, your ideas sound good.

Shiggs
 
Hey Kailric,

How's this going? :) Have you put in on the backburner, while working on the engineers?
 
Hey Kailric,

How's this going? :) Have you put in on the backburner, while working on the engineers?

Basically yeah. I am working on the Combat Engineers ATM.. getting the AI to use the new rules. I haven't worked with AI as of yet so its a bit harder to debug but I am making progress. When I get a bit more done I'll look into this next and post an update and maybe some code soon. :)
 
I started working on this Mod again. I am wondering though just how to handle the Zone of Control, here are some options and questions...

Note the Zone of Control(ZoC) is the units space and all spaces touching it in the 8 directions.

1. Should I make the Zone of Control impassible for enemies and enemies have to defeat the Army in order to get through the Zone of Control?

2. Or should they be able to get around it but get opportunity fired upon?

3. What units should be able to make a Zone of Control? Should it be a promotion? Does there need to be a stack of units to make a ZoC?

I am thinking to make it like number 1, where a unit that has setup a Zone of Control basiclly occupies his space and all the spaces around him. And then make it so that not just any unit can make a ZoC, there needs to be certain conditions met. Just what should those conditions be?
 
I'm not too fond of zone of control. It's very un-Civ-IV. And I think it might be too easy to accomplish a cut-off. I'd go with cutting supply when sitting on a road, and allow all units to block supply. Keep it simple! :)
 
Ah, yes! I good idea, and hopefully, soon a good mod.
I have some ideas, that just might come in handy, but first...
A marine without ammunitions, batteries for radios, and such would only be as effective as an ancient swordsman in terms of firepower

No, the swordsman would be more effective, he has a sword :lol::lol:
and it would really only take no ammunitions to make a marine uneffective :lol: "Ah!! SIR, I NEED MORE AMMO, THERE ARE MEN RUNNING AT ME!!! HELP!" good thing he kept his radio, his commander got to hear him die! :lol:

...
Just had to say that, funny as hell.
Now, on to zone of control. I too think this should have stayed from civ2 into civ4, but oh well.
I started working on this Mod again. I am wondering though just how to handle the Zone of Control, here are some options and questions...

Note the Zone of Control(ZoC) is the units space and all spaces touching it in the 8 directions.

1. Should I make the Zone of Control impassible for enemies and enemies have to defeat the Army in order to get through the Zone of Control?

2. Or should they be able to get around it but get opportunity fired upon?

3. What units should be able to make a Zone of Control? Should it be a promotion? Does there need to be a stack of units to make a ZoC?

I am thinking to make it like number 1, where a unit that has setup a Zone of Control basiclly occupies his space and all the spaces around him. And then make it so that not just any unit can make a ZoC, there needs to be certain conditions met. Just what should those conditions be?
Zone of control should not be impassible, however, it should be -1 move or something. 2: Yep, OF should be too, however, ranged units and gun/armor/gunship/cannon units should have a better chance it this then melee units, and the chance for OF should be less towards a fast moving unit. The chance for OF should be more with the amount of units doing the ZoC. i.e. A MarineA has a OF chance on ZoC tiles. However, if marineA had another marine, marineB two tiles away from marineA, (just outside of marineAs ZoC) then the chance for OF in the three tiles towards the two marines is much higher then the rest of the ZoC.
Melee units, should have something like OF, OA, opportunity attack. If the melee unit has a higher then an 80% chance of beating the unit passing it's ZoC, then the melee unit will try an OA. And I think maybe the OA will not take the melee unit away from it's tile?
Just like SLs can't go through ZoCs, unit's can't heal, and the ZoC tiles can't be worked on by the enemy of the ZoCers. And maybe units can't fort down in enemy ZoCs.
Just some ideas.


1. Heal rate is slowed if not connected to City/Fort or other supply lines source, and completely stopped if in Enemy territory and not connected.
What do you mean, connected? By roads? Or by any clear path to a city/fort? I think it should be the latter. However, units heal faster if connected by roads in your control. To have roads in your control in enemy lands, you must have a unit on it. However, ZoC, i'm guessing cuts off SLs, right? So, if you have a large army, they can be cut off and killed if surrounded. I have an idea, maybe add air new a unit that can resupply units otherwise cut off. Doesn't heal as fast but still works. Also, maybe allow ships to Resupply land units, however ships need to be supplied to, and can also be cut off. So, air is you best bet. Air supply can be cut off by fighters or SAMs intercepting your craft. And yes, spies can also give a bit of supplies, just not very much at a time. Oh, and foot units should very slowly lose heatlh if in enemy lands and not connected to supply lines (Running out of food, and first aid for minor wounds and illness). Other units like, armor and gunships should lose health much faster if not connected (Running low on fuel.) same with ships. Destroying enemy towns should give you supplies, as well as taking over an enemy city (Even a good nights sleep in a bed can keep your HPs up) So you can do what Russia did to France. I think maybe supplies should be like a promotion that goes away after every two turns, and only comes back if connected, or if that Supplies Plane gives that unit supplies, (like a GG, almost) or supply ship. So, units can march into enemy lands without needing supplies right away. (Rush the capital, but then find out that they razed it to the ground... Ack! Now your troops are dying! Run home!)
I would say more, but I gotta go. So, I'll post more later if ya want. :D

Good luck, and good night. :D (I think that's how it's goes :p)
 
I'm not too fond of zone of control. It's very un-Civ-IV. And I think it might be too easy to accomplish a cut-off. I'd go with cutting supply when sitting on a road, and allow all units to block supply. Keep it simple! :)

I guess it was Civ 2 that had a ZoC. Not sure what exactly it did, like slowed movement and maybe opportunity fire also, someone remind me what it was. I do want to add a ZoC though cause it adds more realism to the game, but I want to add it in such a way that its fun. When I release the first version if you don't like it I can edit it out for you really simple like if you don't know how.


Anyway, this is what I added so far.

1. A new Command called Zone of Control. When a unit under Zone of Control is selected the tiles around him under his control get High lighted in team color when he is selected. Right now I am only allowing the North, South, East, And West directions to be under ZoC. That way it takes 4 units to totally surround a City with ZoC. ZoCs can not over lap each other, that is if a Unit can do ZoC command his ZoC can not over lap another Units ZoC. This rule mostly just makes coding lots simpler atm. I haven't worked on any effects of ZoC atm either, thats all on the drawing board still.. but to make it simple to keep up with where your ZoCs are and also your enemies, you can Ctrl Click a unit that is under ZoC and it will highlight other ZoC tiles in the same area. That way you can see if there are any wholes in your Blockade. Once you click another unit or deselect that unit the highlight goes away.

2. For a separate mod but I may add it to this one I added a new Command Called Attack/Retreat. This is useful if for example you have a single enemy unit near a stack of units. You can Attack/Retreat with any unit, even Melee units and instead of that unit moving to the space if he wins the battle, thus being separated from his comrades and most likely to die if not defended, he will retreat back to his stack, using up one movement point and one of his attacks that turn if he has more than one. It actually works the same as if your unit attacked a stack of units.

I lost so many units before trying to kill off lone units because of my units being left on the field of battle alone. If a unit can retreat back at no cost if he attacks a stack of units, I see no reason why he can't do that if he attacks a lone unit as well.

Also, thanks for your input, Grishnash, I'll look over what you said closely and consider it all while this is being developed.
 
Well, there's this little thing I came up with a long time ago...

Thanks for the input. I also like a slower E&E as you put it. I hate it that about the time I get my army of Knights up and going someone is making riflemen already. I am not sure how much an OR would slow down advancement though, you could still spread cities eveywhere you would just need to make sure you didn't stray to far. But, those are some interesting ideas, I'll consider that info as well.
 
Good work. I will probably just settle for using rule 1. :)
 
I guess it was Civ 2 that had a ZoC. Not sure what exactly it did, like slowed movement and maybe opportunity fire also, someone remind me what it was. I do want to add a ZoC though cause it adds more realism to the game, but I want to add it in such a way that its fun. When I release the first version if you don't like it I can edit it out for you really simple like if you don't know how.

As far as I remember, in Civ2, if you were sitting on a tile next to an enemy unit, you couldn't move to another tile which was next to an enemy unit. So effectively, you couldn't go around an enemy unit without destroying it. Many people didn't like this, but on the other hand it allowed for easier creation of choke points.
 
Good work. I will probably just settle for using rule 1. :)

I been working on the ZoC part for a while, but I'll go back to the "Heal from Supply" soon and see what else can be done with this. As of now you have to be connected to cities by roads or rivers in order to heal, but thats a bit drastic so I need to tone that down a bit and just penalize instead of total cut off. When I do this I'll add XML tags so that the figures can easily be modified.

As far as I remember, in Civ2, if you were sitting on a tile next to an enemy unit, you couldn't move to another tile which was next to an enemy unit. So effectively, you couldn't go around an enemy unit without destroying it. Many people didn't like this, but on the other hand it allowed for easier creation of choke points.

Ahh, ok.. so you Could move in close to the unit to attack but then couldn't move around him, could only move away. Thanks, I was wondering how they set up that rule.
 
I love ZoC. It actually allows you to make realistic and reasonable field defences that don't end up requiring a "Great Wall of Units" across the map.

Civ2 stopped adjacent units and required destruction.

Civ3, if a unit had bombardment would bombard any units attempting to pass. I like Civ3's best.

So thank you kailric. Defo want to use ZoC in my India mod!

Btw:

If not units to give ZoC, what about occupied forts? Even in Colonisation a coastal fort would attack passing enemy ships!
 
I love ZoC. It actually allows you to make realistic and reasonable field defences that don't end up requiring a "Great Wall of Units" across the map.

Civ2 stopped adjacent units and required destruction.

Civ3, if a unit had bombardment would bombard any units attempting to pass. I like Civ3's best.

So thank you kailric. Defo want to use ZoC in my India mod!

Btw:

If not units to give ZoC, what about occupied forts? Even in Colonisation a coastal fort would attack passing enemy ships!

Well the hardest part of ZoC is coded now and that was just detecting when you enter a ZoC. Adding what happens when you do is a lot more easy. What I will probably do is both Civ2, Civ3 types, and maybe some others and have an option in the XML that you can easily mod to change how ZoC works.

Forts could offer some kind of bonus or get Opportunity Fire as you say.

I plan on making it so not any unit can do ZoC. They must have certain promotions first, maybe even a new promotion, or a certain level. That way it makes keeping units alive and leveling up all the more important.
 
I almost forgot I typed this yesterday, then the internet went out and I could not post it, so I am posting it now :)

What do you mean, connected? By roads? Or by any clear path to a city/fort? I think it should be the latter. However, units heal faster if connected by roads in your control. To have roads in your control in enemy lands, you must have a unit on it.

I meant by "roads" but the thought had come to me sense then that a Clear Path should be checked for. What I will probably do if I can manage it is have heal rate based on four things...

1. Clear Path to Supply
2. if Path is connected by roads
3. The distance to the supply source
4. If a unit has Medic ability

The distance should be factored in. If enemy units have lots of ZoC set up and a clear path to a supply source is a large distance it should slow down supply.

I like the idea of units being able to supply other units like air units and ships. Maybe I can add a counter that starts to count down once a unit is cut off from the supply line. Once they are out of supplies they could start to lose strength. Other units could refresh their supply and start the counter all over again.
 
I have to admit, I'm skeptical about designing decent supply lines for units.

I mean, part of the problem is that a plot in enemy territory is not considered to be connected to your cities. When the game checks if a tile is connected to a particular city or your larger trade network, the game isn't checking the tiles between it and your city to see if there's a route connecting them. Each time a route is built (or destroyed) on a tile, the tile is added to a "plot group" that contains all the tiles that are connected to the trade network. If two tiles are in the same group, they're considered to be connected.

So if you want to have units on foreign plots considered to be connected, then you are going to have to check for valid paths back to your territory. I've toiled over this subject and found it very frustrating because it seems like a good check for a unit's valid supply line is going to eat up a lot of processing time for each unit.
 
Back
Top Bottom