terraforming / unit placing bug

Started by florrat, October 11, 2013, 02:14:59 AM

Previous topic - Next topic

florrat

Hi,

Why are the rules for being able to place a unit at a certain location so weird? Suppose you want to place a unit in on position x in the small diagram below (where each character is a small cell, so a unit has size 3x3)


.....
.....
..x..
.....
.....

Let's give some places a letter, so that I can talk about them easier.

.c.c.
cbabc
.axa.
cbabc
.c.c.

Now if I'm correct you can place a unit at the x-cell if and only if the following four conditions hold
(1) all a-cells have the same height as the x-cell
(2) all b-cells have the same or lower height than the x-cell
(3) if a b-cell has lower height than the x-cell then the adjacent c-cells must have different height than the x-cell
(4) if either b-cell on the left has lower height than the x-cell, then the adjacent c-cells cannot have both the same height, which is larger than the height of the b-cell.

To illustrate this, you can move or build any (non-titan) unit on the cells of height 2 in the following diagrams:

33333     11111     21212     33333
32223     11211     11211     11213
32223     12221     22222     12223
32223     11211     11211     11213
33333     11111     21212     33333

But you can't move or build units in in the following diagrams:

33333     11111     12121     33333
33233     11211     21212     31211
32223     12221     12221     32221
33233     11211     21212     31211
33333     12111     12121     33333

The first diagram violates rule 2, the second and third diagram violate rule 3 and the last diagram violates rule 4, even though it's the mirror image of the fourth allowed diagram!

Okay, so far I haven't talked about the bug yet, so far it is only highly counter-intuitive and overly complicated.

The bug occurs because you can still terraform the squares which are not in the middle 3x3-cells, even though you have placed a unit there. You can thus terraform around a location to make that location invalid. If a unit is already placed in that location it's not that bad. But if you order a unit to move somewhere and then terraform around it to make the location invalid, the unit will EXPLODE upon landing! This is definitely a bug (and a rather annoying one if you're trying to beat a hard map while low on recourses).

TL;DR: In short, how to reproduce the bug. terraform a location so that these are the heights:

121
222
1211

Order a unit to move to the center "2", and while the unit is in transit, terraform the rightmost "1" into a "2". The unit will explode upon landing.

Mimsy

#1
That's amazing. I have a guess though: some spots are split heights, as I'm sure you've noticed. What if a split height square is always calculated with the higher side on the top right (or wherever)? Then if units were allowed to hang their corners a bit off the edge, they could only do that on the top or right sides. Does that make sense?

I'm okay with having unit placement be a tiny quirk of the system, but the unit exploding on landing is definitely a real bug. Submit it on the bugs thread. I think you'll agree though that it's a tiny bug that should be at the bottom of the priority list. It's still fun to talk about. :) My solution for fixing it would be, either just plain allow it (maybe when landing units, it skips any check if the terrain is valid?) or when landing, the terrain is automatically terraformed to the height of the middle of the unit. It looks like this is
Spoiler
what Loki does at the end, as I've had it drop nodes on two heights and when nullified the node has broken the wall
[close]
.  It needs to be a valid spot when you place it anyway.
Momo on the DMD scores.

Grauniad

In CW2 it was possible to build some building anchored into a piece of terrain marked for excavation. When excavated, the building would explode. We called it GWYD (Get what you deserve).

In CW3, there were endless issues with how the graphics round off corners and this either make it look like a unit can't land on what appears to be legal terrain, can land on what appears to be illegal terrain, ir can't land back in the same position after the terrain around it has been terraformed.

Somewhere late in the game development - around build 94a, Virgil changed the rules to make it look more natural. A consequence of that is what you observe. Yes, indeed, a unit can take off for a legal destination, the destination can be terraformed and then the unit will explode when it lands.

Virgil is mostly out of pocket until Monday, but perhaps his memory of all the intricacies surrounding terrain idiosyncrasies is better than mine and he will add some more background to this state of affairs.
A goodnight to all and to all a good night - Goodnight Moon

teknotiss

i think you covered it though G, don't terraform where you have ordered units to land, or suffer the consequences  :D
"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

Harkler

You can also terraform a cell in any c space while a unit is placed to create an invalid state under the unit. It will stay in place and functional, but once it is moved/destroyed, the space is unusable. It would be awesome if, instead of simply not allowing you to terraform on the 9 cells that a unit occupies, the game would not allow you to terraform in a way that makes the terrain under the unit invalid. This would allow you to terraform b spaces to any level below the unit, and only allow c spaces to be the same height as the unit if b is.

florrat

