[Work In Progress] Functional Trader + stable supply/demand (0.22 final WIP)
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 302
- Joined: Wed, 20. Nov 13, 03:12
-
- Posts: 259
- Joined: Sat, 23. Nov 13, 09:48
-
- Posts: 235
- Joined: Sat, 16. Feb 08, 23:44
So after taking a nap, I looked into it again now. What's causing it is the line
That's the if-clause for basically the whole transfer cargo part. so if the station has zero amount of that ware in stock, this check will fail and the whole cargo transfer is basically skipped. Theres also a dev comment right above stating
I don't know why count = 0 is an issue. Maybe some devide by zero stuff. Anyway if I change the check to min="0" the ship starts unloading the ore like it should.
Code: Select all
<do_if value="$homebase.cargo.{$currentware}.count" min="1">
Code: Select all
<!-- TODO: change to check resources instead of cargo, so we can deal with count = 0 cases; needs adding of KW_RESOURCES -->
-
- Posts: 235
- Joined: Sat, 16. Feb 08, 23:44
can't confirm this. assigned a rahannas to a manager. it bought food, flew back home and transfered it to the homestation.Joleoo wrote:Trade ships such as Rahanas and Scaldis do the same, they go out, buy the stuff, but when they return they dock, undock, dock, undock repeatedly forever until i manually command them to sell their wares.
only one thing went somewhat wrong, though. it was a huge trade, over 50k food rations. the cargo lifters got force despawned while the trade was still going on.
Last edited by pilakin on Tue, 3. Dec 13, 22:03, edited 1 time in total.
-
- Posts: 259
- Joined: Sat, 23. Nov 13, 09:48
the 75sec wait is only on the detach, the trade (which wait till all resources are transfered normally has 8times that).
Altho i did see a few occurrence where execute_trace did seem to end before the timeout and before all resources were transfered. Sadly, without proper documentation on the function, i cant really tell what exactly its supposed to wait for (since it obviously wait for something before exiting).
Still, i need to rewrite the interrupttime function in there to consider the wares volume and not count. That will be a lot more accurate.
Altho i did see a few occurrence where execute_trace did seem to end before the timeout and before all resources were transfered. Sadly, without proper documentation on the function, i cant really tell what exactly its supposed to wait for (since it obviously wait for something before exiting).
Still, i need to rewrite the interrupttime function in there to consider the wares volume and not count. That will be a lot more accurate.
-
- Posts: 235
- Joined: Sat, 16. Feb 08, 23:44
Ok, guys, I'm still building and getting things done on my version 22.
for starters, its far better to be out of zone while trading is going on, things get completed at a much faster rate.
Building stations in X-R is much slower than other versions of X
It takes a lot longer, but is working fine for me.
This includes Phase 2 ,3 & 4.
I just acquired my surface drones and will have a go at mining, as I have a crystal station already built.
The number one thing I see that's needed, is patience on the players part.
This is much more like playing chess rather than checkers.
If you want to play fast, it may not be for you.
Jey keep up the good work.
For me the game is mostly fixed,
as all I like to do is trade, build and manufacture.
for starters, its far better to be out of zone while trading is going on, things get completed at a much faster rate.
Building stations in X-R is much slower than other versions of X
It takes a lot longer, but is working fine for me.
This includes Phase 2 ,3 & 4.
I just acquired my surface drones and will have a go at mining, as I have a crystal station already built.
The number one thing I see that's needed, is patience on the players part.
This is much more like playing chess rather than checkers.
If you want to play fast, it may not be for you.
Jey keep up the good work.
For me the game is mostly fixed,
as all I like to do is trade, build and manufacture.
-
- Posts: 162
- Joined: Sun, 24. Nov 13, 16:06
You using the fix on page 18 for construction ships and station building so traders go to your construction ships or is it working without this fix? I think I may have created a conflict with UFO as I gave my construction ship UFO type commands and THEN initiated construction of a station .... only for the ship to sit there with trade ports open to accept trades for hours and hours and nothing. Only alternative was either fix on page 18 (which seems to create big performance issues) or save game editor.
-
- Posts: 268
- Joined: Tue, 1. Jan 13, 15:48
@Jey123456, Dude. My problem is that IMO trades take too much time... somewhere there is a delay which could be bug... or i donno, but it's wrong. Not even a clue what causes this. I've asked that cargo drones number can speed up the process. You've answered; yes they do. Ok, but even then there are more than enough cargo drones... between a ship dock and start to trade there is a "blackhole" time, and don't know what happening. Also when you see that all the cargo drones are in use, and see that all your cargo has been sold, between that moment and when commander report that trade is complete there another "blachole" in time because it can take several minutes.
Hope you got my point. Can you explain this, or there is a chance it may be fixed?
For me not bothers that cargo ships needs time to travel its destination, maneuvering to docks, etc. But when dock is empty (no another NPC in queue) and it takes eons while trade is starting, and also when all your goods has been sold (you see that cargo is at "0", so probably lifting cargo is over) and when trade finishes, it's also takes eons.
How could we speed up this process?
you order for a trade -> trader starts to go, navigate, gets its dest. (it could take time as it needs) -> dock initiated -> start trading immediately (no delay at all) -> with x cargo drones it takes time as it needs -> then immediately report is made, trade is complete.
Hmm?
Hope you got my point. Can you explain this, or there is a chance it may be fixed?
For me not bothers that cargo ships needs time to travel its destination, maneuvering to docks, etc. But when dock is empty (no another NPC in queue) and it takes eons while trade is starting, and also when all your goods has been sold (you see that cargo is at "0", so probably lifting cargo is over) and when trade finishes, it's also takes eons.
How could we speed up this process?
you order for a trade -> trader starts to go, navigate, gets its dest. (it could take time as it needs) -> dock initiated -> start trading immediately (no delay at all) -> with x cargo drones it takes time as it needs -> then immediately report is made, trade is complete.
Hmm?
-
- Posts: 259
- Joined: Sat, 23. Nov 13, 09:48
the delay between docking and the drones starting moving should be pretty small (were looking at a few seconds here). But yes, trading is slow by design in the game. Most of the time is spent in the 2 core trading functions and since its unknown what they do exactly, we cant replace them with script to remove the time without probably losing stuff in the process.
<execute_trade> and <detach_from_masstraffic>
Detach is a little more obvious since well, all it does is detach the capital ship from the masstraffic on the port. but execute_trade seem to do quite a few things that we dont know about (update station trades qty, cargo etc)
<execute_trade> and <detach_from_masstraffic>
Detach is a little more obvious since well, all it does is detach the capital ship from the masstraffic on the port. but execute_trade seem to do quite a few things that we dont know about (update station trades qty, cargo etc)
-
- Posts: 235
- Joined: Sat, 16. Feb 08, 23:44
-
- Posts: 235
- Joined: Sat, 16. Feb 08, 23:44
-
- Posts: 268
- Joined: Tue, 1. Jan 13, 15:48
No. It's not. When a cargo ship arrives, stands next to docking bay. Then backwards closing to it. Now this is the point when taking eons when commander says: starting trading. Also after this I think the time spent here is much more than should be, especially if you got enough cargo drones. Either way if you wait for this we reach another "blackhole" because at this time you see the changes of your cargo and reaches the exact amount you bought. But trading isn't over still. Here you must wait again but nothing happens. After this commander says trading complete and here you can see, your credits changing.pilakin wrote:The "black holes" you're describing sound like the parking/unparking maneuvers.
So as I see there are several step when some looping happens, and these delays the whole trading process a lot.

