News:

Want to praise Simutrans?
Your feedback is important for us ;D.

[BUG] After making Goods AI player, game crashes after a while

Started by Ranran(Hibernating), August 30, 2020, 08:21:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran(Hibernating)

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. (´・ω・`)
(´・ω・`)シミュトランスのアップデート履歴(日本語) (※更新停止中)
bit.ly/3AuKHHP

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Sirius

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.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

freddyhayward

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.

prissi

The AI could be used to check for desyncs ... But removing the AI is really easy too.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(Hibernating)

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.
(´・ω・`)シミュトランスのアップデート履歴(日本語) (※更新停止中)
bit.ly/3AuKHHP