Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Jun 19, 2013 12:48 pm

All times are UTC




Post new topic Reply to topic  [ 229 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 12  Next
Author Message
PostPosted: Tue Sep 29, 2009 7:18 am 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
Zuu wrote:
I check the age of the youngest vehicle of all the vehicles of a given connection and then don't build new buses if the youngest one is too young.

Thank you, that is really a good and simple idea, much better than adding extra variables. It's quite a shame I didn't think of it... :oops:
Eliandor wrote:
Awesome, congrats on another release.
I think there's a flaw in the logging. It says "I got the subsidy: PASS from (null: 0x00000000) to (null: 0x00000000)". It's a subsidy obtained by the use of Double Rail. The routes themselves have been built perfectly fine.

Thank you :)
That is again something with the new subsidy system, now the endpoints of already taken subsidies are towns/industries, not stations. The AI expects stations there. Anyway, it has no impact on the game, so I think the best is to simply skip that part of the code if the AI is run on the nightly. I'll surely correct it when this new subsidy system gets into the stable release.
This one is a bit strange for me: a subsidy obtained by the use of double rail? That means that subsidies tend to be longer than in 0.7.2. Do you know the new maximum distance for subsidies?
Eliandor wrote:
Suggestion: you only have two types of passing lanes in your library, right? One for North-South and one for East-West. You could try adding two more, for the same directions. If you're building passing lanes, check whether the station is more to the East of to the West, or to the North / the South (depending on the direction of the track), and flip the passing lane when applicable.
Mm complicated to explain. I'll add a screenshot of a situation where that would be a great thing to do in a second...

Do you mean... this?
Attachment:
passing lanes.png [103.16 KiB]
Downloaded 1 time

It should be quite easy to do.

Eliandor wrote:
Oh and also: you could consider adding even more passing lanes: for diagonal tracks as well :P but that's not really a big thing.

Another suggestion: let the number of passing lanes be dependent on the manhattan distance. At the moment it always builds two, that falls short for some routes.

I'd rather not code diagonal passing lane sections yet, they would be quite complicated compared to their usefulness.
And for the number of passing lanes, you're right, but I think that will come after V1, now save/load and engine replacing are more important.

Thank you all for testing! :D


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 4:25 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Mar 22, 2009 7:24 am
Posts: 81
Location: Haarlem, The Netherlands
Yes, that's the passing lane-type I meant. As for the subsidies: they sometimes cover the whole 256x256 map. I don't know about a maximum, but it's quite long. :P


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 7:45 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Brumi wrote:
My problem is that the effect of that new vehicle is seen much later, so I must prevent my AI from building a new vehicle on every loop. How do you do that in your AIs?


Since you asked... :D

Every route has it's own object. That object can be called to examine the route and to add and delete vehicles or even close a bad route. The route stores the last time it had a "checkup" and only performs them once a quarter.

This isn't literal code, since I don't want to dig it up. I call the checkup on each loop and each route controls weather it does one or not.

Code:
function Checkup()
{
    if(Gamedate < lastcheckup + 90)
   {
      AILog.Info("No checkup needed yet.");
      return;
   }

  ...
  //Checkup code.
}

_________________
Denver & Rio Grande Railroad AI


Top
 Profile  
 
PostPosted: Sat Oct 10, 2009 7:08 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
Two little additions to v5 would be nice (for consistency with the old AI):
-> Building HQ at AI's first station/service route
-> obeying the signal_side setting - I usually have it set on "false" because I want my trains to drive on left like with TTO/TTD and with that the signals to appear on the right side = outer side of the track - this only applies to two way meeting points on two train railways (my road vehicles drive on the right side though). :-)

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Sat Oct 10, 2009 8:26 pm 
Offline
Tycoon
Tycoon

Joined: Thu Apr 02, 2009 10:43 pm
Posts: 3007
Location: Massachusetts, USA
SirkoZ wrote:
-> Building HQ at AI's first station/service route


Or a setting saying where you want it.


Top
 Profile  
 
PostPosted: Sun Oct 11, 2009 10:44 am 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
I've been busy for quite a few weeks, so I didn't have much time and energy to develop my AI.
You're right, if I want to be a bit more consistent with the old AI, I'll have to change the HQ building behaviour. I was thinking of that earlier, but at that stage it was much easier to do it that way. Changing it shouldn't be too hard, as the HQ building procedure is quite independent from the other parts of the code.
The other one - do you mean that I should try to build signals on the outer side of the rails?


Top
 Profile  
 
