thefootballguy Posted June 30, 2016 Share Posted June 30, 2016 I am looking for ways to go about creating a sandbox/open world game where anything in the environment can be destroyed/changed. I have been searching for hours for examples of these but to no success. Any help will greatly be appreciated. Link to comment Share on other sites More sharing options...
mattstyles Posted June 30, 2016 Share Posted June 30, 2016 It's not a simple thing to do, hence the lack of much in the way of examples, but, having said that, there are loads of examples of using tilemaps and most of those involve stuff like animating tiles, which means they deal with changing individual (or grouped) parts of the tilemap which means you can have those mutations driven by user action (i.e. when they blow up part of the world). Depends entirely on what sort of game you're making. Phaser is 2d, so if you're planning on something similar to a top-down Minecraft then its simply a matter of changing the tilemap. Your tiles become discrete values in your system, and you either change them as the user interacts or maybe you can add items to it, if so, just add layers to your tilemap. Same for a 2d side-scroller, manipulating your world is just a matter of changing the map, which is likely a problem you'll be handling anyway. Generating and storing an infinite open world is a much more significant challenge. Ideally you just want to generate your chunks (or areas or whatever you want to call it) and store the whole lot, changes and all. You can be smarter though. If you have your areas generated via some sort of algorithm (stuff like perlin/simplex can be seeded, you give it the same seed and you always get the same result) then you only need to store changes to the world and there are far far fewer of those than there are discrete 'tiles' in your world. Tilde, thefootballguy and drhayes 3 Link to comment Share on other sites More sharing options...
Recommended Posts