Cargo System Overhaul [OBSOLETE]

Do you want to have Cargo Overhaul?


  • Total voters
    21

raystuttgart

Civ4Col Modder
Joined
Jan 24, 2011
Messages
9,638
Location
Stuttgart, Germany
Hi guys,

@Nightinggale asked me to dig out some of my old concepts that could use his InfoArrays.
Also recently @Mr. ZorG asked me for configuration options for Cargo types as well. (see here)
And I never was happy with the boring Cargo System ...

So why not make us all happy? :dunno:
But just making a few modders happy is too easy ...

Thus added some more constraints to the Problem Description.
(Makes Problem Driven Design a little bit more fun and challenging ...)
  • It should make our Ships more diverse and improve gameplay
  • It should be easy / efficient to implement
  • It should not cause issues for AI or at least be easy to teach to AI
  • It should be complex enough fun for micro-managers
  • It should not cause issues for beginners
---

So ok ... :hmm: ... "Interesting Challenge, let us see where Problem Driven Design will takes us". :think:
Working on design ... :coffee: ... having an idea ... :mischief: ... here it is:

---

How to use the Info Array:

Each Transport will get an InfoArray with "SpecialUnitTypes" and the max amout of Cargo Slots for each of these:
(And of course the Transports will be balanced differently.)
  • SPECIALUNIT_YIELD_CARGO
  • SPECIALUNIT_COLONIST_UNIT
  • SPECIALUNIT_MILITARY_UNIT
  • SPECIALUNIT_TREASURE
  • SPECIALUNIT_FORCED_LABOUR
e.g. for a Galleon it could look like:
(Those are just example values for explanation !)

Code:
<SpecialUnitCargoRestrictions>
    <SpecialUnitCargoRestriction>
          <SpecialUnit>SPECIALUNIT_YIELD_CARGO<SpecialUnit>
          <iMaxCargoSlots>5<iMaxAmount>
    <SpecialUnitCargoRestriction>
    <SpecialUnitCargoRestriction>
          <SpecialUnit>SPECIALUNIT_COLONIST_UNIT<SpecialUnit>
          <iMaxCargoSlots>4<iMaxAmount>
    <SpecialUnitCargoRestriction>
    <SpecialUnitCargoRestriction>
          <SpecialUnit>SPECIALUNIT_MILITARY_UNIT<SpecialUnit>
          <iMaxCargoSlots>3<iMaxAmount>
    <SpecialUnitCargoRestriction>
    <SpecialUnitCargoRestriction>
          <SpecialUnit>SPECIALUNIT_TREASURE<SpecialUnit>
          <iMaxCargoSlots>6<iMaxAmount>
    <SpecialUnitCargoRestriction>
    <SpecialUnitCargoRestriction>
          <SpecialUnit>SPECIALUNIT_FORCED_LABOUR<SpecialUnit>
          <iMaxCargoSlots>5<iMaxAmount>
    <SpecialUnitCargoRestriction>
<SpecialUnitCargosRestrictions>

This would result in a Ship that could:

1. Carry max. 5 Goods
2. Carry max. 4 Colonits
3. Carry max. 3 Military Units
4. Carry max. 2 Treasure (which needs 3 Cargo Slots each)
5. Carry max. 5 Slaves (or Criminals)

@Nightinggale
I am aware that leaving out entries in the Info Array would be equal to "no restriction".
In this case I however wanted to have all of them in there for better understanding.

---

How to make @Mr. ZorG happy:

@Mr. ZorG
will thus get a tool to create a very diverse and interesting Cargo System.
Specialized Treasure Transports, Troop Transports, ... will become possible.

---

How to make me happy:

Well, first of all I can have fun modding it. :)
But even more importantly for me, ist that I can create a challenging system for micromanagement and gameplay.

---

How to improve gameplay:

First of all the "Galleon" will not be the "One Ship that rules them all" anymore.
Depending on what you want, you will want to buy / build / use different Ships.

1. Some Ships will be better for Goods (considering costs vs. cargo space)
2. Some Ships will be better for Civilian Units (considering costs vs. cargo space)
3. Some Ships will be better for Transporting Goods (considering costs vs. cargo space)
4. Some Ships will be better for Treasures (considering costs vs. cargo space)
5. Some Ships will be better for Forced Labour (considering costs vs. cargo space)

