go-tiled
go-tiled copied to clipboard
invalid decoded tile count
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?
Please provide either sample file that would allow to reproduce the problem or at least stack trance and exact panic message
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
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
@nexovec , it looks like you are trying to load infinite map and it is not supported (see #74)