AI Event: "vehicle is getting old" When should it be sent?

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
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

AI Event: "vehicle is getting old" When should it be sent?

Post by planetmaker »

A question for the AI authors. There currently is no event which indicates that a vehicle is getting old. Such event can be implemented, but the question is, when should the notification be sent?
* one year before the vehicle gets old?
* when the vehicle gets old?
* additionally every year after it has gotten old?

I think concensus is, that AIs only need one notification, but when?
See also the related FS task: http://bugs.openttd.org/task/5078
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: AI Event: "vehicle is getting old" When should it be sen

Post by krinn »

- 1 time only (first the AI cannot forget it like a human, even 1000 vehicles gets old at the same time, second, it might slow down openttd if the AI doesn't handle the event and openttd is sending all years X events because X vehicles are old and the AI doesn't handle vehicle age).
- 1 year before it reach old limit (as at old limit the vehicle breakdown are way too high already).

So my taste is one shot only, one year before date ; upto AI to handle it then ; openttd has done its job.
Thx to muxy (never really get time to try it).
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: AI Event: "vehicle is getting old" When should it be sen

Post by FooBar »

One year before is also when a human player first receives a message, right? It seems fair that an AI gets a similar message (i.e. event) at the same time.
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: AI Event: "vehicle is getting old" When should it be sen

Post by Brumi »

I would probably prefer it the same way as the human player receives these messages.
Krinn makes a valid point regarding the multiplicity, although sending the message multiple times may have a use if, for instance, sending the vehicle to depot fails for some reason.
But in the end I already coded the part which handles vehicles getting old, so even if this feature gets introduced, I probably won't use it anyway, so I'm perfectly fine with the one-time message...
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AI Event: "vehicle is getting old" When should it be sen

Post by Kogut »

The same way as the human player - to keep it simple, easier to understand and debug.
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: No registered users and 42 guests