Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Blog post: Painting the Stars (02/07/20); Updated the Forum Rules and Guidelines (02/29/20)

Author Topic: [Archean order] market isolation bug  (Read 378 times)

enigmato

  • Ensign
  • *
  • Posts: 4
    • View Profile
[Archean order] market isolation bug
« on: February 11, 2020, 05:37:11 PM »

There is a (potentially) game breaking bug which makes some planets get inaccessible from the global market;

Affected planets seems to be random but the one I've got to reproduce is always in Galatia system.
Ancyra for repeated times, Derinkuyu mining station (either pirate or independent); Eldrus seems fine, for that I don't know.
These planets/stations gets no shipping due to this, plummeted stability and spamming extremely lucrative procurement missions for basic goods all day long, allowing player to just ship those from Samarra/Corvus system easily and get all the profit from the repeated mission.

I thought there might be some issues just outside the hyperspace (pirate blocking all the shipment or something) but after seeing this, 100% certain due to a bug;

https://imgur.com/poYcR5a

Getting outside and visited Eventide planet, global market seems just fine except there is no affected planets in the list. like hegemony forgot the existence of their own planet.
I was able to reproduce the issue only with lazylib enabled in Map Seed MN-1433555824374754340, nigh-default start. happened every time I tried starting a new game with the seed.
(the seed was shared with my friends to play together; so I insisted playing on that)

It was my first time with the mod but this led me to feel like exploiting (leveled & cashed up really quick); I am going to start anew with different seed.
I would really appreciate if mod devs take a look into it.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1082
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: [Archean order] market isolation bug
« Reply #1 on: February 11, 2020, 08:41:11 PM »

Hi there, thanks for the report! Also, thanks for confirming you've reproduced it with only lazylib and archean order installed (you shouldn't need lazylib unless you are also using console commands, other mods that require it, etc- just fyi- lazylib shouldn't be the problem here, though) That really helps!

Other things that will help:
Are you on the latest version of the mod? (1.3.4e) This helps me know if I am dealing with an older version's bug that could have subsequently been fixed or if this is brand new.

Does this occur immediately, or does it take a certain amount of time before the planets are affected and cut from the economy? I don't experience this, myself, upon new game starts when I've tested Eldrus' market, so if it is immediate then:

What operating system are you running Starsector on?

*EDIT*
I don't think this is the issue if it's only affecting Galatia, but just in case, this could be relevant if you find this problem on more planets outside of that system:

Spoiler
I got this figured out (I'm pretty sure).  :)

There is nothing I can do to fix this on my end because it depends on your operating system (please let me know what yours is so I can provide solutions to troubleshooting on the mod main page- if you get it to work), but your solution is to play around with the delimiters of the replace array for these particular files.

*EDIT* Sorry! This definitely isn't clear enough. I'm in too much of a hurry today it seems.

Anyway, for some relevant details:

1) The replace array is found in the mod_info.json file. See example below. You'll see the point where the market section starts is the last line of the first example. The full portion that needs to be edited is featured in the second example below the first one.