Quote from: Grauniad on October 11, 2013, 01:18:42 PM
Virgil is mostly out of pocket until Monday, but perhaps his memory of all the intricacies surrounding terrain idiosyncrasies is better than mine and he will add some more background to this state of affairs.
I'd very much like to here whether Virgil thinks this is indeed a bug and whether this will be fixed. Also, if bugs belong in the Support subforum, perhaps this topic should be moved there as well.

Cavemaniac


My two cents worth - the old unit placement/fit system was a real pain.

If your unit didn't fit just so on the terrain, you spent a long, frustrating time trying to make it fit, tricking terps to flatten just so etc. etc.

The current system is awesome, slick and forgiving.

Perhaps it not as intuitive as we'd like, but it's a lot easier to use...
Be yourself. Everyone else is already taken.

4xC

You should have seen how many times I tried to bring up the issue of unit placing with respect to terraforming and terrain.

Unit A requires only a 3x3 cross/plus shape of even ground to be placed, but the corners do not need to be even. However, when placed, Unit B cannot occupy any of the corners as long as Unit A is where you placed it. And Unit A prevents the corners from being terraformed. Plus, if you have numbers on the corners at the start, you can't even build Unit A to begin with.

I may be back with a screenshot to illustrate this if need be.
C,C,C,C

Nephthys

I'm not sure if this belongs in this thread or not, but I didn't want to start a new topic. And the issue isn't about units exploding after being moved, but rather trying to place a Bertha in a PZ that has been Terp-ed.

I am playing S100_105 : Talson and terp-ed out a PZ so I could place a Bertha, but I am not able to do so. There is plenty of room. The Bertha icon turns green all around the PZ, just not in th PZ.

I don't know how to insert an image of it, so I have attached a screenshot.

(I tried the "Insert Image" icon, but I don't know how to use it. Would like to learn. Also tried to paste it after copying the thumbnail from My Docs & that didn't work, tried drag & drop & that didn't work, so I gave up & attached it.)

I'll probably go ahead & finish the world before I hear back, but I'd really like to know for future reference. As always, many thanks.

Grauniad

Quote from: Nephthys on October 29, 2013, 08:52:19 PM

I am playing S100_105 : Talson and terp-ed out a PZ so I could place a Bertha, but I am not able to do so. There is plenty of room. The Bertha icon turns green all around the PZ, just not in th PZ.


Most common cause is that there is one single cell of terrain that you did not terraform to the correct height. Can't tell you how many false bug reports I sent to Virgil on this subject.
A goodnight to all and to all a good night - Goodnight Moon

Kingo

I think it is fine as it is - it prevents the unit being stuck in the air because its old space was occupied (after liftoff you build a collector on its old spot, say) and the new space is terraformed to be invalid.

Nephthys

One reason I hesitated to use this thread was because I didn't think it was a true bug, just something I had not had a problem with in previous maps that had to do with terraforming. So it kinda sorta fit the thread topic.

I'll go back & check to make certain everything is at the correct level. If it still won't take a Bertha, no big deal.
Thx!

Grauniad

Quote from: Nephthys on October 29, 2013, 10:01:40 PM
One reason I hesitated to use this thread was because I didn't think it was a true bug, just something I had not had a problem with in previous maps that had to do with terraforming. So it kinda sorta fit the thread topic.

I'll go back & check to make certain everything is at the correct level. If it still won't take a Bertha, no big deal.
Thx!


Attach the save file here if you still have the issue.
A goodnight to all and to all a good night - Goodnight Moon

Nephthys

I tried terp-ing it again just to make sure, but never could get a Bertha in that PZ. I used a mortar instead.

Attached is the final autosave, so I hope that is what you are looking for. But you can't make fun of my over-building!   

(Well, you can just not in public please.  :)  )


florrat

Quote from: Kingo on October 29, 2013, 09:24:37 PM
I think it is fine as it is - it prevents the unit being stuck in the air because its old space was occupied (after liftoff you build a collector on its old spot, say) and the new space is terraformed to be invalid.

I think at least something should change. Currently, it will occasionally happen that a unit will explode when landing, and there is no obvious reason for it (it will not happen often, but every now and then for all players combined).

I think the simplest fix would be to allow a unit landing on a invalid place (without exploding), as long as the place was valid when you ordered the unit to move there. This can hardly be abused anymore than the current system, because as it currently is, you can already modify the terrain around the unit after it has landed, and the unit won't explode.

---

Another minor suggestion: if one of your units is placed on a position where the terrain on the corners of the unit is lower than the terrain in the center, for example like this:

11111
11211
12221
11211
11111

then allow your terps to terraform these corners to the same height as the rest of the terrain the unit is standing on. In the above example, this would mean that you can terraform the bolded 1's to height 2 (but not to height larger than 2). This will make the terrain the unit is standing on not invalid, and it can be annoying that you have to move the unit to be able to terraform that terrain.