Page 4 of 4

Re: TownCars AI

Posted: 07 Jun 2010 05:52
by openttd_rulez
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?

Re: TownCars AI

Posted: 07 Jun 2010 05:54
by Kogut
That ai is not designed to earn money in efficient/inefficient way. It is designed to pollute cities with small vehicles.

Re: TownCars AI

Posted: 07 Jun 2010 15:12
by openttd_rulez
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

Posted: 07 Jun 2010 17:45
by Zuu
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.

Re: TownCars AI

Posted: 07 Jun 2010 18:58
by planetmaker
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.
Yes, s*** happens.

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.

Re: TownCars AI

Posted: 07 Jun 2010 22:55
by Yexo
I second planetmaker's post. And when you do want to complain about something, don't use language like
why do you even DARE to make such an AI?
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).

Re: TownCars AI

Posted: 25 Mar 2011 23:12
by Zuu
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:

Code: Select all

	function UseAsRandomAI()  { return false; }
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)

Re: TownCars AI

Posted: 27 Mar 2011 03:17
by laserdog
town cars is a good player with busses

Re: TownCars AI

Posted: 24 Jan 2014 20:54
by KeldorKatarn
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?

Re: TownCars AI

Posted: 24 Jan 2014 21:49
by KeldorKatarn
FYI: Fixed in on my end by adding this to bool Vehicle::NeedsServicing() const once the inital service check returns true:

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;
	}
That solves the problem I think and speeds up the game back to the original performance, despite TownCars

Re: TownCars AI

Posted: 26 Jan 2014 09:57
by Zuu
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.

Re: TownCars AI

Posted: 26 Jan 2014 10:54
by KeldorKatarn
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...

Re: TownCars AI

Posted: 26 Jan 2014 13:33
by Zuu
Im quite sure that the AI does not touch that setting. Eg it uses the default value whatever it appears to be.

Re: TownCars AI

Posted: 26 Jan 2014 14:16
by KeldorKatarn
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

Posted: 26 Jan 2014 15:20
by Zuu
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)

Re: TownCars AI

Posted: 26 Jan 2014 16:01
by KeldorKatarn
Ah well... btw, when and how does your AI replace the vehicles with newer models?

Re: TownCars AI

Posted: 20 Nov 2014 17:30
by krinn
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.

Re: TownCars AI

Posted: 10 Jul 2021 06:48
by einsteinyh
Is anybody maybe maintaining this AI? It cannot buy depots with NRT :(

Image

Re: TownCars AI

Posted: 12 Jul 2021 16:14
by justaplayer
einsteinyh wrote: 10 Jul 2021 06:48 Is anybody maybe maintaining this AI? It cannot buy depots with NRT :(

i have the same problem with the DROP Road set.

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

Posted: 12 Jul 2021 20:02
by Firrel
einsteinyh wrote: 10 Jul 2021 06:48 Is anybody maybe maintaining this AI? It cannot buy depots with NRT :(
Check out CityLifeAI.