Example 1:
Code
{
  "id":"archeus",
"name":"Archean Order",
"version":"1.3.4d",
  "author":"Morrokain",
"description":"A complete rebalance of Starsector that focuses on smaller weapons, more fighters and a heavy addition of lore content. Almost all weapons and ships have been reworked to some degree and many added. Tutorials, tooltips, descriptions and hints have been updated to explain new facets of gameplay, or, use the Tactics Manual (.doc in mod folder) as a reference! Enjoy!",
  "gameVersion":"0.9.1a",
"modPlugin":"data.scripts.ArcheusModPlugin",
"jars": ["Archean Order TC v0.9.1a.jar"],
  "totalConversion":"true",
  "replace":["data\\weapons\\weapon_data.csv",
       "data\\hulls\\ship_data.csv",
       "data\\hulls\\wing_data.csv",
       "data\\config\\title_screen_variants.csv",
       "data\\config\\exerelinFactionConfig/hegemony.json",
       "data\\campaign\\sim_opponents.csv",
       "data\\campaign\\special_items.csv",
       "data\\campaign\\econ/aztlan.json",

.... etc

Example 2:
Code

         "data\\campaign\\econ/aztlan.json",
         "data\\campaign\\econ/arcadia.json",
         "data\\campaign\\econ/askonia.json",
         "data\\campaign\\econ/eos.json",
         "data\\campaign\\econ/isirah.json",
         "data\\campaign\\econ/canaan.json",
         "data\\campaign\\econ/algebbar.json",
         "data\\campaign\\econ/kumarikandam.json",
         "data\\campaign\\econ/magec.json",
         "data\\campaign\\econ/naraka.json",
         "data\\campaign\\econ/valhalla.json",
         "data\\campaign\\econ/samarra.json",
         "data\\campaign\\econ/mayasura.json",
         "data\\campaign\\econ/thule.json",
         "data\\campaign\\econ/tyle.json",
         "data\\campaign\\econ/yma.json",
         "data\\campaign\\econ/zagan.json",
         "data\\campaign\\econ/corvus.json",


2) mod_info.json is found in the Archean Order mod folder. It is at the top level of the mod. You can open it with Notepad.

See example image in the spoiler if this is unclear:

Spoiler

[close]

Now, for the fix:

Try replacing the market section only (seen above) with:

Code

         "data\\campaign\\econ\\aztlan.json",
         "data\\campaign\\econ\\arcadia.json",
         "data\\campaign\\econ\\askonia.json",
         "data\\campaign\\econ\\eos.json",
         "data\\campaign\\econ\\isirah.json",
         "data\\campaign\\econ\\canaan.json",
         "data\\campaign\\econ\\algebbar.json",
         "data\\campaign\\econ\\kumarikandam.json",
         "data\\campaign\\econ\\magec.json",
         "data\\campaign\\econ\\naraka.json",
         "data\\campaign\\econ\\valhalla.json",
         "data\\campaign\\econ\\samarra.json",
         "data\\campaign\\econ\\mayasura.json",
         "data\\campaign\\econ\\thule.json",
         "data\\campaign\\econ\\tyle.json",
         "data\\campaign\\econ\\yma.json",
         "data\\campaign\\econ\\zagan.json",
         "data\\campaign\\econ\\corvus.json",


Or:

Code

         "data\campaign\econ\aztlan.json",
         "data\campaign\econ\arcadia.json",
         "data\campaign\econ\askonia.json",
         "data\campaign\econ\eos.json",
         "data\campaign\econ\isirah.json",
         "data\campaign\econ\canaan.json",
         "data\campaign\econ\algebbar.json",
         "data\campaign\econ\kumarikandam.json",
         "data\campaign\econ\magec.json",
         "data\campaign\econ\naraka.json",
         "data\campaign\econ\valhalla.json",
         "data\campaign\econ\samarra.json",
         "data\campaign\econ\mayasura.json",
         "data\campaign\econ\thule.json",
         "data\campaign\econ\tyle.json",
         "data\campaign\econ\yma.json",
         "data\campaign\econ\zagan.json",
         "data\campaign\econ\corvus.json",


Or:

Code

         "data/campaign/econ/aztlan.json",
         "data/campaign/econ/arcadia.json",
         "data/campaign/econ/askonia.json",
         "data/campaign/econ/eos.json",
         "data/campaign/econ/isirah.json",
         "data/campaign/econ/canaan.json",
         "data/campaign/econ/algebbar.json",
         "data/campaign/econ/kumarikandam.json",
         "data/campaign/econ/magec.json",
         "data/campaign/econ/naraka.json",
         "data/campaign/econ/valhalla.json",
         "data/campaign/econ/samarra.json",
         "data/campaign/econ/mayasura.json",
         "data/campaign/econ/thule.json",
         "data/campaign/econ/tyle.json",
         "data/campaign/econ/yma.json",
         "data/campaign/econ/zagan.json",
         "data/campaign/econ/corvus.json",


Or:

Code

         "data/campaign/econ\aztlan.json",
         "data/campaign/econ\arcadia.json",
         "data/campaign/econ\askonia.json",
         "data/campaign/econ\eos.json",
         "data/campaign/econ\isirah.json",
         "data/campaign/econ\canaan.json",
         "data/campaign/econ\algebbar.json",
         "data/campaign/econ\kumarikandam.json",
         "data/campaign/econ\magec.json",
         "data/campaign/econ\naraka.json",
         "data/campaign/econ\valhalla.json",
         "data/campaign/econ\samarra.json",
         "data/campaign/econ\mayasura.json",
         "data/campaign/econ\thule.json",
         "data/campaign/econ\tyle.json",
         "data/campaign/econ\yma.json",
         "data/campaign/econ\zagan.json",
         "data/campaign/econ\corvus.json",


That kind of thing. Only replace the section that includes the "econ" part, however, or you may cause additional issues.
[close]

*EDIT 2*

I also remember a previously reported issue that was similar, so not sure if it's related but I don't remember complete market inaccessibility being the problem. Very lucrative commodity missions were, however. If this also occurs without any mods installed, it could be a Derinkuyu market issue:

Spoiler
Quote
The beginner Derinkuyu mining station. But also there is spam of other good trading opportunities. 
Station keep asking for 200 supplies. There were even double contract... I went to the base with 600 supplies and finished 2 contract with 100k.
It is simple really... this is not a multiplayer game, so u can make boundaries. U cant make machine beat a brain in this, just set a rule that if 1 run is made, there are no other in 1 year or so.... simple as that.
So it will handle it self automatically.

Gotcha yeah I get what you are saying code-wise. I'm not sure I have access to that portion of the code though. I could be wrong and I'll ask around to make sure, but post trade code is not accessible in the API afaik. That would be required to check if a trade was lucrative such as you suggest.

These were commodity missions? Or just a lucrative sell to a pirate market without a tariff? It seems like missions from your post (which are inherently supposed to be profitable) and if not or if you would like a cap on these missions to prevent them as being spammable, then I would suggest that you post in the suggestions sub-forum as that is not my design- that is vanilla and it would take changes on that front most likely.

*EDIT*

Per Alex: (thank you for being such a helpful dev!)  ;D

Ahh, I see. There's some stuff I need to work out there - apparently Derinkuyu suffers from the same or a related issue on new game start, but you could remove procurement missions entirely by removing them from the generic mission manager on every game load:

GenericMissionManager manager = GenericMissionManager.getInstance();

And then iterate over manager.getCreators() to remove whatever you like. And then, possibly, replace it with your own version.

My response:

Thanks for the information!  :)

