Praytic / youtd2

Classic community-driven session-based Tower Defense game with RPG elements.
https://youtd2.com/
MIT License
87 stars 15 forks source link

Segfault during startup #273

Closed hka closed 9 months ago

hka commented 9 months ago

I get a segfault running the latest build on my laptop: linux-v0.8.1-cc259c5.zip

Last lines before exiting:

Set camera limits to [lb: 2782, lt: -2782, ll: -3836, lr: 3836] and pos [(0, 0)]
GameScene has loaded.
ERROR: Can't create buffer of size: 26357760, error -2.
   at: _buffer_allocate (drivers/vulkan/rendering_device_vulkan.cpp:1360)                                                                       
zsh: segmentation fault  ./youtd2.x86_64

Tested 0.7.14 and that works fine. The web verison here: https://youtd2.com/ works as well.

It looks like it tries to allocate more video memory than I have. Details about the GPU I tested on below.

Vendor: Intel Open Source Technology Center (0x8086)
Device: Mesa DRI Intel(R) HD Graphics 4000 (IVB GT2) (0x166)
Version: 20.3.5
Accelerated: yes
Video memory: 1536MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.2
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
Kvel2D commented 9 months ago

I checked and 0.8 version does consume significantly more memory than 0.7.

The main difference between 0.7 and 0.8 is that 0.8 added new tiles so that's what consuming the memory.

We'll try to reduce memory consumption to something more reasonable.

Kvel2D commented 9 months ago

Removed "-floor2" tilesets in this commit 20160b1e9a21736950300adcfda08890af3a4fa3 This resulted in ~20% reduction in used memory (1.7GB->1.4GB).

Should try to improve memory use more.

hka commented 9 months ago

That fixed it, now it loads fine. But sounds big with 1GB of video memory use? Is the same texture stored multiple times?

hka commented 9 months ago

Or not, crashed when I placed a tower. Attaching log of output. youtd_crash.log

Kvel2D commented 9 months ago

I created a separate issue #274 where we'll try to get VRAM usage down to something reasonable.

That fixed it, now it loads fine. But sounds big with 1GB of video memory use? Is the same texture stored multiple times?

It's because of tiles and the way we use them. The tilesheets are high-res and you can't compress them if you want to use them in Godot tilemaps. And we use a lot of tiles in general.

hka commented 9 months ago

Tested 0.8.4 now and it works fine playing, closing this issue.