On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Thanks for the feedback! Totally agree with you on the enemy thing, it was a pain to try and work out the math on when the enemy can safely fire, and I feel the result is simultaneously too slow and too unpredictable and hard to avoid. I'm really not sure how to fix that while maintaining some level of challenge, as they have to shoot at the player :/

Perhaps you have made the problem harder than it needs to. If you think about it you basically need a normal bullet hell, but with the bullets flying in reverse. Obviously that would require some intense trigonometry shenanigans to pull it off with two moving participants, but here me out. What if the enemy doesn't move while the bullet is in the air? All that pesky math would go away and as a bonus the AI gets even more predictable (remember predictability is actually good for game AI). Granted one AI standing there for two seconds might look boring and make the game easier, but imagine 30 of them simultaneously in a level. That would be kept the player on their toes and provide the challenge of dodging.

By the way would you be willing to share your prediction code, so we could be on the same page?

https://github.com/JackVandergriff/Flashback the Enemy controller script is the one with all the shenanigans. I like the idea of them staying still, you still have the issue of them pathfinding towards the player and accidentally shooting each other, but on some level that's pretty unavoidable unless they don't move at all, which would make it just a standard bullet hell.

Very clean code. It was a pleasure to read. I need a little more time to fully understand.
From what I could tell the shot decision making is very dependent on your shot tolerance. Basically a bubble around the predicted point. I don't know how strict you have set it, so increasing it a little might make the AI more trigger happy.

Also, making the shooting rate dependent on the frame rate is sort of bad. There might not be too big of a difference in 30 and 60 fps, but hardware might change in the future making the game unplayable without frame rate locking.

Anyway. I would like to offer you a different perspective. Currently Your AI is programmed to be an expert marksman alla sniper elite. Only taking shots when it is certain the bullet will hit the target. But if we look at what is actually happening in the game aka we invert the time, we get an AI that is fixated on shoot at a spot our hyperactive (ducking and weaving) protagonist has already been at a split second ago. This is kind of hilarious imo.
I would like to suggest a more frantic approach to the AI. Lining up shots with a sphere/circle (sorry if I mix 2d and 3d too liberally) around the player that represents where the player could have been a moment ago (or will be in a moment, again time perspective weirdness).
Imagine a gangster shooting frantically at a crackhead. You don't need to be accurate, you just need to fill the air with lead.

In my opinion the biggest challenge to correctly implement the mechanics is to solve the paradox. We need to tell the world how to react to something that has already happened, but we don't know what that was, since it will happen in the future. To be honest that sounds a lot like quantum uncertainty lol. Where was the electron one second ago? We have it's exact position, but due to Heisenberg's uncertainty principle we don't know it's velocity at all. Congratulations you will need advanced physics to solve that one accurately. (and this one example is actually unsolvable :))

If you're not a fan of wild shootings and prefer a more thinking man's game. There would also be solutions to that. One doesn't need to escalate things to that high of a level if you accept some drawbacks.

About your shooting each other accidentally problem. If you were to make the enemy "wounded" than taking a shot to the face would actually heal them up. As you already pointed out healing a fully healthy unit would cause a paradox. But perhaps one could turn that one in a feature as well. Shooting a healthy enemy would lock both in a "space-time" (or something fancy with all kinds of special effects). This would add unit sinks to the game that would compliment the unit faucets represented by the corpses.

Hope you don't mind the essays I write you. I would like to hear more of your thoughts. I hope I didn't deviate too far from the original problem. As I already mentioned I will have a go with your script first.

Dang that's really well thought out! I might try and do that at some point, hopefully it would make it more fun and less randomly difficult :)

If only my skills matched my ideas. Ideas are a multiplier for the execution and I am still lacking in that department. But hey... that's why I jam.