Need help understanding how object coordinates work

Post » Tue May 17, 2011 12:12 pm

Anyone know how the coord system for object placement works? (i.e. how do I decrypt object positions such as (x) -15415.189453, (y) -112831.414063? Figured I'd ask before wasting time trying to figure it out only to find out it's already known. :)
User avatar
Laura
 
Posts: 3456
Joined: Sun Sep 10, 2006 7:11 am

Post » Tue May 17, 2011 4:26 am

Do you mean in-game? If so, open the console, click an object, and enter Getpos X to get its X coordinate, or Getpos Y for Y coordinate, or Getpos Z for Z coordinate (e.g. altitude).

If you meant the CS, you can just double-click a placed object reference in the render window, and you'll see the coordinates listed in the properties pane. This doesn't work for creatures and NPCs though, but you'll still be able to see their coordinates in the status bar at the bottom of the window while they're selected.
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Post » Tue May 17, 2011 8:30 am

To expand a little further, if by decrypt you mean understand what it is, the coords simply define the number value of where the object is either in interior values (for interior cells) or world values (for exterior). BTW if I am wrong about any of this someone correct me. The coords you posted look like world coords because they are high numbers. World coords are an absolute value representing anywhere in the entire MW world and cross cell boundaries - thats why you have numbers exceeding the hundred thousands. Interior coords are usually much smaller because each interior cell has its own independent coord set. Also, all interior cells are not related geographically to the exterior world. They exist outside the exterior world completely and you create the illusion that they are geographically related by placing 'teleport' links via doors and such - mentioning this because it took me a while to understand this concept.
I have found that the specific coord values are not really important in terms of figuring where your own objects and actors will go. If you are struggling to place things in exact spots, here's what I do: first familiarize yourself with the local (interior) coord layout (or exterior) by zooming in to your area of interest and click on various objects to look at their coord values in the display window. If you compare 2 objects nearby each other, you can determine which direction +x and +y are, and of course z is just up and down. Another tip is to just drag your object into the render window, then (double) click on it to view the reported coord values. Now change your y (or x, or z) value by clicking on the value and typing in a new one thats about 50 units different and watch how your object moves. At this point you can keep typing in small changes until your object is right where you want it, and dont worry about the decimal - you really dont need accuracy to 5+ decimal places, 1 or even none in plenty. Note that you can also type in rotation values to get your objects to line up with the environment, or lay flat, not clip, etc. in much the same way, just type in small changes and watch how it rotates - adjusting until its how you like it.
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Tue May 17, 2011 5:06 am

Sorry, I guess I was a bit vague.

What I was really trying to find out it what forumla does it use?

Fun note of the day!!!!!
Apparently, one of the quirks of Tesfaith (cmd line ver) is that it doesn't move teleport markers (so I have to do it myself).

So while I was looking at the different coordinates listed in a tesfaith log and in CS, I began wondering what the exact formula was used to figure out what those numbers meant (I'm just curious that way). That way I could just edit the teleport destination coordinates right in the CS NPC entry (instead of manually replacing all teleport points).
Initially I thought maybe the numbers had a meaning (like the first three digits mean something then the next three amplify that data) but after a quick check I realized it was just a straight up x,y coordinates broken down not by cells at all but by units. Each cell is 8192 by 8192 long, and for objects it further breaks down to the 6th decimal place.

So this is what I came up with...

N = 8192(S) + O
N is the new coordinate you're solving for
O is original coordinate (x or y ..you have to do both)
S is the number of cells shifted on that plane (it'll be negative for west and south)


Example (fake numbers of course)
I have an object at the the x,y coords (100.123456, 4000.654321) and I use Tesfaith to shift cells -10,20 (or west 10 and 20 north)
My equations would be X = (100.123456) +8192(-10) and for Y = (4000.654321) + 8192 (20)

It's actually a very easy equation. So all I have to do is load up the CS, click on each NPC who teleports and edit the teleport coord according to the formula.

BONUS fun note!
Tesfaith when it moves a cell, it works out just like the formula above. Except when the X coord crosses from a positive cell to a negative...then it still works but it looses a little accuraty. From my quick checking pretty small....the ones I checked were 0.000244 and 0.000488 off from the correct value after being moved. I never noticed any problem in-game so I think it's really too small to affect anything. I'll sum it up to a programming error.

EDIT: Tried it out in TESCS. Directy edited the x,y values for the teleport marker linked to the NPC (under AI->Services). Worked perfectly. Cell changed right where it needed to be. Also, the TESCS apparently only shows to the third decimal place for the discrepency. But not sure if it saved it right. I'll figure that out tomorrow. I'll use EE as long as it doesn't corrupt my mod
User avatar
Mr. Allen
 
Posts: 3327
Joined: Fri Oct 05, 2007 8:36 am


Return to III - Morrowind