Original Post
I''m making a space fighter game called Myriad Argosy in C++. It''s not the Galaga type... you can move in all directions. But to the point:
I don''t like my current AI system as it only allows for enemies to attack the player, they can''t attack any thing else. Here''s how it works... you''ve got a ship structure that holds everything needed about any given ship. The player''s ship is stored in it''s own structure, and every other ship is stored in a linked list. When updating enemy ships, they just go straight for the player ship.
So now, instead of putting the player ship structure seperatly, I''m going to put it in with the list of ships. Each ship structure has a ''team'' field and ''priority'' field. I need to come up with an efficent way for ships to aquire targets efficently, but still work good. For example: if an enemy is attacking you (a 5 priority ship) and a colony transport floats by (a 10 priority ship) the enemy ship would go after the transport.
Right now my current idea is to have a currentTarget pointer in each ship''s structure. It will attack the currentTarget regardless. Then every second or so it would reaquire targets, if it finds something of higher priority then currentTarget will repoint to the new ship.
I''m accepting suggestions though because I''m looking for the most efficent design possible.
---
Guns don''t kill people..................
...........................................Lag kills people. ~LlamaGuy