Archived

This topic is now archived and is closed to further replies.

Homeworld-style ship pathing

This topic is 5040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I was wondering what would be the best way to plot paths for ships like in Homeworld? There are so many fighters, they fly in arcs and maintain formation, never bump into each other- how do they do that?? The algorithms I have come up with so far are horribly inefficient, I hope someone out there has a good idea

Share this post


Link to post
Share on other sites
Thank you and yes I do have the sourcecode, but what I''m looking for was an algorithm- its faster than looking thru code (with little or no comments) and trying to figure out how all the pieces fit.

Share this post


Link to post
Share on other sites
quote:
Original post by akn81
its faster than looking thru code (with little or no comments) and trying to figure out how all the pieces fit.


You need to get yourself a program like Sniff, or similar. Such programs are invaluable when you need to decode someone elses work.

Cheers,

Timkin

Share this post


Link to post
Share on other sites
From looking at it they use flocking algorithims to get the ships to stay in formation. The ship AI is multilayered, using a subsumption architecture, where the lower reactive behaviors like follow the leader, avoid collision and such are modulated by the higher behavaiors of attack/defend/etc..

They proably optimize the proximity calculations needed for flocking algorithims by using some spatial sorting algorithim combined with a query cache.

You can find the low level flocking behavior mostly in AIShip.c.

It''s an intresting approach, I''m taking somewhat of a similar approach with my AIs.

Good Luck!

-ddn

Share this post


Link to post
Share on other sites