The International Simutrans Forum

 

Author Topic: [BUG] After making Goods AI player, game crashes after a while  (Read 425 times)

0 Members and 2 Guests are viewing this topic.

Offline Ranran

  • Devotee
  • *
  • Posts: 1282
  • Languages: ja
Reproduction procedure:

(1) open the demo.sve

(2) In the pull-down list under player 4, select Goods AI and click the left checkbox.

(3) Wait a few hours in game time.

(4) The game will crash.


I have never seen a Cargo AI player made a stop. The version about two years ago might still be working, but I'm not sure. (´・ω・`)

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20341
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #1 on: August 30, 2020, 10:55:15 AM »
Thank you for the report. I should note that the AI code has not been substantively updated since I started work on Extended; it has only had such updates as are necessary for the code to compile and for the game not to crash.

I have fixed this crash, but I do not expect the AI to work. I have not done anything with the AI because it would be a truly enormous amount of work to make it work well with Extended and playing online with other people is more interesting.

I wonder whether the AI code should be removed or left in place for others to improve upon later if they would like?

Online Freahk

  • Devotee
  • *
  • Posts: 1354
  • Languages: DE, EN
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #2 on: August 30, 2020, 11:17:09 AM »
If it's not working anyway, please remove it.
The fact that nobody has reported the broken AI indicates, that there is no, or at least not much demand for an AI anyway.

If anyone was to implement a new AI, the squirrelAPI is the way to go.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20341
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #3 on: August 30, 2020, 01:17:06 PM »
If it's not working anyway, please remove it.
The fact that nobody has reported the broken AI indicates, that there is no, or at least not much demand for an AI anyway.

If anyone was to implement a new AI, the squirrelAPI is the way to go.

Thank you - that is helpful. It may be a while before I get around to doing anything about this; in the meantime, does anyone else have any views on this?

Offline freddyhayward

  • Devotee
  • *
  • Posts: 454
  • Languages: EN
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #4 on: August 30, 2020, 01:35:04 PM »
Thank you - that is helpful. It may be a while before I get around to doing anything about this; in the meantime, does anyone else have any views on this?
I support removing all AI code, and all squirrel API code, because both negatively affect the development of simutrans-extended for virtually zero benefit. As I have said elsewhere, it would be no more difficult to re-implement these from standard in the future than to attempt to resurrect the existing code.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10300
  • Languages: De,EN,JP
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #5 on: August 30, 2020, 03:22:23 PM »
The AI could be used to check for desyncs ... But removing the AI is really easy too.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20341
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #6 on: August 30, 2020, 03:26:11 PM »
The AI could be used to check for desyncs ... But removing the AI is really easy too.

Interesting - how would that work?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10300
  • Languages: De,EN,JP
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #7 on: August 31, 2020, 02:33:07 AM »
If you run the AI then it would build new routes etc. So one could check after which steps (i.e. adding convois to routes) the deviation occurs. But I think this would need the scripted AI, because the built in AI uses the direct call to local functions.

However, one could make the AI call the proper tools for each step, then one could use the for unit testing. Pre 87.xx.xx had something like that, but it was obsolete then.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20341
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #8 on: August 31, 2020, 10:25:48 AM »
If you run the AI then it would build new routes etc. So one could check after which steps (i.e. adding convois to routes) the deviation occurs. But I think this would need the scripted AI, because the built in AI uses the direct call to local functions.

However, one could make the AI call the proper tools for each step, then one could use the for unit testing. Pre 87.xx.xx had something like that, but it was obsolete then.

Thank you for clarifying. I suspect that updating the AI to work with extended would be very significantly more work than doing this manually, especially as losses of synchronisation caused by player interactions are generally much easier to diagnose than those which occur without player interactions.

Offline Ranran

  • Devotee
  • *
  • Posts: 1282
  • Languages: ja
Re: [BUG] After making Goods AI player, game crashes after a while
« Reply #9 on: September 02, 2020, 01:49:51 PM »
I was thinking that AI players wouldn't work only with goods AI, but passenger AI doesn't seem to work either. If we focus only on passenger AI, which is simpler than Goods, extended requires vehicle selection (class setting, comfort level selection) according to class demand, sophisticated behavior to set operation frequency according to demand will be.
I agree with Freddie. So until somebody wants to implement it, I'd like to comment out the code about it after the GUI overhaul. Because there are meaningless choices and dialogs (buttons that open) that are only in the way, which can confuse the player.