#planetfall continues to be uncultured
Explore tagged Tumblr posts
Text
Invisible Inc why are you like this.
If you move the cursor around in a safe area the game is really choppy.
At first I thought this was it, I had tracked it down to mousing over tiles and was ready to make a shitpost like
[calls a meeting of all the mods] All right, which one of you’s been doing string comparisons in the mouseover function
because you see it’s a joke on the multi - look, never mind that, the point is I noticed something else: if you move the cursor around in a dangerous area the game is sometimes smooth and sometimes moderately choppy, but performance is consistent for the same areas. Noticed and hidden tiles are visibly slower than watched tiles.
From this (I think) I know exactly what it’s doing, and it’s ridiculous.
When you mouse over a tile, in order to give you the watched/noticed/hidden/none tooltip, the game is recalculating every enemy’s line of sight. If one enemy watches a tile, it is watched, end of story. So as it’s looping through every enemy it finds one watching your tile, gives you the ‘watched’ tooltip, and doesn’t bother evaluating any of the rest. Hence why some areas perform better than others - the enemies are being iterated over in a fixed order based on internal ID or something like that. If it’s noticed or hidden you don’t get to skip the rest of the enemies because there still might be another watching from a different angle.
The correct way to do this is cache enemy vision in an array of size height*width where you can look up the status based on coordinates and then only update that array when a unit moves or is enabled/disabled. Obviously.
I really hope I’m wrong about this because this is just inept! I mean, the enemy vision is displayed constantly on the floor, it’s clearly being stored somewhere, but not somewhere the mouseover text has access to? For some reason?
If I’m right it’s clear that either:
a) a mod is somehow overriding the optimized default behavior with unoptimized custom behavior (or for that matter... efficient C?? behavior with bloated lua behavior, boy THERE’s a wound that still stings)
b) someone at Klei is aggressively incompetent, which I wouldn’t expect given their general reputation for high quality, but II is the only game I know of that stores its save file as a lua script (?!) so all bets are off.
I’m glad I have at least some kind of lead here since I had assumed it was a too-many-mods problem or a my-computer-has-always-been-a-little-janky problem. (One of those is probably the origin of the huge hitch on opening Incognita and transferring items, but I don’t have any clue where to begin or if they’re even fixable.) Though maybe there is - my original understanding of this problem was “lag when bumping the edge of the screen and tabbing between characters but not when dragging the camera” so perhaps some other underlying thing will reveal itself.
I did do a few searches beforehand to no avail. My apologies if this is a known/solved issue and I somehow didn’t chance upon the right terms.
4 notes
·
View notes