The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

We are working on a game that uses a lot of tilesets. We have some questions about how to optimally work with spritesheets in Godot.

1. How do we efficiently select a new sprite from the spritesheet at runtime?
We want to change the sprite of a tile. Should we just set the TextureRegion to the correct tile, or is that not optimized if a lot of sprites change at the same time?
2. Can we check if a sprite in the spritesheet is empty?
Since we plan to have variations of our sprites, there is a chance that regions of the spritesheet are empty. What would be the best way to detect this?

Example of a small spritesheet with empty tiles. We would want to randomly select one of the variations, while making sure it never selects an empty tile.

3. How should we handle large amounts of sprites in Godot?
We are planning to have a lot of different biomes in our project. Would it be best to organise each biome in it's own spritesheet? Should we combine all of them in one massive spritesheet, or should each tile be it's own file? What is the optimal way to handle this in Godot?

Thanks!

in Engine by (42 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.