itch.io is community of indie game creators and players

Devlogs

Source code version 2: Fixing an issue with deactivation

Room Object Metroidvania Mapping System
A downloadable engine for Windows

Got alerted to this in a GMC forum discussion, romms_rooms_handle_deactivation did not work properly and could leave rooms deactivated permanently if you switched layers. There are two separate issues at play here:

  • instance_(de)activate_region should be given left/top/width/height arguments and not left/top/right/bottom (a larger region than expected was always activated and it would grow the further right/down you go)
  • For some reason instance_activate_layer is buggy and the rooms wouldn't get activated when layer and region functions are mixed with each other like this

The fixed version of the code looks like this, updating the function accordingly will fix this buggy behavior in your project and I've updated the source as well so others won't run into this issue in the future.

Having to resort to activating all rommsrooms and then deactivating them one at a time with a with loop feels a bit stupid and inefficient but it looks like it's the only way right now :/ Performance issues at least shouldn't be a big concern since this function is only ran when you scroll to a different room / change layers. (No clue why the object-layer objects weren't affected and only the rooms-layer ones)

Files

  • Source Code (GMS2) (version 2) 77 kB
    Dec 23, 2023
Download Room Object Metroidvania Mapping System
Leave a comment