Page 1 of 3

AroAI - v1.2

Posted: 31 Jul 2010 18:23
by Lord Aro
AroAI - Lord Aro's feeble attempt at making an AI. Currently buses only.

Well, I've managed it. I've made my own working AI!
It can currently only use buses, but can max out the default vehicles count within 5 years and be sitting on a £2m pile of cash as well.
HQtown
HQtown
AroAI HQtown.png (335.53 KiB) Viewed 32948 times
Routes built in under 5 years
Routes built in under 5 years
AroAI Map.png (13.09 KiB) Viewed 32948 times
The AI uses 1.1 API so you have to have at least r20563/1.1.0-beta1 to use this!

Download it below or from Bananas.

Comments, problems and suggestions are always welcome.

AROAI CHANGELOG

Code: Select all

1.2 (2011-04-15)
------------------------------------
- Feature: New version system (r7-r13)
- Add: Don't reset the company information on load (r15)
- Add: Automatic versioning of readme.txt (r26)
- Change: Rewrite the readme (r24)
- Change: Add 96 to the version compared with the HG repo revision, so there are no incompatibilities caused by the lower version number (r19-r23)
- Change: Switch to openttdcoop hg repo (r-numerous)
- Change: Make the AI un-sexist (r18)
- Fix: A possible infinite loop if no path was found (r27)


------------------------------------ Archived Changelog from the SVN repo ------------------------------------
1.1.1 (2010-12-29)
------------------------------------
- Fix: A temporary fix for an invalid engineID (r96)
- Add: GetEventName() so AI can print event names (r95)
- Add: Some debugs (r94)
- Codechange: some variables were global when they didn't have to be (r93)
- Codechange: Put lots of numbers into constants (r92)
- Change: AutoRenewMonths to -6 (r91)
- Codechange: A variable didn't have a very explanatory name (r90)
- Fix: A building of road failure didn't actually stop the building of roads (r89)
- Doc: Standardise comments (r88)
- Codechange: Standardise some debugs (r87)
- Clean-up: Delete unused variable (r86)
- Fix: BuildBusStop() was using wrong sqrt function (built-in instead of in code) (r85)
- Codechange: Merge BuildRoadDepot() and BuildBusStation() functions (r84)
- Codechange: Combine some unneeded event manager variables (r83)
- Change: Warning debugs were actually errors(ish) (r82)
- Codechange: Merge 2 if statements because they had the same output (r81)
- Fix: Out of money debug was appearing more than necessary (r80)
- Fix: Event debug was appearing when it shouldn't have (r79)
- Change: Increased manageOnly sleeping time (r78)
- Codechange: Make coding style more like OpenTTD (r77)
- Codechange: Make the company naming block a switch block (r76)
- Codechange: Streamline the build bus route code a bit (r75)
- Fix: Another possible lock when another AI built where AI was going to build (r74)

1.1.0.1 (2010-08-22)
------------------------------------
- Fix: Debug not changed properly [Brumi] (r73)

1.1.0 (2010-08-21)
------------------------------------
- Codechange: Simplify the sign remover (r72)
- Change: A debug in loan management to something that makes better sense (r71)
- Feature: Build Bus Stations when drive through bus stations cannot (r70)
- Add: noai.openttd.org url (r69)
- Fix: Rewrite build depot code as when out of money the AI could freeze/not build the depot (r68)
- Change: Fiddle around with build route errors (r67)
- Fix: AIAbstractList has been replaced with AIList, so needed to upgrade. AI NOW REQUIRES r20563 OR LATER (r66)
- Feature: Deal with build road depot errors (r65)
- Change: An Error() to a Warning() in Stop(); to make it clearer (r64)
- Codechange: Rename debugs.nut to util.nut and move some functions into it (r63)
- Feature: Reformed debug output (r62)
- Feature: Events Manager (r61)
- Change: Some debugs in manager.nut (r60)

1.0.2 (2010-08-09)
------------------------------------
- Add: Forum url (r59)
- Fix: Variable not declared properly in vehiclemanager.nut (r59)
- Codechange: Rename moneymanager.nut to manager.nut in preparation for something... (r58)
- Fix: Display town name in GetTowns (r57)
- Add: Properly limit AI to management only when vehicle limit reached or unable to build bus route properly (r56)

1.0.1 (2010-08-02)
------------------------------------
- Fix: A debug output was an Info instead of a Warning (r55)
- Fix: When out of money, the AI would not build the route properly [Brumi] (r54)

