Devlog 3: Derrick Domena-Guzman: Data Oriented Building Menu, Showing Building Preview, and Animations


Problem:

This week, I focused on implementing a data-oriented building menu, adding a build preview feature, and introducing player animations. These improvements enhance the player's interaction with the building system and add more visual feedback to the game world.

Data-Oriented Building Menu

Previously, the game lacked an intuitive way to select and place buildings. To address this, I created a UI build menu that dynamically generates buttons based on available building options in a data table.

Here’s how I tackled it:

Dynamic Button Creation: Instead of manually placing buttons, I generate them dynamically based on a templated custom button using the building data table. Each button displays an image of the corresponding building, making selection more intuitive. This button is a custom button with a texture for the image.

Efficient UI Structure: Buttons are divided between two containers, with the first two buildings appearing at the top and the rest in a scrollable wrap container. This ensures a clean and organized interface.

Event Handling: Clicking a button updates the selected building index and removes the build menu, allowing the player to focus on placement.


Custom Button with Texture:

Initial Build Menu:

Updated Build Menu:

Data Table:


Populate Build Menu Function:


Toggle Building & Create Build Menu Functions:


Building Preview System

To provide better feedback when placing buildings, I implemented a build preview system that shows a ghosted version of the selected building before placement.

Here’s what I did:

Line Trace for Placement: A line trace from the camera determines where the preview should appear, ensuring precise placement on valid surfaces.

Dynamic Mesh Assignment: When a building is selected, its corresponding static mesh is set for the preview. This prevents unnecessary updates and improves performance.

Visual Feedback: The preview mesh changes color based on whether placement is allowed, with green indicating a valid spot and red indicating an invalid one.


Create Array of Buildings from Build Data Table:


Preview Build Function:


Video of Build Menu & Build Preview:

Player Animations

In addition to the build system improvements, I also worked on animations for the player character to enhance realism and engagement.

Idle and Walk Animations: Implemented smooth transitions between idle and walking states, providing a more natural movement flow.

Integration with Player Movement: The animations sync with the player’s movement speed and direction to ensure accurate representation.

Foundation for Future Animations: This setup serves as a base for future animations, such as interacting with objects and combat actions.


Video of Player Animations (Sorry for jump scare):

Next Steps:

Moving forward, I plan to refine the building system by introducing rotation options for placement and expanding the animation set for additional player interactions.

Thank you for reading!

Get Echoes of Creation

Leave a comment

Log in with itch.io to leave a comment.