Each Ship could become a bit more unique and diverse already by its cargo balancing.
(In the future we will of course also change other balancing, like costs and also Promotions.)

We would visualize it by Mouse Over and in Colopedia.

There will simply be much more strategic choices considering which Ships you use for Transportation.

---

Will it be easy to implement:

After what I have seen yesterday, yes it will.
InfoArrays of @Nightinggale will save a lot of time. :thumbsup:

Will it be a problem for AI:

AI should be no problem either if I balance it correctly wihtout overexagerating. :)
(Cargo Rules balancing and AIWeights for Ships will get adjusted.)

If necessary, I will of course adjust AI logic.
(But AI should mostly just need to be taught if it can still load or not.)

---

Will it be complex enough for micromanagers:


Well, this is no "Railroad Tycoon", but the transportation aspect of the game should get more fun.
It is just no stupid "buy only Galleons" anymore ...

Is it going to cause issues for beginners:

I do not think so, because there will be a Mouse Over and Colopedia for it.
But to be sure, we will make the "Cargo Overhaul" a Game Option.

---

So my last questions is simply:

Do you guys want to have it? :)

---

Comment:

Please let us not waste time to discuss single XML values now. ;)
(We will create a good balancing for this with our partners.)

---

@Nightinggale:
Do not worry, this is just the first of many "Overhauls" and new features to use your InfoArrays. ;)
You inautiously called for the "feature devil" and now he is here! <evil laughing sound> :satan:
 
Last edited:
  • Like
Reactions: nci
I like the idea. However, if the cargo system would be modified - would it be possible to place different goods into one cargo slot? Would be great. If I remember correctly other mods already using this feature.
 
What if I want to carry one civilian and one cargo? How does mixed transport fit into this?
You can, it will only check the "max cargo slots" you use for a specific "Special Unit Type".

So with a "Galleon" that has these limits:
(Just as example !)

1. max. Carry 5 Cargo
2. Carry max. 4 Colonits
3. Carry max. 3 Military Units
4. Carry max. 2 Treasure (which needs 3 Cargo Slots each)
5. Carry max. 5 Slaves (or Criminals)

You could still use all 6 slots:

e.g. you can still combine smartly
  • 3 Military Units and 1 Treasure (as 3 Cargo Slots)
  • 3 Colonists and 3 Goods
  • 5 Slaves and 1 Goods
You just cannot do these anymore boring "no brainers" anymore
  • 6 Goods
  • 6 Colonists
  • 6 Slaves
  • ...
----

You are simply "forced" to use your cargo slots a bit smarter. :)

----

Summary:

Galleon (as example) will still be the best in "overall Transport Capacity" and "Treasures".
But e.g. for Troops or Civilians it will not be the best anymore. (considering cost vs. cargo capacity)

So for transporting Troops or Civilians you may prefer to use other ships.
Thus your Galleons could e.g. still be available for transporting Treasures.

----

In other words:

The system does not take away "Overall Storage Capacity".
It just makes the player think how he can optimally use / distribute the transporation capacity of his ships.
 
Last edited:
would it be possible to place different goods into one cargo slot?
Nope, never liked that anyways, because that is the contrary of what I want to achieve. :nope:
I want to make this more challenging and interesting.

