Skip to content

Add basic transport load/unload#936

Open
ajhalme wants to merge 17 commits into
C7-Game:Developmentfrom
ajhalme:transport
Open

Add basic transport load/unload#936
ajhalme wants to merge 17 commits into
C7-Game:Developmentfrom
ajhalme:transport

Conversation

@ajhalme

@ajhalme ajhalme commented May 18, 2026

Copy link
Copy Markdown
Contributor

Add basic support for transport mechanic: loading and unloading units from a vehicle with transport capacity.

  • Add UI element to show transport contents
  • Extend C7 and unit actions with load/unload
  • Add engine message for load/unload
  • Load unit load status from Civ3 saves
  • Adjust MapUnit move(..) to allow load/unload
  • Adjust MapUnit move(..) so transports can move other units
  • Adjust tile unit display to prioritise transport over strongest defender, when out to sea
  • Adjust tile context menu to highlight transport-loaded units
  • Add load and unload buttons, with keyboard shortcuts (L/U)
  • Extend base ruleset with capacity (+patch missing/misplaced things)

Manual

Loading and Unloading
You can have a ship wait until it is loaded to capacity with units by clicking the Load order or pressing [L]. Boarding a
ship uses up all a unit’s movement points for the turn. If you attempt to move a naval unit into a land square that does not contain a port city, any passengers who have not already moved this turn are offered the option to disembark and make landfall. You can also order a ship to unload all its passengers by clicking the Unload order or pressing [L].

Demo

transport_basic

@stavrosfa stavrosfa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, I can imagine this being a slight pain to work out 😅

I have encountered some bugs and such, but i mostly think these can be attributed to the fact that anything can be loaded into anything with enough capacity. Should be ok once this is implemented.

Comment thread C7/UIElements/GameStatus/StatusUtils.cs Outdated
Comment thread C7Engine/C7GameData/ImportCiv3.cs
Comment thread C7/Lua/texture_configs/civ3.lua
Comment thread C7/UIElements/GameStatus/TransportInfoBox.cs

@stavrosfa stavrosfa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a whole lot of comments. I think this looks mostly done,
I would still like the Load/Unload special actions to be a part of this, but if you don't intend to add them here, please add a TODO, and you could also link this PR and my comments so it's quite clear what needs to be done in the future.

Comment thread C7/Game.cs Outdated
@ajhalme

ajhalme commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

I would still like the Load/Unload special actions to be a part of this

I agree, would be nice to have these. Happy to look into it, but I think the base ruleset needs cleaning up first. Otherwise it's a bit of a hassle to cherry-pick the right unitPrototype rows. (See the issue outlined in #937)

@stavrosfa

stavrosfa commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

A few comments from my play testing.

  1. When a unit is loaded and there is no other defending unit, we should be showing the transport instead of the loaded unit (unless explicitly selected).

What is currently happenning:
Screenshot_88

These few updated lines in the UnitLayer seem to solve this, although it might need some more tweaking, not sure

MapUnit bestDefender = units.First(u => u.loadedOnUnitId == null), selected = null, transporter = null, doingInterestingAnimation = null;
var currentlySelectedUnit = looseView.mapView.game.CurrentlySelectedUnit;

foreach (var u in units) {
          if(u.loadedOnUnitId != null && u != currentlySelectedUnit) continue;
  1. The Unload action button should be shown for the transport units (except Army I think), not for the loaded units themselves.
    What is currently happenning (Nipponese Infantry is selected) :
Screenshot_90

So the Unload action, should be on the trasport and Unload the loaded units (the original game gives a few options to what you want to unload, perhaps a future TODO?)

  1. Out-of-scope comment/thought
    When a coastal city tile has a transport with loaded units and there no other defending units, if a land unit attacks, should the transport be destroyed/captured, since it cannot fight back, and the loaded units destroyed in any case? I don't think there is a case where the trasnport fights back..
    I tried to create a scenario where I have only loaded units on a trasport on a city tile, but there is no option to load them, so I couldn't test it.

  2. Out-of-scope comment/thought no 2
    If I want to send a land unit on a transport that is on a sea tile but right next to a land tile. I can't use the go-to (this is faithful to the original). I can however use the numpad keys to move it and load it in (again this is faithful to the original)

Should we keep it like this, or refine in the future?

  1. I see you implemented the CanCarryAircraft actions etc, but the actuall mechanic is not implemented, correct? I can see for example that the Bombers/Fighters are not loaded on the Carriers.
image

That's fine if that's so, and we can leave it for the future, I am jsut making sure I understand correctly.

@ajhalme

ajhalme commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look. I'll look into (1) and (2).

(3) might one be one for the Civ experts on Discord to weigh in on. I wonder if a test could be created via editor by giving player character a city with transports and units, then setting up the scene in-game, and then back in editor handing over the city and units to opponent.

(4) seems like a useful quality of life upgrade. (5) is not implemented, but as you say, I loaded up the flags: feels like a nice first issue for a new contributor. Indeed (4) and (5) together could be nice issue, maybe with (3) as well, if we get agreement on the behaviour.

@ajhalme

ajhalme commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

(1) and (2) implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants