[Script] Station Manager v1.11 (March 27)
Posted: Tue, 27. Dec 05, 06:44
Deutsch
Download links:
Note: with 2 authors and 2 different hosts, sometimes versions will be different. Please check that you are downloading the highest version number below.
Station Manager Version 1.11 - AalaarDB's Zip with .spk
Station Manager Version 1.11 - Zip without .spk
Station Manager Version 1.11 - Burianek's host (both .zip and .spk versions available)
(note that my host service is awful, you likely won't get in on the first attempt. If it says page not found, just keep hitting refresh until it works. The most number of tries it's ever taken me is around 15, so you'll get in soon. Sorry )
Hi guys! Aalaardb and I have worked very hard to attempt to improve BPH for X3. We're pretty proud of it and we hope you like it!
See the second post for version history.
Description:
Station manager is a fully automated software system that manages and coordinates traders assigned to a factory. It will decide which wares need to be bought and sold, and where the best locations are to buy/sell them. It's very flexible and allows you to assign as many or as few traders as you like to take care of a factory.
Traders assigned to the same factory will coordinate with eachother, and will not all try go out to buy the same ware at the same time. They will also not visit the same stations to trade the same ware. Station manager allows you to customize the traders belonging to a station and set up individual parameters by ship for which wares should be traded, and how far of a jumprange to look within. So, for example, it is very easy to set up a spp to have two customized ships supplying it: 1. a very small, fast ship that looks for crystals to buy within a large jumprange. 2. a huge energy tanker that sells energy cells to the stations immediately surrounding the spp.
Traders will only buy resources if your station is less than 90% full, and will only sell products if your station is more than 10% full.
Traders that have been damaged to have less than 80% hull value will not continue trading for your factory. Instead, they will automatically fly to the nearest safe repair dock and contact you for help. Safe means that they will not cross any sectors owned by races defined as enemies in the ship's friend/foe settings.
In order for your traders to be able to see the ware prices within a sector, you must have a satellite, ship, or station in the sector to be scanned (this is shown by a green border around the sector in the galaxy map). Your ships will not visit sectors where they cannot see the ware prices. You can use this to your advantage. If you don't want traders to visit sectors because you think they might not be safe, do not put any satellites or ships in those sectors, and your traders will not look for stations to trade at within them.
Station Manager costs 20,000 credits to download and install in your station. This is a one time fee. If you stop the station manager command on your station and restart it, you will not be recharged.
--------------------------------------------------------------------------
Instructions:
Starting Station Manager (station command, station command console):
Select the 'Station Manager: Automate' command from the station command console. The first time this is activated on a station, the station account will be debited 20,000 credits to install the software.
Assigning Ships to a Station (station command, station command console):
After Station Manager is running on a station the command to add / remove ships from the station's list of traders will appear in the station command console. To add a ship, select the 'Station Manager: Add/Remove Ship' command and then select one of your ships. Note that your ship must not currently be docked to be able to find it to select it. Once your ship has been selected, it will be added to the station's list of traders and the ship will begin to be controlled by the Station Manager software. The following ship types can be assigned to trade for a station: M3, M4, M5, M6, TS, TP.
To remove a ship, follow the same procedure of selecting the 'Station Manager: Add/Remove Ship' command from the station command console, but then select a ship that already belongs to the station. The ship will be removed from the station's list of traders and will stop trading for the station and will begin to idle in space.
To get a list of the ships belonging to a station, select the 'Station Manager: Add/Remove Ship' command and then select the station itself. A nicely formatted list will be sent to your logbook, listing all of the traders belonging to the station and their parameters.
Continuing a Manually Interrupted Trader (ship command, trade menu):
It is possible to manually interrupt one of your traders by simply issuing it a new command. This can be useful to tell a trader to dock somewhere safe if you think it is in danger, or to repair a trader if needed. Once a trader has been manually taken control of, after a short period of time (less than five minutes), the station will see that the trader is no longer trading for it and will send a signal to the ship. This signal places a new command in the trade menu of the ship's command console, 'Station Manager: Continue'. Select the 'Station Manager: Continue' command to order the ship to begin trading for the station again. If your trader has been automatically sent to a repair dock to get fixed, you can also restart the trader after you fix it by issuing the continue command.
Defining Wares to be Traded (ship command, ship additional commands):
Go to the command console of one of your traders. In the additional ship commands section of the command console you will have the 'Station Manager: Prohibit Ware' command. Select the command and then select one of the wares to prevent your trader from trading it. To reallow your trader to trade a prohibited ware, simply select the command again and choose a prohibited ware. Your trader will now be allowed to trade it again. To see which traders can trade which wares, use the 'Station Manager: Add/Remove Ship' command from the station command console to get the station's list of traders as described above. Traders are set up to trade all of the wares of a station by default.
Setting a Jumprange (ship command, ship additional commands):
Go to the command console of one of your traders. In the additional ship commands section of the command console you will have the 'Station Manager: Set Jumprange' command. Select the command and then enter a jumprange. To cause your ship to use the standard station jumprange parameter, select the command and enter a negative number for the jumprange. Your ship will then use the standard jumprange defined at the station. To see the jumpranges defined for each trader, use the 'Station Manager: Add/Remove Ship' command from the station command console to get the station's list of traders as described above. Traders are set up to use the standard station jumprange by default.
Stopping Station Manager (station command, station command console):
Go to the station command console and select the command slot Station Manager is running on. Select none to stop the station from running Station Manager.
--------------------------------------------------------------------------
How It Works (Detailed Trader Logic Description):
- Your ships will look at their homebase and make a decision as to what the most critical ware to trade is. They will look at what other ships belonging to your homebase are attempting to do to help them make the best decision. So, if your station desperately needs energy, but you already have another freighter enroute to buy more than enough to supply the station with energy, your trader might look for a different ware to buy or sell.
- After a trader has decided which ware to trade for the station, it will look for the best station to go to. It will search the stations of all sectors within jumprange that have a player asset in them (have a green border on the galaxy map so the player can see ware prices). The trader will rank order the stations by best price, and then by shortest jumprange. It will then visit the best station that no other trader for this station is visiting. (traders can visit the same station if it is to trade different wares, i.e. two traders from an spp might visit the same crystal fab if one was going to sell energy, and the other to buy crystals)
- Once a trader has a ware and station to trade, it will start travelling towards that station. Every sector, the trader will make a limited search to see if there is a better station to trade at. A limited search means that only stations that are as close as, or closer than the current target station will be checked. This is to prevent a trader from flying one sector east and then saying, "oh wait, the best station is to the west", flying one sector west and then saying, "oh wait ..." and never landing anywhere. Traders that set out from a station will always continue to close to a target with every sector travelled unless something happens such that there are no stations within the jumprange to the current target that trade the ware for the price limits set at the homebase. When this happens, the trader will abandon the current trade run and will start completely over, looking for the best ware to trade for the station. (if it picks the same ware, it will expand its search to include all sectors within the jumprange of the homebase)
- If a trader ever picks a ware and finds that it cannot find any stations at which to trade that ware within the price limits set at the homebase, it will give up on that ware and pick the next best ware to trade for the homebase.
- If a trader finds that it cannot trade any wares for its homebase, it will return to its homebase and sit there until it is possible to trade something.
--------------------------------------------------------------------------
Explanation of Pathfinding Algorithm:
The station manager uses AStar to find paths to the destination, rather than the normal paths. These paths are, in general, safer. You can change the way AStar makes paths relatively easily, to customize it to your playing style.
AStar assigns a cost to each path it could take to get to the destination. It then chooses the path with the lowest cost as the optimum route. The easiest way to think of cost is: safety_weighting * distance, with higher safety weighting meaning more dangerous.
As an extremely simplified example, assume there are two paths to get to a destination:
Path 1: 300km travelled through enemy sectors
Path 2: 400km travelled through neutral sectors
Foe weighting: 1.55 (this is the default weight used for Foe sectors in station manager)
Path1 cost: 300km * 1.55 = 465
Path2 cost: 400km * 1 = 400
In this example, AStar would pick the safer route, even though it is a bit longer. Notice that if Path 2 were much longer (greater than 465km) AStar would actually prefer to go through the enemy sectors.
To change the saftey weightings to get AStar to prefer different routes on your computer, open up your script editor, and open the file ADB.AStar.GetPlayerCosts. You may edit the 4 numbers at the top, but it is recommended you only edit the FOE number. You may also edit the center of the script in between where it says to edit. This spot is for those who want to have different costs for different races of the same type. For example, Xenons might be more dangerous than Pirates although they are both FOE. Please do not edit any other files.
For instance, if you want the trader to stay safer by visiting enemy sectors less often, increase the FOE number. If you want your traders to prefer faster routes with increased risk, decrease the FOE number slightly. You can even make traders prefer visiting 'Allied' sectors more often by decreasing the Friend number.
If you are interested, please see here for a further explanation of AStar. Please note: the AStar here and there are different, the station manager version will not overwrite the commands - it is only for your station traders.
Feedback is very welcome!
Download links:
Note: with 2 authors and 2 different hosts, sometimes versions will be different. Please check that you are downloading the highest version number below.
Station Manager Version 1.11 - AalaarDB's Zip with .spk
Station Manager Version 1.11 - Zip without .spk
Station Manager Version 1.11 - Burianek's host (both .zip and .spk versions available)
(note that my host service is awful, you likely won't get in on the first attempt. If it says page not found, just keep hitting refresh until it works. The most number of tries it's ever taken me is around 15, so you'll get in soon. Sorry )
Hi guys! Aalaardb and I have worked very hard to attempt to improve BPH for X3. We're pretty proud of it and we hope you like it!
See the second post for version history.
Description:
Station manager is a fully automated software system that manages and coordinates traders assigned to a factory. It will decide which wares need to be bought and sold, and where the best locations are to buy/sell them. It's very flexible and allows you to assign as many or as few traders as you like to take care of a factory.
Traders assigned to the same factory will coordinate with eachother, and will not all try go out to buy the same ware at the same time. They will also not visit the same stations to trade the same ware. Station manager allows you to customize the traders belonging to a station and set up individual parameters by ship for which wares should be traded, and how far of a jumprange to look within. So, for example, it is very easy to set up a spp to have two customized ships supplying it: 1. a very small, fast ship that looks for crystals to buy within a large jumprange. 2. a huge energy tanker that sells energy cells to the stations immediately surrounding the spp.
Traders will only buy resources if your station is less than 90% full, and will only sell products if your station is more than 10% full.
Traders that have been damaged to have less than 80% hull value will not continue trading for your factory. Instead, they will automatically fly to the nearest safe repair dock and contact you for help. Safe means that they will not cross any sectors owned by races defined as enemies in the ship's friend/foe settings.
In order for your traders to be able to see the ware prices within a sector, you must have a satellite, ship, or station in the sector to be scanned (this is shown by a green border around the sector in the galaxy map). Your ships will not visit sectors where they cannot see the ware prices. You can use this to your advantage. If you don't want traders to visit sectors because you think they might not be safe, do not put any satellites or ships in those sectors, and your traders will not look for stations to trade at within them.
Station Manager costs 20,000 credits to download and install in your station. This is a one time fee. If you stop the station manager command on your station and restart it, you will not be recharged.
--------------------------------------------------------------------------
Instructions:
Starting Station Manager (station command, station command console):
Select the 'Station Manager: Automate' command from the station command console. The first time this is activated on a station, the station account will be debited 20,000 credits to install the software.
Assigning Ships to a Station (station command, station command console):
After Station Manager is running on a station the command to add / remove ships from the station's list of traders will appear in the station command console. To add a ship, select the 'Station Manager: Add/Remove Ship' command and then select one of your ships. Note that your ship must not currently be docked to be able to find it to select it. Once your ship has been selected, it will be added to the station's list of traders and the ship will begin to be controlled by the Station Manager software. The following ship types can be assigned to trade for a station: M3, M4, M5, M6, TS, TP.
To remove a ship, follow the same procedure of selecting the 'Station Manager: Add/Remove Ship' command from the station command console, but then select a ship that already belongs to the station. The ship will be removed from the station's list of traders and will stop trading for the station and will begin to idle in space.
To get a list of the ships belonging to a station, select the 'Station Manager: Add/Remove Ship' command and then select the station itself. A nicely formatted list will be sent to your logbook, listing all of the traders belonging to the station and their parameters.
Continuing a Manually Interrupted Trader (ship command, trade menu):
It is possible to manually interrupt one of your traders by simply issuing it a new command. This can be useful to tell a trader to dock somewhere safe if you think it is in danger, or to repair a trader if needed. Once a trader has been manually taken control of, after a short period of time (less than five minutes), the station will see that the trader is no longer trading for it and will send a signal to the ship. This signal places a new command in the trade menu of the ship's command console, 'Station Manager: Continue'. Select the 'Station Manager: Continue' command to order the ship to begin trading for the station again. If your trader has been automatically sent to a repair dock to get fixed, you can also restart the trader after you fix it by issuing the continue command.
Defining Wares to be Traded (ship command, ship additional commands):
Go to the command console of one of your traders. In the additional ship commands section of the command console you will have the 'Station Manager: Prohibit Ware' command. Select the command and then select one of the wares to prevent your trader from trading it. To reallow your trader to trade a prohibited ware, simply select the command again and choose a prohibited ware. Your trader will now be allowed to trade it again. To see which traders can trade which wares, use the 'Station Manager: Add/Remove Ship' command from the station command console to get the station's list of traders as described above. Traders are set up to trade all of the wares of a station by default.
Setting a Jumprange (ship command, ship additional commands):
Go to the command console of one of your traders. In the additional ship commands section of the command console you will have the 'Station Manager: Set Jumprange' command. Select the command and then enter a jumprange. To cause your ship to use the standard station jumprange parameter, select the command and enter a negative number for the jumprange. Your ship will then use the standard jumprange defined at the station. To see the jumpranges defined for each trader, use the 'Station Manager: Add/Remove Ship' command from the station command console to get the station's list of traders as described above. Traders are set up to use the standard station jumprange by default.
Stopping Station Manager (station command, station command console):
Go to the station command console and select the command slot Station Manager is running on. Select none to stop the station from running Station Manager.
--------------------------------------------------------------------------
How It Works (Detailed Trader Logic Description):
- Your ships will look at their homebase and make a decision as to what the most critical ware to trade is. They will look at what other ships belonging to your homebase are attempting to do to help them make the best decision. So, if your station desperately needs energy, but you already have another freighter enroute to buy more than enough to supply the station with energy, your trader might look for a different ware to buy or sell.
- After a trader has decided which ware to trade for the station, it will look for the best station to go to. It will search the stations of all sectors within jumprange that have a player asset in them (have a green border on the galaxy map so the player can see ware prices). The trader will rank order the stations by best price, and then by shortest jumprange. It will then visit the best station that no other trader for this station is visiting. (traders can visit the same station if it is to trade different wares, i.e. two traders from an spp might visit the same crystal fab if one was going to sell energy, and the other to buy crystals)
- Once a trader has a ware and station to trade, it will start travelling towards that station. Every sector, the trader will make a limited search to see if there is a better station to trade at. A limited search means that only stations that are as close as, or closer than the current target station will be checked. This is to prevent a trader from flying one sector east and then saying, "oh wait, the best station is to the west", flying one sector west and then saying, "oh wait ..." and never landing anywhere. Traders that set out from a station will always continue to close to a target with every sector travelled unless something happens such that there are no stations within the jumprange to the current target that trade the ware for the price limits set at the homebase. When this happens, the trader will abandon the current trade run and will start completely over, looking for the best ware to trade for the station. (if it picks the same ware, it will expand its search to include all sectors within the jumprange of the homebase)
- If a trader ever picks a ware and finds that it cannot find any stations at which to trade that ware within the price limits set at the homebase, it will give up on that ware and pick the next best ware to trade for the homebase.
- If a trader finds that it cannot trade any wares for its homebase, it will return to its homebase and sit there until it is possible to trade something.
--------------------------------------------------------------------------
Explanation of Pathfinding Algorithm:
The station manager uses AStar to find paths to the destination, rather than the normal paths. These paths are, in general, safer. You can change the way AStar makes paths relatively easily, to customize it to your playing style.
AStar assigns a cost to each path it could take to get to the destination. It then chooses the path with the lowest cost as the optimum route. The easiest way to think of cost is: safety_weighting * distance, with higher safety weighting meaning more dangerous.
As an extremely simplified example, assume there are two paths to get to a destination:
Path 1: 300km travelled through enemy sectors
Path 2: 400km travelled through neutral sectors
Foe weighting: 1.55 (this is the default weight used for Foe sectors in station manager)
Path1 cost: 300km * 1.55 = 465
Path2 cost: 400km * 1 = 400
In this example, AStar would pick the safer route, even though it is a bit longer. Notice that if Path 2 were much longer (greater than 465km) AStar would actually prefer to go through the enemy sectors.
To change the saftey weightings to get AStar to prefer different routes on your computer, open up your script editor, and open the file ADB.AStar.GetPlayerCosts. You may edit the 4 numbers at the top, but it is recommended you only edit the FOE number. You may also edit the center of the script in between where it says to edit. This spot is for those who want to have different costs for different races of the same type. For example, Xenons might be more dangerous than Pirates although they are both FOE. Please do not edit any other files.
For instance, if you want the trader to stay safer by visiting enemy sectors less often, increase the FOE number. If you want your traders to prefer faster routes with increased risk, decrease the FOE number slightly. You can even make traders prefer visiting 'Allied' sectors more often by decreasing the Friend number.
If you are interested, please see here for a further explanation of AStar. Please note: the AStar here and there are different, the station manager version will not overwrite the commands - it is only for your station traders.
Feedback is very welcome!