1.0.0 (2010-07-31)
------------------------------------
First release of AroAI (r53)
- Feature: Bus support

See readme.txt for more info
AroAI-1.2.tar
(80 KiB) Downloaded 1740 times
Hope you enjoy the AI,
and that the first person to download it doesn't get an error straight away,
Lord Aro

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 06:44
by Lord Aro
(reserved for more screens)
My AI's first ever profit!
My AI's first ever profit!
AroAI FIRST PROFIT.png (52.76 KiB) Viewed 32804 times

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 09:05
by fanioz
Congratulation...
Lord Aro wrote:EDIT: i can't seem to upload it to bananas - Unexpected error while uploading
I've got that same error sometime ago, but that is because the unsupported license . So, what is the license you've set for the AI?

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 09:15
by Lord Aro
only gpl 2 :?

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 10:53
by fanioz
Thats right. What about the tar content? Is there any other text except ai script?

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 11:09
by Lord Aro
Its exactly the same as the download above

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 11:16
by Zuu
If you tried to upload to bananas the same tar file that you have uploaded to the forums, then you could try to create a new tar file where you remove the COPYING file. When you select the GPL 2 license on the upload page, it will try to add a standard COPYING file. When I reread the Terms of Service it does not actually state that you must not include a copying file if you select a non-custom license. The only thing could be is that they use lower-case letters for the COPYING, README and LICENSE files.

Re: AroAI - V1.0.0

Posted: 01 Aug 2010 18:06
by Brumi
Congratulations Lord Aro! :D Considering that you did it without any programming experience beforehand, it's a great achievement. :))

I gave it a short test (I will test it more of course :) ) and there was no crash. But the AI has problems when it doesn't have enough money to finish a road.
not enough money.png
not enough money.png (52.4 KiB) Viewed 32878 times
And again, congratulations for the first release :)

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 02:38
by Lord Aro
@Zuu

nope, removing the COPYING file hasn't worked
i'm trying to input this infomation, see anything wrong with it:

edit: remove attachments becasue problem fixed

@Brumi
Thanks! :D

@Brumi's AI problem
are you sure it was just that it didn't have enough money? could you possibly post the debug? because when it doesn't have enough money to build a road it's supposed to wait for a while (500 ticks) before trying again. In fact, i've seen it do it properly my self. Even so, expect an update soon!
Edit: although, i've never seen it have a problem with the same tile twice, so maybe that's the problem area

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 03:04
by fanioz
Have u tried to remove all file except only *.nut file?

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 03:17
by Lord Aro
just have!
no...

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 04:00
by fanioz
Last effort ...
Try upload this

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 04:57
by Lord Aro
thats got it! :mrgreen:
AI is now on BaNaNaS!!

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 07:51
by Brumi
Lord Aro wrote:@Brumi's AI problem
are you sure it was just that it didn't have enough money? could you possibly post the debug? because when it doesn't have enough money to build a road it's supposed to wait for a while (500 ticks) before trying again. In fact, i've seen it do it properly my self. Even so, expect an update soon!
Sorry I don't have the savegame, but I remember that there were many yellow 'Waiting for money' lines in the debug window. Later the AI seemed to turn to other things.

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 08:51
by Lord Aro
Update!

Changelog:
1.0.1 (2010-08-02)
------------------------------------
- Fix: When out of cash, the AI would not build the route properly (Brumi) 8)
- Fix: A debug output was an Info instead of a Warning

download in first post or off bananas

total downloads as of posting: ~16! :mrgreen:

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 09:08
by Rubidium
Lord Aro wrote:EDIT: i can't seem to upload it to bananas - Unexpected error while uploading
Congratulations! You are the first (of over 1000 BaNaNaS uploads) that used '(' or ')' in their filename, so we didn't know that that would break the uploading. Now it should be quite a bit sturdier and allow such uploads! Or in other words: the failure to upload should be resolved now.

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 11:30
by Zuu
Congratulations to getting your AI ready for a first release. I decided to give it a test run, but it had problems with my settings.

Problem:When building drive through stations on town roads is disabled, then the AI fails to build road stations instead of falling back to building them on new/own road.

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 11:38
by Lord Aro
Thanks Zuu, its near the top of my todo list (which is quite lengthy - 15+things - see readme or main.nut for full list)

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 14:42
by Samu
I don't see it on banana :(

Re: AroAI - V1.0.0

Posted: 02 Aug 2010 16:01
by Lord Aro
I'm going to be answering a lot of this - AroAI is the first AI released to use 1.1API (i think) so you need a recent nightly to use this