Lost Echo’s Preview 47 – Moths reacting to lights
Lost Echo’s Preview 47
For this weeks preview of Lost Echo’s, I focused on expanding the moth pathing from last week and expanded each of the current rooms, and improving the underlying logic that keeps track of the state of the lights, doors, and player position.
Room Pathing & Workflow Improvements
I started by setting up base paths for each room. I also took some time expanding the GitHub script I mentioned last week to both include batch exports as well as applying modifiers to help speed up the process. This let me:
- import the paths from the last room I worked on,
- apply the modifier to deform the curve to match the stations shape,
- move both the room and the light paths to match the new room,
- adjust the sizes as needed.
- Batch export while applying all of the modifiers and global transforms.
This workflow sped things up significantly.
Power, Doors, and Player Tracking Logic
Once that was in place and tested, I spent a lot of time expanding the code to keep proper track of the players position, the state of power per room, and the state of the doors. Most of the logic has actually been there for a while, but it wasn’t properly applied to all of the rooms yet, so spent the time double checking the logic, ensuring it was getting properly updated, and even encountered a few glitches I wasn’t even aware of.
Moth Behavior Updates
After that, I started adding in new behavior checks for the moths. They now look if the lights are on, and change their logic for if they’ll fly down the hallway or swarm the lights depending on if they were powered or not. Then I added in a special script that would track the flashlights position and visibility, and added in a reference to a set of paths. Those paths would dynamically change direction within the Paths manager, and if the conditions for the power, the flashlight was on, and the player was close enough, then it would trigger the moths to swarm the flashlight. Once the lights on the station are turned back on or the flashlight is turned off, then they’ll immediately switch back to their normal behavior.
Next Week’s Goals
Next week, I’d like to focus on finalizing the pathing system, and implement the branching system, so that moths can detect open or closed doors, and fly in and out of rooms from the hallway.
Leave a Reply