Open cspotcode opened 1 year ago
@cspotcode Is any of this still applicable with the new hitbox system?
Yeah, the performance improvements from #1601 were never merged, and the concepts are still relevant to the new hitbox system.
I can link to some descriptions from Discord:
https://discord.com/channels/458662222697070613/458662458198982676/1111322355785011321
https://discord.com/channels/458662222697070613/1085299745116917851/1117975229185134635
Enhancement request:
Refactor hitboxes, adjusted hitboxes, and optimize their usage within spatial hashes.
What should be added/changed?
Broad goals
left
/right
/top
/bottom
; use newhit_box.radius
insteadHitBox
its own classHitBox
across manySprite
andTexture
instancesFurther explanation
Why defer spatial hash updates?
Naive code will often do something like this:
Today, this code triggers spatial hash removal and re-add 3-4 times per frame. We should avoid that. The first modification marks the spatial hash entry as "dirty." Then collision detection will fix the hash on-demand.
Class Diagram
This is not rigorous UML
What would it help with?