Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Aug 18, 2018 2:23 pm

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: EmotionAI
PostPosted: Mon Jun 11, 2018 7:51 pm 
Offline
Engineer
Engineer

Joined: Mon Jun 11, 2018 7:48 pm
Posts: 3
HEY, everyone!

EmotionAI is my first attempt to create an AI that responds to an interaction
from other players.
AI in OpenTTD in general are pretty "dumb" in a way that if you start making
their existance hard, for example place a road blockade on a path, they will
do nothing about that and start loosing heavy money on that path.

So EmotionAI "scans" her paths and is looking for a intervention from other players,
if something like this is found she will make adjustments to that path (build a
workaround or so on).
EmotionAI checks if some player:
- destroyed a path
- tries to steel material from her stations
- tries to block her path
- destroyed a path in form of her depot

EmotionAI also has a mechanism to "attack back" the author of those things.
She has a model, in which she stores player's "karma" points and if they have low
enough makes an attack back.
Attack include:
- blocking players path with road blockade
- destroying his road tile in a path of his vehicles
- buys rights/advertisement/rebuilds roads in a players city
- surrounds his city with rails in order to stop the city growth

The building and money portion of the AI is from SimpleAI by Brumi.

Hope you like the AI, if interested leave a comment below. :)


Top
   
 Post subject: Re: EmotionAI
PostPosted: Mon Jun 11, 2018 8:13 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Nov 18, 2010 7:48 pm
Posts: 263
I never knew I needed GrieferAI.
Now my life is complete, as I can perfectly simulate network games while offline.
The only thing it lacks right now is some 'lol nub pwnd' chat messages.


Top
   
 Post subject: Re: EmotionAI
PostPosted: Mon Jun 11, 2018 8:31 pm 
Offline
Engineer
Engineer

Joined: Mon Jun 11, 2018 7:48 pm
Posts: 3
It's not exactly a GreferAI in the sense that it greefs you.
EmotionAI (the stat that it is right now) will only attack you if you really try to make a lot of damage to it.
Maybe for future work there can be implemented a setting which will determine the likelihood of an attack to other companies.


Top
   
 Post subject: Re: EmotionAI
PostPosted: Mon Jun 11, 2018 9:05 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Nov 18, 2010 7:48 pm
Posts: 263
Simply decrease the karma value each month for the nearest player., and it will be perfect high-challenge AI ;)


Top
   
 Post subject: Re: EmotionAI
PostPosted: Wed Jun 13, 2018 6:35 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 881
Wow, another fork of SimpleAI, I'm honored :)

I tried for a while, but I fail to see how she attacks other players. Did the classic destroy-trucks-with-trains thing, set Player::DEFAULT_KARMA_POINTS to 0, but still haven't seen an evil move... Of course, she builds another route around the level crossing when I destroy her trucks, so destroying the trucks is a bit tricky :)


Top
   
 Post subject: Re: EmotionAI
PostPosted: Thu Jun 14, 2018 11:17 pm 
Offline
Engineer
Engineer

Joined: Mon Jun 11, 2018 7:48 pm
Posts: 3
Brumi wrote:
Wow, another fork of SimpleAI, I'm honored :)

I tried for a while, but I fail to see how she attacks other players. Did the classic destroy-trucks-with-trains thing, set Player::DEFAULT_KARMA_POINTS to 0, but still haven't seen an evil move... Of course, she builds another route around the level crossing when I destroy her trucks, so destroying the trucks is a bit tricky :)


I didn't implement the detection of destroying truck with trams, as it could be just a luck (not effect intentional from other player). Also it could be tricky to decide who did it (because only the event gets passed that your vehicle was destroyed, no inication where it was rammed).

If you want to see EmotionAI do some harm try to play agains her and just cassually build some routes, best if you build truck routes between cityes. Then make a train blockade on one of her routes or build a lot of stations around one of her stations. She will decite what to do with you (if you have more karma point she will just buy rights in your citys or advertize there, if you have low karma point she will make train blockade on your paths, build rails around your city, or a heliport in your city. "your city" means that you have a good reputation in the city). :)

I will try to implement more decisions in the future or maybe change the karma system.


Top
   
 Post subject: Re: EmotionAI
PostPosted: Mon Jul 30, 2018 8:56 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4537
Location: /home/sweden
zuma wrote:
I didn't implement the detection of destroying truck with trams, as it could be just a luck (not effect intentional from other player). Also it could be tricky to decide who did it (because only the event gets passed that your vehicle was destroyed, no inication where it was rammed).


There is AIEventVehicleCrashed::GetCrashSite which should give you the tile where the vehicle crash occurred. But you still need to check ownership of nearby rail tiles to try to resolve a company to blame.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: EmotionAI
PostPosted: Fri Aug 17, 2018 4:06 pm 
Online
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 215
EmotionAI crashes with a "too long to start" message on a 4096x4096 map.


Attachments:
Unnamed, 1950-01-02#4.png [104.67 KiB]
Not downloaded yet

_________________
Formerly known as Samu
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Wormnest, xarick and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.