Prototyping interiors


Today I started working out how outdoor/indoor transitions are going to work, and how world levels will actually behave when this happens.

Right now switching to an indoor scene is just a debug command

indoors

that just teleports the player from a random location:


to an interior test scene:

The part I'm not sure of in all of this is how exactly the rest of the world proceeds while in a building. Currently what I'm doing is just splatting the interior on top of the rest of the world, and disabling all of the collision - so other objects in the world are still present (as visible in debug below) but they aren't drawn and they don't trigger interactions:

Here a train station is actually still present and being simulated, but is not drawn and has its collision disabled.

This works right now, and has the upside that the entire rest of the world continues simulating as-is. But I'm not sure I'm happy with it yet: it does feel like I'm just putting off dealing with how exactly I create and tear-down collision objects that have been registered - something I may just be forced to fix later (currently collision objects are registered once when an object is created and there is no way to remove them at all - something which obviously doesn't gel with e.g. objects being destroyed/removed from play). And yet - on the other hand, this approach is very, very simple, which is a huge plus. 

This stuff currently has a lot of code duplication for actually drawing (drawing tiles for the world vs. interiors) - maybe the 'correct' way to do this will become clearer as the duplication is removed. We'll have to see.

Leave a comment

Log in with itch.io to leave a comment.