Skip to content
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

invalid decoded tile count #92

Open
nexovec opened this issue Dec 28, 2024 · 3 comments
Open

invalid decoded tile count #92

nexovec opened this issue Dec 28, 2024 · 3 comments
Labels

Comments

@nexovec
Copy link

nexovec commented Dec 28, 2024

Hi, this basic code triggers a panic

	tiledMap, err := tiled.LoadFile("assets/platform.tmx")
	if err != nil {
		panic(err)
	}
	slog.Debug("tiled level", "tiles", tiledMap.Layers[0].Tiles)

What could be happening?

@lafriks
Copy link
Owner

lafriks commented Jan 3, 2025

Please provide either sample file that would allow to reproduce the problem or at least stack trance and exact panic message

@nexovec
Copy link
Author

nexovec commented Feb 3, 2025

I forgot the repo is private(I can see some of my commits that link this issue here). Sorry for the delay. Here is the stack trace. I can give you a repro if needed.

panic: tiled: invalid decoded tile count

goroutine 52 [running]:
main.NewGameSample(0xc000168040)
	/home/nexo/src/tmx_bug/experimentalLevel.go:57 +0x8ac
main.NewMainMenu.func1(0xc000db4a80?)
	/home/nexo/src/tmx_bug/mainMenu.go:154 +0x29
main.NewMainMenu.ButtonOptions.ClickedHandler.func29.1({0x903580?, 0xc000d0b278?})
	/home/nexo/go/pkg/mod/github.com/ebitenui/[email protected]/widget/button.go:373 +0x31
github.com/ebitenui/ebitenui/event.(*Event).handle(...)
	/home/nexo/go/pkg/mod/github.com/ebitenui/[email protected]/event/event.go:82
github.com/ebitenui/ebitenui/event.(*deferredEvent).Do(0xc001045b18?)
	/home/nexo/go/pkg/mod/github.com/ebitenui/[email protected]/event/event.go:88 +0x43
github.com/ebitenui/ebitenui/internal/event.ExecuteDeferred()
	/home/nexo/go/pkg/mod/github.com/ebitenui/[email protected]/internal/event/deferred.go:26 +0x8a
github.com/ebitenui/ebitenui/event.ExecuteDeferred(...)
	/home/nexo/go/pkg/mod/github.com/ebitenui/[email protected]/event/deferred.go:8
github.com/ebitenui/ebitenui.(*UI).Update(0xc0005c61c0)
	/home/nexo/go/pkg/mod/github.com/ebitenui/[email protected]/ui.go:69 +0x8af
main.(*MainMenu).Update(0x1?)
	/home/nexo/src/tmx_bug/mainMenu.go:189 +0x17
main.(*SystemManager).Update.func3({0xb9a488?, 0xc00007c000?}, 0xc001045ba0?)
	/home/nexo/src/tmx_bug/stateManager.go:58 +0x22
github.com/samber/lo.Map[...]({0xc000b171f0?, 0x1, 0xc001045c78}, 0xb0de30?)
	/home/nexo/go/pkg/mod/github.com/samber/[email protected]/slice.go:30 +0x79
main.(*SystemManager).Update(0xc000168048)
	/home/nexo/src/tmx_bug/stateManager.go:57 +0xd2
main.(*Runner).Update(0xc000168040)
	/home/nexo/src/tmx_bug/main.go:54 +0x25
github.com/hajimehoshi/ebiten/v2.(*gameForUI).Update(0xc0005c78f0)
	/home/nexo/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/gameforui.go:112 +0x23
github.com/hajimehoshi/ebiten/v2/internal/ui.(*context).updateFrameImpl(0xc000439700, {0xba08b8, 0xc0004ade60}, 0x1, 0x4094000000000000, 0x4086800000000000, 0x3ff0000000000000, 0xc000000608, 0x0)
	/home/nexo/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/context.go:154 +0x2f0
github.com/hajimehoshi/ebiten/v2/internal/ui.(*context).updateFrame(0xc000439700, {0xba08b8, 0xc0004ade60}, 0x4094000000000000, 0x4086800000000000, 0x3ff0000000000000, 0xc000000608)
	/home/nexo/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/context.go:73 +0x85
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).updateGame(0xc000000608)
	/home/nexo/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:1491 +0x1a5
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).loopGame(0xc000000608)
	/home/nexo/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:1448 +0x8b
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).runMultiThread.func2()
	/home/nexo/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run.go:71 +0x12c
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/home/nexo/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
	/home/nexo/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96
exit status 2

@nexovec
Copy link
Author

nexovec commented Feb 3, 2025

Minimal reproduction is now available in bugs/failing_load. You should be getting this when you run it:

go run .
panic: tiled: invalid decoded tile count

goroutine 1 [running]:
main.main()
	/home/nexo/src/go-tiled/bugs/failing_load/main.go:13 +0x146
exit status 2

@lafriks lafriks added bug and removed question labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants