[DGD] Using r-trees to subdivide a world
Shentino
shentino at gmail.com
Sun Jul 29 11:56:59 CEST 2012
On Sun, Jul 29, 2012 at 1:28 AM, Jared Maddox <absinthdraco at gmail.com> wrote:
> Yeah, you should subdivide the z dimension as well.
Was planning on it.
> If you want to allow rooms with internal protrusions, then I suggest
> just breaking them into multiple rooms instead. With builder-tools,
> this sub-division can be done automagically.
I probably would...haven't really decided yet though.
> Especially with this, you should sub-divide the z axis, that way you
> don't have to deal with it later. Also, it'll improve the case of e.g.
> rooms on different floors of a tower.
In this case I'd most likely have to do a coordinate system change.
Spherical, but assuming cartesian approximation.
Once I launch into outer space, go XYZ and then translate to XYZ for
the solar system. Another translation would probably be required if
the unlucky astronaut drifted far enough to get into interstellar
space.
> Out of curiosity, are you planning to allow construction/wizards? If
> so, how will you handle it, by allocating them a 'plane'/r-tree
> node/room that they get to be wizard in, and simply not extending the
> capability to them elsewhere?
I'd probably stuff them into another plane of existence entirely.
> The split planes being what I refer to as 'walls'.
Probably not, but close.
I'd have a standard hierarchy, with zones -> areas -> buildings ->
rooms -> objects -> possessions, plus automagic rtree nodes to divvy
up an object's "real" inventory as needed.
> You sound like you're already playing with the trees, what did you
> need advice with?
Not quite playing with r-trees yet, just regular trees.
At the moment in my prototype, I have an infinite plane of grassland
within which lie rocks, patches of bare soil, deer, and wolves.
Next extension to my model will be big rectangular rooms of arbitrary
size and position.
In theory, r-tree nodes would start being injected if any object's
inventory grew past a certain point.
If I make a soil bomb go off, r-tree nodes would probably start
mushrooming up between the leaf level soil patches and the root level
infinite grassland.
That's probably what the r-tree thing is most going to be. Automatic
injection of r-tree layers if an object's direct inventory gets too
heavy.
In the big picture, r-tree nodes are just invisible glue.
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
More information about the DGD
mailing list