Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#1174 closed enhancement (fixed)

Buildings rise into place as they are constructed

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

Description

As creating multiple instances of buildings in various states of construction would be cost prohibitive in manpower, a good alternative would be to have the buildings rise into place as they are being constructed. Their position would be relative to their percentage complete. They would rise up through the foundation and through the construction dust into place.

Change History (19)

comment:1 by Erik Johansson, 12 years ago

I would say this is a duplicate of #576 :) But I will leave it for you to decide which one to close :)

Last edited 11 years ago by historic_bruno (previous) (diff)

comment:2 by historic_bruno, 11 years ago

Owner: set to historic_bruno
Status: newassigned

comment:3 by historic_bruno, 11 years ago

Keywords: Buildings construction removed

Current approach:

  • A new method SetModelRelativeOffset() is added to CmpVisualActor which doesn't affect the simulation state, only the rendered model. Offset is proportional to the model's bounding box size. For example: (0.0, -1.0, 0.0) is completely underground, (0.0, -0.5, 0.0) is half underground, etc. Transformation is applied during interpolation.
  • CmpFoundation creates a special type of entity ("construction|") which is non-local so it's network synced and serialized. It begins offset underground.
  • As building progresses, CmpFoundation adjusts the model offset. When the foundation is destroyed, so is the construction entity.

I thought this was better than a.) local preview entities that are not saved, b.) adding a bunch of construction logic to CmpVisualActor.

comment:4 by historic_bruno, 11 years ago

With Philip's help, a solution was found for building previews not matching the final model. Now they match down to the variation of each prop :) This video shows current progress: http://youtu.be/_6_F0jKDbvY

in reply to:  4 ; comment:5 by fabio, 11 years ago

Replying to historic_bruno:

With Philip's help, a solution was found for building previews not matching the final model. Now they match down to the variation of each prop :) This video shows current progress: http://youtu.be/_6_F0jKDbvY

Nice! An observation, though: if a building reach 99% of its final status it will look similar to a finished building (although the foundation is still partially visible) and may confuse the player thinking it's a complete building.

comment:6 by Erik Johansson, 11 years ago

Great!

in reply to:  5 ; comment:7 by historic_bruno, 11 years ago

Replying to fabio:

Nice! An observation, though: if a building reach 99% of its final status it will look similar to a finished building (although the foundation is still partially visible) and may confuse the player thinking it's a complete building.

Good point. A few possible solutions:

  • Enlarge the foundation so it's visibly larger than the completed structure
  • Add scaffold props so it's clear that the building is under construction. See Michael's attachments on #1581
  • Show floating completion percentage above the foundation (this might be a nice idea anyway but the engine doesn't support it yet)

in reply to:  7 comment:8 by fabio, 11 years ago

  • Show floating completion percentage above the foundation (this might be a nice idea anyway but the engine doesn't support it yet)

I also like this one, if this is not yet possible what about changing the color of health bar from green/red to yellow/red and always show the bar (even when not selected) until the building is finished?

comment:9 by B. Guns, 11 years ago

I'm more in favour of phases like in Age of Empires I. For example every 20 or 25 % of construction it builds up. Disadvantage is alot of extra work for art team... cf. http://www.youtube.com/watch?feature=player_detailpage&v=mVAIj0elLR8#t=75s

Last edited 11 years ago by B. Guns (previous) (diff)

comment:10 by historic_bruno, 11 years ago

As a side note, while working on the patch, I've added a random actor seed to the scenario format. Basically Atlas now generates a random number when you place an entity (it matches the preview as well), similar to how the in-game building placement will work. Previously all entities used their entity ID; the advantage of the new approach being that it's a random number, you can experiment until you find a random variation you like before placing it, and know each player will see exactly the variant you chose.

I plan to add a button and possibly a hotkey to Atlas for this randomization (in the future, there will be a variation selector as well, which overrides the random variation, e.g. "brown hair", "short beard", "blue shield", etc.)

Still TODO are unit training and wall building.

comment:11 by historic_bruno, 11 years ago

Example of how this can look with scaffolding: http://www.youtube.com/watch?v=rGQevrMprBU&feature=youtu.be

I added a "scaffold" variant to the 3x3 and 4x4 foundations, using rough scaffold models I cobbled together from existing props in SVN. They get attached to the root attachpoint, so there's no need to modify existing foundations models. A similar process should work for every foundation actor, IMO it's not too much work.

I think the scaffolding is a nice visual detail and makes it clearer when construction has finished.

comment:12 by fabio, 11 years ago

What about making the buildings appear from their lower base (like you would expect a real building is done) rather than rising from the top?

in reply to:  12 comment:13 by Erik Johansson, 11 years ago

Replying to fabio:

What about making the buildings appear from their lower base (like you would expect a real building is done) rather than rising from the top?

That sounds a lot more difficult. Perhaps it would be possible to do via a shader though? And e.g. have the full building appear from the start, but have it invisible and only gradually display it.

comment:14 by historic_bruno, 11 years ago

I don't think it's possible without a lot of work, and there are technical reasons for that. For instance, the polygons on our models are one-sided, so transparent structures won't work - you wouldn't be able to see anything on the other side. I'm not sure that shaders could fix that, and even if they could, would it be significantly better results?

This seems like the best compromise between visual appearance, artist work required, programmer work required, and gameplay usefulness.

One thing we do need is more construction dust.

Last edited 11 years ago by historic_bruno (previous) (diff)

comment:15 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:16 by historic_bruno, 11 years ago

Milestone: BacklogAlpha 13

in reply to:  15 comment:17 by zoot, 11 years ago

Replying to ben:

In 13143: Extends CmpVisualActor and CUnit to support random variant seeds.

How does this affect #118, #1007 and #1786, I wonder? Perhaps you could update those tickets appropriately?

Last edited 11 years ago by zoot (previous) (diff)

comment:18 by historic_bruno, 11 years ago

It doesn't directly affect #1007 or #1786, but thanks for finding #118! I knew there was a ticket about that somewhere but couldn't find it.

comment:19 by historic_bruno, 11 years ago

I take that back, #1007 might be fixed with a few lines of code now, it's unit promotion I was confusing it with (requires a more complicated fix, because the different ranks' actors don't match up nicely)

Last edited 11 years ago by historic_bruno (previous) (diff)
Note: See TracTickets for help on using tickets.