Brim7Premium / Calamity-Reign-of-Yharim

Calamity Reign of Yharim is a fangame based on the Calamity Mod
3 stars 2 forks source link

Game Event Handling #38

Open Best-JelloBeanz opened 1 year ago

Best-JelloBeanz commented 1 year ago

At the time of this issues publish, many older parts of the code create functionality similar to that of Terraria, which do not make sense in the context of RoY specifically. Certain game events such as music changes are handled based on the "biome" that the player is currently in. Since biome changes are determined by the number of certain tiles in an area, biome changes are not smooth, and thus all events related to biome changes are not dynamic either. Similar to many other games with pre-built maps and levels, it would be wise to handle certain game events with invisible hitboxes and barriers that activate specific game events such as cutscenes, dialogue, enemy spawns, and even music and audio changes and transitions.

Preconditions N/A

Requirements

Note: This seems pretty complete for now, but let me know if there's anything I missed Also, should this be listed for the open demo milestone?

Brim7Premium commented 1 year ago

@Best-JelloBeanz Reign of yharim's biomes are currently handled using an invisible tilemap with biome background tiles. if the player is in front of these tiles, the game will trigger the biome triggers.

Brim7Premium commented 1 year ago

This doesn't have to be in the open demo. Only four biomes will actually be in it, so the system descried above should work for now (Spawn plains, first half of snow, underground below spawn plains, half of underground snow)

Brim7Premium commented 1 year ago

I do think any time we need to add something new that could be an event handler, we should to make it easier for when we need to recode the old systems to use the event handlers

Best-JelloBeanz commented 1 year ago

@Best-JelloBeanz Reign of yharim's biomes are currently handled using an invisible tilemap with biome background tiles. if the player is in front of these tiles, the game will trigger the biome triggers.

I see. If there are no biome background tiles, what would happen? Or if the player left an area with background tiles to one without, what would happen?

Brim7Premium commented 1 year ago

@Best-JelloBeanz I'm pretty sure it just keeps doing whatever is was doing the last time it was in a tile. In one of the old videos showing off the backgrounds, the music and stuff just kept going and the variable was the same when the player jumped off the world and out of the tiles. I don't believe that code has changed