I don't think I will go to that length most likely as it has the potential to break in future updates and be harder to maintain, but it's really awesome that this is possible.
[close]
« Last Edit: February 11, 2020, 09:02:47 PM by Morrokain »
Logged

enigmato

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [Archean order] market isolation bug
« Reply #2 on: February 12, 2020, 12:46:30 AM »

Thank you for the response, Morrokain!
Yes, I double-checked the version I downloaded and it is v1.3.4e, seems like the old bug persists in some changed form.
It occurs immediately after starting game (starting on non-faction start, fly from Jangala station to directly to Ancyra Station).
Weirdly Eldrus is spared(which makes in-system procurement possible for some of the missions for Ancyra/Denrikuyu), every time it is Ancyra and Mining station.

I am running Starsector on Windows 10 64-bit professional,
and I have JRE 1.8.0_131 set up on my system and set ENV_PATH to it. (It should not matter, because starsector runs on its own JRE, right?).

For the other systems, I doubt I have checked thoroughly but the only one I could find this happening was only Galatia system. I spent merely 4 hours and did not visit all the systems (especially systems owned by initially hostile factions) so I might missed some cases.

I will try the modification on the JSON files. Thanks!


EDIT 1: woot? path string with escape characters messes up? sounds likely, didn't came into mind at first because it is on Java which is supposed to be platform independent... makes me ashamed.

I use C#/Unity at work and this kind of problem is a rare encounter thanks to .NET / unity engine usually handles those chores...
« Last Edit: February 12, 2020, 05:29:54 AM by enigmato »
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1082
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: [Archean order] market isolation bug
« Reply #3 on: February 12, 2020, 08:33:48 PM »

Thank you for the response, Morrokain!
Yes, I double-checked the version I downloaded and it is v1.3.4e, seems like the old bug persists in some changed form.
It occurs immediately after starting game (starting on non-faction start, fly from Jangala station to directly to Ancyra Station).
Weirdly Eldrus is spared(which makes in-system procurement possible for some of the missions for Ancyra/Denrikuyu), every time it is Ancyra and Mining station.

I am running Starsector on Windows 10 64-bit professional,
and I have JRE 1.8.0_131 set up on my system and set ENV_PATH to it. (It should not matter, because starsector runs on its own JRE, right?).

For the other systems, I doubt I have checked thoroughly but the only one I could find this happening was only Galatia system. I spent merely 4 hours and did not visit all the systems (especially systems owned by initially hostile factions) so I might missed some cases.

I will try the modification on the JSON files. Thanks!


EDIT 1: woot? path string with escape characters messes up? sounds likely, didn't came into mind at first because it is on Java which is supposed to be platform independent... makes me ashamed.

I use C#/Unity at work and this kind of problem is a rare encounter thanks to .NET / unity engine usually handles those chores...

Always wanted to learn C#. I still have a unity class tutorial somewhere that I've been meaning to check out one of these days.

Anyway, just to confirm, did that solve it? Or is there still an issue to track down?
Logged

enigmato

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [Archean order] market isolation bug
« Reply #4 on: February 13, 2020, 09:38:14 PM »

