Iris2.de

Iris2-Forum
It is currently Fri Apr 19, 2024 7:06 am

All times are UTC




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Fri Jun 13, 2008 12:57 pm 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
yes, the map is a typical heightfield therefore there is only one height per field/cell/tile.

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 13, 2008 1:18 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
mountain top is from the heightfield, but there can also be static-ground-tiles BELOW the heightfield for cave-floor


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 17, 2008 5:01 pm 
Offline

Joined: Mon Jun 09, 2008 1:04 pm
Posts: 12
Finally got everything working :-D

One more question along these same lines though. How would I go about gathering only the cell within an area? So if I specify a rectangle as my area and the top left corner of that rectangle is in the middle of a block somewhere, how do I know what cells should be read and what should not?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 17, 2008 5:07 pm 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
you could write a getXY function that handles the loading of the depending block, converts the XY to local block-internal XY and returns the infos.
then reading out a rectangle area is just getting each cell info.

if this is to slow you could put the complete file into memory that you can access the info directly or
load blocks and use a caching that you dont need to reload every block if you iterate over more than one block.

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 17, 2008 7:03 pm 
Offline

Joined: Mon Jun 09, 2008 1:04 pm
Posts: 12
Image

I believe I have figured it out without the need of the translating coordinate. Since the map coordinates will be given, I just have look up the block, then convert the map coordinates to block coordinates. The translation would be map coordinates - top left selected map coordinate. This seems like a bad way to me though. If cell id 43 is the top left selection coordinate of 3,5 then it maps to 0,0. Block 0 is loaded and the information is retrieved. The loops continue until map coordinate 8,5 is reached. Then block 512 is loaded. When map coordinate 3,6 is reached, block 0 will be loaded again. This will just keep continuing. There will be 10 block switches for only 4 blocks of data. How can I improve this?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 17, 2008 7:32 pm 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
caching. just hold a list of for example 10 blocks ordered by last access time and everytime you access a cell you calculate the depending block and check if its in the cache. if this is the case use it otherwise throw away the oldest, load the depending block into the cache and use it.

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 20, 2008 3:43 pm 
Offline

Joined: Mon Jun 09, 2008 1:04 pm
Posts: 12
I thank you guys again for all the help :-D


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 21, 2008 1:54 am 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
now im curious. what are you working on?

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 22, 2008 7:16 am 
Offline

Joined: Mon Jun 09, 2008 1:04 pm
Posts: 12
A long distance pathfinding script. Tried getting help with the file formats etc over at RunUO but people were not very helpful as they all wanted me to do a different way, when I wished to learn this way as I had never done nearly this much file handling before. The original goal was to create races around the world between NPCs and players. The pathfinding is only within one block by default, I was trying to do paths from Vesper to Yew length, sometimes longer.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 22, 2008 9:36 am 
Offline
iris2-developer
User avatar

Joined: Mon Aug 09, 2004 12:20 pm
Posts: 1431
paths for npc right? nice idea todo some realisic interaction with npc <> gameworld.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 22, 2008 1:33 pm 
Offline

Joined: Mon Jun 09, 2008 1:04 pm
Posts: 12
Yes for npcs. The idea was for a scavanger hunt. Normally its a player thing, but then I thought of adding the bonus of competing against npcs. It can be anywhere in the land though and during the event, all participants magery and chivalry is removed so that they may not travel but on foot.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC


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