Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon May 20, 2013 3:53 am

All times are UTC




Post new topic Reply to topic  [ 111 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Tue Feb 24, 2009 9:06 am 
Offline
Engineer
Engineer

Joined: Thu Jul 10, 2008 8:03 am
Posts: 9
I found another bugs in your AI
screens attached:


Attachments:
0.7.0., 8my Lis 1941.png
0.7.0., 8my Lis 1941.png [ 199.76 KiB | Viewed 2135 times ]
0.7.0., 17ty Maj 1946.png
0.7.0., 17ty Maj 1946.png [ 158.67 KiB | Viewed 2130 times ]

_________________
Image
Top
 Profile  
 
PostPosted: Tue Feb 24, 2009 6:04 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Thanks, never seen those. Might be that it went out of money.

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


Top
 Profile  
 
PostPosted: Thu Feb 26, 2009 3:53 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Jan 01, 2007 5:29 pm
Posts: 93
I don't know if this has been reported before - it looks slightly different to the ones above. I like this AI though it plays in exactly the same way as I do :D


Attachments:
Quigley & Co., 23-07-1953.png [398.9 KiB]
Downloaded 184 times

_________________
Formerly thanet-bomber.
Top
 Profile  
 
PostPosted: Thu Feb 26, 2009 6:58 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
thanet-bomber wrote:
I don't know if this has been reported before - it looks slightly different to the ones above. I like this AI though it plays in exactly the same way as I do :D


That's a new one.

Most likely that one is because it don't use the join distant stations feature that was just recently added to NoAI. So it tries to build the fourth bus station next to the airport, but fails because there is another adjacent station.

Thank you!

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


Top
 Profile  
 
PostPosted: Thu Feb 26, 2009 8:05 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Did you look at the open road vehicle window and where that vehicle is trying to go to?

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
 Profile  
 
PostPosted: Tue Mar 17, 2009 7:48 am 
Offline
Engineer
Engineer
User avatar

Joined: Wed Aug 06, 2008 12:56 pm
Posts: 9
I was found a bug for AI PAXlink vers. 7.0

Image

_________________
CHANTIERS INTERNATIONAUX DE JEUNES BENEVOLES
+ d'info: http://www.accjura.fr
Image
Draw and code by himself: aviable only if i understant actions codes! lol


Top
 Profile  
 
PostPosted: Tue Mar 17, 2009 10:07 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Mister Me wrote:
I was found a bug for AI PAXlink vers. 7.0

Image


It looks like you haven't downloaded the road pathfinder library. If you download via in-game content service you should have got the needed libraries with it, but apparently not. Or if you downloaded PAXLink from the forum, then you need to download the road pathfinder library manually.

Recently there was a change in paths for untared libraries. So if you have old libraries or you manually extracted them from the tar files, easiest is just to remove/rename the library directory and then download all AI libraries from the in-game content server.


Next time, please attach the image to the forum, as it is easier to view it then.

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


Top
 Profile  
 
PostPosted: Tue Mar 17, 2009 3:07 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Hello,

I've been working on the airport construction and management today.

* Taking teraforming into account when deciding where to build airport, and also teraforms the decided area so it become flat. This is an iterative process as the level land function may succeed in test mode, but fail to completely flattern the land in exec mode.

*Building of bus stations next to airport now is done by the airport maintenance code that is ran after an airport is constructed and then every now and then. If building a bus stop fails, then it places a rail way track cross on the bus station location to reserve it from being used by the road pathfinder as well as by other companies. A little bonus is that if you rename the town, then the airport is renamed next time it runs the maintenance code.

* Bus stops of an airport are now joined by passing the airport station id, instead of using join adjacent. Fixes a pug posted above.


But there is one bug, I'm getting both with PAXLink and TownCars which both share much code. See the screenshot below. In the red circle there is a road station. The problem is that the code thinks it is possible to connect to road, but it isn't. :s So I am waiting with releasing PAXLink8 until that is sorted out.
Attachment:
File comment: preview of paxlink8. But will not release it until bus station bug is fixed.
paxlink8.png [366.51 KiB]
Downloaded 101 times



On top of written above, there are some other changes I made previously, but not released and those relate to making PAXLink not expand to fast to new towns until current towns are served well enough.

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


Top
 Profile  
 
PostPosted: Wed Mar 18, 2009 1:37 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
And here it is,

PAXLink 8

The bug i wrote about above has been fixed. Also I added conditional orders to the AI. They are used when buses are in feeder mode, and if you think it is unfair that the AI can mass produce conditional orders, then there is a setting to turn of conditional orders in the AI settings.


When I start in 1970 on a 512x512 mountainous rough map with high sea level PAXLink performs equally good as AdmiralAI when I tested two games of about 5 years. In 1950 it bankrupts more than in later years. Still it has become better to not bankrupt. :-)

