Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95a is out! (03/26/21); Blog post: Skill Changes, Part 2 (07/15/21)

Author Topic: [0.8.1a RC6] CTD with stations in hyperspace  (Read 2344 times)

Histidine

  • Admiral
  • *****
  • Posts: 3281
    • View Profile
    • Bitbucket profile
    • Email
[0.8.1a RC6] CTD with stations in hyperspace
« on: June 03, 2017, 10:06:09 PM »

Caused by scavenger fleets?
This potentially breaks a key feature of at least one mod (Exigency).

Code
110035 [Thread-5] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ClassCastException: com.fs.starfarer.campaign.Hyperspace cannot be cast to com.fs.starfarer.api.campaign.StarSystemAPI
java.lang.ClassCastException: com.fs.starfarer.campaign.Hyperspace cannot be cast to com.fs.starfarer.api.campaign.StarSystemAPI
at com.fs.starfarer.api.impl.campaign.fleets.RouteManager$RouteSegment.<init>(RouteManager.java:42)
at com.fs.starfarer.api.impl.campaign.fleets.RouteManager$RouteSegment.<init>(RouteManager.java:47)
at com.fs.starfarer.api.impl.campaign.procgen.themes.RuinsFleetRouteManager.advance(RuinsFleetRouteManager.java:65)
at com.fs.starfarer.campaign.BaseLocation.advanceEvenIfPaused(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
at com.fs.starfarer.campaign.save.CampaignGameManager.super(Unknown Source)
at com.fs.starfarer.title.TitleScreenState.dialogDismissed(Unknown Source)
at com.fs.starfarer.ui.N.dismiss(Unknown Source)
at com.fs.starfarer.ui.impl.O0oO.dismiss(Unknown Source)
at com.fs.starfarer.campaign.save.J.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.supernew.super(Unknown Source)
at com.fs.starfarer.ui.int.processInput(Unknown Source)
at com.fs.starfarer.ui.O0Oo.o00000(Unknown Source)
at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 18940
    • View Profile
Re: [0.8.1a RC6] CTD with stations in hyperspace
« Reply #1 on: June 03, 2017, 10:22:34 PM »

Odd thing is this hasn't changed from .8a, but yeah, that's a problem. Fixed it in the dev build.

Hmm - in the meantime, it can be worked around by setting the market size to 0 (it can still have the *condition* for whatever population is desired, as long as it's had .setSize(0) called on it. I don't think that would break anything else, though it could possibly have some consequences. Still, probably worth a shot.

Another option would be to go through every system on sectorgen and remove RuinsFleetRouteManager scripts, and replace them with a derived version that has that bug fixed.

(The dev version fix was adding:
if (market.getContainingLocation() == null) continue;
if (market.getContainingLocation().isHyperspace()) continue;

to the pickSourceMarket() method. So a derived version could just override that method and it'd be all good.)
Logged

Histidine

  • Admiral
  • *****
  • Posts: 3281
    • View Profile
    • Bitbucket profile
    • Email
Re: [0.8.1a RC6] CTD with stations in hyperspace
« Reply #2 on: June 03, 2017, 10:33:51 PM »

Thanks Alex!

We'd actually encountered the issue in 0.8a, but I'd assumed someone else had already reported it in PM at the time.

(Incidentally, DR raised the concern that other things are likely broken with hyperspace stations besides the crash reported here. So I quickly did a haxed Duzahk.java here that adds a hyperspace station; might be worth testing with.)
(EDIT: uncommented the part where it actually spawns the station)
« Last Edit: June 03, 2017, 10:36:50 PM by Histidine »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 18940
    • View Profile
Re: [0.8.1a RC6] CTD with stations in hyperspace
« Reply #3 on: June 04, 2017, 11:35:29 AM »

Yeah, it's not entirely impossible for something else to be broken, "markets aren't in hyperspace" could be an assumption made just about anywhere. I try to be careful about that sort of stuff, but sometimes things slip through.

Did run w/ your hyper station (thanks, btw!) for about a cycle and that seemed ok, though.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 3281
    • View Profile
    • Bitbucket profile
    • Email
Re: [0.8.1a RC6] CTD with stations in hyperspace
« Reply #4 on: June 07, 2017, 06:55:01 AM »

Left-clicking on a hyperspace station in the Tab map crashes the game, presumably from trying to show system info:
Code
java.lang.ClassCastException: com.fs.starfarer.campaign.Hyperspace cannot be cast to com.fs.starfarer.api.campaign.StarSystemAPI
at com.fs.starfarer.campaign.ui.intel.B.Ò00000(Unknown Source)
at com.fs.starfarer.ui.newui.J$7.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.newui.J.setCurrentTab(Unknown Source)
at com.fs.starfarer.campaign.CampaignState.showCoreUITab(Unknown Source)
at com.fs.starfarer.coreui.map.oOOO.o00000(Unknown Source)
at com.fs.starfarer.coreui.map.U.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.interface.processInput(Unknown Source)
at com.fs.starfarer.ui.V.o00000(Unknown Source)
at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 18940
    • View Profile
Re: [0.8.1a RC6] CTD with stations in hyperspace
« Reply #5 on: June 07, 2017, 09:41:41 AM »

Thank you, fixed - yeah, it shouldn't be showing the "system info" option there in the first place.

For a workaround:
hyperstation.removeTag(Tags.STATION);

That should do the job, and, as far as I can tell, won't have any repercussions.
Logged