-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ran out of available textures in the pool when long range teleporting #54088
Comments
Hello. I tried to reproduce this bug but could not. Could you please upload a save file where this issue can be reproduced as well as your config folder?
|
Reproduced it. Wasn't able to reproduce it with default population, but after cranking population to 10x and long range teleporting to nearest town two times, reproduced it. |
Unfortunately even with save scumming I can not reproduce this reliably. But by creatng a world with a heightened population density it becomes way easier to reproduce. Thanks for the tip! |
Should we just increase |
It works if you just manually walk up to stuff, the sudden change when you long range teleport might upset it, but I am neither a C++ nor SDL expert so I have no idea. |
Could be long teleport not unloading submaps (and thus not releasing pixel minmap textures). |
based on discord discussions, this is still present in recent experimentals. |
Can confirm this does happen (and on default settings) it's just rare |
I tried to replicate by repeatedly teleporting a few OMTs away (one fast scroll) and noticed that resting memory usage went from ~1100MB (exodii base, lot of sprites!) to ~960 after the first teleport (open field) and then rapidly climbed as the teleports continued, despite repeatedly landing in open fields. After about 18 teleports I was sitting at 1500MB resting usage, in an open field! With another two dozen or so I was sitting at 1900MB. Trying to parse the profiled memory now. |
I have a snapshot I took shortly after the 18 teleport mark (around 20 teleports in my estimation). (Note: All numbers below are from VS2019's reporting of allocations in map::loadn) The big stand-out memory usage to me is this: There's 7,708 instances of submap::ensure_nonuniform, each of them at 18,576 bytes for a total memory usage of ~143MB. There's also 26,870 instances of The call tree reports that jmapgen_sealed_item::apply was sucking down around 113MB of memory. That seems very strange to me. All of that should have already been handled, done, and the memory released. |
Ahaha, okay, I got it. The problem is you're landing on a monster with no available spaces. Therefore game::place_player fails, returning your actual current position. game::place_player_overmap doesn't account for this, assumptions are invalidated, bad things happen. That's also why increasing spawn rate affects it - you're more likely to land on a monster. Here, put this in JSON. Debug spawn a desolate barn special. Teleport to it with the debug menu. 100% reproduction.
|
This branch stops the crashing and places the player back on the OMT they came from, but it offsets their position due to how place_player_overmap works. This could, for example, put them into solid rock or other nasty stuff. master...RenechCDDA:Cataclysm-DDA:fixteleport So not a complete fix. Would appreciate if someone could pull it over the finish line. |
While whoever does that (I might take a look myself) is at it favouring tiles you can stand on would be nice, it's pretty annoying when you try to tp onto a roof and just fall multiple times |
I would prefer if the teleport failed with message "Cannot teleport there, there is X in the way". The player could decide to teleport to the neighbouring tile. Or we could do some map reveal and the player would teleport to the tile specified. Edit: that is what is being done in the linked PR #72887 |
Describe the bug
When I long range teleport, there is a chance I get the aforementioned error.
Steps to reproduce
This is tricky to reproduce. It only happens sometimes and only when I long range teleport.
As you can see, this is clearly SDL/tiles only. There is no crash log generated but it segfaults and thus produces a coredump (thanks to systemd-coredump):
Expected behavior
It does not freeze. I remember it happened way in the past, too so I highly doubt it is a recent regression.
Screenshots
No response
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Bionic Professions [package_bionic_professions]
]
Built from a1f0736
Additional context
No response
The text was updated successfully, but these errors were encountered: