Page 28 of 32

Re: AdmiralAI v25

Posted: 14 Aug 2010 22:01
by Yexo
If you can reproduce that problem I'd like to see that savegame very much. It's something that is definitely not fixed between version 22 and 25, I suspect you have been changing newgrfs, but I'm not sure that is the cause of the problem. Even in that case I'd like to try and fix it in my AI.

Re: AdmiralAI v25

Posted: 15 Aug 2010 11:50
by iNVERTED
After updating to v25, I got a more serious crash:

http://www.tt-forums.net/viewtopic.php? ... 56#p896556

Re: AdmiralAI v25

Posted: 17 Aug 2010 12:32
by Flaggerdagger
Hi all,

I just got an error in a game where I played against seven Admiral AI's (v25).
I think the problem occured when Electric loc's were introduced and the (only) AI having trains tried to change his tracks into wired tracks.


Regards

Re: AdmiralAI v25

Posted: 18 Aug 2010 21:12
by Yisc
Hi, I'm playing a game against 3 AdmiralAI's and just ran into a crash of it.
I've attached a screenshot of the crash, a savegame which I made just after the crash and the last autosave before the crash.

Re: AdmiralAI v25

Posted: 18 Aug 2010 22:35
by Yexo
Flaggerdagger and Yisc thanks for your reports. I suspect that the save/load code is still not working correctly, I'm currently trying to fix this bug.

Re: AdmiralAI v25

Posted: 19 Aug 2010 16:20
by Steffl
It's a little bit offtopic, but it would be interesting for me: Is it really better to initialise variables with 'null'? Why not just set new variables to digital '0'?
I often read this error with the 'invalid type null' in bug reports.
I think you're really a good programer and you know what you are doing. So, what is the advantage of using null?

Re: AdmiralAI v25

Posted: 19 Aug 2010 16:38
by Yexo
This way I get a much better bug report. If I initialized the value to 0 I could get a "divide by zero" error a few lines later, which would then leave me wondering whether I forgot to initialize the value completely or whether the value was incorrectly initialized to 0. With null when I see the bug report I know immediately that I forgot to initialize this variable somewhere. Where exactly that is I still need to find out, but at least the cause of the bug is clear.

In this particular case when the value was initialized to 0 instead of null the AI would not crash but would instead build stations incorrectly. That would give other (much more obscure) bug reports, which are much harder to trace. In general I prefer a crash of the AI above unexpected behavior, because a crash if a lot easier to trace and fix.

Re: AdmiralAI v25

Posted: 19 Aug 2010 19:32
by Yisc
I've investigated a little more and started playing tonight with the already supplied autosave.
At the 1st of january 1967 the SH30 electric train is introduced and then again the AI crashed at the 12th of januari 1967. (which happened at the same date yesterday)
Hopefully this will give you some extra information to determine where it's going wrong.

Re: AdmiralAI v25

Posted: 23 Aug 2010 06:51
by Flaggerdagger
Lol! That was exactly the same with my game. When E-locs (SH30) were introduced, error came up.
Good luck with the fix! If you need any other info / files, just say so :)

Re: AdmiralAI v25

Posted: 31 Aug 2010 00:00
by SirkoZ
Another null/integer crash - in year 1974...
Screenie:

Re: AdmiralAI v25

Posted: 03 Sep 2010 18:10
by Yisc
I don't want to sound impatient, but any chance this problem will be fixed soon?

Re: AdmiralAI v25

Posted: 02 Oct 2010 11:57
by Lord Aro
not a bug as such, but while running the AI trains only i got this train jam:

Re: AdmiralAI v25

Posted: 24 Oct 2010 13:01
by Moriarty
Running v25 with FIRS and the Japanese trainset. The AI builds a valid route between unserved stations, it builds a train, it gives the train orders, but it doesn't start the train. The reason is because the particular wagons it's using for that train require a brake-van but the AI doesn't build one. Is there a way for Admiral to discover this requirement without it having to be hard-coded for each GRF?

Re: AdmiralAI v25

Posted: 24 Oct 2010 14:11
by Yexo
Unfortunately not, because there is no way for the newgrf to specify that requirement to OpenTTD other than by disallowing to start the vehicle (which can be for a number of reasons). What AdmiralAI can do is detect the failure to start the vehicle and not build that combination of engine+wagons again. It'll have to rediscover that ever game, so it's not a very good solution but better than nothing.

Re: AdmiralAI v25

Posted: 26 Oct 2010 14:46
by Lord Aro
hmm.

i could swear that i saw SimpleAI add a brake van to one of its trains...
I'd confirm it now but my computer is out of action :(

Re: AdmiralAI v25

Posted: 26 Oct 2010 15:05
by Brumi
Lord Aro wrote:i could swear that i saw SimpleAI add a brake van to one of its trains...
??? Really? :D
SimpleAI doesn't have support for NewGRF trainsets. It may work in some cases, but the term 'brake van' is unknown for SimpleAI.
I think you saw a mail wagon attached to a passenger train instead... :wink:

Re: AdmiralAI v25

Posted: 26 Oct 2010 15:10
by Lord Aro
nope, was definately a brake van, i checked on the train info :?

Re: AdmiralAI v25

Posted: 26 Oct 2010 15:12
by Yexo
Can you provide a savegame where simpleai does that?

Re: AdmiralAI v25

Posted: 26 Oct 2010 17:07
by Lord Aro
ok, i take that back.
I can't find the savegame a originally noticed it in, but testing shows that it was probably UKRS2 with it adding a lookalike on the end of the train

Sorry for wasting your time :lol:

However, perhaps this is something to add to the NewGRF/AI spec? Whether the wagon needs a brake van or not, and defining a brake wagon. Perhaps?

Re: AdmiralAI v25

Posted: 09 Nov 2010 23:20
by Yisc
Any news about a possible new version of this AI?
I would really like to play on with it, but am still stuck with this crash when SH30 is introduced.