What you describe is a system that completely removes thinking for cargo. :(
(You simply just dump into your ship until it is full.)
 
I like the idea. However, if the cargo system would be modified - would it be possible to place different goods into one cargo slot? Would be great. If I remember correctly other mods already using this feature.
DoaNE makes use of that feature. I would like to add that as it makes automated transports more efficient (5 fur, 10 tobacco, 8 cotton, all in one slot). I think I wrote something about it on GitHub once about how I would make the implementation be based on EnumMap, but place it in a wrapper function, which takes care of "bookkeeping" as in it counts total. This will make it high performance without using a lot of memory in non-transports.

If we add such a system, we can set max total cargo. Number of slots used for cargo is then cargo on board * number of slots / cargo capacity, rounded up. This allows a cargo specialized transport to have more cargo in each slot, like in one transport, a slot takes up 30 cargo while it's 50 in another. Since a civilian takes up one slot, that's another way to make the transports more diverse.

The main problem with this would be that it would need a GUI upgrade to display the cargo on board. This in turn means work on colony screen and trade screens. Doable, but not trivial.
 
DoaNE makes use of that feature.
Yes, but I always hated that system to be honest.

It is a "no brainer system" that removes all thinking for cargo space usage optimization.
You just dump everything into the Ship until it is full - you e.g. do not even have to consider to first sail to another colonize to fill up a cargo slot that is partially full and thus optimize the cargo space usage.

I would like to add that as it makes automated transports more efficient
Yeah sure, every "no brainer system" is good for AI. :dunno:
But I want to create a system that is fun and challenging for the Human player.

Those 2 constraints simply do not match ... :(

The main problem with this would be that it would need a GUI upgrade to display the cargo on board.
The UI you need for hat is really ugly and it is also not convenient for usability ...

----

Are you really sure that the DoaNE system is what you guys want?
It is neither fun because there is no thinking involved, nor is it good for usability nor does it look good ...

Sorry if I say it like that.
But I really do not like it ...

----
  • The system I suggest here is supposed to make players think and manage optimal cargo space usage and buy ships strategically
  • It is supposed to give Ships differentiated specific roles (advantages / disadvantages) for Transportation.
----

By creating a "dump all you want into the Ship system until it is full" we would completely destroy that again.
 
Last edited:
InfoArrays of @Nightinggale will save a lot of time. :thumbsup:
InfoArrays are fast when looping an array with lots of default (0) values and it's easy to set up to read from xml.
EnumMaps are fast when reading a specific index (like what is the value for UNIT_MASTER_BLACKSMITH), but it can't read from xml. InfoArray is read only after it has been set while EnumMap can change contents at any time if needed.

Luckily I have written converters meaning we can do stuff like filling an InfoArray from xml and then convert it to an EnumMap using just two lines (one for reading, one for converting). Those two exist as a pair. Which one to use depends on how you plan to access the contents.

Common to both is low memory usage if not used. InfoArray is (I think) 20-32 bytes while EnumMap is 4 bytes when completely empty. EnumMap is designed to be added to a class like CvUnit and then only be used by some. It's perfectly fine to add one, which is only used by transports, one which is only used by human players etc because they carry such a small memory overhead.

We shouldn't worry too much about the implementation while brainstorming for a gameplay design. We have multiple options to make the best of the situation depending on what we need to do.
 
We shouldn't worry too much about the implementation while brainstorming for a gameplay design.
Fully agree. :)

I created this concept (and others) yesterday though, because I was thinkig about good usage of "InfoArrays".
You know me, when I get a new toy, I want to play with it ... :mischief:
 
So again, to avoid confusion:

You will always be able to fully fill the cargo slots of your ship.
But to do so, you will need to pay a bit of attention to the type of ship and combine goods to fill the cargo slots efficiently.

A Treasure Ship can always fully be loaded with Treasures.
But for loading other goods you need to combine a bit. And maybe not everything can be loaded.

A Cargo Ship can always fully be loaded with Cargo.
But for loading other goods you need to combine a bit. And maybe not everything can be loaded.

A Slave Ship can always fully be loaded with Slaves.
But for loading other goods you need to combine a bit. And maybe not everything can be loaded.

A Military Transport can always fully be loaded with Troops.
But for loading other goods you need to combine a bit. And maybe not everything can be loaded.

A Civilian Ship can always fully be loaded with Civilians.
But for loading other goods you need to combine a bit. And maybe not everything can be loaded.
 
Last edited:
That will not happen, I assume we will use the ships which are already implemented.
I fully agree. :thumbsup:
We will not enforce to add more Ships "just to have more". :nono:

Maybe only one or two to close a gap if required.
Excactly. :thumbsup:
If there is a good gameplay reason or a good reason considering immersion for a new Ship we might add it. :)
  • I could e.g. imagine that we add a "Slave Ship" for gameplay once we add "Actual Triangle Trade".
  • I could e.g. also imagine that if our balancing of Promotions requires a specific new role in balancing of Ships, we might add a new Ship.
  • I could e.g. also requirest that if we ever do the "Rebuild of War of Independence" and want to give the King different Ship types we might add a new Ship.
  • ...
