Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Map reading issues #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
So, the issues we currently have with the map are as follow.

1. Still havent tested if the fix i did with the help from ZioNz was enough
to sort the issues we've had with mapreading. Not enough atleast. I updated
it to make it only read through the actual objects.

2. Its still to slow. More focus on only looking on the current floor,
aswell as only active objects. And why do we have so many functions? Can't
we just slim it down to a mapsquare? and make Location a sub of MapSquare
rather than tile. Its to much hasstle to go through converting between
tiles and mapsquare
My suggestion is going like MapSquare is right now. But having GetTile
return a MapSquare, and use it as a faster version of GetMapSquare that we
should build on instead.

3. The current GetTiles will not work, since it only gets the actual tiles
information. This means that holes like sewergates and stonepiles can't be
found, since they are a object on the tile.

4. We need to Get the actual IDs of the holes, the ones we got now are
mostly wrong. Klusbert is helping out already, this is something the
community can do. 
An example is TrapDoor2 = 408;
Thats actually the standard tree floor on rook and most cities.

Original issue reported on code.google.com by hugo.per...@gmail.com on 25 Aug 2008 at 11:22

GoogleCodeExporter commented 9 years ago
MapSquare
-Relative Location (Memory)
-Absolute Location (World Map)
-Number (as in SquareNumber)
-Address (duh)
+Tile
 -Id (Of the tile)
 -Number (Again, for the possibility to just look for certain tiles rather than all
the objects. When found create a MapSquare of it)
+List<Object>
 -Id (Of the object)
 -Data (Such as ID of player)
 -Extra data (It has this for something)
 -Number (Being able to get a list of objects. Like if it can find 5 holes, we'd want
it to return 5 objects with what number the Square is, then we can count from 
there)

For the developer, it should look something like this. Obviously the naming may 
change.

map.GetSquaresWithTile(FishTiles)
Internally, it scans through the current floor. For tiles containing fish, then
returning a bunch of mapsquares with all data needed. Meaning he can just use 
Fish(tile1.GLocation);

map.GetSquareWithObject(99,player.ID)
Will get a list of all the tiles with creatures on em, then find the one that 
has
this specific id. The return should be a mapsquare with everything in it.

map.GetSquaresWithObject(386, true)
Gets all the ropespots on the current floor. Returns a list of Squares that the
player can rope up at, then the developer can get the closest one himself.

The easiest way is probably to just get the number of the MapSquare, then make 
all
the calculations from there in one specific function. Will ease the coding 
aswell.

Original comment by hugo.per...@gmail.com on 25 Aug 2008 at 11:53

GoogleCodeExporter commented 9 years ago
That's really good organizing and I like it. Recommended by me!

Original comment by Oskari.V...@gmail.com on 26 Aug 2008 at 12:11

GoogleCodeExporter commented 9 years ago
What do you think about renaming the location types to MemoryLocation and 
WorldLocation?

Original comment by ian320 on 1 Sep 2008 at 2:08

GoogleCodeExporter commented 9 years ago
I completely rewrote Map from the ground up, most of these should be fixed in 
r402.

NOTE: Needs extensive testing! (change to Verified after testing)

Original comment by ian320 on 1 Sep 2008 at 6:27