Also with the new teraforming code it handles mountainous maps better than before. One thing that can happen though is that a neighbour town get angry and forbid it to build the road stations of an IC airport. The tereforming has room for improvement, as it currently only consider leveling the land to the same heigh as the screen-wise uppermost tile of an airport.

[Edit] When constructing airports it now make sure it will accept passengers, so that it really can deliver passengers to it from another town.[/edit]


If you download the AI from here, make sure you get the road pathfinder library too.
Attachment:
PAXLink-v8.tar [89 KiB]
Downloaded 72 times


Update: Here is two screenshots demonstrating that the AI now keep trying to add more bus stops to airports from time to time.
Attachment:
File comment: One of the bus stops the yellow PAXLink player wanted to build at its airport was refused by a town. So it placed a railway track there as place holder.
Unnamed, 18th Apr 1972.png [317.6 KiB]
Downloaded 69 times

Attachment:
File comment: Later, the town become more friendly against the yellow company, and it could replace the tracks with a bus stop.

Here you also see a side effect from conditional orders. The estimated maximum number of buses per bus station don't hold anymore. But at this point a better load distribution than conditional orders to skip to last order when full is needed. As well as expansion of grid bus stations to multiple bus stations.

Unnamed, 19th Nov 1974.png [299.04 KiB]
Downloaded 67 times


Upgrade PAXLink in a running game
Remove all your old PAXLink-v*.tar files and download version 8 from the in-game-content system, and I as I understand it, OpenTTD will use version 8 of PAXLink, even if your game used version 7 or any previous version.

If your old game had bus stations that where unreachable because of the slope of the adjacent road, then the new PAXLink will remove these stations, and in most cases construct a new station at that grid location that can be accessed. (there is two thresholds for number of cargo within the catchment area, one for building new stations and one lower for removing existing, and the old station could in theory be below the new-station-threshold, and then a new one wont be constructed.)

This fixing code is ran every time it looks for constructing new stations in a town, so you can actually try cheating to the AI and rotate an existing road station so it faces a wrongly sloped road, and it will soon change it back as it used to be. :)

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


Top
 Profile  
 
PostPosted: Thu Mar 19, 2009 4:18 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Dec 27, 2002 9:25 am
Posts: 324
Still a lot of lag in this AI in the game and it runs very slow.


Top
 Profile  
 
PostPosted: Thu Mar 19, 2009 1:51 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
wozzar wrote:
Still a lot of lag in this AI in the game and it runs very slow.


When you say slow, what is slow?

There is an initial delay when you start it which might be due to that the timed tasks are not performed until one interval of time has elapsed. I have not checked this. But other than that I think it is quite fast. A problem has more been to reduce the expansion speed of it.

And lag, how does it lag? I mean of course if you run on fastforward the load changes a bit depending on if it is performing any task at the moment or not. But this hard to avoid I think. Or do you have problems in non-fast forward mode? Compared to other AIs?


But I should add that the AI is not optimized for speed at the moment. There are some computations that could be cached. But I have not made any measurement on how long time those things take so I don't really know which parts are worth spending time on trying to optimize for speed.


