Tag Info

New answers tagged

1

You need to keep a enemy heading (direction) variable and only move the enemy along that direction. Slowly rotate the enemy heading to face where it actually wants to go but only a few degrees per frame. You move forward according to the dot product of the heading and where you should be heading. This prevents overshooting the target. The enemy will move a ...


3

What your algorithm doesn't account for is if the ball's vertical speed is less than your paddle's speed (in your specific scenario, 3). Consider the following example: The ball is moving perfectly horizontally (y speed is zero) The AI paddle uses a vertical speed of 3 units as in your exact scenario The paddle's y position is 10 The ball's y position is ...


1

I would use some sort of points system assigned during the race. So each time a player crashes in the corner - add a point to "steering upgrade suggestion", each time he looses a race add a point to "engine upgrade", brakes for prolonged periods and misses an apex - "better brakes", gets overcome by an opponent in a straight line - "booster" and "engine" ...


0

Instead of using A-star from each zombie to the player, use a breadth-first (ie Dijstra's) out from the player, and as you encounter each zombie assign it the current best path. Have each zombie ignore other zombies for pathfinding but skip a step if the next node is occupied by a zombie.


3

A design pattern I've enjoyed using has two types of things: task management and task execution. Task management asks the question "What should I be doing right now?" And task execution asks, "How do I complete the current task?" Task Managers The job of the task manager is to constantly look at the AI's internal state (read-only) to determine whether new ...


1

Depending on the language you're using use a virtual function, a function pointer, or a delegate for your actor's "do something" function (some engines call it Process() or Update() ) in C++ class BaseAI { protected: //... virtual void ProcessFrame() = 0; public: static void ProcessAIs(); // this call the ProcessFrame of all existing BaseAIs //... ...


0

create corresponding states for the AI. for example: AIDefaultState, AIReloadingState , AIStunnedState you can inherit from the normal states if seemed logically correct in your situation



Top 50 recent answers are included