Sorry for being late, my workplace has gone ablaze due to a system failure I had to do a whole-night stuff...

I looked into path string issue, but escaped reverse-slash should just work fine for windows (although this should be handled in code appropriately per operating system; otherwise it would make some trouble in non-windows system) so I don't think this is the issue.
Removing affected system from posting procurement mission won't be a true fix, these planets will have always deficit of anything (although they won't show up as profitable market as they are omitted in the global market, but you know it is there and you can just ship the goods to market and cash-in for any food or domestic goods...)

I opened up global market list for food consumer (as there can't be a inhabited planet/system with no consumption of food) and compared to the list of planets in the intel screen.
Yes, only affected planets are missing in the global market info as a food consumer : Ancyra and Derinkuyu Mining Station in Galatia.
Other planets are just fine. Doubted Ceyx as affected as well but actually it was Hesperus' moon, so not the case.

No other planets are affected. Eldrus is also in the Galatia system, but it is not affected.
Made several other start options but same results. It gotta be something gone wrong in the code, not the data I presume.
« Last Edit: February 13, 2020, 09:40:34 PM by enigmato »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 1548
    • View Profile
Re: [Archean order] market isolation bug
« Reply #5 on: February 14, 2020, 08:15:35 AM »

Ancyra and Derinkuyu Mining Station are removed from the economy until you finish the tutorial. If you haven't finished the tutorial or if Archean Order modifies/removes the tutorial, then there's your problem.
Logged

enigmato

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [Archean order] market isolation bug
« Reply #6 on: February 14, 2020, 11:30:52 AM »

Ancyra and Derinkuyu Mining Station are removed from the economy until you finish the tutorial. If you haven't finished the tutorial or if Archean Order modifies/removes the tutorial, then there's your problem.

As far as I know, currently AO forces player to skip tutorial; maybe it is not "skipped" properly then. hmm.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1082
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: [Archean order] market isolation bug
« Reply #7 on: February 14, 2020, 02:37:30 PM »

Well, the tutorial does have a bunch of modifications from the early release of the mod during .8 so there may be some new implementations of the market code for those colonies that came with .9.

I'll take a look, but to be honest I thought I had already accounted for that potential issue during the mods compatibility patch to the .9 update. I must be missing something but I'll report my findings here regardless. :)
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 1548
    • View Profile
Re: [Archean order] market isolation bug
« Reply #8 on: February 14, 2020, 07:58:01 PM »

TutorialMissionIntel.endGalatiaPortionOfMission() has most or all of the setting-things-right code. If enigmato's problem is the tutorial settings, then I think the critical part is putting them in the main economy group:
Code
ancyra.getMarket().setEconGroup(null);
derinkuyu.getMarket().setEconGroup(null);

Hopefully it's just that missing and nothing insidious.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1082
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: [Archean order] market isolation bug
« Reply #9 on: February 14, 2020, 10:07:04 PM »

Ah ok thanks! No I don't think that was there. Let me check the original implementation in case I missed anything else.  :)

It should go before:

Code
        Global.getSector().getEconomy().addMarket(ancyra.getMarket(), false);
        Global.getSector().getEconomy().addMarket(derinkuyu.getMarket(), false);

Correct?

I wonder why Eldrus works and the other two don't? I don't think Eldrus has that added either. I'll add it just in case.

Should be fixed in the next update if it works. I can't give you an experimental jar because the project is too far advanced in id updates for other files at the moment. It would likely break the currently released version.

*EDIT*

Yes that did it. This will be fixed in the next release. :)
« Last Edit: February 14, 2020, 11:20:09 PM by Morrokain »
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 1548
    • View Profile
Re: [Archean order] market isolation bug
« Reply #10 on: February 15, 2020, 04:36:43 AM »

Ah ok thanks! No I don't think that was there. Let me check the original implementation in case I missed anything else.  :)

It should go before:

Code
        Global.getSector().getEconomy().addMarket(ancyra.getMarket(), false);
        Global.getSector().getEconomy().addMarket(derinkuyu.getMarket(), false);

Correct?

I wonder why Eldrus works and the other two don't? I don't think Eldrus has that added either. I'll add it just in case.

By default, markets are placed in the null econ group. Ancyra and Derinkuyu, however, are set to their own groups in data/scripts/world/systems/Galatia.java

I'd expect you can set their group before or after adding them to the economy, but in this case it is already after because they are added to the economy in Galatia.java
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 1082
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: [Archean order] market isolation bug
« Reply #11 on: February 15, 2020, 12:03:02 PM »

Thanks again! I took a look at that file and now it makes sense. The original econGroup used in that file is the entity id instead of null.
Logged