ipochto / stratagus

The Stratagus strategy game engine
GNU General Public License v2.0
0 stars 0 forks source link

Improving the performance of the shared vision code. #19

Closed ipochto closed 3 years ago

ipochto commented 4 years ago

Andrettin:

I just made a change that resulted in the visibility-checking code becoming a lot faster when checking for visibility of a unit or tile instead of looping through ALL players and checking if each has shared vision with the "this" player and if they see the unit. I made shared vision be stored in the player instance as a set of player indexes. So then I just iterate over the other players the player actually has shared vision with. This is specially important for when moving the mouse, because when you move the mouse, it checks to see if ALL units are visible and on the viewport

https://github.com/Andrettin/Wyrmgus/commit/ac15658ec515cfc7bb8e723961d066a3a6cb17ae

ipochto commented 4 years ago

Fixed in master

ipochto commented 4 years ago

Performance improvements to shared vision checking Improved the performance of the radar visibility checking

ipochto commented 3 years ago

Fixed in master