Also, what CPU/Memory do you have?

I have an single core CPU: Amd64 3500 (2.2 GHz) and 1.5 GB ram. Usually my web browser eats quite a bit of the memory and CPU time also. Even on 1280*2 x 1024 and with 1 PAXLink, AdmiralAI, FanAI there was no lag on non-fast forward mode. In fast forward is was not smooth, but that is pretty much the same for any AI that the load varies over time.

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


Top
 Profile  
 
PostPosted: Thu Mar 19, 2009 8:22 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Warning: There seam to be a serious bug in last PAXLink 8. The code that I added to remove bad stations, seam to remove all grid stations. :( Sorry for the problem that might have caused.

There is a new version on the way, I will edit this post when it is done.


Edit: seams to be something I have broken in my development version, as PAXLink 8 from bananas do not have this bug. Phew :)

Edit 2: Update - PAXLink 9
I'm not sure if I have fixed the problem, but I switched back and fourth between the old builder.nut and the new builder.nut, and is no longer able to reproduce the problem in PAXLink9. So I hope it is fixed, or it was a problem of reloading some file. But if you find this problem please report it. The symptom is that the AI removes all his bus grid stations (not those at the airport) and, if there is no bus stations at the airport, it will also remove all buses from the town.

Changes:
* #2, #3, etc is appended to the name if more than one PAXLink is present.
* Wait until vehicles move out of way if that hinders the AI from building a bus station or depot. (same as fixed in TownCars)
* Added restriction for airport placement, that not only the airport upper tile has to be closest to correct town, also at least one bus station need to be closest to the town that the airport is constructed for. This is to fix the problem when all bus stations would be closer to another town that just got angry because of teraforming, but if PAXLink don't have any service in that town, it will never get good rating there (or it takes very long, I don't know). Now at least one bus station should be possible to build
* I have disabled the code that makes the AI only retry building one bus stop until it succeeds, as that will cause problems if some bus stops are in another town. And one of the towns have too bad rating.


Things on the TODO:
* Reduce the number of bus stations in town to no more than necessary to supply the airport with passengers, so we don't get worse rating in town than necessary. (This is good for the next thing on the todo, as well as for keeping costs down.)
* Upgrading of airports. Currently large aircrafts are built on small airports which is not really good. And the small airport really get congested.
* If there is a demand for a new aircraft - don't build new buses. PAX that don't reach their final destination won't generate any cash.


Attachments:
PAXLink-v9.tar [89 KiB]
Downloaded 71 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
 Profile  
 
PostPosted: Thu Mar 19, 2009 11:05 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Dec 19, 2008 5:03 am
Posts: 305
Location: Indonesia
Download it :P

In your previous version (v 0.8 ) I 've got error "Division by zero"

But forgive me because I'm forget to capture the Debug panel screen, just want to check it again with the new version :lol:

_________________
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image


Top
 Profile  
 
PostPosted: Fri Mar 20, 2009 11:00 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Fri Dec 27, 2002 9:25 am
Posts: 324
From when the game starts it is pretty slow. And moving the mouse around is very slow and erratic.


Top
 Profile  
 
PostPosted: Wed Apr 15, 2009 9:40 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Update - version 10

Over the last weeks some updates have been made. There is still plenty of things to do before significant impact on the AI behaviour will be visible. The main reason for publishing this version now is the improvements to the code that apply an internal order list to a vehicle. The new code removes the flickering that was previously visible if you kept a order window open for a vehicle in feeder mode. (it constantly removed and added the conditional orders back again)

Another thing that has changed, that might not affect the behaviour very much, but still. That is that the AI now detects jam at stations, and uses that as limit for how many buses/aircrafts to buy, instead of hard limits based on number of stations and distance between them. - One problem now is however that if you block the road between two stations it will keep add vehicles until one of the stations is jammed.