-
- Posts: 100
- Joined: Tue, 24. Feb 09, 03:47
"Realism/Immersion" the captain is waiting for traffic control to clear them to unpark or any plethora of other things that large cargo ships have to deal with after offloading cargo. Things not being instantaneous help give that feeling that the world is alive and doesn't revolve around you.Pimpace wrote:No. It's not. When a cargo ship arrives, stands next to docking bay. Then backwards closing to it. Now this is the point when taking eons when commander says: starting trading. Also after this I think the time spent here is much more than should be, especially if you got enough cargo drones. Either way if you wait for this we reach another "blackhole" because at this time you see the changes of your cargo and reaches the exact amount you bought. But trading isn't over still. Here you must wait again but nothing happens. After this commander says trading complete and here you can see, your credits changing.pilakin wrote:The "black holes" you're describing sound like the parking/unparking maneuvers.
So as I see there are several step when some looping happens, and these delays the whole trading process a lot.
"Gameplay/Design" It's expected that you will be running around doing other things while your freight ships are moving cargo.
-
- Posts: 21
- Joined: Sat, 15. Nov 08, 08:07
-
- Posts: 287
- Joined: Fri, 29. Nov 13, 23:14
Can't load savegame
Just installed v0.22 but can't play with it.
I mean I can't continue with my ast savegame.
The game crashes when loading at 100%.
Uploaded the save for your reference..
https://www.dropbox.com/s/wdr7170b3jin8lw/quicksave.zip
Cheers, End
I mean I can't continue with my ast savegame.
The game crashes when loading at 100%.
Uploaded the save for your reference..
https://www.dropbox.com/s/wdr7170b3jin8lw/quicksave.zip
Cheers, End
-
- Posts: 21
- Joined: Sat, 15. Nov 08, 08:07
Re: Can't load savegame
You really have to start a new game I believe.Endeavour79 wrote:Just installed v0.22 but can't play with it.
I mean I can't continue with my ast savegame.
The game crashes when loading at 100%.
Uploaded the save for your reference..
https://www.dropbox.com/s/wdr7170b3jin8lw/quicksave.zip
Cheers, End
-
- Posts: 80
- Joined: Wed, 2. Oct 13, 12:52
-
- Posts: 346
- Joined: Mon, 9. Apr 12, 05:14
-
- Posts: 210
- Joined: Sat, 18. Sep 10, 07:07