Fog of War
#11
Well, as I previously stated...
(11-12-2024, 01:13 AM)DerVVulfman Wrote: It needs some cleanup by my standing, and I want an optional means to flag events besides within the config page. So not done yet.  BUT it is performing the options you've requested... and more.

So additional work will be performed.

I was able to apply your options TO my demo, only the mild correction to the 'check_adjacent' method within Spriteset_Map being necessary.

Why my version has an altered 'check_adjacent' method

However, whilst it worked with your edits, I encountered an issue.  When the player moved about on the map, the player erased the fog within the 3-tile range prescribed by the FOW_RANGE_DEFAULT configuration variable.  After standing for some time, the area around the player erased more, returning to the 5-tile range defined within the FOG_MAPS array for map 3.  So it did not properly erase the  area around the player whilst moving as it should, only that around the player when standing still.


The update_fow_tilemap section does have long code, some quite similar to one another. Do note that he has comments that his work is designed to 'only process fow currently on the screen'. And for that, he used routines that had lines such as:

if @fow_tilemap.map_data[x, y, 1] == 96
    @fow_tilemap.map_data[x, y, 1] = 96
end


Now while it ensured that the data within the coordinates of x/y became whatever value it demanded, it only performed the data change if the x/y coordinate data wasn't.  Odd as it sounds, performing the check and skipping takes slightly less time than arbitrarily changing it every time.  Go figure. 


Some of the content you 'removed' thinking redundant within the update_fow_tilemap was was actually present to prevent errors and map glitches, particularly around the static secondary static map section when it indeed needed to see if areas needed to be SKIPped.  The SKIP flag is called into play both within this area and tested for when a map is initialize or re-initialized, this to reduce more lag and fog processing.

And further below is the area that updates the tileset based on 'range'... likely where it sees (at least within mine) the proper area range for the player or the NPCs and the area to erase.

Meanwhile, changes I made to  update_fow_tilemap include both the request of x/y coordinates of the target character (player or any event), and a speciic range for said player or event. The range passed into it directly related to the area you erased near the bottom of the method.


Again, I do state it needs some cleaning up.  But some facets of the script need remain in place, or optimized rather than wholly removed.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
Fog of War - by Tepe - 11-05-2024, 12:42 AM
RE: Fog of War - by DerVVulfman - 11-05-2024, 05:06 PM
RE: Fog of War - by DerVVulfman - 11-05-2024, 06:15 PM
RE: Fog of War - by Tepe - 11-06-2024, 04:11 AM
RE: Fog of War - by Tepe - 11-06-2024, 02:49 PM
RE: Fog of War - by DerVVulfman - 11-09-2024, 08:21 PM
RE: Fog of War - by DerVVulfman - 11-12-2024, 01:13 AM
RE: Fog of War - by Tepe - 11-12-2024, 04:54 PM
RE: Fog of War - by DerVVulfman - 11-12-2024, 05:10 PM
RE: Fog of War - by Tepe - 11-12-2024, 05:58 PM
RE: Fog of War - by DerVVulfman - 11-12-2024, 08:58 PM
RE: Fog of War - by Tepe - 11-12-2024, 09:53 PM
RE: Fog of War - by DerVVulfman - 11-13-2024, 04:02 AM
RE: Fog of War - by Tepe - 11-14-2024, 01:27 AM
RE: Fog of War - by DerVVulfman - 11-14-2024, 02:19 AM
RE: Fog of War - by Tepe - 11-14-2024, 02:29 AM
RE: Fog of War - by DerVVulfman - Today, 01:57 AM
RE: Fog of War - by Tepe - 7 hours ago
RE: Fog of War - by DerVVulfman - 3 hours ago
RE: Fog of War - by Tepe - 1 hour ago



Users browsing this thread: Tepe, 2 Guest(s)