SimpleAI v14 - trying to remake the old AI
Moderator: OpenTTD Developers
Re: SimpleAI v1 - trying to remake the old AI
Well, the main obstacle of adding plane support is terraforming, I have no clear ideas for that. So that is something I cannot include in the near future.
About backward compatibility, my intention was that this would be the first 'official' version, so there are no more versions to be backward compatibile with... Anyway, I'll try to avoid 'index doesn't exist' crashes.
About backward compatibility, my intention was that this would be the first 'official' version, so there are no more versions to be backward compatibile with... Anyway, I'll try to avoid 'index doesn't exist' crashes.
Re: SimpleAI v1 - trying to remake the old AI
Brumi wrote:About backward compatibility, my intention was that this would be the first 'official' version, so there are no more versions to be backward compatibile with... Anyway, I'll try to avoid 'index doesn't exist' crashes.
Indeed. We can then call it the AI testers' old version compatibility check - limited edition.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v1 - trying to remake the old AI
Hi, Trying to run SimpleAI on a new trunk (18804) build, and having a rather odd problem.
Every time the AI tries to build a road route this happens, no idea why. I can't remember seeing it happen before, so I assume this was a new issue, maybe a grf?
Attached Screenshot and savegame, anyway.
Every time the AI tries to build a road route this happens, no idea why. I can't remember seeing it happen before, so I assume this was a new issue, maybe a grf?
Attached Screenshot and savegame, anyway.
- Attachments
-
- Allan & Co., 1985-10-29.sav
- (448.37 KiB) Downloaded 138 times
Re: SimpleAI v1 - trying to remake the old AI
I tried to open your savegame with the latest nightly (r18814), but OpenTTD crashed.
Then I tried to start a new game with your NewGRF configuration. Why does OpenGFX show up as a NewGRF in your list? Anyway, I downloaded the others and started a new game, but SimpleAI didn't show this strange behaviour. But OpenTTD acted weirdly, when I select a NewGRF to be added to the list, all NewGRFs beneath it are automatically added. Plus, I managed to crash OpenTTD from the NewGRF settings window.
Based on your screenshot, most likely the AI doesn't build roads correctly. The AI builds roads first, then places the station and the depot over them, like the top row in the picture. But when connecting two tiles, it builds like the right one in the second row, not like the one on the left. It results in the road formation seen in your screenshot, and the station cannot be placed over that. Anyway I have no idea why the AI builds roads that way.
Do the other road building AIs have this problem? And have you tried without NewGRFs?
Thank you for your report!
Then I tried to start a new game with your NewGRF configuration. Why does OpenGFX show up as a NewGRF in your list? Anyway, I downloaded the others and started a new game, but SimpleAI didn't show this strange behaviour. But OpenTTD acted weirdly, when I select a NewGRF to be added to the list, all NewGRFs beneath it are automatically added. Plus, I managed to crash OpenTTD from the NewGRF settings window.
Based on your screenshot, most likely the AI doesn't build roads correctly. The AI builds roads first, then places the station and the depot over them, like the top row in the picture. But when connecting two tiles, it builds like the right one in the second row, not like the one on the left. It results in the road formation seen in your screenshot, and the station cannot be placed over that. Anyway I have no idea why the AI builds roads that way.
Do the other road building AIs have this problem? And have you tried without NewGRFs?
Thank you for your report!
Re: SimpleAI v1 - trying to remake the old AI
With a newer version, I've loaded it up, reloaded the AI, and it worked, first time. No idea what the problem was, then.
OpenGFX shows up there likely because I haven't updated the GRF list since before the graphics set was made selectable in the main options screen. I've removed it now, I presume this bug was just a weird one from that earlier revision.
OpenGFX shows up there likely because I haven't updated the GRF list since before the graphics set was made selectable in the main options screen. I've removed it now, I presume this bug was just a weird one from that earlier revision.
Re: SimpleAI v1 - trying to remake the old AI
There was a bug with the road building API introduced a few days ago and was fixed yesterday.
Re: SimpleAI v1 - trying to remake the old AI
With the latest trunk revision, SimpleAI v1 gets stuck building unbuildable connection indefinitely. So much so that it doesn't even replace old vehicles:
.
.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v1 - trying to remake the old AI
I've already seen my AI doing something like that earlier, but I didn't find the place where it was stuck. I can't figure out the intended route here, either it is something with the pathfinder or the endpoints given to the pathfinder are wrong. Anyway, saving and reloading the game should work here.
The correction of the road is done recursively, so if I don't find any other solution, I may have to include some recursion depth check.
I'll try to test this issue further.
Thank you for the report!
The correction of the road is done recursively, so if I don't find any other solution, I may have to include some recursion depth check.
I'll try to test this issue further.
Thank you for the report!
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: SimpleAI v1 - trying to remake the old AI
It's always a good idea to have recursion also stop at a certain depth - regardless what the recursion endpoint is. Restarting, e.g. is not an as easy option, if you run an AI server-side.Brumi wrote:I've already seen my AI doing something like that earlier, but I didn't find the place where it was stuck. I can't figure out the intended route here, either it is something with the pathfinder or the endpoints given to the pathfinder are wrong. Anyway, saving and reloading the game should work here.
The correction of the road is done recursively, so if I don't find any other solution, I may have to include some recursion depth check.
I'll try to test this issue further.
I just got the funny idea to have AIs play against eachother on a head2head server
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: SimpleAI v1 - trying to remake the old AI
You're welcome.Brumi wrote:I've already seen my AI doing something like that earlier, but I didn't find the place where it was stuck. I can't figure out the intended route here, either it is something with the pathfinder or the endpoints given to the pathfinder are wrong. Anyway, saving and reloading the game should work here.
The correction of the road is done recursively, so if I don't find any other solution, I may have to include some recursion depth check.
I'll try to test this issue further.
Thank you for the report!
Perhaps you could make it so - if the AI can't build the road/rail, it goes back (possibly deleting its built road/rail like the old_AI did ) and then at the first square that is clear/sloped right continue in the right direction (I realise it could be difficult to implement).
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v1 - trying to remake the old AI
The route correcting algorithm is completely different for roads and rails. For rails, the AI deletes the last three tiles if obstructed and then tries again, this time from the other end. When obstructed while building a road, first the AI just 'ignores' it, and then tries to correct the holes. This works fairly well, so I don't intend to change it. Both algorithms are recursive, so I'll have to check the depth in both of them.
I tried to recreate the case in your screenshot using the scenario editor, but didn't experience this bug. Most probably the endpoints are given wrong when correcting the road, but I don't know why.
I'm planning a bugfix release when OpenTTD 1.0.0 is ready, because there are some slight changes to the subsidy system.
I tried to recreate the case in your screenshot using the scenario editor, but didn't experience this bug. Most probably the endpoints are given wrong when correcting the road, but I don't know why.
I'm planning a bugfix release when OpenTTD 1.0.0 is ready, because there are some slight changes to the subsidy system.
Re: SimpleAI v1 - trying to remake the old AI
I see.
Well - it probably wouldn't do much good if I send the save game. It was just a quick game (on fast forward of course) where I build a few basic things and then look at what AI makes from time to time - perhaps you can re-create the situation with my settings (I now usually call AI's when in-game, e.g. start_ai SimpleAI)...
Well - it probably wouldn't do much good if I send the save game. It was just a quick game (on fast forward of course) where I build a few basic things and then look at what AI makes from time to time - perhaps you can re-create the situation with my settings (I now usually call AI's when in-game, e.g. start_ai SimpleAI)...
- Attachments
-
- Fondinghead Transport - settings.png (34.4 KiB) Viewed 4284 times
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v1 - trying to remake the old AI
You (Brumi) might want to checkout if this is related to the issue I found when I checked some of the bug reports I got for CluelessPlus. (See my response here: http://www.tt-forums.net/viewtopic.php?p=852991#p852991 )SirkoZ wrote:With the latest trunk revision, SimpleAI v1 gets stuck building unbuildable connection indefinitely. So much so that it doesn't even replace old vehicles:
.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: SimpleAI v1 - trying to remake the old AI
Thanks for that, that might be the issue, but as far as I remember I have seen this one earlier in one of my games as well. But only this could be a valid reason why the AI cannot build something that is buildable according to the pathfinder
Anyway, planetmaker has a point there, so I will insert the recursion depth check. It should not take 10 or more tries to build a connection under normal conditions.
Anyway, planetmaker has a point there, so I will insert the recursion depth check. It should not take 10 or more tries to build a connection under normal conditions.
Re: SimpleAI v1 - trying to remake the old AI
Looks like terkhen solved the road/rail building getting stuck when encountering an obstacle. Very nice indeed. Haven't tested it with SimpleAI though...
- Attachments
-
- r18986-87_terkhen_NoAI_fix.png (2.42 KiB) Viewed 4209 times
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v1 - trying to remake the old AI
He's Dev? Since when?
My congrats!
My congrats!
Re: SimpleAI v1 - trying to remake the old AI
Since ~r18939, http://hg.openttd.org/openttd/trunk.hg/rev/e22eee302585Timmaexx wrote:He's Dev? Since when?
My congrats!
Re: SimpleAI v1 - trying to remake the old AI
Brumi - despite terkhen fixes for AI's to stop building when reaching an obstacle I still caught SimpleAI trying indefinitely while crying out ERR_LAND_SLOPED_WRONGLY.
That was yesterday with build r19053. And it happened quite late in the game, somewhen after 2020...
That was yesterday with build r19053. And it happened quite late in the game, somewhen after 2020...
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: SimpleAI v1 - trying to remake the old AI
Thanks I've already encountered this problem before that particular change in the OpenTTD, so this is rather a bug in my code. I will try to make a bugfix release after 1.0.0 stable is ready, because there are some changes in trunk, like the ability to change AI parameters ingame, so I will add support for that.
Re: SimpleAI v1 - trying to remake the old AI
That's nice. Perhaps you could look at (the only/example AI that used to be included with the trunk back when NoAI was first introduced) the WrightAI. It only builds air-routes and perhaps you could use some of its methods for SimpleAI.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Who is online
Users browsing this forum: No registered users and 21 guests