EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[Work In Progress] Functional Trader + stable supply/demand (0.22 final WIP)
Post new topic Reply to topic Goto page 1, 2, 3 ... 31, 32, 33  Next
View previous topic :: View next topic
Author Message
Jey123456





Joined: 23 Nov 2013



modified
PostPosted: Wed, 27. Nov 13, 14:35    Post subject: [Work In Progress] Functional Trader + stable supply/demand (0.22 final WIP) Reply with quote Print

As i mentioned in some other posts, ive been working on fixing the game in general, first was the engineer and now the trading / economy.


I have already fixed just about every trading issues i could find (cargo drone going crazy, trade ship getting stuck, mining ship getting stuck etc etc), altho it is not in the form of a mod yet, due to the large amount of changes and the fact i worked with full files to ease the work

But those fix revealed a much larger issue. The supply and demand in Albion (freeplay) is out of wack to say the least. If you let the universe run for a few hours, you end up with every station starving, and all freighters unable to find work because no station is able to produce much of anything (there is some small production going on, but ridiculously small, the kind that only use 10% of one large freighter to move).

This cause a major problem, that is even more gamebreaking than the tradenetwork not working. With the trader fixed, you cannot do any trades anymore since there is no supply available anywhere heh (npc take it all, and the demand is way higher than the supply)

I am currently running some tests / experiments to fix that, and get a proper trading network going on, not too much supply, not too much demand, in some form of self balancing system.

Stuff like station eating more when they have too much food (people are swimming in food so they waste a lot) which in turn will stabilize the food supply/demand and a similar system for energy.

Most other material have an outlet already, and that is the shipyard. The shipyard will take it upon itself to make ships whenever its not busy.






The shipyard bring another problem, there is essentially no ship dieing, so you end up with even more traders all around the place. This is due to the lack of proper "attacks", you see a xenon destroyer now and then, but it generally end up outnumbered and killed too easily. But i do not plan on fixing that part before the trading is actually working enough to get some supply / demand that player can use to trade as well.



For those interested in trying it out. While i did not make a mod of it yet, i can provide a work in progress archive of what i use to work on.

To use it, you will need to add "-prefersinglefiles" without the quotes to your launch options otherwise, many things will not load properly. I also strongly suggest you backup your save file, as there is a chance it will **** it up (altho ideally you should start a new game but well, the fix should work on an existing game).

http://www.jeypc.com/dl/tradeship_fix_wip_0.08.zip to download. Extract it in the root of your X Rebirth folder. To uninstall, delete the aiscripts, index ,assets/props and assets/units then restart your game.



