TownCars AI
Moderator: OpenTTD Developers
-
- Traffic Manager
- Posts: 173
- Joined: 06 Jun 2010 01:42
- Location: MALAYSIA
Re: TownCars AI
why do you even DARE to make such an AI? It does not do anything and it keeps going bankrupt and being replaced in perpetual motion at least 3 times a year on my games! But some kids who just love to see some "Your'e The Winner" message still use this AI because "they don't do much".
PS does it support LRVS?
PS does it support LRVS?
Re: TownCars AI
That ai is not designed to earn money in efficient/inefficient way. It is designed to pollute cities with small vehicles.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
-
- Traffic Manager
- Posts: 173
- Joined: 06 Jun 2010 01:42
- Location: MALAYSIA
Re: TownCars AI
yeah, and risk the city road traffic (buses trucks & trams) being clogged, delayed or even the game crashing due to processor overload.
Re: TownCars AI
TownCars AI (I can't speek of StreetTraffic as that's not my AI) has a property set that means that OpenTTD will never select it by random. So if you decided to explicitly use this AI, then you better read the description than complaining about it. It says in the description what the purpose of the AI is.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: TownCars AI
Yes, s*** happens.openttd_rulez wrote:yeah, and risk the city road traffic (buses trucks & trams) being clogged, delayed or even the game crashing due to processor overload.
Especially mind what Zuu tells you. Go and play your game as you like. But PLEASE stop the whining that there are people who play it differently than you and that people develop extensions which suit their playing style and not yours.
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: TownCars AI
I second planetmaker's post. And when you do want to complain about something, don't use language like
Remember that all AIs you can find in this forum are created in peoples free time (same holds for openttd itself and the newgrfs you can find on various places).why do you even DARE to make such an AI?
Re: TownCars AI
TownCars version 5
I noticed that TownCars 4 did not tell OpenTTD that it should not be selected as a random AI. I believe this is wrong behaviour for a non-competitive AI and has therefore released this update which adds the following code to info.nut:
Some strings has been tweaked here and there. I've also removed some redundant code and used my Helper class from SuperLib (version 6) instead of including an old version of it directly in the AI.
Download
Version 5 of this AI for manual download can be found in the first post. (there you also find a link to SuperLib)
I noticed that TownCars 4 did not tell OpenTTD that it should not be selected as a random AI. I believe this is wrong behaviour for a non-competitive AI and has therefore released this update which adds the following code to info.nut:
Code: Select all
function UseAsRandomAI() { return false; }
Download
Version 5 of this AI for manual download can be found in the first post. (there you also find a link to SuperLib)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: TownCars AI
town cars is a good player with busses
-
- Transport Coordinator
- Posts: 274
- Joined: 13 Apr 2010 21:31
Re: TownCars AI
Question: How does this AI replace its vehicles with newer models in later years? I'm guessing it build depots again but how do the vehicles get to these depots? Does it trust in the standard servicing behavior or does it order them into the depot?
The reason I'm asking is pretty severe: I just profiled an old savegame of mine, where I used this AI. The AI causes a massive slowdown of the game once the cars try to service. The "Road Vehicle Find Depot" function uses 83% of the frame time at that point, since the vehicles are unable to find one they constantly trigger the pathfinder.
I am trying to work around this by patching my personal code to never service or breakdown vehicles with 0 running costs and 0 initial cost. however if you do not order your vehicles do a depot specifically this would prevent the AI from upgrading them.
Can you comment on this?
The reason I'm asking is pretty severe: I just profiled an old savegame of mine, where I used this AI. The AI causes a massive slowdown of the game once the cars try to service. The "Road Vehicle Find Depot" function uses 83% of the frame time at that point, since the vehicles are unable to find one they constantly trigger the pathfinder.
I am trying to work around this by patching my personal code to never service or breakdown vehicles with 0 running costs and 0 initial cost. however if you do not order your vehicles do a depot specifically this would prevent the AI from upgrading them.
Can you comment on this?
-
- Transport Coordinator
- Posts: 274
- Joined: 13 Apr 2010 21:31
Re: TownCars AI
FYI: Fixed in on my end by adding this to bool Vehicle::NeedsServicing() const once the inital service check returns true:
That solves the problem I think and speeds up the game back to the original performance, despite TownCars
Code: Select all
/* Do we even have any depots/hangars */
uint rail_pices = 0;
uint road_pieces = 0;
for (uint i = 0; i < lengthof(c->infrastructure.rail); i++) rail_pices += c->infrastructure.rail[i];
for (uint i = 0; i < lengthof(c->infrastructure.road); i++) road_pieces += c->infrastructure.road[i];
if ((this->type == VEH_TRAIN && rail_pices == 0) ||
(this->type == VEH_ROAD && road_pieces == 0) ||
(this->type == VEH_SHIP && c->infrastructure.water == 0) ||
(this->type == VEH_AIRCRAFT && c->infrastructure.airport == 0)) {
return false;
}
Re: TownCars AI
This AI was written to spawn town traffic. Having depots staying around that cost maintenance did not fit into that picture. Thus the AI removes the depots and never add them back. The problem hat you mention of a high performance cost due to not having any depots was not known when the AI was written. Thanks for bringing it up thought. With that in mind it may be better to leave the depots if servicing is enabled in advanced options and instead be more clear that users should use cheats to make the company survive.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Transport Coordinator
- Posts: 274
- Joined: 13 Apr 2010 21:31
Re: TownCars AI
Well... it would already help if the AI didn't set service to "every 150 days"
if it set them to some percent of the original reliability the cars would probably never ask for service, since from what I can see, the NewGRF sets with vehicles for this to use don't decay...
if it set them to some percent of the original reliability the cars would probably never ask for service, since from what I can see, the NewGRF sets with vehicles for this to use don't decay...
Re: TownCars AI
Im quite sure that the AI does not touch that setting. Eg it uses the default value whatever it appears to be.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Transport Coordinator
- Posts: 274
- Joined: 13 Apr 2010 21:31
Re: TownCars AI
Hmm, pretty sure I didn't use that setting as my default. In any case, the AI should reset it to a percentage based value.
Re: TownCars AI
Actually, reviewing the API, I can't see any option for AIs to change the service frequency settings. (Vehicle API, Game Settings API. AIs can toggle auto renew here: AICompany)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Transport Coordinator
- Posts: 274
- Joined: 13 Apr 2010 21:31
Re: TownCars AI
Ah well... btw, when and how does your AI replace the vehicles with newer models?
Re: TownCars AI
Here are patched files of towncars using toylib (i clean my personal version to make it, well, fine for everyone).
Changes:
- bump to a v6
- Add toylib to pay expenses
- Add option to disable toylib usage (but toylib is enable per default)
- Alter all info.nut boolean to be INGAME swappable (so you can change your mind).
I hope some will enjoy.
Changes:
- bump to a v6
- Add toylib to pay expenses
- Add option to disable toylib usage (but toylib is enable per default)
- Alter all info.nut boolean to be INGAME swappable (so you can change your mind).
I hope some will enjoy.
- einsteinyh
- Engineer
- Posts: 46
- Joined: 15 Feb 2016 01:22
- Location: Bogotá
Re: TownCars AI
Is anybody maybe maintaining this AI? It cannot buy depots with NRT
- Attachments
-
- Captura.PNG (60.1 KiB) Viewed 2038 times
- justaplayer
- Engineer
- Posts: 40
- Joined: 12 Dec 2020 12:37
Re: TownCars AI
i have the same problem with the DROP Road set.einsteinyh wrote: ↑10 Jul 2021 06:48 Is anybody maybe maintaining this AI? It cannot buy depots with NRT
Just use the company changing cheat to create vehicles (i know that its not automatic but at least the you have cars , Right?)
Its just better than none
Re: TownCars AI
Check out CityLifeAI.einsteinyh wrote: ↑10 Jul 2021 06:48 Is anybody maybe maintaining this AI? It cannot buy depots with NRT
Who is online
Users browsing this forum: No registered users and 1 guest