The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended bug reports => Topic started by: Ranran(retired) on August 30, 2020, 08:21:25 AM

Title: [BUG] After making Goods AI player, game crashes after a while
Post by: Ranran(retired) on August 30, 2020, 08:21:25 AM
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. (´・ω・`)
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: jamespetts 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?
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: Mariculous 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.
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: jamespetts on August 30, 2020, 01:17:06 PM
Quote from: Freahk 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.

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?
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: freddyhayward on August 30, 2020, 01:35:04 PM
Quote from: jamespetts on August 30, 2020, 01:17:06 PMThank 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.
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: prissi 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.
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: jamespetts on August 30, 2020, 03:26:11 PM
Quote from: prissi 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.

Interesting - how would that work?
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: prissi 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.
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: jamespetts on August 31, 2020, 10:25:48 AM
Quote from: prissi 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.

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.
Title: Re: [BUG] After making Goods AI player, game crashes after a while
Post by: Ranran(retired) 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.