Jump to content
Sign in to follow this  
lhrob

Question about TerrainQuery

9 posts in this topic Last Reply

Recommended Posts

This is probably a simple question, and I feel a little stupid for asking: What do the numbers in the TerrainQuery tool refer to? See the screenshot below...what do the x, y, and z numbers mean? And what are "cell x" and "cell z"? I presume ONE of the numbers gives me the height of the tile above sea level, correct? If so, which one?

what_do_these_mean.jpg

Share this post


Link to post
Share on other sites

I am probably wrong by a degree, however, that's never stopped me before:

The X, Y, and Z coordinates are where the pixel you queried is. This information is used by the save file to, among other things, remember the positions of props and models. Z represents height.

The cell X and cell Z represent the coordinates of the tile that contains the pixel you queried. Not sure if it's used by anything, since the pixel coordinates can do more things and are more accurate. I don't think Z represents height here, but then why not use X and Y?

Semantically, I don't think "pixel" is the proper word to use...

Oh, and as an old moose says: The only questions not worth asking are the ones not asked.

Edit: Ganaram Inukshuk has been kind enough to educate me. "Y" is used for height in SC4, not Z.


  Edited by Mister Giggles  

Share this post


Link to post
Share on other sites
  • Original Poster
  • Well, that old moose knows his stuff. ;) I've come to respect so much of what he says.

    Thanks so much for answering. I almost thought X was height, so I'm glad I asked. It goes to show my memory is a little rusty when it comes to math. High school was a LOOOOOOONG time ago. So back to the screenshot I posted...does that mean the pixel represents 3227 units (feet/meters) above sea level? :???: That seems pretty high for where I clicked on the map. But I guess it doesn't matter. I'm trying to create a diagonal bridge, and the land on one end is much much higher than the other. So I need to lower the terrain some, but I don't know to what point I should stop. If Z is the height, no matter what it represents, at least it gives me a general idea of what number to come close to.


      Edited by lhrob  

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • yes, z should be height, and I'll bet that it is measured from the very lowest point the game offers, since you can change the height of the sea level.

    You can? I thought it was static. I know when you're creating a city, the God mode let's you raise or lower all the terrain - and if you lower it all, everything's covered in water. Then slowly raising it one click at a time, you eventually reach a point where it's all flat land. So I thought the sea level was automatically set by the game. If there's a way to change it, do you know how to do it?

    EDIT: Okay, I think there's a flaw in our thoughts about Z being the height above sea level. I don't think Z is the height reference to anything at all. I just conducted an experiment, and did a query on several tiles around my map. On a plot of land where I want to start my bridge, the Z reading was lower than the reading at the bottom of my river. I also checked Z on the top of a nearby mountain, and it showed as being significantly lower than the river bed. IE..the Z reading of the river bed was the highest. So I don't know exactly what Z represents, but it's not height.

    Having said that, I think Y is the height coordinate. I realize in normal Cartesian coordinates that's not the case. But somehow it must be in the game, because when I looked at the Y coordinates of each tile I queried while looking at the Z reading, the Y showed a number significantly higher on the top of the mountain than it did at the bottom of the river bed. Likewise, the number where I'd be starting my bridge is higher than the river bed, but lower than the mountain top.

    Soooo.....just offering an FYI. Thanks, guys!


      Edited by lhrob  

    Share this post


    Link to post
    Share on other sites

    Clarification of a few things:

    It's the Y value that's the height, not the Z value, plus it measures from the Y value's "absolute zero", the lowest possible level in-game, which is where you terraform all the way down until the city tile's completely underwater or (if there's a zero-water mod installed) until the land's essentially paper-thin.

    It's not the sea level where the height begins at, since that can be customisable; It's like Celcius and Kelvin. Think of sea level as Celcius, but the lowest possible depth as Kelvin.

    In a completely flat city, the height everywhere is 270 meters above absolute zero depth, and the (0,0) tile begins at the northwestern-most tile. Each tile is 16x16 meters, so each tile is 256 square meters.

    When your cursor points at a specific pixel, it gives you five data points: The X value (how east from the origin you are), the Y value (how high from the origin you are), and the Z value (how south from the origin you are). Cell X and Cell Z just give you the coordinates of the tile.

    For example, the (0,0) tile. If the X and Z values read (for example) 9 and 13, you're in tile (0,0). For the record, if the X and Z values are in the domain [0,16)x[0,16) (in other words, beginning from zero, and less than 16 but NOT 16), you're in the (0,0) tile. Outside that, and you're in a completely different tile.

    The sea level height is controlled by a parameter in the terrain exemplar; It's simply called SeaLevel, and the default (at least according to the terrain mod I have) is 250 meters above absolute zero depth.

    The thing about sea level mods is this: Unless they're made specifically to work with either the default terrain exemplar or a specifically modified one (Columbus Terrain Mod, for example), the use of a sea level mod can result in conflict with your terrain mod (if you have one). This also applies to certain beach mods (how far a beach extends, not the actual textures), cliff mods (how "high" a tile has to be to become a cliff face), and water transparency mods (how transparent the sea water is).

    The reason for such conflicts is that all of those properties (WaterDepthForMaxAlpha, WaterMinAlpha, MaxNormalYForCliff, MaxBeachWidth) are all in the same exemplar, and that trying to download multiple terrain mods will result with the last terrain mod (the one that's last in alphabetical order) being the one that's loaded. I learned this the hard way with trying to get a beach mod to work properly for me.

    It's therefore better to modify your own terrain exemplar rather than to download a sea level mod, unless you don't have a terrain mod installed.

    In case you're wondering, the TGI (the type, group, and instance IDs) are 0x6534284A, 0x88CD66E9, and 0x00000001.


      Edited by Ganaram Inukshuk  

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • @Ganaram Inukshuk - thank you for all the fantastic input, and for confirming that Y is the height coordinate. I had no idea sea level could be modified, so I definitely stand corrected. Knowing what the coordinates mean in the TerrainQuery tool is both interesting and very useful information. I appreciate that you took the time to explain it for us. :yes:


      Edited by lhrob  

    Share this post


    Link to post
    Share on other sites

    Leave it to Maxis to break the common rules and use the Y ordinate as the height. Wonder if this is a deliberate attempt to 'hoax the yokels' or a feature of their 3D editor?

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Help Keep Simtropolis Online, Open & Free!

    stexcollection-header.png

    Would you be able to help us catch up after a bit of a shortfall?

    We had a small shortfall last month. Your donation today would help us catch up for this month.

    Make a Donation, Get a Gift!

    We need to continue to raise enough money each month to pay for expenses which includes hardware, bandwidth, software licenses, support licenses and other necessary 3rd party costs.

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections