AIAI

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI zeta (46) version

Post by Kogut »

Known problems:
- train engines are not replaced
- adding trains to route is not working
- AIAI with enabled trains have worse start than with disabled
- not AI friendly brake vans in Japan Set
- stupid rail builder builds depot in stupid place
- too high pf time limit for second track
- RV with very small cargo capacity are confusing
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (40.71 KiB) Viewed 5483 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: AIAI zeta (46) version

Post by Zuu »

After a 35 year long AI battle (from 1950 to 1985), your AI is soon to get bankrupt.

I've noticed that your AI has very good serviced stations. Out of 80 stations, only two of them have waiting cargo. On many stations there are several trucks loading cargo. Perhaps some of these could be sold to give a better profit margin?
Sardingworth Transport, 9th Jul 1985.png
(181.17 KiB) Downloaded 1 time
Attachments
AI Marathon.sav
r22127
(697.19 KiB) Downloaded 111 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI zeta (46) version

Post by Kogut »

Selling should happen but my method is likely to be destroyed be LongVehicles.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
redheat
Engineer
Engineer
Posts: 2
Joined: 05 Apr 2011 14:41

Re: AIAI zeta (46) version

Post by redheat »

Having trouble installing the AIAI by hand (cant go online) - can you please advise?

I put graph.aystar-6 into ai/library, as well as queue.binaryheap-1.

Still I get the error that the library graph.aystar is not found. What's wrong?

Thx for your advise.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: AIAI zeta (46) version

Post by Lord Aro »

graph.aystar-4 is required for the road pathfinder (it should be updated, i know :) )
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
redheat
Engineer
Engineer
Posts: 2
Joined: 05 Apr 2011 14:41

Re: AIAI zeta (46) version

Post by redheat »

Ok I see.

Where can I find version 4? Its not linked any more on the bananas front page.

Edit:
Found it via goolge on
http://noai.openttd.org/downloads/Libraries/
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: AIAI zeta (46) version

Post by bokkie »

I was playing with some AI's in a cargodest game with some NewGRF's and AIAI was doing pretty well! It is pretty good at looking for opportunities in cargo delivery with vehicles. TransAI got bankrupt multiple times and SimpleAI didn't know what to do somehow so AIAI was the best AI by far.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI zeta (46) version

Post by Kogut »

bokkie wrote:I was playing with some AI's in a cargodest game with some NewGRF's and AIAI was doing pretty well! It is pretty good at looking for opportunities in cargo delivery with vehicles. TransAI got bankrupt multiple times and SimpleAI didn't know what to do somehow so AIAI was the best AI by far.
It sounds good!
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AIAI zeta (46) version

Post by Brumi »

In my recent test, I spotted this using the version of AIAI with train support:
Attachments
wagons in depot.png
(7.18 KiB) Downloaded 1 time
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI zeta (46) version

Post by Kogut »

Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI zeta (46) version

Post by Kogut »

Bugs:
Longvehicles bug: http://www.tt-forums.net/viewtopic.php?p=931701#p931701
Toyland bug: http://www.tt-forums.net/viewtopic.php?p=949897#p949897
Test map: http://www.tt-forums.net/viewtopic.php? ... 68#p774726

Known problems:
- train engines are not replaced
- adding trains to route is not working
- AIAI with enabled trains have worse start than with disabled
- not AI friendly brake vans in Japan Set
- stupid rail builder builds depot in stupid place
- too high pf time limit for second track
- RV with very small cargo capacity are confusing
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (49) version

Post by Kogut »

Known problems:
- RV with very small cargo capacity are confusing
- Test map: viewtopic.php?f=65&t=42468#p774726
- Sometimes after train upgrade AI should sell part of trains

FIXED: "for some reason hundreds of wagons are sitting in a train depot without a locomotive"
FIXED: adding trains to route is not working
FIXED: train engines are not replaced
FIXED: brake vans in Japan Set

Code: Select all

