You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I drastically improved the performance of the UnitOnScreen() function by using Select() to get units within a suitable range, and only then looping through them. Instead of looping through ALL units as UnitOnScreen() previously did for the Select(), I used an offset of (-1, -1) for the viewport's top left pos, and of (1, 1) for the viewport's bottom right pos. The assumption there being that a unit's box size won't fully encompass a tile that the unit doesn't physically occupy. This assumption is valid for both Wyrmsun and Wargus unit types
and with some work, it isn't even necessary to make such an assumption, you just need to calculate the max box size tile overflow
e.g., going through each unit type and doing:
Andrettin:
and then using that number for the viewport top left/bottom right tile offsets
Andrettin/Wyrmgus@71ec95d
original messages here:
https://discord.com/channels/780082494447288340/780082494447288344/890998108668956722
The text was updated successfully, but these errors were encountered: