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. Wed, 07 February 2007 17:33 Go to previous messageGo to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
sirgwain wrote on Wed, 07 February 2007 22:36

Each turn each player's knowledge set must be updated based on what universe objects are within scan range of his fleets. On a Huge/Packed universe with 15 AI players creating scanner ships and sending them out, it's taking 12 seconds to update scan knowledge. There are 1257 universe objects (with 312 of those being fleets) at this point.

The way my current algorithm works is like so:

Each fleet checks every universe object to see if it's within distance of its non pen scanners followed by a check for the pen scanners. This means I have 312 * 1257 = 392,184 distance calculations for a turn generation.


Tagging comes to mind. If an object has already been scanned, remove it from the list for subsecuent scanners. Twisted Evil

Also, if you do the penscans 1st, the objects tagged by them can be ignored by the "openspace" scanners. Or perhaps do it the other way around. Whip

I'd directly exclude planets from "openspace" scanning... Rolling Eyes

Cloaked fleets/starbases still pose some challenge, tho, as they cannot be "tagged out" until a satisfactory scan has been obtained. Sherlock

Perhaps your distance check could be improved too... Teleport



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

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 09:19:27 EDT 2024