PostPosted: Mon Oct 12, 2009 1:02 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
For my case - in "Options" I always have "drive on right" but under "Advanced Settings" I use "Do not show signals on the drive side" so I see them on the outer side of a two way railway (I use the left side for rail). So yes - it would look nice if all signals would be on the outer side (and also trains traveling on the left side). I hope I'm not complicating too much. :-)

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Sun Dec 27, 2009 5:15 pm 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
I know I'm a bit late for Christmas, but let me place a present under the Christmas tree: SimpleAI beta1. :) It's there in the first post. I regret that I couldn't do this earlier, but I was quite busy... Anyway, I hope that my AI hasn't been totally forgotten.
The first Bananas release is nearing, so it is not alpha anymore, I'm mostly done with the features intended for V1. It just needs some polishing (and of course your bug reports :) ), and V1 will be ready.
The main development was preparing the AI for a long-term game, which means save/load support, and the ability to switch to newer engines. You can see the changelog in the first post. Save/load is not the best yet, it may leave some rubbish on the map (although it shouldn't in most of the cases). It will cause problems if the game is saved while electrifying rail lines, so there is some work to be done until V1.
Merry Christmas! :D (OK I'm late but I have to say this)


Top
 Profile  
 
PostPosted: Sun Dec 27, 2009 5:47 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4029
Location: /home/sweden
Don't worry that you didn't make it to Christmas. Fixing all those last things usually takes longer than you think.

I've tried beta1 and found that it decided to remove a livestock line. An inspection shows that the farm only produces 12 livestock units per month so that decision might be valid. It was able to remove everything except for one depot. This depot contains two remaining livestock wagons.

Edit: that was probably not a bug, just that I paused the game at that moment. The depot seams to be gone now after I've unpaused for a while.

Good work with your ai!

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


Top
 Profile  
 
PostPosted: Mon Dec 28, 2009 11:46 am 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
That's quite an interesting case, even if it was not a bug. The AI is supposed to remove unprofitable vehicles first and then remove the stations if there are no vehicles attending them. And if those trucks had arrived to the depot from another line, then the AI would have failed to remove the depot. So, it's a bit strange... :?
Anyway, thanks for testing! :)


Top
 Profile  
 
PostPosted: Mon Dec 28, 2009 10:21 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
And now I'm late to thank you for the new beta release, Brumi. :D

Anyhow - thank you - will test the new version soon and Merry Christmas and a Happy New Year!

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Mon Dec 28, 2009 11:45 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
I just had to try the new version out real quick so I ran a game from 1950 till 1993 (OpenTTD 0.7.5, only_decrease neutraliser, temperate, mountain, 200k USD) so far and I must say it is great.
Cheers:
-AI replaces exploded road vehicles with new ones, build more than 5 if production allows,
-AI remakes the second train on a two-train track if production picks up,
-though Autoreplaces but still - old engines with faster ones.

Shortcomings:
-When at the start AI doesn't have enough money it only builds one two waggon train on a two-track-5-waggon trail. It should add additional waggons at a later date when it can afford them.
-sometimes it's scared to build a long bridge, e.g. it wanted to connect some oil wells with a refinery and the last stretch of tracks would have to be on the bridge, but didn't build it 'cause it would have been some 20 or more squares long. Without tubular as an option, it would have to have been the good ol' 112-km/h suspension bridge... :-)

I think I've listed all things for now. :mrgreen:

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Tue Dec 29, 2009 6:54 pm 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
Thanks for testing, it's good to see that the AI survives even under those conditions.
I have to add that currently the AI only works under 0.7.5 properly, as there seems to be a bug in 1.0.0-beta1 which has been fixed since then, you will see short trains running around in 1.0.0-beta1. See FS#3442 for details. If there is a SimpleAI user who uses 1.0.0-beta1, I can release my AI with a temporary fix, but later I would like to return to using AIVehicle::MoveWagonChain.


Top
 Profile  
 
PostPosted: Wed Dec 30, 2009 1:13 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
Yes indeed - I did test in 0.7.5 and I know of the FS#3442 and I thank you for reporting that one.
Even in 0.7.5 there are short trains running around sometimes when the AI doesn't have enough money to complete the whole train according to OldAI spec. (5-wag.). If wagons are added to such train at a later time it'll be nice.

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Fri Jan 01, 2010 7:27 pm 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
Happy New Year! :D
I'm mostly done with the features intended for the first Bananas release, so beta2 is out, downloadable in the first post.
The AI is now able to attach wagons to short trains, and it will build longer bridges. There is an option to make the AI slower as the times progresses, imitating human behaviour.
What I may do before V1 is a general vehicle checkup to avoid some bugs (e. g. vehicles sitting in the depot forever), but mainly this is what I would like to upload to Bananas.
Happy testing!


Top
 Profile  
 
PostPosted: Sat Jan 02, 2010 5:01 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
Works mighty fine. However for some reason one of them (5 instances started in snowy/hilly/200k map) crashed when trying to replace a loco with a newer one in the depot...
Here's the screen-shot (nightly r18683):
Attachment:
Donningville Transport, 12th Jul 1985.png
Donningville Transport, 12th Jul 1985.png [ 205.16 KiB | Viewed 848 times ]

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Sat Jan 02, 2010 11:02 am 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
Thank you for your report, it was a typo in my code. I fixed it in beta3, along with some minor optimizations, it's there in the first post. If there are no problems, this will be the version uploaded to Bananas. 8)


Top
 Profile  
 
PostPosted: Sat Jan 02, 2010 7:08 pm 
Offline
Tycoon
Tycoon

Joined: Thu Apr 02, 2009 10:43 pm
Posts: 3007
Location: Massachusetts, USA
Brumi wrote:
Thank you for your report, it was a typo in my code. I fixed it in beta3, along with some minor optimizations, it's there in the first post. If there are no problems, this will be the version uploaded to Bananas. 8)

Thanks for all the great work, Brumi. I have recommended your AI to many people so that they can use the old AI. :-)


Top
 Profile  
 
PostPosted: Sun Jan 03, 2010 2:22 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1464
Location: The sunny side of Alps
Simply marvelous! :-)

I'll give beta 3 a spin/fast forward.

EDIT: So far - with re-loading the game from yesterday ('1994) - all is functioning properly. Again a little marvel of an AI. :mrgreen:

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Mon Jan 04, 2010 12:25 pm 
Offline
Chief Executive
Chief Executive

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 647
petert wrote:
Thanks for all the great work, Brumi. I have recommended your AI to many people so that they can use the old AI.

Thanks for the PR management :)

There haven't been many bug reports recently, so I decided to upload my AI to Bananas (also available in the first post). 8)
Thank you all for testing!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 229 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 12  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 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-2013 phpBB Group

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