Forums de Wizou

Pour discuter des programmes de Wizou
It is currently Thu 28 Mar 2024, 20:29

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Freelancer Companion source code & improvments
PostPosted: Tue 02 Oct 2007, 15:30 
Offline

Joined: Tue 02 Oct 2007, 15:20
Posts: 3
Like,
Is source code for Freelancer Companion available?


Top
 Profile  
 
 Post subject:
PostPosted: Tue 02 Oct 2007, 19:32 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
it is not (for the moment)

why do you ask ?
is there any feature you'd like?

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject:
PostPosted: Tue 02 Oct 2007, 23:36 
Offline

Joined: Tue 02 Oct 2007, 15:20
Posts: 3
Yes there is :)

1) Add the reverse logic. Have a mode where the selected system/base is the destination instead of the source and the grid shows all profitable trips to it.
One way would be to add a button to toggle the mode. Maybe better would be to have Source[system][base] <=> Dest[Sytem][Base] combo boxes. The button in between swaps them.

2) Allow system from/to with Any base. The grid shows trips to or from all bases in the system. So Source[Any][Any] <=> Dest[Any][Any] would show every profitable run in the game (a very large number ;-)

3) Add another grid (under the map?) to track your route. As you find a good trip, you can add it to your route and it shows your overall profit etc. You should be able to save/load routes.


I had written one similar years ago in Access using the DB from FLData.
It also did searches for combined routes ending at the start.
It worked good but you had to have Access and it didnt read the data from the FL files directly.

Yours is very fast and works very well with mods.


Top
 Profile  
 
 Post subject:
PostPosted: Mon 12 Nov 2007, 01:13 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
1) currently, my way of storing the game data doesn't allow for an easy implementation of reverse logic
Plus, it would show too many possibilities as you would not be limited by the available goods on the given base, as all bases (in most mods) accept all kinds of goods

2) again, my way of storing the game data doesn't allow for an easy implementation of the "any" base
Plus, it would completely spoil the fun of the game as everybody would be doing the one most profitable route directly

3) Mmmh.. maybe.... well for this one it's not too hard to use a paper and a pencil ;) the good old way ;)

anyway, I'm beginning of thinking about letting the source code out

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject:
PostPosted: Wed 14 Nov 2007, 16:19 
Offline

Joined: Tue 02 Oct 2007, 15:20
Posts: 3
Wizou wrote:
Plus, it would completely spoil the fun of the game as everybody would be doing the one most profitable route directly


Yeah, that is always the kicker.
As it is, I think I have the best runs (which could change from mod 2 mod) , but pirates know them too. It keeps it fun :)

oo, I cant believe you would even mention pencil & paper on the internet :P
Isn't that against some computer law somewhere? :twisted: :mrgreen:

Sign me up if/when you decide to release the source.

Thanks Wiz


Top
 Profile  
 
 Post subject: A better thing...
PostPosted: Tue 02 Sep 2008, 03:07 
Offline

Joined: Tue 02 Sep 2008, 03:01
Posts: 1
What would really make this interesting is a process on the server side that would monitor trading and alter commodity values based on how much of a given item was bought or sold on each base. It could also cause minor random fluxuations in prices or even major ones based on some predetermined methodology. The trick, in my opinion, would be getting the server to reload this data on the fly - I don't think the software touches this data again after initialization. And the monitoring would probably have to be done through some sort of memory hooks. Maybe those hooks are a way to force a data reload... thinking out loud, sorry.


Top
 Profile  
 
 Post subject:
PostPosted: Mon 08 Sep 2008, 22:39 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
i think there is already something like that, called "DynEcon"

see http://discoverygc.com/forums/index.php ... hreaded003

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject:
PostPosted: Tue 02 Dec 2008, 21:01 
Offline

Joined: Tue 02 Dec 2008, 20:56
Posts: 4
Hi,

I would like to ask you if you could manage that your amazing programm works with following Mod:
http://www.freelancerserver.de/download ... .zip.flmod

Because, on HHC Mod we have Dynamic economie, prices change every 10min(only if some goods are sold or bought)


gretz
Just

€dit: one big problem I have to report. Using FLC the prices IG are show vanillia, even the server has a dynamic economie. Only way to get rid of this is, to exit FLC and reload ID on server.... (its some kind of bug)
I think if you could manage that FLC reads the prices for goods in the FL Mod files instead of taking allways the Vanillia ones you would solve both problems!!


thx :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon 15 Dec 2008, 06:51 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
i will see what i can do

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject:
PostPosted: Mon 02 Feb 2009, 14:34 
Offline

Joined: Tue 02 Dec 2008, 20:56
Posts: 4
Hi,

you allready had time to take a look at HHC Mod???

gretz


Top
 Profile  
 
 Post subject:
PostPosted: Tue 03 Feb 2009, 23:13 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
sorry, I think I forgot your request !
but here I am...

can you post your request in a new thread, because it is not really related to FLC source code ?

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject: Re: Source code for Freelancer Companion
PostPosted: Mon 06 Apr 2009, 16:20 
Offline

Joined: Mon 06 Apr 2009, 16:17
Posts: 3
It would be really cool if you can think again about releasing the source code. I'd like to dig into that code and see if I can learn from it. I have some ideas to implement. If you release it as GPL, anyone making changes to it would have to release those too. Other licenses restrict even making money with the code.

I'd really like to toy around with the code.