But for completeness here is a list of things that has changed:
  • New TownManager that keep track of some statistics for stations in town, including how much jam there is at the stations.
  • Restricting building of vehicles is now based on statistics from TownManager rather than hard limits. (Though new hard limits on how much jam is allowed have been introduced)
  • Don't buy new buses for a town if the newest bus is younger than 25 days.
  • Don't build large aircrafts if at least one airport is a small airport or commuter airport.
  • Don't try to set buses in feeder mode if there is no bus stops at the airport.
  • OrderList::ApplyToVehicle have been reworked so that no changes are made to a order with conditional orders if all orders are correct. (the previous code purged all conditional orders, checked the normal orders and then added back the conditional orders. This resulted sometimes in strange behaviour of the buses as well ugly look of orders window) Unfortunately this breaks compatibility against 0.7.0 because of a bug present in 0.7.0 with the SetOrderJumpTo function that has been fixed in trunk.

And again, note that the AI is no longer compatible with 0.7.0. Unfortunately it seams that BaNaNaS don't provide 0.7.0 users with version 9 of PAXLink, so I might look into how to detect 0.7.0 and call the old function instead. To get PAXLink compatible with 0.7.0 again.


Attachments:
File comment: r16063 or later
PAXLink-v10.tar [105.5 KiB]
Downloaded 56 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
 Profile  
 
PostPosted: Wed Apr 15, 2009 9:55 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Update - version 11

Realized that I can check if SetOrderJumpTo fails, and if so call the old ApplyToVehicle function, this way it will work on older nightlies and 0.7.0 using the old apply order code. With r16063 and newer conditional orders will be treated in a better way.

Version 11 is already on BaNaNaS, and have been tested with 0.7.0 as well as with r16063. If you download manually, make sure you have the road path finder as well as the dependencies for the library installed.


Attachments:
PAXLink-v11.tar [110 KiB]
Downloaded 58 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
 Profile  
 
PostPosted: Thu Apr 16, 2009 9:52 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
One each day keeps the doctor away, here is todays bug fixes ;)

  • Bug fix for detecting jam at large airports. Only a very small part of the hold pattern area was checked.
  • Bus fleet was not reduced at some situations even if the airport was overcrowded.
  • Fixed a orders bug that caused buses in intra city mode (non-feeder mode) to have their orders change to feeder mode every time the town infrastructure was checked just to immediately have the orders changed back to intra city mode. This could make buses react on a conditional order and turn around at the street to go elsewhere than they originally headed to.



Edit: If you apply the fix FS #2842 sending buses to depot for selling will work properly. Without the patch you will get buses without orders driving around. Sometimes heading to the depot and sometimes not. With some luck and time they finally reach the depot while they have the status "go to depot".


Attachments:
PAXLink-v12.tar [109.5 KiB]
Downloaded 71 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 5:47 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Feb 07, 2008 2:06 pm
Posts: 370
Location: Glasgow
Congrats with your new version Zuu!

The bus behaviour is much improved IMHO, however in my games your AI still goes bankrupt as it doesn't do proper cost / benefit analysis. Sometimes it places the airports very close together so the airplane can't make enough profit to make up for the running costs of the busses. I think this is one of the major issues with your AI at this moment. If you place airports further away (at least to get to a break-even point) or uses more airplanes relative to the number of busses things should look better.

But nice work :).


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 8:06 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 3986
Location: /home/sweden
Thank you Morloth, and you are very right on what need to be done to make the AI better to "lift off". The only thing really related to cost/benefit is that it won't expand to new towns (== build infrastructure in new towns) until the existing one are served good enough.

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


Top
 Profile  
 
PostPosted: Fri Apr 17, 2009 4:02 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon Jan 15, 2007 9:45 pm
Posts: 653
Location: FRANCE
I am playing a game with PAXLink, as well as the street trafic AI. I have noticed that PAXLink uses town cars instead of buses. Surely that is because they are free, but I think in terms of gameplay it isn't fun to see an AI buildings scores of cars for nothing. Maybe you could set a minimum capacity for building vehicles...

_________________
I am little, ugly, and nasty. How do you do?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 111 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  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.