Ticket #21 (new enhancement)

Opened 7 years ago

Last modified 3 months ago

[PATCH] Building construction

Reported by: stuart Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords: patch review
Cc: thomas.fussell@…

Description (last modified by zoot) (diff)

  • Level terrain when foundation placed. See #1846 for possible pitfalls when changing terrain height.
  • Building rises out of ground as construction proceeds (#1174)
  • Scaffolding not necessary but maybe as a bonus if time allows? (#1581)

Attachments

21.2.patch (7.6 KB) - added by thomas 8 months ago.
21.patch (7.6 KB) - added by thomas 8 months ago.
My attempt at a fix

Change History

comment:1 Changed 3 years ago by anonymous

  • Milestone Advanced Playability Demo deleted

Milestone Advanced Playability Demo deleted

comment:2 Changed 3 years ago by wacko

  • Milestone set to Backlog

comment:3 Changed 12 months ago by historic_bruno

  • Type changed from task to enhancement
  • Description modified (diff)
  • Summary changed from Entity Event - Construction to Building construction

comment:4 Changed 8 months ago by thomas

  • Cc thomas.fussell@… added
  • Keywords review added
  • Summary changed from Building construction to [PATCH]Building construction
  • Milestone changed from Backlog to Alpha 12

This is my first patch and I thought it would be a useful issue to start on.

To summarise the changes:
-Added a section to Foundation.js component to flatten the surrounding area when construction is started.
-Added method to complement ICmpTerrain::GetGroundLevel?(), ICmpTerrain::SetGroundLevelRegion?(). This method sets all height values to the same value for a given (possibly rotated) rectangular region.
-Added setter to CTerrain to set value of heightmap at a specific point.

The main issue now is smoothing into surrounding tiles and updating the footprint decal once the height changes. I'll be working on that.

Last edited 8 months ago by thomas (previous) (diff)

comment:5 Changed 8 months ago by k776

  • Keywords patch added
  • Summary changed from [PATCH]Building construction to [PATCH] Building construction

Changed 8 months ago by thomas

Changed 8 months ago by thomas

My attempt at a fix

comment:6 follow-up: ↓ 7 Changed 8 months ago by historic_bruno

Are there any constraints on this, like the maximum height difference that is allowed? That might be more of a building restriction concern, but it's worth thinking about now if we're going to have terrain flattening.

One problem I anticipate is that building on a hill might create permanent impassable terrain tiles (due to slope) or dramatically alter the surrounding terrain. This would also potentially affect territories since they are terrain dependent. A related issue: the player might use this to their advantage by repeatedly placing foundations and deleting them before they finish. So I think we need to be very careful with how this is implemented.

comment:7 in reply to: ↑ 6 Changed 8 months ago by Geek377

See ticket #1634

Replying to historic_bruno:

Are there any constraints on this, like the maximum height difference that is allowed? That might be more of a building restriction concern, but it's worth thinking about now if we're going to have terrain flattening.

One problem I anticipate is that building on a hill might create permanent impassable terrain tiles (due to slope) or dramatically alter the surrounding terrain. This would also potentially affect territories since they are terrain dependent. A related issue: the player might use this to their advantage by repeatedly placing foundations and deleting them before they finish. So I think we need to be very careful with how this is implemented.

comment:8 Changed 7 months ago by thomas

Those are some good points. I don't know what the correct answer is. We can look at other games for some suggestions. In Empire Earth, the elevation can't change that much so it isn't an issue. In reality, if someone is building a building on an incline, he can either excavate or build a basement foundation (like that which is done for walls in 0 A.D.). We could try building a "foundation" or prevent a player from building a building if the height difference is too great.

comment:9 Changed 7 months ago by historic_bruno

Yeah I think if the terrain flattening is purely a cosmetic concern, often it could be addressed by altering the models themselves, which removes any gameplay concerns. There may be a few structures where this wouldn't work or would look bad, like some of the civil centers. For the remaining cases we could place some tight constraints on the terrain flattening (e.g. at most 1-2m difference between min and max height) and perhaps even add to the construction costs to make it less exploitable.

comment:10 Changed 7 months ago by FeXoR

I'm not sure if the approach of terrain flattening is solving more issues than it creates especially since it "only" solves a visual issue and generates a gameplay issue. That's a bad trade IMO.

Sorry, thomas, but I feel I need to say this.

I think, and AFAIK is was pointed out by others before, all buildings should reach far into the ground to avoid flying buildings.

It's a bit of a shame that for the nice Hellenic Civil Centre that will not be enough but filling the gaps in the ground with lower parts of another color should fix it, too, and if the terrain is about flat they will not be seen so in that case it would look like it is now.

Last edited 7 months ago by FeXoR (previous) (diff)

comment:11 Changed 6 months ago by k776

  • Milestone changed from Alpha 12 to Backlog

Backlogged until a decision is reached. Best thing to do is open a thread in the "Development & Technical Discussion" forum and see what others think (reference this ticket, post screenshots of before and after your patch, list the benefits and the negatives, etc). Once we have a clear decision, we can move ahead with this one way or another.

comment:12 Changed 6 months ago by FeXoR

I think feneur would be best suited to do this ;)

But if nothing happens for a while concerning this I will do it.

Last edited 6 months ago by FeXoR (previous) (diff)

comment:13 Changed 6 months ago by thomas

comment:14 Changed 5 months ago by historic_bruno

  • Description modified (diff)

comment:15 Changed 4 months ago by ben

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 Changed 4 months ago by historic_bruno

  • Description modified (diff)

comment:17 Changed 3 months ago by quantumstate

  • Description modified (diff)

comment:18 Changed 3 months ago by zoot

  • Description modified (diff)
Note: See TracTickets for help on using tickets.