Closed mattjennings closed 10 months ago
@mattjennings Thanks for the bug!
I bet this a bug in the TSX vs TSJ parsing. The XML version stores the points in an odd string representation that needs parsing. It appears the TSJ is far more convenient. Should be a quick fix to support the TSJ hopefully🤞
I've had a few of these types of bugs, I might spend some after fixing this to refactor the tiled parsing to be more robust.
I have something that mostly works, needs more testing. Vite really resists npm link!
@eonarheim I spent some time trying to get @excaliburjs/plugin-tiled
propertly symlinking with vite myself and the following vite.config.js
is what worked for me:
import { defineConfig } from 'vite'
export default defineConfig({
optimizeDeps: {
force: true, // vite 3.0.0 feature, busts node_modules prebundle cache
},
resolve: {
preserveSymlinks: true,
dedupe: ['excalibur']
}
})
However I use pnpm
to both install and link my packages (pnpm link path/to/excalibur-tiled
), so possibly there's some differences there with npm link
, but this is what finally made it work reliably for me
I'm not sure if tile custom colliders are officially supported, but an error is thrown when trying to use them.
It seems the polygon data structure is not what it expects:
(inspecting
polygon.polygon
)Steps to Reproduce
See repro: https://github.com/mattjennings/excalibur-iso-tiled-collider-bug
I've added both an isometric and orthogonal tilemap that uses the same tileset. When loading the isometric, the above error occurs on load. However, the orthogonal map does not cause the error, so the polygon data must be different in isometric vs orthogonal?
Expected Result
Isometric custom tile colliders to be loaded
Actual Result
An error is thrown
Environment
Current Workaround
None