But this is currently not the case. :dunno:
At the moment we just talk about doing an "Cargo Space System Overhaul" of existing Ships.
 
Last edited:
Do you guys want to have it?

No and yes.
Voted no -> because of the results it will provide.

The only way as I can agree exactly the same:
I like the idea as long as a bunch of new ships are added.

So without divide (existing) ships; and/or add new ships, like the present "all in" galleon divided into (as new units):
  • treasure galleon
  • war galleon
Or probably a third as trade galleon it is just restricts.

In the other hand:
be possible to place different goods into one cargo slot?
DoaNE makes use of that feature. I would like to add that as it makes automated transports more efficient (5 fur, 10 tobacco, 8 cotton, all in one slot).

That would be nice. :thumbsup:
Actually always hated the slot system itself :sad: both in original col and civ4col
-> as it limits one type of goods in one slot.

Opposed with the carry weight (tons/ barels/ etc...) in other games, like: Port Royale series.
 
Last edited:
  • Like
Reactions: nci
I'm all for the idea of making transports more unique. However I feel like the proposed system might result in odd combinations, which will confuse players as they end up being illogical.

Rather than defining how many of each category a ship can load, how about defining type restrictions to slots? Like a slave ship with 5 slots, but one slot is defined as "can't load forced labor" while two other slots are "can't load civilians or military". If clearly labeled and with proper code to move units around, the game will always solve the "how to fit everything in the right slots" issue. Restricted slots can be color coded to make it clear to the player that they aren't general purpose.

UnitInfo should tell how many yields there can be in a slot. A passenger optimized ship can carry less yields in each slot than a cargo optimized ship.

Allow ships to have professions. Professions can add/remove slot as well as altering how much cargo each slot can have. Professions can then modify how the unit is as in sacrifice military strength for +10 cargo in each slot or something like that. Sacrificing cargo space (possibly even slots) for added movement. Promotions can affect this too.


I don't think this is "complete" in the sense that xml setup and intuitive understanding of the player might not be perfect. It's most certainly work in process, but that is why we have a thread to discuss ideas.

EDIT:

I think I solved how to configure this in xml. Add an InfoArray, which is the default slot on the unit in question. Then there is an array of InfoArrays, all of the same type. This configures those, which are different from the standard.

Implementation would be to store that in an int, which is then used as 32 bools. 30 bools is 6 slots with 5 bools each. This means checking if a certain type can be in a specific slot would be
HasBit(int,(slotID * 5) + enum)) where the enum is the different categories. Not only would this use almost no memory, it would also have no impact on performance at all.
 
Last edited:
Rather than defining how many of each category a ship can load, how about defining type restrictions to slots?
Sounds great. :)
Defining each slot specifically would be awesome.

Like it even more than my original idea. :thumbsup:
But how do you want to do it?

Like a slave ship with 5 slots, but one slot is defined as "can't load forced labor" while two other slots are "can't load civilians or military". If clearly labeled and with proper code to move units around, the game will always solve the "how to fit everything in the right slots" issue. Restricted slots can be color coded to make it clear to the player that they aren't general purpose.
Again, sounds great and if we figure out how we can do it, forget about my idea above. :thumbsup:
(I did not suggest something like that because I have no "ready to go design pattern" I could use to implement it.)

UnitInfo should tell how many yields there can be in a slot. A passenger optimized ship can carry less yields in each slot than a cargo optimized ship.
Nice, I start to get the idea. :hug:
So you still want to allow e.g. "Trade Goods" in a "Passenger Cargo Slot" simply less. (Applying a negative modifier)

Allow ships to have professions. ...
Hm, ... :think:

Do we really want to abuse Professions for it? :hmm:
Why not directly balance it into the UnitInfos? :dunno:

