Ryandor.com

Forums
It is currently Thu Apr 18, 2024 8:47 am

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: The 3 Dimensions of UO
PostPosted: Wed Jan 26, 2005 12:39 pm 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
This is something that is absolutely fundamental in the map-making process, and yet is assumed you already fully understand it in all of the tutorials and guides I?ve seen. If you?re not a beginner, this should all be horribly obvious to you, but for those out there just getting their feet wet, this might help.

UO is traditionally thought of as a two-dimensional (2D) game because of its use of 2D graphics (even the 3D client uses, for the most part, 2D graphics). While it is true that the graphics are loaded and handled in a 2D way, the world itself is actually 3D, in a limited sort of way. This little guide should help clear up why this is important.

The most obvious 3D aspect to UO (including the ?2D? client) is the ground, which is stored in ?map0.mul? (and its variations). The ground is fully 3D, with both X, Y, and Z axes. It is stored in what is called a ?height map?, where each tile has a height stored, which defines the upper-left corner of the tile?s height. The height of the other 3 corners of the tile is defined by the tiles around it. The location of the tile is implied by its position within the file. This is the only part of the original 2D client which is displayed in 3D.

While you can, technically, define the X, Y, and Z axes to point in any direction you like, the standard for UO is for the X and Y to lie on the same plane as the ground if it were flat, and for the Z to point ?up?. The X axis runs from the western tip of the map to the eastern, and the Y axis runs from the northern tip of the map to the southern. I have never seen a tool which aligns the axes any differently.

The second, less obvious, part of the game that is 3D is the objects within the world. This includes anything you can interact with, buildings, roofs, even rocks and trees. Each object has a ?Z? or height value attached to it, which defines how high in the air something should be. Assuming the object is high enough, you can even walk underneath it.

A note should be made, however, that UO does not use a floating-point linier system for storing the height (or the location, for that matter), so everything is bound in height by the integer (no decimal point) values between -127 and +127. Generally speaking, a one-story building is 20z from its floor to its ceiling, and each consecutive level is an additional 20z higher.

The X and Y location of objects and tiles, unfortunately, are also stored in non-linier integers that are one tile in dimension. This means a change of 1y of an object will move it down one tile. There is no way to have an object overlap tiles physically, however some objects are drawn in such a way as to give the illusion of overlapping tiles or even taking up multiple tiles. Another trick is to increase the height of the object until it looks like it is overlapping the tiles you want it to, however this can be tricky, since the interaction with the object is still controlled by its physical location and not by its visual location.

Another important aspect of UO is that collision detection is not precise when it comes to collisions with objects. Collision detection with the ground is pretty accurate, but all collision detection between characters and objects is defined by the bounding box of the character and the bounding box of the object. Both bounding boxes have the width and length of exactly 1 tile, but the height is variable. Some objects have a height of 5z, while others (such as walls) have a height of 20z, or anywhere in-between. This can be confusing since the height and dimensions of the bounding box of the object rarely align perfectly with the actual object?s on-screen visual dimensions. A rock, for example, would look like a cube based on its bounding-box, even thought it doesn?t look anything like that in the game.

One more tricky aspect of collision detection in UO is ?falling? ? you can ?fall? off any object onto any walkable tile or object, but not onto any un-walkable tile or object. Whether or not a tile is walkable is defined both by the server and by the client files, but the easiest way to learn which things are and are not walkable is to test it. The reason for the client not allowing you to fall onto an un-walkable tile is primarily a safety concern, since, chances are, if you did, you would then be stuck wherever you fell, and the GMs have better things to do than to rescue players who fell and got stuck (although this still managed to happen quite frequently anyway).

The last aspect of collision detection that is of some interest is ?climbing? ? a character can generally climb any object with a very small height (less than 5) but with the special exception of ladders and stairs, which allow for much higher ?climbs? than regular objects. Again, what things are defined as stairs or ladders is defined client and server side, but this one is pretty obvious. To climb onto any object, however, it, obviously, must be walkable.

Hopefully this clears some things up. If not, oh well, I?m at work, so it?s not like it was wasted time to write this. ;-)

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 7:06 pm 
Offline
Posting Whore
Posting Whore

Joined: Fri Aug 29, 2003 6:21 pm
Posts: 1434
Location: Colorado Springs, Co.
We used to have a blast teleporting to the peak of the roof in the smithing shop next to the moonglow bank and jump on people who walked under you.

Until they fixed it you would rubberband back to the roof and emote and *Oof!* take a couple of points of damage. This was a great deal of amusement for us simple chimps. :wink:

Nice explination of the UO world basics btw.

Dev

_________________
"So...if crazy people don't know their crazy...does that mean your only sane if your know your crazy?"


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 13, 2005 1:40 pm 
Offline
Young
Young
User avatar

Joined: Sat Aug 13, 2005 1:34 pm
Posts: 16
Interestingly, Origin had been doing that since Ultima VII - Serpent's Isle, four years prior to UO's release.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group