FreeOrion

Forums for the FreeOrion project
It is currently Mon Dec 11, 2017 7:48 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Sep 22, 2011 9:41 am 
Offline
Space Dragon
User avatar

Joined: Tue Sep 20, 2011 10:32 pm
Posts: 411
Location: Halle (Saale)
I was asked to make this remark from the WithinStarlaneJumps implementation thread a separate post, so here it goes.

Many effects apply to targets within a certain starlane range from their source. Instead of having each possible target search its neighborhood for sources that can affect it, the source objects could create a new kind of (invisible) "effect" object in all systems within range. Thus, only the source object needs to scan its neighborhood, not every potential target. The source object should keep references to the effect objects, with farthest sorted first, so it can easily extend or shrink the effect range without re-scanning its neighborhood. At the very least, the effect objects must keep a reference to the source, so that they can be removed by another neighborhood scan when the source loses the effect (and it also avoids having to store all the other information about the effect in the object).

The only advantage of this strategy over the proposed improvement of WithinStarlaneJumps is that it avoids re-scanning the neighborhood of the "sources" every turn.

_________________
Yesterday, we were still on the brink. Fortunately, today we have come one step further.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group