Summary: Savegame handling of ACTIVITY_GEN_ROAD and road type
Submitted by: cazfi
Submitted on: Sun 19 Feb 2012 01:06:10 PM EET
Priority: 5 - Normal
Status: In Progress
Assigned to: None
Discussion Lock: Any
Planned Release: 2.5.0
It's not yet ready to be submitted, but I'm working on patch to add savegame
handling of ACTIVITY_GEN_ROAD and pillaging targeted to road type.
Transitional steps from old "2 road types as specials" to generic road types
are quite complicated, so I explain a bit what happens in this step.
What we have before the patch:
Handling of ACTIVITY_GEN_ROAD and pilaging targeted to road type once unit has
such an activity, should be working short of savegame part. Catch is that
there's no way for user to assign such activities to unit. Client (and ai)
still always use old ACTIVITY_ROAD, ACTIVITY_RAILROAD and specials targeted
This is relatively simple. It just saves activities as they are; ACTIVITY_ROAD
as ACTIVITY_ROAD, and ACTIVITY_GEN_ROAD as ACTIVITY_GEN_ROAD. There's no
conversion from ACTIVITY_ROAD to ACTIVITY_GEN_ROAD here since later versions
will not feed it ACTIVITY_ROAD at all. Same goes for road type targeted
pillaging vs special targeted pillaging.
Even when freeciv uses ACTIVITY_GEN_ROAD exclusively, savegame loding part
must be able to handle ACTIVITY_ROAD from old savegames. Thus it always
converts ACTIVITY_ROAD and ACTIVITY_RAILROAD to appropriate ACTIVITY_GEN_ROAD
activities. That happens even if it was this very same transitional version of
freeciv still saving ACTIVITY_ROAD.
What we end with:
User is still unable to directly assign ACTIVITY_GEN_ROAD for units, but
assigns ACTIVITY_ROAD. As long as one plays in one session, ACTIVITY_ROAD is
used. Once user saves the game, activity gets saved as ACTIVITY_ROAD. But when
user then loads such an saved game, activity is converted to
ACTIVITY_GEN_ROAD, and that's used then on. If user saves again,
ACTIVITY_GEN_ROAD gets saved.
Thus one is likely to encounter bugs related to new ACTIVITY_GEN_ROAD handling
code after saving + loading, but never when playing game from the start.
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list