Ever since the release of Turnover’s reveal trailer, I feel pretty invigorated. Work has been productive lately.
HUD & Minimap
After some tester feedback, I have added a minimap to the HUD.
Since level work is hitting the midway point, levels are becoming larger and more complex, so the player might become slightly lost when trying to figure their way around. Adding a minimap is a logical remedy, as it gives the player an idea where they are without revealing the entire floor to them. Since only walls and deco are shown in the minimap, the player can use it as a quick reference. Looking ahead and planning your movement are still a must.
You can also see from the shot above that I’m starting to group HUD elements together. The player can also choose their HUD opacity.
Improved Line of Sight
Previously : Anthonydev.tumblr.com
My play tester complained often about corner problems when a Rent a cop and a Sentinel would square off in a gun battle. I was finally able to reproduce the problem.
Originally, I depended on a higher-resolution (i.e. small tile size) grid map to check for obstacles. The obstacle map was the floor, split into a grid of tiles that indicated whether the tile had an obstacle occupying it. Using Bresenham’s line algorithm, I would check from the enemy’s view to his target. As I plotted the path, if a tile had an obstacle, he didn’t have LoS to his target. Simple, effective, yet problematic.
As you can see here, the Rent a cop and the Sentinel can see each other, thus will fire at each other. But, their bullets are striking the walls. That’s because the bullet collision is less forgiving (point precise) then the tile-based LoS. While the entities can see other, the bullet, on it’s straight path, will collide with the wall.
To remedy this problem, I have rewritten my Line of Sight code, moving away from the grid-based system to its own raycast routine. Now, the enemy will cast a line to its target, checking intersection with obstacles entities (broken into wall segments). This allows a much finer resolution of sight checking.
This LoS has a negligible increase in CPU time, but I gain far more accuracy and a reduction of memory usage, since I don’t have to store a LoS grid anymore.
Next
Level work continues. The HUD is now draft-quality and no longer a work in progress. Some other neat things are currently a work in progress and hopefully I’ll get to show those off soon.