Map table definitions

Events happening in the community are now at Drupal community events on www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!
Posted by dmitrig01 on April 16, 2007 at 1:40am
Last updated by aaron on Tue, 2009年04月07日 20:21

Map definition table

column description
mid Map ID
name name of the map
limit_x the limit of the x field: 0 <= x <= limit_x
limit_y the limit of the y field: 0 <= y <= limit_y

Tile data table

column description
mid Map ID that this tile belonds to
coord_x the limit of the x field: 0 <= coord_x <= map_definition_table.limit_x
coord_y the limit of the y field: 0 <= coord_y <= map_definition_table.limit_y
tid The tile ID
tile_info Tile description, we use serialized data because we dont know ahead of time of the exact data we will store.
the minimal info that we need is this: Tile, Link (allows for the infinite scalability)
Link would look like
<?php
array(
'type' => 'link'
'link_to'
=> array(
'mid' => // mid of map to link to
'x' => // where the map should be focused on apon entering
'y' => // ditto
)
)
?>

Tile content table

column description
tid The tile id this stuff belongs to
data name serialization of data_name, and content_id
To do stuff, it would call [data_name]_load($content_id)

I am not sure weather I like the name field.

Comments

We need a terrain in the tile_info, that looks like:

Posted by dmitrig01 on April 16, 2007 at 4:09am
<?php
array(
'basic' => 'grass'
'complex'
=> 'flowers' (data to present to the theme function)
)
?>

Or, for tile transitions,

<?php
array(
'from' => array(
'position' => WEST (constant)
'type' => array(
'basic' => 'grass'
'complex'
=> 'flowers' (data to present to the theme function)
),
'to' => array(
'position' => EAST (constant)
'type' => array(
'basic' => 'water'
'complex'
=> 'shallow' (data to present to the theme function)
)
)
?>

we need to be able to tell

Posted by litwol on April 18, 2007 at 12:44pm

we need to be able to tell the mapapi the regions that we want loaded and the kind of data loaded in one call!

for example:
1) if i want to load that mini map that shows where the player is with respect to the rest of the map, in that call we would want to load a large 20 x 20 map (random size for example) and only load things like fog of war

2) i want to load the actual map on which the player stands, the smaller one that is 5 x 5 or 10 x 10, but that map will now contain actual tile contents!

so to expand dmitrig01's example

<?php
array(
'region_minimap' => array(
'mid' => // mid of map to link to
'x' => // where the map should be focused on
'y' => // ditto
'length_x' => // how many columns to load
'length_y' => //how many rows to load
'tile_content' => // true/false on whether to load tile content or not.
),
'region_playmap' => array(
'mid' => 4
'x' => 215
'y' => 30
'length_x' => 5
'length_y' => 6 // doesnt have to be exactly square!
'tile_content' => true // true/false on whether to load tile content or not.
)
)
?>

by using this communication structure we can pass multiple regions to the mapapi and all the regions ill be loaded with one call!

possible uses for this are:
1) world mini map
2) player 'walk-on' map
3) crystal ball magic skill that allows you to look far into the land unknown (possibly clears fog of war!)

i think it is important that mapapi implements fog of war because it ties directly into managing whether to load content or not. the setting of fog of war can be turned off in the administrator pages but it stil needs to be managed by the mapapi_load


------------------
Sometimes interesting things appears on http://litwol.com

we would also need...

Posted by dmitrig01 on April 18, 2007 at 3:05pm

we would also need the center tile.
after that, I'm good to go.
Remember, our private pastebin is http://game.dev.dmitrizone.com/pastebin/
And if you want to upload phps files (no php files allowed) go to http://game.dev.dmitrizone.com/dump/

some code!

Posted by litwol on April 19, 2007 at 8:53am

through collaborative effort we managed to get initial code off the ground. Tomorrow i will be providing some optimization and more features, would love to do it now alas its 5 am right now.

Initial attempt, 100% works but lacks minor details (documented in the code)

i also included sql data against which i was running the above code.


------------------
Sometimes interesting things appears on http://litwol.com

Games

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /