NokiMo
shibagani48
shibagani48

patreon


Weekly report May-3, 2024

Hello everyone! Thank you as always for your support. Let's take a look at this week's progress.

This week, the work mainly involved revisiting hitboxes and code, so the report will be somewhat abstract.

# Hitbox and Code Review Work

This week, the work mainly involved revisiting hitboxes and code, so the report will be somewhat abstract.

## Collider Box Review

I initially planned to simply replace the hitboxes, but it turned out to be a more complex task.

### First Issue: Hitbox Transformation

One issue is how to transform the hitboxes. I had avoided making hitboxes visible to hide the fact that I was only using one. Typically, one to four boxes are used, with the number varying for each motion. Controlling this through scripts is complex and prone to bugs. Previously, I altered the hitboxes on the animation clip's timeline, but this caused issues like hitbox disappearance and hitboxes moving to strange coordinates.

Instead of transforming a single box, I decided to switch between pre-prepared sets of boxes. Although this method requires many box sets, it shouldn't significantly increase data size and makes understanding the complex box configurations easier.

### Second Issue: Managing Numerous Boxes

The next issue was how to manage the increased number of boxes. Controlling around eight hitboxes and hurtboxes is necessary. Additionally, I had forgotten about another type of collider: the collision box, which is required for character interactions and pushing each other upon contact. Managing these three types of boxes together needed a rethink to prevent the process from becoming chaotic. Reviewing the code revealed how poorly organized it was.

To address this, I created a manager class to oversee the three colliders, and a collider box manager to oversee everything. This allows all collision-related processes to refer to this manager, simplifying the flow.

### Third Issue: Switching Colliders

The third issue was how to switch colliders. Similar to the first issue, it involved determining the method to switch between pre-prepared box sets. Previously, this was managed on the timeline, but due to the process's unreliability, a new method was necessary.

Unity's animation clip timeline has weak integration with scripts, making it impossible to specify objects to pass to the script. While the timeline function managing the entire scene can pass arguments to scripts, it's unsuitable for managing single objects and switching between multiple animations. The solution, though labor-intensive, was to specify box switching in the script. This development has taught me that sometimes, brute force is the best solution. Despite Unity's versatility, some aspects are inconvenient and analog, making it quicker to handle things directly.

## Process Flow Review

Overhauling the collider system led to a necessary review of the reference relationships during attack hits. The Battle Manager class (BM) handles the processes when an attack lands by referring to both players' information.

The BM directly searches for and retrieves individual components from characters, but with multiple colliders, this method would become chaotic. Even without this, the method caused player information to be jumbled, making the code hard to followβ€”a classic case of spaghetti code.

Previously, I prepared a Player Manager class (PM) to solve this problem but abandoned it midway. Now, it's essential to fully implement the PM. By having the BM refer to the PM for player information, the process flow becomes clearer, reducing bugs and making them easier to find. Plus, this should improve my overall productivity and well-being. However, based on past experience, this large-scale improvement will likely take longer than expected. I will strive to finish it by next week.

## Next Week's Plan

End-of-month demo updates are a tradition, but if the PM implementation isn't complete, the game might be unplayable. In that case, I'll have to postpone the update. If everything goes smoothly, the formal implementation of hitboxes and their display functions will be added.

- Formal implementation of PM

- Placement of all colliders (likely impossible)

That's all for this week. Thanks to everyone's support, we can continue development! Much appreciation.
Have a great weekend!

Weekly report May-3, 2024

Related Creators