[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] Map object thoughts

From: Kai Sterker
Subject: [Adonthell-devel] Map object thoughts
Date: Wed, 13 Jun 2007 15:51:37 -0700

This is a list of ideas/future tasks regarding map objects that I'd
like discuss. Please see
for a very basic overview of map objects.

1. Bounding Boxes:

Right now, the x and y extension of an object's bounding box is
specified in multiples of the grid size (40px). That will not work
well for thin objects (like people, columns, trees, walls, etc.) and
for larger objects whose size isn't a multiple of the grid size. (for
example I've got a ground tile that is 60x60).

The first thing that should happen (possibly after an initial demo
release) is to change the bounding box to all pixel size. That should
improve the collision detection that currently isn't very

I'd also like to be able to change the shape of the bounding box. At
the very least, it would be nice if the (top) corners could have
different heights, enabling us to create sloped objects. If anyone
really dares, we might implement real 3-dimensional bounding boxes to
cover for irregular-shaped objects.

2. Map Object State:

Each map object model has a pixel offset, so that it does not need to
be aligned with the grid. The offset you specify there is then used by
all objects using that model. So for my 60x60 ground tile, I would
have to use 4 different models (with offsets 0:0, 0:20, 20:0 and
20:20) to create a seamless ground.

It is possible to specify a separate offset when actually placing
objects on the map, but right now the collision detection code does
not support this (I tried and it caused a segfault). Maybe this issue
can be resolved together with the changes to bounding boxes. But there
might be a different approach that also takes into account another

There is only one instance of each map object, even if it is used
multiple times on the map. That's great for efficiency but not so
great for objects like doors or chests and the like. If you change the
state of one such object, all other objects would change too. In the
same way, if you change the offset of one object, all others' offset
is changeit as well.

What we would need is a way to change the attributes of a map object
without affecting other objects that initially share the same
instance. A technique like lazy copying comes to mind here. We also
need to make sure that the state can be saved and restored correctly
for each object. A reference to the original object model will not be

I will make sure those too become tasks on the Wiki and are reflected
in the roadmap. But any input you have before I do that is


reply via email to

[Prev in Thread] Current Thread [Next in Thread]