Hi Kai,
Since I'm not familiar with the engine code I can't really add much
but it sounds like you're on top of things :-)
However, something occurred to me while reading these mails:
Will we run into problems if we have very high or low locations (e.g.
mountain locations)? If we imagine Waste's Edge to be more or less
ground level, then map objects in Uzdun Kal might have massive z-
offsets. Apart from making rendering harder this would probably be
hard to represent in a map editor GUI too.
I'm not sure how the map format works at the moment, but I assume we
won't have a single massive file representing the whole (outside)
world. Assuming things get split into smaller maps, I suppose objects
will only need z-offset relative to the map their on, which shouldn't
get too big. However it would be nice if the player can walk
seamlessly from one map to another and if that's possible you'd need
a way to describe one map's z-offset relative to another map.
I hope that kinda makes sense - I don't have time to make sketch
right now, but if it helps explain what I mean I can make one later.
Regards,
- James
On 16 Apr 2008, at 17:11, Kai Sterker wrote:
Am 16.04.2008 um 17:41 schrieb Kai Sterker:
Lets start simple, with what we need for rendering an object
visible in a map view:
* Its "base point", i.e. the location at which it needs to be drawn.
* Its position and size, so that we know when it intersects with
the map view.
* Its z position, for the order in which to draw overlapping objects.
All that information is available when placing objects on the map,
we only need to get it into a structure that is efficient for
rendering.
Which we kind of have right now, except for the problem with the
objects at height != zero. Here's a little sketch to demonstrate
what is going on there:
First, a view of our map, as seen in the game:
<top-view.png>
The dark brown rectangles represent the ground covered by objects
placed on the map, with a distance -z and +z below/above ground.
The lighter rectangles show where they end up when rendered in the
map view. Now lets look sideways at the same scene (thanks for the
inspiring scary eye, James!), so that we can see actual heights:
<side-view.png>
Imagine our map view just contains cell no. 2 and 3. There are no
objects located directly on that cell (they are at 0, 1 and 4), but
we could for example precompute a min_z and max_z value for each
cell that would tell us how far away to look for objects that might
have to be rendered on that square.
Even better though might be to enhance the square class (that
represents a single cell in the map grid) to store two distinct
types of information. The actual position of objects (for collision
detection) and the position where objects would be rendered (for
the map view). This seems to be a much simpler solution than what I
was thinking about before, and it could be put to a test fairly
fast with the current code. It will also show whether the rendering
will still work as expected (I actually expect it to improve).
Yay ... back to coding!
Kai_______________________________________________
Adonthell-devel mailing list
Adonthell-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/adonthell-devel
--
Personal site:
http://cirrus.twiddles.com/
_______________________________________________
Adonthell-devel mailing list
Adonthell-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/adonthell-devel