Keep in mind, this is a very raw WIP version, it include a lot of changes that did nothing, and debug value (shouldn't spam your error logs tho, since they need a debugging tag set on the pilot in most cases)

Feel free to reuse/modify/ whatever the code. Credits would be apreciated, but are not required.


The WIP only include the trader fixes currently. I am still analysing the economy so there is no changes on that side currently.


http://www.jeypc.com/dl/tradeship_fix_wip_0.15.zip to download. (delete the old pck files first they were renamed to xml in 0.15)
* Most likely not save compatible with 0.08, use at your own risk. (start a new universe)

- include close to perfectly working (in my tests), non players trade ai the last remaining bug is when drones refuse to appear, but the worst scenario is 11min15sec of waiting before they undock and resume their merry way
- AI will also use their booster a lot more (will be separated in another mod once in mod release, but highly recommended to use with it as it reduce by a lot the time the ai waste in a zone).
- some wares production and cost were changed to help keep the economy stable (wares.xml included in the mod is not a diff, and include every wares for ease of editing).
- Fully rewritten custom.findfreetraderun to buy things that another station wants (so that it actually trades instead of stockpiling).



http://www.jeypc.com/dl/tradeship_fix_wip_0.20.zip
- construction ships are now given a special attention by tradeships.
-- Large freighters and XL will take the construction ship deal in priority if its able to satisfy at least 5% of its storage capacity and make a proffit (no matter if the proffit is better than stations or not and the specific ware is picked at random from what the freighter trade).
-- Small and Medium tradeships will take any offer no matter how small, from the construction ship, so long as it turn a proffit. They also do not use the reservation system (so quite a few will rush to you with random wares your ship request).
-- In my test, it took about 45mins before the first traders showed up (at which point, a shit ton showed up shortly after xD), altho that will entirely depend on the state of the economy in your universe

*** as with all my other WIP, this is not garanteed to be safe compatible with either vanilla or the other versions, it is strongly recommended you use it on a fresh universe to avoid issues.
*** The proper mod release version will ensure to function over a vanilla 1.18 altho the process to uninstall it might be slightly complicated due to the numerous changes involved in the save and command structures.

http://www.jeypc.com/dl/tradeship_fix_wip_0.22.zip
* each trader now have a watcher that keep an eye on them, if they stop moving / executing trades attempt (frozen in whatever state) for more than 20 minutes, they get a force reset done on them, which should keep everything moving quite nicely (freezes are pretty rare now, since most are either handled by my changes with interrupts, or fixed with 1.18 beta), but well, a few still happen, and until i catch them all, that at least, let the universe run (and in debug, give me info on where the ai was frozen).
* player trade should now be fully functional. Altho still need some esthetic work (some dock are hard to reach using collision, so if they cant get to the park withing acceptable time (5mins once the docking actually start), they disable the collision and just get to the destination.
** fixed the docking, the notification and 3 different case of trading getting stuck.


- As with all my other WIP there is no garantee the save will be compatible, altho an universe from 0.20 should since most changes in between are compatible or player trade related (which you can generally reset easily by removing / adding to your squad).



version 0.22 will most likely be the final WIP release. Everything should work at an acceptable level (minus a small bug where a trader with no tradenpc cannot accept ai reservation, but there is manual fix you can do about that on page 18 ).

Once the mod is completed, it should also (in theory, could end up being impossible depending on how much i can cheat around the problem xD) be able to be "uninstalled" from a save by installing, and then removing the mod once its released



Last edited by Jey123456 on Mon, 2. Dec 13, 12:22; edited 9 times in total
Back to top
View user's profile Send private message
swatti





Joined: 07 Dec 2003
Posts: 889 on topic

Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 15:01    Post subject: Reply with quote Print

Does this fix the trade-drones not showing up on NPCs? Standalone version of that would be welcome till Ego fixes them.

Back to top
View user's profile Send private message
Jey123456





Joined: 23 Nov 2013



PostPosted: Wed, 27. Nov 13, 15:14    Post subject: Reply with quote Print

if you mean the cargo drone moving the wares from the ship to the station and from station to the ship, yes it fix them.

Altho there is still one case where they wont display, its if a trade was started out of system, and then you come in the system and go look at the ship. There wont be any drone, but once the transaction time is past (a few minutes depending on how many wares), it will undock and go around its day.

The transaction when oos, are instant and then the ship just wait for the duration, so it look a bit weird when you catch it on the act.

and a "standalone" version of that is by no mean a small task xD. you essentially need all the files in the zip to achieve the functional traders (with a few exceptions). Each of those files have a few dozen changes at least.

I plan on making it in a mod that can be toggled on and off, once im done fixing the economy as a whole.

youll see if you try it out, that this fix is no good, sure the traders work, for a while, but then there is no ressources left to move around and production die out.

With it running on an universe for a few hours, youll find it nearly impossible to find anything to buy for your tradeship to make you some money either (hence why it wont be standalone Razz)


The mod for it will come, but it will be a few more days, so in the meantime, people who want to play with working tradeship, can use the WIP version.

Back to top
View user's profile Send private message
BlueWulv





Joined: 07 Feb 2004
Posts: 233 on topic
Location: Germany
Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 15:18    Post subject: Reply with quote Print

Wow, lots of files, lots of changes, no surprise I could not fix the drone problems Wink

Very nice work, thank you Smile

Back to top
View user's profile Send private message
csaba





Joined: 26 Aug 2005



PostPosted: Wed, 27. Nov 13, 15:19    Post subject: Reply with quote Print

Will check it out. Ego should pay you for this.....

Back to top
View user's profile Send private message
Jey123456





Joined: 23 Nov 2013



PostPosted: Wed, 27. Nov 13, 15:28    Post subject: Reply with quote Print

swatti wrote:
Does this fix the trade-drones not showing up on NPCs? Standalone version of that would be welcome till Ego fixes them.


If you meant, on the shipyard, then yes it does, partially. It will show drones so long as some are available, but the shipyard eat drones like candy when it build new ships to send in the wild (ill have a look at that as well, to limit the building to only when there is spare material, so that at least some kind of minimum is kept for the player to use heh).

And there is the underlying issue that, once the initial supply of drones from the production bases is drained, the production is nowhere near strong enough to keep up, so your lucky if you see even 10 drones at the shipyard heh. (thats the part im working to fix now, but its a bit more complicated than fixing the drone production lol)

Back to top
View user's profile Send private message
seedee





Joined: 16 Sep 2006
Posts: 78 on topic

Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 15:35    Post subject: Reply with quote Print

gonna test that after backing up my saves

Back to top
View user's profile Send private message
Gaotseun





Joined: 25 Nov 2013



PostPosted: Wed, 27. Nov 13, 15:41    Post subject: Reply with quote Print

You are my Hero!!

im testing it right now Very Happy
will give you a feedback later

Back to top
View user's profile Send private message
BlueWulv





Joined: 07 Feb 2004
Posts: 233 on topic
Location: Germany
Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 15:42    Post subject: Reply with quote Print

Seems not to work with my plot construction ship.
Trade was initialized, 20 of 20 cargo drones change their status to "used" but nothing happens.

Seems construction ships or at least the plot construction ship is a special case...
I will try to conquer a normal trader now Wink

Back to top
View user's profile Send private message
Jey123456





Joined: 23 Nov 2013



PostPosted: Wed, 27. Nov 13, 15:46    Post subject: Reply with quote Print

construction ship might not have the code in place for the actual trading to happen. They probably can only trade when they are deployed, i would have to investigate that.

If the drones get set to isused, then its trying to undock the drone for the trade, but it might not know where.

Back to top
View user's profile Send private message
csaba





Joined: 26 Aug 2005



PostPosted: Wed, 27. Nov 13, 16:18    Post subject: Reply with quote Print

Jey123456 wrote:
The shipyard bring another problem, there is essentially no ship dieing, so you end up with even more traders all around the place. This is due to the lack of proper "attacks", you see a xenon destroyer now and then, but it generally end up outnumbered and killed too easily. But i do not plan on fixing that part before the trading is actually working enough to get some supply / demand that player can use to trade as well.


Might help if the AI could build stations instead and prioritize that over ship building. Would make more sense for them to build stations as their economy is starving.
Just a thought.

Back to top
View user's profile Send private message
Jey123456





Joined: 23 Nov 2013



PostPosted: Wed, 27. Nov 13, 16:24    Post subject: Reply with quote Print

its still a bit too early in my tests to be sure, but it doesnt seem like more station would fix it, since whats lacking most apparently, are the raw resources (mining) , in my run with increased miners qty (bad solution, way too laggy, but faster for testing than changing the mining code to mine better / faster Razz) it seem that the economy is doing much better. But its still a bit too early to properly compare

Back to top
View user's profile Send private message
Fumblesneeze





Joined: 26 Nov 2013
Posts: 75 on topic

Thank you for registering your game
PostPosted: Wed, 27. Nov 13, 16:31    Post subject: Reply with quote Print

Concerning the xml-diff, there is this tool:
https://mega.co.nz/#!TFEDGRQB!Z0dUv3OHLyL0tUC4gFfyZALFjIRkbGU36pGL1pYs-ik

It does generate xml diffs, but not in the required format. But I think it would definitely help when trying to convert the mod files later. (If anyone wants the source you can get it from here: http://msdn.microsoft.com/en-us/library/aa302294.aspx)

Hopefully Ego releases some mod tools soon-ish, like their diff-patch library, so we don't have to reverse engineer everything.

Back to top
View user's profile Send private message
Jey123456





Joined: 23 Nov 2013



PostPosted: Wed, 27. Nov 13, 16:35    Post subject: Reply with quote Print

i do have a diff tool already, but thats not my worry, im much more worried in the fact that any change around the file could break it hence why it will probably be full file change even tho its a bunch of small change around (well, not full rewrite, but scriptname change for most, and only a few small diff in the trade.ship etc).

But thats the last step, first i need to get it in a shape that i find good enough to be worth making a mod off. Only reason i released the wip is because i know some people don't want to wait the few days needed for me to finish it completely, before playing around with it, hence why i made it available.

Back to top
View user's profile Send private message
Gaotseun





Joined: 25 Nov 2013



PostPosted: Wed, 27. Nov 13, 16:49    Post subject: Reply with quote Print

feedback so far after 1h playing...
it works!! all traders doing what they should Surprised
i will name my first born son Jey123456 Laughing

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3 ... 31, 32, 33  Next
 
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Control Panel
Login Data
The time now is Tue, 23. Sep 14, 22:20

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2009
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.27412 seconds, sql queries = 75