Ryandor.com

Forums
It is currently Thu Mar 28, 2024 5:50 am

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Apr 12, 2007 4:11 am 
Offline
Newb
Newb

Joined: Thu Apr 12, 2007 4:06 am
Posts: 3
I've been working on a UO client for a wee bit now, and I've come to a point where I can't make any headway. Doubtless this question has a simple answer, but for the life of me, I can't figure it out:

How are statics drawn to the screen?

I know the altitude of the tile I'm drawing the statics on, the altitude of the static, the 'height' value of the static... but for the life of me, I can't figure out how to combine these into a simple coordinate to display the static from.

Are there any special cases? [ ex., where width < 44, x = x + (44-width)/2 ]

Thanks so much!


Last edited by farfromhomefish on Thu Apr 12, 2007 11:10 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: >BLINK<
PostPosted: Thu Apr 12, 2007 9:54 am 
Offline
Journeyman
Journeyman

Joined: Mon Aug 14, 2006 11:51 am
Posts: 102
Ummm, what did you say?

If you explain alittle (cough) more... we might be able to help.

What are you doing?
is your map ingame an your manually placing statics?

more info please


Last edited by Pallando on Thu Apr 12, 2007 11:39 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:02 am 
Offline
Newb
Newb

Joined: Thu Apr 12, 2007 4:06 am
Posts: 3
=) I wasn't sure I was going to get a response here at all - certainly not so quickly. Thanks for responding - I'll try to be a little clearer.

I'm programming a UO client. Right now, all I want to do is display the original map0.mul (along with its statics). I'm not using any custom data at all.

So far, I have the terrain displaying perfectly , along with altitude, etc.

However, I can't figure out how to display the statics at the correct positions.

Here's my question: what is the method of determining where a static should be drawn on the screen, if it is drawn on a tile that is currently displayed at the screen coordinate tileX, tileY? For example, could it be:

staticX = tileX + (44 - static.pixelWidth);
staticY = tileY + static.altitude * c_pixelsPerAltitudeByte + static.height;

(static.altitude would be loaded from the statics0.mul file, whereas static.height is one of the values that is loaded from tiledata.mul).

Obviously, that particular function isn't it. =/ I worked on this for about three hours last night, and finally gave up in frustration. Finding out how to load the graphics and display the map, even with altitude data, is easy. Placing the statics on screen, on the other hand, isn't. =/

On a related note, how are statics ordered, so that the top-most ones display over the bottom-most ones (i.e., roofs over walls over floors).

Thanks again!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 5:00 pm 
Offline
Apprentice
Apprentice

Joined: Tue May 20, 2003 5:00 pm
Posts: 26
One could look at the source for WorldMaker Map editor. It would have the sorting algorithm, and the static placement code.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 6:01 pm 
Offline
Newb
Newb

Joined: Thu Apr 12, 2007 4:06 am
Posts: 3
For those people who are looking for the same thing I am (or something related), I was able to find the source code for WorldMaker Map editor at this website: http://ultima.lonet.cz/download.php

Now I'm going to see if I can hunt down the proper bit of code...

Thanks for your help!

[update]
Great, statics are working now. Thanks again for your help, punt. =)
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 12:10 am 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
I've been meaning to upload punt's stuff to the Ryandor files section, I just keep putting it off.

I'll try to knock that out over the weekend. Sorry for the delay!

P.S. I don't know if this helps at all since it refers mainly to the map and not the statics; but just in case:

http://www.ryandor.com/forum/viewtopic.php?t=2386

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


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

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


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