Happy New Year! This week I finally refactored the entity system and started spawning NPCs. I’m not thrilled with using an ECS, there’s already been a few “gotchas” that I would have otherwise caught at compile time, but oh well. My previous system was not going to scale well to all the different types of entities in Half-Life.
Leveraging the animation code from last week, I now spawn scientists, Barneys, and the G-man. Although I only spawn standing scientists at the moment. I’m also now able to parse and hit test hitboxes, meaning that I can play flinch animations when shot:
After that I dug into GoldSrc’s sprite format, and I’m now able to decode the crosshair images along with the data files that describe the different sprites used by each weapon. Here’s the revolver with the appropriate crosshair:
I also extended the entity selection system to work for entities that have animated models:

As the holiday break comes to a close, updates are going to become sparser around here. Hopefully I can find enough time on weekends to keep pushing this project forward. I’m not entirely sure what to tackle next, right now I’m toying with doing NPC movement and AI. I think I want to move towards being able to do combat in a simple arena.