[Freeciv-Dev] (PR#6174) Loading transports
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6174 >
Per discussed this on IRC.
It's not easy to replace assign_units_to_transporter directly because it
does a lot of logic for ground, air, and missile carriers:
- Ground units are assigned first.
- Air units are assigned second.
- Missile units (which can also fit into air transport) are assigned last.
- If you load an air unit transporting a ground unit, the ground unit is
loaded into different ground transport at the same location.
Doing this without assign_units_to_transporter is not easy. We want to
have a load command to load units into and out of transporters, but this
load command shouldn't always be needed. For instance when moving a
ground unit into an oceangoing galleon the loading is implied; there's
no intermediate step. And when returning airplanes to a carrier you
don't want to have to use the load command.
The logic of air versus missile units is tricky. Per suggested that
carriers just shouldn't be able to carry missile units. Otherwise when
loading a missile unit we should prefer to put the missile unit into a
missile-only carrier. This generalizes well but requires extra code.
Of course if the loading is done via the "load" command this is no problem.
The logic of transporters-carrying-transporters is even more tricky. At
first we wanted to ban it entirely. However we quickly realized this
won't work: if an airplane is transporting infantry and the airplane
lands on a carrier, the infantry shouldn't drown. We do want to
restrict this, however. My suggestion was that you can't (un)load a
unit in a transported transporter. A more complicated, looser
restriction would be that you can't (un)load a unit in a transported
transporter unless you can (un)load it in the transporting transporter
(in other words a missile truck that was carrying a nuclear missile on a
transport couldn't launch that missile unless the transport was capable
of carrying nuclear missiles, and had free room). Per's suggestion was
that a transporter that was loaded would take up one extra "spot" for
every unit it was carrying (this prevents any possibility for unlimited
transport bugs). This could eventually be a ruleset option.
All of this is quite feasible to code, but doing it in steps (rather
than one monolithic patch) isn't as easy. But if this design is
approved we can work on it and submit patches that work toward the goal.
jason
|
|