Thoughts on Fog Of War

Discussion in 'ToEE Engine Recreation Project' started by DarkStorm, Aug 12, 2010.

Remove all ads!
  1. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    Hello,

    I am currently trying to implement the fog of war, but I really don't grok how the tile-flags work :-/

    Here is the current information visualized in my engine:
    [​IMG]

    What bothers me is that there is a gap between the start of the vision extend region and the flyable region. Up until now I always assumed, that the engine will simply stop revealing the fog-of-war when it hits a blocking tile. But this doesn't seem to be the case.

    Here's an example of the trees in Hommlet. They are blocking (not fly-over), but have no vision extend markings. Yet in the original game, they are revealed:
    [​IMG]

    I really need to figure out how the original engine decides when a tile is visible from the user's position w.r.t. fogging.

    Here's a screenshot of my engine doing fog of war (ignore the unsmoothed corners for now) without using the SVB files:
    [​IMG]

    As expected, the result looks incorrect.

    Possible theory: The flyover/blocking flag is entirely ignored and ONLY SVB files control fog of war visibility.

    If you know anything about this, or have some idea how it could be solved nicely, please let me know!

    Regards,
    Storm
     
    Last edited: Aug 12, 2010
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Hm, aren't there also vision 'bases' or something like that, which would presumably go where your gaps are?

    Also, I thought fly-over was a tile condition variant of blocked (tables, etc. - can't walk through them but can fly over them), so everything else in the room in your example that is currently 'flyable' (open spaces, plain floor) would be technically only 'unblocked.'
     
  3. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    I left that out intentionally. Vision Base is only used in conjunction with Vision Archway, which seems to be a special case for portals. I'll ignore that for now, since the more basic stuff isn't solved yet. You can actually see a vision base at the base of the door in the screenshot, but it overlaps with the ground, so it's hard to make out.

    Yes they are. The unblocked area in this visualization also includes blocked tiles that are marked as flyable. I assumed that vision will extend through blocking tiles that are marked as flyable, since they logically would be chasms, or barrels (things you could easily see through/over).
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Shiningted has a tutorial about sectoring that discusses this stuff to some extent: http://rpg-rant.blogspot.com/2006/02/sectoring-tutorial.html.

    Otherwise I would think Agetian knows the most about it. I never really understood it much myself - I always viewed vision extender tiles as the tiles that make it so you can see 'cloudy' character models on the other side of walls, not so much affecting what your characters can see i.e. fog of war. And I ignore vision ender tiles completely with no apparent ill effects. :shrug:
     
  5. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    Erm... That's actually quite an interesting idea. I'll have to check it out. I always assumed that the game uses the clipping geometry to decide what needs to be drawn "greyed out".

    What about the Co8 "new content" maps? I think you didn't use clipping geometry, did you manage to get the "greyed out" characters drawn with vision extender tiles? Just curious :)

    *edit*: But I do think the vision extend tiles have an effect on visibility. I remember seeing the fog being revealed beyond the actual visible range on the Hommlet map. The roofs of houses seemed to be revealed beyond the usual radius.

    Sector visibility blocking really seems to use some arcane logic...

    Regards,
    Storm
     
    Last edited: Aug 13, 2010
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Yes, making tiles 'vison extender' greys out characters, but clipping does play a role. Without clipping (that's one thing we can't do ourselves) characters are either all grey, or not. (e.g. if you're standing behind a wall at all, you'll be grey, even if part of you is not behind the wall.) With clipping in use, the parts of characters behind walls get greyed out, and the parts that aren't behind walls don't. It's much better with clipping, more precise and convincing.

    I can post some screens to illustrate later if I'm not describing that well.

    [edit]

    Agetian also has a tutorial on all this somewhere in World Builder.
     
  7. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    That's quite interesting. In my engine, I am only using the clipping information to show grey (the x-ray effect...) characters behind walls. It's possible they didn't know how to do that (I am using some stencil buffer magic to do it), or they wanted to use the vision extenders for "special" effects. I don't know.
     
  8. gazra_1971

    gazra_1971 Knights of Legend

    Joined:
    Aug 3, 2010
    Messages:
    818
    Likes Received:
    2
    DarkStorm, looking at your above screenshot of your engine doing fog of war, it makes me think that the maximum sight (visual) range of your engine's fog of war is set too short (unless you are shortening the maximum distance that characters can target spells from what it is in the vanilla game engine).

    A lot of spells (like Fireball) can be cast at a target that is MUCH further away than the visual range of spellcasters in the vanilla game engine (which is an exploit). I really don't like this. I think that it is silly that a spellcaster can target a spell further than the spellcaster can actually see (assuming that there are no obstructions blocking their line-of-sight).

    Also, the maximum visual range of your engine's fog of war only allows archers/crossbowmen to fire at relatively close targets (i.e. approximately 20 to 30 metres away, judging by the scale of the size of the character in the screenshot), which lessens their usefulness in the game. I don't see why an archer/crossbowman should be prohibited from being able to fire at a target 100 metres away (albeit with a massive penalty to their attack roll).

    That's just my humble opinion. I don't mean to offend you in any way. Indeed, I can only admire what you are doing.
     
  9. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    You are overinterpreting the screenshot, really. I set the visual range to an arbitrary value to test the fog of war implementation. I still have to actually reverse engineer the value used by the vanilla engine before finishing the implementation.

    *edit*: But on second thought the value seems to be rather close to the original already. You shouldn't forget that the above screenshot is made at 1920x1200 resolution, while the original game runs at resolutions much lower than that, making the visual range seem small on the screenshot, while it would be the entire screen in the original.

    Regards,
    Storm
     
    Last edited: Aug 29, 2010
Our Host!