mysql - Database Design - 2d tile grid -


I played a web game, while the back was called racewalkhams. It used a 2D text based system. What is the interest to me Map Map is made up of 255 tiles in the direction of X, and 255 in the Y direction. 5 of these maps are total. But the amazing thing is that there is a lot of data in each and every one has its own 'state' which will be about 50 variables per tile. Then every 'monsters' are kept with health bars and data, which are permanently remembered.

How would such a thing be designed? I suspect that there was each tile table, I thought you would have a map 1_table with a different element that would be found in any, but I'm not sure . I am facing a situation where I need a similar design, but it does not know where to start from.

Thank you!

I recommend using the following structure together with my plan

  • Tiles generally save the amount of tiles, each tile has an ID, a tile size is difficult - for example 5 * 5 pix.

  • Tile_matata saves name, and a small "tooltip" description. Meta is self explanatory;)

  • Tiles are the minority of tiles. Here you should include things on which a user will enter multiple times, but it must be kept to a minimum .

  • The Tiles_content_midium contains such things as "items xy to 12% here". Create an extra "loot_table" with the item "item_hash" All the items in the item can have a hash of ID which may drop.

  • Tile_Source_Legains is the largest table where you store, on which the coordinates located inside the tile is located, where it looted the item number 1234.

  table: tiles id table: tiles_meta id tile_id name range: tiles_content_low id tile_id owner_id go_id table: tiles_content_medium id tile_id mob_hash item_hash table: tiles_content_large id tile_id Savegame  

If you want to create a "tile_set" or "map" JavaScript, do not create an entire map on your server, just pass the tile date to JavaScript. Will save a lot of performance.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -