[CF-Devel] Floors / walls and archetypes

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Mon Sep 29 03:03:58 CDT 2003


>
     
       My question I guess would be 'what are you trying to do?' 
     
     
Something that I think has been discussed earlier: ingame map building.
I added some archetypes for building walls, floors, doors. They work 
fine for now (only in unique maps, because I'm not sure on how other 
maps are stored... But the code should work anywhere).

The issue I'm running into is to correctly remove a wall, or check that 
there is indeed a floor on a square.
Currently my code uses things like no_pass or is_floor. But in some 
cases I think that may not be enough.
For instance, into your apartment, on the east wall (with extender). 
Just behind the wall is a 'blocking view'. It does have the 'no_pass' 
flag. So my code, if you remove an east wall & put a floor, will 
consider that blocking view to be a wall. Which, in a way, it is. Thus 
it'll leave that blocking view, which isn't really nice (black square, 
i'd rather have walls).

Small drawing to illustrate:

   FWB
   FWB
   FWB

(F = floor, W = wall, B = blocking view)

Adding a floor on the middle square results in:

   FWB
   FFB
   FWB

(correct gameplay-wise, player can't move outside the floor area)
but i'd rather have

   FWW
   FFW
   FWW

to have nice walls :)
So I need to find a 'real' wall, not a blocking view...

Also if you build near the grates an apartment's entrance, I had to do 
some tweaking to correctly see that the grate, even if it has 'no_pass', 
is not a wall...

Note: i'll send a patch with my current code in a few days if someone 
wants to have a look :)

>
     
       For floors, thing to always check for is FLAG_IS_FLOOR. 
     
     
Seems that flag is always set, yes... So easy to find.

>
     
       For walls, no_pass is the right thing to check.  As you note, there 
     
     >
     
      are some things that have no_pass set which aren't really walls (eg 
     
     >
     
      doors), but the question is then what are you really trying to 
     
     >
     
      do/check for? 
     
     
I think i answered that, tell me if that's not enough :)

>
     
       My general philosophy is that types should only be defined if there 
     
     >
     
      is code in apply.c or time.c (or maybe a few other places) that needs 
     
     >
     
      to know the type. For something like walls and floors, which are 
     
     >
     
      passive, there really isn't any reason to define a type, because the 
     
     >
     
      attributes of the object itself dictate the no pass/can't see below 
     
     >
     
      behaviour. 
     
     
Well for 'correct' map building some tweaking will be required. Because 
you don't want to have a square with no floor and only a wall, it isn't 
nice :)

Note: i don't say we should be able to build on all maps, probably on 
some special maps which could be tweaked with some special types or 
values on floors or walls.



_______________________________________________
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