Alpha 50A Flattening Terrain

Discussion in 'Clockwork Empires General' started by Alavaria, Apr 15, 2016.

  1. Alavaria

    Alavaria Member

    Check following post, mystery might be solved


    Ever wonder how the game decides what level to use when flattening terrain? Well let's check:

    scripts\gameobjects\flatten_zones.go
    It isn't "point where you start designating the zone" (and we all know this). Not the center either.

    If my suspicion is right, (it was!) it's actually a corner of your zone. So if you always click and then draw out the zone in a particular direction, you will not be surprised.

    You can't tell from the above where originX and originY are coming from. I think it is something from the .exe when you designate a zone.

    ========================

    Then I realized you can mods the above file so the game will print out in the console the variables x, y, w, h and originX originY, and target height. And so!
     
    Last edited: Apr 16, 2016
    Samut likes this.
  2. Alavaria

    Alavaria Member

    This is what I got out of the modification I attempted:

    [​IMG]
    X: 239__Y: 284__Height: 10__Left Corner
    X: 234__Y: 284__Height: 10__Bottom Corner
    X: 233__Y: 286__Height: 13__ Right Corner
    X: 239__Y: 287__Height: 10__ Top Corner

    Selected a region to flatten with all these corners, result:
    X: 234__Y: 284__(dimensions of zone)6,4 OriginX: 234__OriginY: 284 Height: 10

    So for this particular camera angle (i guess it changes when you flip around) it will be the bottom corner of a zone created. My colony is currently at height 10. If you see the grid and think of a V extending from a square of height 10, I can turn any square within the V into a height 10 square. So, cliffs etc.

    But anything outside that (eg to the left) I cannot.


    [​IMG]

    Same camera angle. If designated as above, that entire cliff will be brought down to the height of the bottom square in the corner (ie: height 10). Verified, works just fine

    If there is a cliff at height 13 below the edge of the screen and I click-and-drag a zone downwards, that zone will be raised to height 13. Also verified

    ============================================================

    Is there a way to tell where the origin square will be? Yeah, now that we have the minimap. The minimap does not rotate with your camera, you are going to be looking for the top-left corner of minimap. Yep, that's the "origin: (where X and Y are equal to 1, I suppose)

    [​IMG]


    While the game map is a diamond shape, the minimap is a square (rotated). By looking at the explored lines on the map (thanks, traders) I can determine which direction the top-left corner of the minimap will be.

    The top left corner of the minimap is where the "origin square" which determines height will be. In my current camera rotation, you can see where the green arrow lies. So if my whole colony was designated for flattening, that green arrow points to the square that determines height

    So I can flatten from the building underconstruction all the way to the opposite corner of the map, essentially a big < shape



    [​IMG]

    Another illustration, suppose I designate the big blue square to be flattened. The purple square tells the game what height to flatten it to.

    TIP: Make a huge "flatten terrain" zone of the height you want. When you see an overseer working on it, assign them a bunch of lower class to help out. Repeat everytime a different overseer starts flattening.

    The game has the colonists flatten land in a particular way in the rectangle you designate (and there's nothing you can do about it) so if you're in a box, one direction will be fast (colonists move along the cliff) but the other will be slow (colonists will be walking up and down the slope a lot). But they'll get it gone!


    Another example:

    [​IMG]

    I cannot just clear downwards to make room for my colony there. However, see the red line showing an area which is of height 10 (same as my colony). Now if I designate appropriately (as shown) I can flatten upwards (ie: towards top-right of the minimap) which allows me to remove the whole raised hill section.

    =====================================

    Of course if you modify the section so it prints the stats to the console you can always check the height of your colony (make a 1 square flatten terrain, it will work even though the job will cancel after a moment) and then check any flatten job by opening the console.txt after creating a flatten job.

    I uh closed the file I was editing so that's an exercise for the reader. printl, great stuff
     
    Last edited: Apr 16, 2016
  3. MOOMANiBE

    MOOMANiBE Ah, those were the days. Staff Member

    Note to self: CC this to Nicholas on monday so he can fix this.
    We've known there were weird issues with flattening for awhile but it wasn't until the biome update that it became so vitally important to flatten that -everyone- was noticing it. I'd say it's about time to prioritize fixing this, especially since you've determined what the actual issue is already xD
     
    Viion, Tarod, EggsAckly and 1 other person like this.
  4. Alavaria

    Alavaria Member

    Hmm good, now to Flatten The World

    And make it more pleasing to the eye
     
    Teutomatos and EggsAckly like this.
  5. EggsAckly

    EggsAckly Member

    I wondered why the flatten didn't act the way I thought . I just assumed it would flatten to the point where you start dragging from . I tried to level the ground and look away for a while and they're digging a swimming pool .
     
    Last edited: Apr 18, 2016
    Tarod likes this.
  6. Rahbek23

    Rahbek23 Member

    Did the same and what was worse was that I couldn't for the life of me get them to remove that pool in an orderly fashion. Either smaller pool or a little hill.
     
  7. Alavaria

    Alavaria Member

    Yeah on the one hand it sorta flows naturally from the side of how the computer looks at it...

    Actually the colonists will even choose squares to flatten based on the X- and Y-directions, which has interesting issues.

    ========================


    Oh yeah I want to point out this:

    [​IMG]

    Sometimes you can have sections which the colonists simply cannot flatten. Worse yet, they will take the job and stand around doing nothing, very troublesome.

    The green section can be flattened down as expected.

    However, the blue line cannot be flattened down, due to the slope/top being inaccessible.
     
  8. Vordrak

    Vordrak Member

    Had exactly the same issue in my playthrough on 50B. I agree it should be the height of the first square you drag from.
     
  9. MOOMANiBE

    MOOMANiBE Ah, those were the days. Staff Member

    (This has been brought to programmer attention; Relevant ticket is OC-4586)
     
    Tarod and Lord Brassbucket like this.