Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Efficient Algorithm for Scanning planets/fleets/etc.
Re: Efficient Algorithm for Scanning planets/fleets/etc. Thu, 08 February 2007 17:08 Go to previous messageGo to previous message
sirgwain is currently offline sirgwain

 
Senior Chief Petty Officer

Messages: 86
Registered: March 2004
Location: Tucson
LEit wrote on Wed, 07 February 2007 23:03

One thing I did in FreeStars is to keep a list of objects at each location, this is useful in a lot of areas and not hard to build and maintain as things move around.


I already have that list for determining what fleets are involved in battles. I was thinking I needed to make it more globally accessable to the game. I'll chock up one more reason to do so. Smile

Quote:


One place it's useful is in scanning. If you check if one fleet/planet is in range, you know the whole stack of them are or are not in range. Then you have to check cloaking/tachyons...

The other thing you can do is quickly rule out some objects by checking if the x or y is out of range first. IOW, if the scan range is 100ly and the scanner is at 1000, 1000, anything beyond 1100 x or y is out of range, no need to calculate the exact range or cloaking/tachyon for that combination.



Thanks for the explanation. I was looking through the Freestars code and I noticed there was a lot more in there than just a simple nested loop. You also used the tagging approach m.a@stars described above. I need to implement that.

Report message to a moderator

 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New stars! server clone proposal
Next Topic: 3D tool
Goto Forum:
  


Current Time: Mon Apr 29 05:13:32 EDT 2024