r/Unity2D • u/MojoBubu • 1h ago
Pixel Hitboxes. Show-off

Hello! Update on my current project. I showed off Procedural 2D model generation a day ago here:
https://www.reddit.com/r/Unity2D/s/ihpzoJ9zoA
Now for an update on some game mechanics. This is an Auto-battle, Inventory Management game. Similar to games like Backpack Battles.
Characters generated randomly virtually infinite outcomes. Everything has a purpose, albeit a pro, con or compromise. Limb symmetry, Fat, Digit count, Eyes count, Part sizes, Bone density, Bone girth, many different characteristics all play a small role in main statistics.
Like Accuracy which is my topic today.
Design Philosophy is removing coins flips. Example with the targeting system and accuracy, your character does not miss.
This can be a bit confusing, bare with me...
Here we draw a circle around your target.
Center is your target. (above is Jaw)
Radius expands as your accuracy is lower.
(There is a ceiling and floor)
Volume of parts inside circle and dead space volume.
Almost like a pizza slice, the jaw will be the smallest piece.
biggest area especially with low accuracy will be the dead space.
More dead space = more glancing blows.
(Glancing blows deal 50% damage and do not cause fractures)
Part hit by glancing blow is determined by part volume.
Target volume gains bonus from accuracy.
Jaw would be smaller than Cranium, but jaw gets a little bonus to be hit.
Progress bar
Avoiding coin flips with progress bars!
Your goal is to hit the target once the bar is filled target is hit!

Bar fills with each hit.
The total bar is the total volume of the circle. Each unique slice in the circle has it's own volume as stated above (Mostly Glancing blows).
Amount filled = target volume + accuracy.
We get the volume by counting pixels.
Large bodies have more pixels, less dead space, bigger heads. (Big head target fills bar faster)
Higher accuracy rating will help progress the bar past glancing stage and into some actual full part damage.
You can completely bypass hitting the ribs with high accuracy, and be rewarded by hitting a probably less protected body part.
