11-13-2024, 04:02 AM
(This post was last modified: 11-14-2024, 01:10 AM by DerVVulfman.)
(11-12-2024, 09:53 PM)Tepe Wrote: But there has to be optimization in fow_update_tilemap. In the original code there are large fps drops. The difference is at least 2x in favor of my version of the script. Of course, as I mentioned earlier, I still have frequent drops but it doesn't reach less than 16 on a large map with more events, and in my case the additional load is generated by other scripts, some of which are for a specific fix.
(11-12-2024, 05:10 PM)DerVVulfman Wrote: THAT... is why I crafted the customized moving? method, one that checks to see if any NPC just 'starts' moving from one tile to another.
Were I to have the method that reveals the fog execute based on the default 'moving?' method, the 'fog-revealing' method would execute over-and-over from the start of the NPC's move into a tile space to when it finishes walking into the tile and stop.... That's a lot given it need to only reveal that area once, and not over and over for the same area. With four NPCs, it reduced FPS from 39 to 36 on my PC.
(11-12-2024, 09:53 PM)Tepe Wrote: The maximum number of frames is about 36 but with frequent fluctuations, while in yours I have a stable 8-9 fps in all time.
I gotta wonder... how are you getting that low a FPS with this?
I had to make 23 events all clean the map (300x250 tiles) at the same time. Not one or two, but 23... and that's quite a number cleaning the map on your behalf. Under normal circumstances, it is 40fps, but switches to 30 FPS when the defined events move and clear out the map. And that FPS reduction changes (increases faster) as the map is cleared.
But that is with 32 events flagged to clear the fog, a rather unusually high number indeed.
Again, I am still working.
Video difference of your version, and mine. Yours with the FPS showing significant drops down to as low as 3. Mine with a red fog with FPS drops no lower than 29. Both using the same map with 23 keyed events that erase the fog.
2024-11-13 18-56-38_Segment_0_x264_x264_x264_x264.mp4 (Size: 924.15 KB / Downloads: 1)