Why not create a new XML with "CargoSlotTypes" working also as an InfoArray we add to the Ships?
(So we could e.g add 3 Cargo Slots for X and 3 Cargo Slots for Y)

I don't think this is "complete" in the sense that xml setup and intuitive understanding of the player might not be perfect.
Once the gameplay design works the reast (e.g. Mouse Over, Pedia, Pop-Ups, .. should be no problem.) :)

It's most certainly work in process, but that is why we have a thread to discuss ideas.
Considering these I like it:
  • Gameplay :)
  • Usability :)
  • Immersion :)
  • XML balancing :)
  • AI concept :)
The only thing I worry about is this here:
  • Effort :(
 
I think I solved how to configure this in xml. Add an InfoArray, which is the default slot on the unit in question. Then there is an array of InfoArrays, all of the same type. ...
Sorry you lost me with array of InfoArrays ... :confused:
I fully trust you it will work, but I will need to see an example to understand.

But ok, if you are interested and have a technical concept we can make it happen. :thumbsup:
Should become a fun modding session for a nice feature again - the gameplay concept definitely sounds great.
 
Sounds great. :)
Defining each slot specifically would be awesome.

Like it even more than my original idea. :thumbsup:
But how do you want to do it?
PHP:
enum
{
  CARGO,
  CIVILIAN,
...
  NUM_TYPES,
};
NUM_TYPES should be max 5 for this to work highly efficient.

Unit XML
PHP:
<DefaultSlot>
  <eType>CARGO</eType>
  <eType>CIVILIAN</eType>
</DefaultSlot>
<SpecialSlots>
  <SpecialSlot>
    <eType>CARGO</eType>
  </SpecialSlot>
  <SpecialSlot>
    <eType>CARGO</eType>
  </SpecialSlot>
</SpecialSlots>
That would be a ship, which can carry cargo and civilians, but the first two cargo slots can only carry cargo.

Do we really want to abuse Professions for it? :hmm:
Why not directly balance it into the UnitInfos? :dunno:
Well professions can always be added later if we feel like it. I'm just trying to figure out how it can be used. Adding cargo space to a profession shouldn't be difficult.
 
PHP:
enum
{
  CARGO,
  CIVILIAN,
...
  NUM_TYPES,
};
NUM_TYPES should be max 5 for this to work highly efficient.

Unit XML
PHP:
<DefaultSlot>
  <eType>CARGO</eType>
  <eType>CIVILIAN</eType>
</DefaultSlot>
<SpecialSlots>
  <SpecialSlot>
    <eType>CARGO</eType>
  </SpecialSlot>
  <SpecialSlot>
    <eType>CARGO</eType>
  </SpecialSlot>
</SpecialSlots>
That would be a ship, which can carry cargo and civilians, but the first two cargo slots can only carry cargo.

That is what I was hoping for. :thumbsup:
(The Info Array looks understandable to me.)

Basically what I would have called "CargoSlotTypes" (your Enum) which I was thinking of as a new XML first.
Because we could use the XML to balance the behaviour of those Slot Types.

E.g.
  • A "Standard Slot" (Cargo Slot) would be allowed to carry 100 Goods (and all others)
  • "Treasure Slot" would be allowed to carry 100 Goods alternatively (but no other Units)
  • "A Civilian Slot" would also be allowed to carry 75 Goods alternatively (but no other Units)
  • "A Slave Slot" would also be allowed to carry 75 Goods alternatively (but no other Units)
  • "A Military Slot" would also be allowed to carry 75 Goods alternatively (but no other Units)
  • ...

In XML we could balance all of that.
It would make it friendly for XML modders. :dunno:

---

Those are the only 5 Types I think we would need:

And int the "CargoSlotTypes" we should also reference those " SpeciaUnits" because they can already be referenced by Units (and Yields are also units.)

So we would connect
CargoSlotTyes <---- SpecialUnitTypes ----> UnitTypes

  • SPECIALUNIT_YIELD_CARGO
  • SPECIALUNIT_COLONIST_UNIT
  • SPECIALUNIT_MILITARY_UNIT
  • SPECIALUNIT_TREASURE
  • SPECIALUNIT_FORCED_LABOUR
 
Last edited:
Top Bottom