function RailBuilder::GetBrakeVan()
	{
	local wagons = AIEngineList(AIVehicle.VT_RAIL);
	wagons.Valuate(AIEngine.IsWagon);
	wagons.RemoveValue(0);
	wagons.Valuate(AIEngine.IsBuildable);
	wagons.RemoveValue(0);
	wagons.Valuate(AIEngine.CanRunOnRail, AIRail.GetCurrentRailType());
	wagons.RemoveValue(0);
	local cargo_list=AICargoList();
	for (local cargoIndex = cargo_list.Begin(); cargo_list.HasNext(); cargoIndex = cargo_list.Next()){
		wagons.Valuate(AIEngine.CanRefitCargo, cargoIndex);
		wagons.RemoveValue(1);
		}
	if(wagons.Count() == 0){
		Error("No brake van on the current track (" + AIRail.GetCurrentRailType() + ").");
	} else {
		wagons.Valuate(AIEngine.GetMaxSpeed);
		return wagons.Begin();
		}
	}
FIXED: airport selection bug (AIAI ignored small airport)
FIXED: bug in debugging function
FIXED: too many airplanes directed to airport
FIXED: bug on large-map-scan
FIXED: railtypes (Japan trainset etc)
CHANGED:"Longvehicles" bug: viewtopic.php?p=931701#p931701 (now it rather agressive and may start "sell RV->buy RV-> sell RV etc" cycle )
BROKEN: unable to load saves from previous versions
Superlib version bumped to 6
DONE: better error handling
DONE: max number of trains in station name
DONE: store depot tile location in station name
DONE: better behaviour in games with vehicles never expiry (floods of low quality aircrafts)
Attachments
AIAI-eta.tar
(287.5 KiB) Downloaded 132 times
Przechwytywanie.PNG
Przechwytywanie.PNG (62.5 KiB) Viewed 4505 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: AIAI eta (49) version

Post by Zuu »

Kogut wrote:Superlib version bumped to 6
In headers.nut, you import version 7. Also, mind that as far as I know, BaNaNaS have a limitation that you can only select the last version of a library as dependency. This unfortunately means that new users of OpenTTD will not get the correct SuperLib version when they select to download AIAI whenever you decide to upload this version to BaNaNaS.

If you don't feel like spending the time required to upgrade to SuperLib 13, you could include SuperLib 7 inside your source code. I think you would only need minor if any modifications to it to get it work. As long as you use GPL2 that would be perfectly legal even without my permission. It could however mean more work in the long run as well as duplicating code on bananas. But from a technical and legal point of view it is possible. Although, a better solution would be to fix BaNaNaS to allow dependencies to older libraries or pushing AIAI up to SuperLib 13.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AIAI eta (49) version

Post by planetmaker »

Zuu wrote:Although, a better solution would be to fix BaNaNaS to allow dependencies to older libraries or pushing AIAI up to SuperLib 13.
IIRC such work is (slowly) in the making.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (49) version

Post by Kogut »

Zuu wrote:In headers.nut, you import version 7
Strange.
Zuu wrote:pushing AIAI up to SuperLib 13.
It is planned.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (49) version

Post by Kogut »

Kogut wrote:
Zuu wrote:In headers.nut, you import version 7
Strange.
Zuu wrote:pushing AIAI up to SuperLib 13.
It is planned.

Code: Select all

import("util.superlib", "SuperLib", 7); //http://www.tt-forums.net/viewtopic.php?p=960013#p960013 - przed up do 10
from headers.nut
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (50) version

Post by Kogut »

New version, with additional bugfixes.
Attachments
AIAI-eta-50.tar
(287.5 KiB) Downloaded 92 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (50) version

Post by Kogut »

Random bugfixes, slightly better AI log.
Attachments
AIAI-eta-51.tar
(287.5 KiB) Downloaded 105 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (51) version

Post by Kogut »

New version, bananas ready!

DONE: SuperLib updated to v15
DONE: ConvertRailCrossingToBridge is imported in proper way
DONE: better debug output (still terrible)
FIXED: YA crash bug
Attachments
AIAI.PNG
AIAI.PNG (149.23 KiB) Viewed 4286 times
AIAI-eta-52.tar
(286.5 KiB) Downloaded 136 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AIAI eta (52) version

Post by Kogut »

As I noticed Superlib v15 is in a fruit store, so a new version of AIAI is ready for official publication!

EDIT: random stat, cumulated download count reached 169054. Woooho!
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests