Opened 18 years ago

Last modified 8 years ago

#118 new task

[PATCH] Actor variation persistence

Reported by: Philip Taylor Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by historic_bruno)

Save the actor variation for entities when saving map files in the editor, and use them when the map is loaded.

Preferably, don't do it too inefficiently: don't store "Idle" for entities; modify the XMB format to have fewer redundant strings; and:

For objects which the designer wants to just be random, perhaps generate the initial variation pseudo-randomly and deterministically, based on a single ID number - then if the map is saved, it only has to save that number and not all the variation strings. (It shouldn't be a new random variation each time you load the map, because that'd be confusing when saving/reloading in the middle of a game and when doing multiplayer). The variation will become wildly different if the actor XML file is modified, but that is not very common and shouldn't matter.

Attachments (3)

variations.diff (3.0 KB ) - added by trompetin17 9 years ago.
variations.2.diff (12.0 KB ) - added by trompetin17 9 years ago.
variations.2_rebased.diff (5.3 KB ) - added by elexis 8 years ago.
Rebased.

Download all attachments as: .zip

Change History (13)

comment:1 by (none), 14 years ago

Milestone: Atlas Stage 1

Milestone Atlas Stage 1 deleted

comment:2 by Andrew, 14 years ago

Milestone: Backlog

comment:3 by historic_bruno, 11 years ago

Description: modified (diff)

The last part of this ticket was mostly implemented in r13143, for Atlas entity placement and in-game construction. Still need to generate random seeds for:

  • unit training - so that e.g. the first unit you train doesn't always look the same on the same map (currently tied to entity ID instead). How to handle batches?
  • wall construction - not as important, they don't have much variation?

Selection strings are still TODO.

by trompetin17, 9 years ago

Attachment: variations.diff added

by trompetin17, 9 years ago

Attachment: variations.2.diff added

comment:4 by Stan, 9 years ago

Keywords: review patch added
Milestone: BacklogAlpha 19

comment:5 by Stan, 9 years ago

Summary: Actor variation persistence[PATCH] Actor variation persistence

comment:6 by Itms, 9 years ago

Milestone: Alpha 19Alpha 20

comment:7 by elexis, 8 years ago

In 17650:

Remove trailing whitespace. Refs #118.

by elexis, 8 years ago

Attachment: variations.2_rebased.diff added

Rebased.

comment:8 by Itms, 8 years ago

Milestone: Alpha 20Alpha 21

If I'm not wrong, that doesn't follow Philip's recommendation to not do it inefficiently (for all units there will be a variation string saved).

The CUnit* unit = cmpVisual->GetUnit(); should go inside the if (cmpVisual).

I think this is dangerous to include a change to the map loading and saving now. However, if I'm wrong on the efficiency matter, it should be committed right after the release. Leaving the review tag for that reason.

comment:9 by sanderd17, 8 years ago

Keywords: review removed

You need to be able to store partial variations, and let others depend on the seed. So the else on line 1097 shouldn't be there.

And I agree with Itms that the variations shouldn't be written to the map automatically, but that Atlas should provide a way to set them explicitly.

comment:10 by elexis, 8 years ago

Milestone: Alpha 21Backlog

Backlogging due to lack of progress.

Note: See TracTickets for help on using tickets.