Wednesday, March 7, 2018
2018 7DRL: Day4
It's looking increasingly unlikely that I'll have anything even remotely resembling a Roguelike by the end of this week. On the plus side I've got some cool crowd motion.
This morning was spent working on the enemy steering behavior so they would behave better in groups. It's all a bunch of damped spring type things that generate forces on the enemies. There is a force toward/away from the target; a much smaller lateral force to bring orbiting to a halt; and forces to repel enemies from each other. The neighbor repulsion force never has any component pointing toward the target, though. This keeps large groups from compressing in on the target, and reflects how people avoid each other; they mostly only pay attention to the people in front of them. Finally, the desired separation distance between neighbors is a function of distance from the target. This lets groups move close together to approach the target and then spread out when they reach combat range.
The afternoon was spent trying to improve the player control scheme, with only minor success. I tried a couple of schemes. One involved “dragging” the sword like a water-skier behind a boat. Another went for simple dual-stick control: one stick to move and another to swing the sword. I've always thought about trying this, so I'm glad I did, but it really doesn't work. It takes too long to move the right stick for the speed of gameplay I'm targeting, especially if you have to swing it through an arc.
In the end I settled on a couple of refinements to the prior scheme, which involves auto-targeting the nearest enemy and then swinging the sword into a forehand or backhand stance relative to that target. I've got some adjustments to help minimize rotation when switching targets; it will switch from a forehand stance to a backhand and vice versa.
Tomorrow I will work on enemy windups and attacks. With luck I'll have a simple combat game by the end. Maybe with a boss enemy who is bigger, more dangerous, etc.