Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#1581 closed enhancement (fixed)

Construction visual enhancement: Scaffolds during construction

Reported by: michael Owned by: historic_bruno
Priority: Nice to Have Milestone: Alpha 13
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by michael)

Currently, the player clicks the building icon in the unit UI, then places a foundation. Then the unit walks to the foundation, smacks on it for a bit, some dust rises, then the building pops into existence.

The desired enhancement should go like this (the enhancements for this ticket are bolded):

  1. Player/unit places foundation.
  2. Walks up to it, starts building.
  3. Scaffold actor appears (or rises very quickly into place), and dust starts appearing.
  4. Building rises up slowly through this as a percentage complete.
  5. At 100% complete, the foundation actor disappears, and the scaffold actor either just disappears or drops down quickly (as if dying).

I could see something like this in the building templates:

  <VisualActor>
    <Actor>structures/athenians/barracks.xml</Actor>
    <FoundationActor>structures/fndn_5x5.xml</FoundationActor>
    <ScaffoldActor>structures/construction/scaffold_5x5.xml</ScaffoldActor>
  </VisualActor>

Attachments (3)

const_1.jpg (173.5 KB ) - added by michael 12 years ago.
Foundation placed (already a feature)
const_2.jpg (174.5 KB ) - added by michael 12 years ago.
Builders begin building. Scaffold quickly rises (or pops) into place. Building will begin rising into place as it is built.
const_3.jpg (179.3 KB ) - added by michael 12 years ago.
Building is nearly completed and is nearly 100% risen.

Download all attachments as: .zip

Change History (16)

comment:1 by michael, 12 years ago

Description: modified (diff)

comment:2 by michael, 12 years ago

Description: modified (diff)
Priority: Should HaveNice to Have
Summary: Scaffolds during ConstructionConstruction visual enhancement: Scaffolds during construction
Type: defectenhancement

comment:3 by michael, 12 years ago

Description: modified (diff)

by michael, 12 years ago

Attachment: const_1.jpg added

Foundation placed (already a feature)

by michael, 12 years ago

Attachment: const_2.jpg added

Builders begin building. Scaffold quickly rises (or pops) into place. Building will begin rising into place as it is built.

by michael, 12 years ago

Attachment: const_3.jpg added

Building is nearly completed and is nearly 100% risen.

comment:4 by historic_bruno, 12 years ago

I was just looking into the building rising part, right before you created this ticket :) It's not too difficult but there are a few visual glitches I've encountered:

  • The rising building can't be the final real building because we don't want to allow full interaction (no attack, training, etc.) That means we start with a "preview" entity and then create the real one when construction is finished. Due to random variations, there may be differences between the preview and the final entity, e.g. different props. We probably need some way to copy the variations between entities.
  • How to determine the height of the building, this is needed to adjust the height of the preview as it progresses. I'm using the footprint height which looks good for some buildings, but not for others that use default values. The alternative would be using the actor's bounding box (based on the model).
Last edited 12 years ago by historic_bruno (previous) (diff)

in reply to:  4 comment:5 by historic_bruno, 12 years ago

Replying to historic_bruno:

there are a few visual glitches I've encountered

I believe I've solved these issues, in the process I also found a solution for promoted units and corpses potentially having different random variations than the original entity. Here is a video showing the constructed buildings rising from the foundation (without the scaffold):
http://youtu.be/BVAd20jYGGw

IMO it looks pretty good, but the buildings do seem to "jump" into position due to how unevenly the construction progresses. Next I'll try adding the scaffolds.

comment:6 by Erik Johansson, 12 years ago

That's great Ben. Does the preview/final entity changes required for this in any way help with solving the issue with you being able to see changes to enemy buildings in FoW?

comment:7 by historic_bruno, 12 years ago

No, it's not related to that.

comment:8 by Erik Johansson, 12 years ago

Ok, I just thought there might be parts of the "preview"/real entities implementation that could be relevant/reused :)

comment:9 by historic_bruno, 12 years ago

I've had to reanalyze my approach.

At first I thought to use a local entity to avoid sync problems (since the position of the entity would be changed based on the "unsafe" model height) The problem is local entities are not serialized either in multiplayer or saved games, so the beautiful new rising construction entities would disappear when loading a saved game (the way corpses do). Now I'm thinking the actual rising behavior will need to be part of CmpVisualActor or similar, and a purely visual non-simulation effect.

Also I don't like the idea of creating separate entities for the foundation, scaffold and rising building - seems like to much waste of resources. At the same time CmpVisualActor is set up to deal with a single model and I'm not sure it's a great idea to break that concept.

comment:10 by historic_bruno, 11 years ago

Owner: set to historic_bruno
Status: newassigned

comment:11 by historic_bruno, 11 years ago

This and #1174 are connected, so I'm working on both.

For scaffolding, I think the best approach is to make it a non-random actor variation, rather than a separate actor. If it's a separate actor, the code needs to create and manage another entity. With a variation, it's as simple as selecting that variation in the foundation script. The scaffold variant would appear instantly when the builder(s) began construction.

What this would mean for artists is going through the foundation actors and creating a scaffold variant for each (with frequency=0), maybe called "building-scaffold". I think this would allow nicer results anyway, since the scaffolding could be more integrated with the foundation rather than stuck on top of it.

This could be worked on gradually or ignored entirely if we don't have time, but it's probably the simplest implementation.

comment:12 by ben, 11 years ago

Resolution: fixed
Status: assignedclosed

In 13143:

Adds building previews that rise during construction, fixes #1174, refs #21.
Adds scaffold support for foundations, includes two examples for 3x3 and 4x4, fixes #1581.
Extends CmpVisualActor and CUnit to support random variant seeds.
Fixes bug in actor hotloading.
Fixes serialization failure caused by destroying entities in OnDestroy handlers.

comment:13 by historic_bruno, 11 years ago

Milestone: BacklogAlpha 13
Note: See TracTickets for help on using tickets.