I’m early in my game dev journey and trying to learn by doing, but could use some advice to get me in the right direction.
I’m prototyping a basic asteroid mining game, which includes:
- Multiple asteroids, each moving (along predefined paths) and rotating, with their own gravity (only acting upon the player). This part is done.
- Player that can travel between and land on asteroids. Also done.
What I’m trying to figure out now is what system to build to enable the player to dig into the asteroid. The few possible options I’ve thought about or found online include:
- Building each asteroid with a tilemap, then removing a tile on each dig action. I think I can figure this out easily enough, but the problem is that I guess I’d need a tilemap for each asteroid as they are moving and rotating independently from each other. I’m assuming that would become quickly resource intensive and unwieldy.
- Using pixel perfect destructible terrain (like the old Worms games). I’ve found several examples that are frankly beyond my current understanding, but regardless they’re more granular than I’d like - I’d prefer to have it feel more like tiles or blocks (like Terraria for example)
- Using sprite masks to remove parts of the asteroid when digging, and then somehow modifying/redrawing the collider to enable the player to descend into the hole. In my mind this makes sense, but I haven’t found any examples of how to dynamically recalculate the collider based on the new shape after masking. My reading also tells me that recalculating colliders is resource intensive.
- Doing a scene transition upon landing, then managing the digging in a separate scene using a tilemap. The benefits of this are obvious, but the main drawback I see is what I guess is the difficulty of showing the results (holes, tunnels etc.) on the asteroid after having transitioned back to the main scene.
Can anyone give me some pros and cons of these or other solutions or point me in the right direction? I’m not looking for specific code, just an approach that I can try to work toward. Thanks!