Thread: Roomless world
View Single Post
Old 08-15-2014, 07:50 PM   #2
koteko
New Member
 
Join Date: Mar 2012
Posts: 20
koteko is on a distinguished road
Re: Roomless world

I'm currently giving a better thought to the "second option", that is a proper coordinate system where objects have shapes, without using temporary rooms to store lists of entities.

For a MUD, I wouldn't really need the Z coordinate, or objects one over another. Every object/player/mob would have two points associated, top-left and bottom-right, determining their bounding box on ground (the "base"). Two entities could "sit" in the same area for simplicity.

By storing all entities and the map itself in a R-Tree or similar structure (in a DB in my case), I should easily be able to do range queries such as: "Given this bounding box (an area around the player), find all objects/players/mobs whose bounding box overlaps it".

At that point, getting back in a reasonably fast time a result set of entities, I should be able to process them appropriately.

I'm curious if this is the system KaVir uses for Godwars 2
koteko is offline   Reply With Quote