Top
 Profile E-mail  
 
 Post subject: Re: Source code for Freelancer Companion
PostPosted: Mon 13 Apr 2009, 09:23 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
If you looked at my others programs, you would notice I already know about GPL ;-)

I don't plan on releasing FLC source code for now, especially as it is based on some base libraries I made that I don't want to release.

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject: Re: Source code for Freelancer Companion
PostPosted: Mon 13 Apr 2009, 15:02 
Offline

Joined: Mon 06 Apr 2009, 16:17
Posts: 3
Can you release at least release the INI parser and the distance measurement code?


Top
 Profile E-mail  
 
 Post subject: Re: Source code for Freelancer Companion
PostPosted: Tue 14 Apr 2009, 04:07 
Offline

Joined: Wed 01 Apr 2009, 03:53
Posts: 10
INI parsing isn't that hard if you have decrypted inis (all mods I've seen where, but standard installs start encrypted), not sure how hard it is to decrypt them (just get "bini" if your inis aren't legible). Here's a sample ini parser written in PHP:
Code:
$names = file("universe.ini"); //Loads each line of input file into a node in an array
   foreach($names as $line){ //Loop through all nodes of array, current node will be assigned to $line
      if(preg_match('/^\[(.*)\]/',$line,$matches)){ //This REGEX searches for text within [ and ]. if found, it saves the text as node 1 of $matches
         if($matches[1] == "Base"){ //If the contents are "Base", set a flag to true
            $adding = true;
         }else{ //All other possible entries in universe.ini I want to ignore for this script, so turn off my flag
            $adding = false;
         }
      }
      if($adding){ //So, if we're adding, that means we're looking somewhere after "[Base]", but before some other [ ] text
         if(preg_match('/^nickname = (.*)$/',$line,$matches)){ //REGEX to check for a line that reads "nickname = ". Capture any text after the "=" if found
            echo $matches[1]."<BR>"; //Prints, for debugging
            $name = tr($matches[1]); //Save the name, used later because I'm making an array of bases
         }
         if(preg_match('/^strid_name = (.*)$/',$line,$matches)){ //REGEX for the DLL's string table id (a number that points to a string, the number will be something like 1003, and the text could be something like "Planet New York")
            //echo $matches[1]."<BR>"; //Commented out, but would print the string id
            $names[$name] = tr($matches[1]); //$names is my array of bases, and $name is the base name I saved up above.  the function tr (by the way) just cuts off any newline characters on the end of my string.  I'm setting up an array off base names and the string ids for use later
         }
         if(preg_match('/^system = (.*)$/',$line,$matches)){ //The system field, will be something like "BR01"
            $system = tr($matches[1]); //Hold on to the system name, we will reference this much like "$name" from earlier
            if(!array_key_exists($system,$files)){ //array_key_exists will be true if I've already entered this system, I only want to load each file once (efficiency and preference, not mandatory)
               $f = file("systems/".$system."/".$system.".ini"); //Load the given system ini file
               foreach($f as $lines){ //We're searching out "Objects" this time, but the process is the same
                  if(preg_match('/^\[(.*)\]/',$lines,$match)){
                     if($match[1]=="Object"){
                        $adding2 = true;
                     }else{
                        $adding2 = false;
                     }
                  }
                  if($adding2){  //As a note, if we came across a [Asteroids] entry (for example), the above code would turn $adding2 to false, so no processing, just loop to the next line and check for [Object]
                     if(preg_match('/^pos = (.*),(.*),(.*)$/',$lines,$match)){ //The pos field is stored in the ini as X,Y,Z and I want all three of them
                        $pos[0] = tr($match[1]);
                        $pos[1] = tr($match[2]);
                        $pos[2] = tr($match[3]);
                        $pos[3] = $system; //Save the system name as well
                     }
                     if(preg_match('/^base = (.*)$/',$lines,$match)){ //This line will reference which base is at the above location
                        $name = tr($match[1]); //grab the base name
                        $base[$name] = $pos; //Assign the position array (along with parent system) to our $base array
                     }
                  }
               }
               $files[$system] = true; //Set our $files array for this system name to true, so we don't parse it again
            }
         }
      }
   }

Now I left out the part just after all this where I actually use the data I've parsed, but you only asked for a parser ;)

If you need more info on how I'm doing this, or help converting the code over to something C/VB compatable, let me know.

Distance measurement isn't hard:
A = starting X position
B = starting Y position
C = starting Z position
X = ending X position
Y = ending Y position
Z = ending Z position
Distance = sqrt(sqrt((max(A,X)-min(A,X))^2+(max(B,Y)-min(B,Y))^2)^2+(max(C,Z)-min(C,Z))^2)
Or in mathematical-esque speak: use the pythagorean theorem with the change in X and change in Y, then take that distance as a variable for a second pathagorian theorum with your change in Z.

The tricky part is using that information ;)

I have three related questions, how do you (Wizou) determine the best path? Did you use the systems_shortest_path.ini, or do you try all possibilities and discard all but the fastest for each destination? Also, when compantion wants you to abandon trade lanes midway down one, is it at a gate only, or did you calculate the perpendicular and abandon the trade lane at the closest possible point? Lastly, from point to point (I'll say from a base to a jump hole) do you calculate the travel time as a straight path, then calculate again using possible trade lanes, and take the best, or do you have a better method to decide when to use lanes and when to use cruise engines?


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group