[CF-Devel] Java editor and elevation.

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Wed Oct 29 18:00:54 CST 2003


On Tue, 28 Oct 2003 09:16 pm, Andreas Vogl wrote:
>
     
      David Seikel wrote:
     
     >
     
      > [...] the Java editor [...]
     
     >
     
      > Can I make changes to it?  (BTW, I am an excellent Java coder.)
     
     >
     
     
     >
     
      You're welcome to make changes.
     
     
Thanks.

>
     
      I would appreciate it if you could write an email about
     
     >
     
      what exactly you're going to do, before committing to CVS.
     
     
Following that instruction...

>
     
      > Does the latest Java editor keep track of
     
     >
     
      > elevations properly now?
     
     >
     
     
     >
     
      Nope. The reason is frankly, I'm not the biggest fan of the
     
     >
     
      elevation concept. Of course you can add support for it.
     
     
I asked because I was making manual changes to the big world maps and needed 
elevation support in the editor.  Yesterday I wrote really basic elevation 
support, but I will discuss those changes before committing them.  BTW, it 
works well B-).

First of all, all code that needs elevation information reads it from the 
bottom of the map.  This makes sense as elevation is the height above sea 
level of the ground, not the tree or building on that ground.  All the 
current elevation code I know of does that.

My editor changes just make sure that any elevation information already in the 
map is propagated to the bottom of the map as needed.  To quote from my 
notes, the propagation is as follows -

delete bottom - propagate elevation up first.
delete other  - do nothing.
insert bottom - propagate elevation down after.
insert other  - do nothing.
move bottom tile up - propagate elevation down after.
move tile to bottom - propagate elevation down after.
move other    - do nothing.

The actual changes I made are as follows -

Created ArchObject.setAttributeString() and ArchObject.removeAttribute() to 
complement the existing getAttributeString() method.

Created an ArchObject.propagateElevation() method to do the actual propagation 
using the above mentioned methods to get, set, and remove elevation 
attributes as needed.

Sprinkled calls to ArchObject.propagateElevation() in appropriate places in 
CMapModel.

Note that elevation is only propagated up or down within a stack
of tiles.  This means that if you delete all tiles in a particular
spot, then add a tile, there is no tile to propagate the elevation
from, so elevation needs to be set manually.  Best to add a tile
first, then delete the old one if you want to keep the old
elevation.  Naturally, if you are replacing hills with mountains,
you need to change the elevation manually anyway...

Having made these changes, I then used the editor to make my changes to the 
big world maps and everything worked smoothly.  I will be committing those 
changed maps sometime today.  I will hold off committing my editor changes 
until I get approval from the list B-).

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list