Maybe bribing? (can AIs bribe?)jui-feng wrote:Ah - Yes! That may very well be. However, the trees don't seems to help with the rating, as it's still bad (and no more tree space available ).
I wonder why Pathzillas rating is that awful? mh. And how did it burn almost 100k EUR for one city, marking only 20 or so tiles as "brown" (tree)? Last time I checked, trees were only EUR 50 or something.
But yeah. Maybe it's not a bug after all. I'm not sure.
PathZilla (v6) - A networking AI
Moderator: OpenTTD Developers
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: PathZilla (v5) - A networking AI
Re: PathZilla (v5) - A networking AI
WOW! Thanks for all the replies guys I can hardly keep up.
When selecting an engine the AI discounts expensive ones that it cannot afford. The problem is that when the AI runs out of money it cannot afford any of them and simply doesn't make a choice! There should also be a null check to allow it to fail gracefully.
Thanks for the report. Expect a fix in v6.
Incidentally, is the setting to allow DTRSs on town roads turned on in your game?
I was wondering if anyone would comment on the RAWR! This bug should be easy to fix.dbkblk wrote:Oops...the RAWR monster crashed again ...
When selecting an engine the AI discounts expensive ones that it cannot afford. The problem is that when the AI runs out of money it cannot afford any of them and simply doesn't make a choice! There should also be a null check to allow it to fail gracefully.
Thanks for the report. Expect a fix in v6.
Thanks again jui-feng. I think I know the kind of thing you are talking about. Eventually I will add a feature to detect bodies of water that cannot be bridged and forbid the pathfinder from trying to cross them. This will probably be in v7.jui-feng wrote:Hi again!
I "played" (watched?) another game. This time, I chose a hilly map and also there's more water than before.
First attempt: Pathzilla calculated a route between a small island and the main island over the span of the first year, before I cancelled it. Maybe it should break or pause the attempt after a certain reasonable time span.
Second attempt: Everything seemed to work nicely, however I noticed a strange behavior: Pathzilla burned a lot of money for "Sonstiges" (engl. misc?), which is pretty much for landscaping only.
I eventually noticed that sometimes the "Sonstiges" budget jumps up by 16k or something like that in a few seconds. At the same time, Pathzilla outputs a "Building road stations in XXX town" message and there are "brown" tiles near the town (see screenshot). Sometimes this repeats a few times, and sometimes Pathzilla succeeds in building stations and everything is okay.
However, sometimes all that (bombing? land raising?) leads to bad authority ratings, so red errors appear.
X_stream wrote:I think I can help you out on that last error.. if you want to call it one.
PathZilla tends to build trees around towns to boost the ratings
But it seems you play with trees set to transparant, so you only see brown squares where it builds trees.
It builds as many trees as it can until it either increases the rating above a certain level, fills the entire area around the town with trees, or spends more than a limit of £8,000 (€16,000) in one go. €240,000 per year is a bit excessive though! I might try to tune this a bit.jui-feng wrote:Ah - Yes! That may very well be. However, the trees don't seems to help with the rating, as it's still bad (and no more tree space available ).
I wonder why Pathzillas rating is that awful? mh. And how did it burn almost 100k EUR for one city, marking only 20 or so tiles as "brown" (tree)? Last time I checked, trees were only EUR 50 or something.
But yeah. Maybe it's not a bug after all. I'm not sure.
Incidentally, is the setting to allow DTRSs on town roads turned on in your game?
Yes but this costs a fortune! PathZilla will not start bribing until it has more than £3,000,000 available.CommanderZ wrote:Maybe bribing? (can AIs bribe?)jui-feng wrote:Ah - Yes! That may very well be. However, the trees don't seems to help with the rating, as it's still bad (and no more tree space available ).
I wonder why Pathzillas rating is that awful? mh. And how did it burn almost 100k EUR for one city, marking only 20 or so tiles as "brown" (tree)? Last time I checked, trees were only EUR 50 or something.
But yeah. Maybe it's not a bug after all. I'm not sure.
PathZilla - A networking AI - Now with tram support.
Re: PathZilla (v5) - A networking AI
Well, currently admiralAI seems to outperform Pathzilla every time i try, but I still like Pathzilla more.
DTRSs on roads are enabled (if that means "bus or post stops" ), and Pathzilla happily builds them all over the place. But somehow it spends really large amounts of money on trees (I disabled transparency to check that). The 16.000 EUR/go-limit seems to be pretty "useless", as there is only a few seconds of waiting time between two mainloop (?) iterations, so 16k pretty soon adds up to a few thousands, if there's enough space available. Also, it started growing trees when the rating was actually "good", so there should have been no problem.
The green belt still is a great feature. Maybe it should only do it if there are real problems (local authority doesn't allow building a station) or if the estimated cost of building the trees still makes building the stations worthwile.. I don't know.
Maybe some patch setting I use causes cities to be extremely strict about their ratings?
AdmiralAI doesn't grow trees and can still build stations without problems. And on top of that Admiral uses all the 1.000.000 EUR it can get as a credit. Pathzilla only goes in dept to a total of 500.000, resulting in a slower "start up speed".
I also noticed that AdmiralAI often "steals" (or rather shares) routes built by Pathzilla (very shortly after Pathzilla built them). That's also a reason why it performs better. Pathzilla doesn't steal Admiral's routes, but that's fine, since they probably don't fit into the Pathzilla network.
Thanks for the hard work. Just compare it to the original TTD AI.. I wonder if i'd be able to win a game vs. Pathzilla...
DTRSs on roads are enabled (if that means "bus or post stops" ), and Pathzilla happily builds them all over the place. But somehow it spends really large amounts of money on trees (I disabled transparency to check that). The 16.000 EUR/go-limit seems to be pretty "useless", as there is only a few seconds of waiting time between two mainloop (?) iterations, so 16k pretty soon adds up to a few thousands, if there's enough space available. Also, it started growing trees when the rating was actually "good", so there should have been no problem.
The green belt still is a great feature. Maybe it should only do it if there are real problems (local authority doesn't allow building a station) or if the estimated cost of building the trees still makes building the stations worthwile.. I don't know.
Maybe some patch setting I use causes cities to be extremely strict about their ratings?
AdmiralAI doesn't grow trees and can still build stations without problems. And on top of that Admiral uses all the 1.000.000 EUR it can get as a credit. Pathzilla only goes in dept to a total of 500.000, resulting in a slower "start up speed".
I also noticed that AdmiralAI often "steals" (or rather shares) routes built by Pathzilla (very shortly after Pathzilla built them). That's also a reason why it performs better. Pathzilla doesn't steal Admiral's routes, but that's fine, since they probably don't fit into the Pathzilla network.
Thanks for the hard work. Just compare it to the original TTD AI.. I wonder if i'd be able to win a game vs. Pathzilla...
Re: PathZilla (v5) - A networking AI
That's not true. It may not be as visible as with PathZilla, that's possible, but AdmiralAI does build trees if it can't build an airport or rail station.jui-feng wrote:AdmiralAI doesn't grow trees
It'll notice there is a route, but the "% transported last month" is still low (or even 0), because PathZilla just started transporting the goods. There is no way to determine whether the route has been there for several years and other companies are just providing bad service or whether it's a new route. The only way I can think of would be to save all found routes and use them if a year later there is still no good transportation but that would hurt performance (a lot).I also noticed that AdmiralAI often "steals" (or rather shares) routes built by Pathzilla (very shortly after Pathzilla built them).
/me starts a game with PathZilla to see how the latest version works
Edit: this must be a small bug, I forgot to save the game. Please tell me if a savegame will help you:
Re: PathZilla (v5) - A networking AI
Hey Yexo!
I didn't mean to say that your AI *can't* build trees at all, but it didn't do this in *my* Pathzilla/AdmiralAI game. So what I actually wanted to say is: Pathzilla spent more than 300k EUR on trees in 3 years, while AdmiralAI seemingly built no trees at all, thus having more money left for stations/vehicles/.. Which is basically a good thing, unless you consider trees a very important feature of OpenTTDs landscape.
And "stealing routes" is - usually - a clever thing I guess, so why fix it? Okay, maybe it's kind of bad if human players suffer from it..
Also, I'm really impressed by how fast your AdmiralAI raises it's network. I guess all AIs have their strengths, and I like the networking character of Pathzilla most, but that's just me. I'm always looking forward to new versions of any AI out there. It's very interesting to see them work.
I didn't mean to say that your AI *can't* build trees at all, but it didn't do this in *my* Pathzilla/AdmiralAI game. So what I actually wanted to say is: Pathzilla spent more than 300k EUR on trees in 3 years, while AdmiralAI seemingly built no trees at all, thus having more money left for stations/vehicles/.. Which is basically a good thing, unless you consider trees a very important feature of OpenTTDs landscape.
And "stealing routes" is - usually - a clever thing I guess, so why fix it? Okay, maybe it's kind of bad if human players suffer from it..
Also, I'm really impressed by how fast your AdmiralAI raises it's network. I guess all AIs have their strengths, and I like the networking character of Pathzilla most, but that's just me. I'm always looking forward to new versions of any AI out there. It's very interesting to see them work.
Re: PathZilla (v5) - A networking AI
This might surely hold for current API. Since the philosophy is that the AI should only be able to do things that the player can do I'd like to point out that using the query tool a player can determine when a station was built. Another way would be to look at the vehicles that service the station and see which age they have.Yexo wrote:There is no way to determine whether the route has been there for several years and other companies are just providing bad service or whether it's a new route. The only way I can think of would be to save all found routes and use them if a year later there is still no good transportation but that would hurt performance (a lot).jui-feng wrote:AdmiralAI doesn't grow trees
I just checked the API and it seams like it doesn't explicitly say that you can't get the station ID of a station that belong to another company. And with the station ID of another company then get a AIVehicleList_Station list. And then check the age of the oldest vehicle. But I guess you know better if that is possible/allowed or not.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: PathZilla (v5) - A networking AI
You only get some information about what your opponents are doing. Whether that is good thing or not, I don't want to discuss now (but feel free to open a new topic).Zuu wrote:I just checked the API and it seams like it doesn't explicitly say that you can't get the station ID of a station that belong to another company. And with the station ID of another company then get a AIVehicleList_Station list. And then check the age of the oldest vehicle. But I guess you know better if that is possible/allowed or not.
AIStation::GetStationID(tile) will return a StationID for station belonging to your opponents, but AIStation::IsValidStation will return false for that StationID (so every other AIStation fails on that id). About the station age, is that information usefull in any way? (Assuming you can only get the age of your own stations).
Re: PathZilla (v5) - A networking AI
It was most a suggestion on how you could solve your issue with knowing how old a connection is. Not something I will look into myself anytime soon.Yexo wrote:You only get some information about what your opponents are doing. Whether that is good thing or not, I don't want to discuss now (but feel free to open a new topic).Zuu wrote:I just checked the API and it seams like it doesn't explicitly say that you can't get the station ID of a station that belong to another company. And with the station ID of another company then get a AIVehicleList_Station list. And then check the age of the oldest vehicle. But I guess you know better if that is possible/allowed or not.
AIStation::GetStationID(tile) will return a StationID for station belonging to your opponents, but AIStation::IsValidStation will return false for that StationID (so every other AIStation fails on that id). About the station age, is that information usefull in any way? (Assuming you can only get the age of your own stations).
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: PathZilla (v5) - A networking AI
Thanks for the bug report Yexo. I thought I had fixed this!Yexo wrote:Edit: this must be a small bug, I forgot to save the game. Please tell me if a savegame will help you:
I wont trouble you for a save but can you remember anything unusual about the construction for the service? Perhaps there were no stations built at the other end? Had the AI run out of money?
Thanks.
PathZilla - A networking AI - Now with tram support.
Re: PathZilla (v5) - A networking AI
I am using version 15339 nightly. And i cant get PathZilla to work. I have four unnamed players not doing anything.
Re: PathZilla (v5) - A networking AI
Then you should make a screenshot of the ai debug panel (found under the red question mark, the rightmost button in the toolbar) and post it here. The errors are listed there.wozzar wrote:I am using version 15339 nightly. And i cant get PathZilla to work. I have four unnamed players not doing anything.
Re: PathZilla (v5) - A networking AI
As requested. Here is the debug panel.Yexo wrote:Then you should make a screenshot of the ai debug panel (found under the red question mark, the rightmost button in the toolbar) and post it here. The errors are listed there.wozzar wrote:I am using version 15339 nightly. And i cant get PathZilla to work. I have four unnamed players not doing anything.
- Attachments
-
- Unnamed, 23rd Jan 2003.png (76.57 KiB) Viewed 5216 times
Re: PathZilla (v5) - A networking AI
You're missing the aystar library.wozzar wrote:As requested. Here is the debug panel.Yexo wrote:Then you should make a screenshot of the ai debug panel (found under the red question mark, the rightmost button in the toolbar) and post it here. The errors are listed there.wozzar wrote:I am using version 15339 nightly. And i cant get PathZilla to work. I have four unnamed players not doing anything.
Did you download PathZilla via the content service? If not, try deleting the pathzilla.tar file you have now and then download it in game using the "Check online content" button. This will download the aystar library for you automatically.
PathZilla - A networking AI - Now with tram support.
- Zhall
- Tycoon
- Posts: 1237
- Joined: 17 Jul 2007 01:36
- Skype: moonray_zdo
- Location: Teh matrix, duh.
- Contact:
Re: PathZilla (v5) - A networking AI
Rawr Goes pathzilla! Truely amazing AI. The flashing cat strikes again, or the cat in hyperspace? Really i cant tell.
Last edited by Zhall on 05 Feb 2009 00:32, edited 1 time in total.
Formerly known as Sapphire United.
Learn Openttd
Learn Planetary Annihilation
Learn Orbit
Whose poo?
Learn Openttd
Learn Planetary Annihilation
Learn Orbit
Whose poo?
Re: PathZilla (v5) - A networking AI
Zutty. Thanks i have resolved that issue. How ever i have another problem. All the AI are building bus routes but the road is being blocked.
- Attachments
-
- Fletfinghill City Transport, 11th Jan 2003.png (88.5 KiB) Viewed 5206 times
Re: PathZilla (v5) - A networking AI
It looks like the area is busy. Judging by the debug output it has tried to build various roads in the same town and failed a few times.wozzar wrote:Zutty. Thanks i have resolved that issue. How ever i have another problem. All the AI are building bus routes but the road is being blocked.
This is probably due to other AIs competing for the limited space in that one town.
When I designed PathZilla I never expected people to want to run 8 AIs at the same time!! I'm going to have to change a few things to make it cope with situations like this better.
I have a few tweaks in mind for v6 that should help with this problem and also make it more efficient and robust.
Thanks I'm glad people like it.Sapphire united wrote:Rawr Goes pathzilla! Truely amazing AI.
Eh?The flashing cat strikes again, or the cat in hyperspace? Really i cant tell.
PathZilla - A networking AI - Now with tram support.
Re: PathZilla (v5) - A networking AI
I ran it on 2 ai and it still couldn't complete road or it couldn't find path. Does it build anything else besides buses.
Re: PathZilla (v5) - A networking AI
Currently, it only transports passengers and mail (by road, no airplanes or trains involved).
My observation is that Pathzilla has two problems when starting in the year 1980 with "rather big" towns.
edit: whoops, list screwed up a bit.
My observation is that Pathzilla has two problems when starting in the year 1980 with "rather big" towns.
- It tries to build a lot of stations (maybe up to 10) in every town it connects to the network (since these towns are big). With each station, the authority rating goes down a bit, soon forcing the AI to build trees. LOTS of trees. Maybe it would be better to just build a few stations in the beginning, then add more as the rating goes up because of a good transport service. But that's probably hard to implement.. I don't know.
- It fails to build enough vehicles. At least that's what I think. Passengers soon start stacking up at most stations as the town grows, but no new vehicles are built. In fact, I've never seen Pathzilla add new vehicles after establishing a fleet. I changed the formula for updating a fleet, so now the number of waiting passengers has a stronger impact on new vehicles, but still it's not good, probably worse than the original formula.. The problem is that it's only possible to add new vehicles to a "service", and then all the vehicles are somehow randomly distributed across the stations. I've seen a major station in a city without any busses that go there. In order to be efficient, the new vehicles should connect two stations which have a lot of cargo waiting or bad station ratings (or both). I know there have been some changes to the "updating fleet" code in SVN (CVS? BZR? HG? well, source control..). I haven't tried that, so maybe it's better in v6.
edit: whoops, list screwed up a bit.
Re: PathZilla (v5) - A networking AI
Thanks for the feedback jui-feng. (and sorry for my late reply).
Fleet sizes are a bit of an issue for me. I have done some tweaking so that v6 will have larger fleet sizes, and I have also added a setting to allow user control. The trouble is that the AI still builds ridiculous fleets. the code to calculate this is a follows...
The inital estimate is...
Once the service has beenc reated it is periodically modified by...
Where...
minAcceptance = Total amount of cargo acceptance for all stations in the smallest town in a service
waitingCargo = Total cargo waiting at all stations in all towns of a service
capacity = Cargo capacity of vehicle
distance = Distance between towns
speed = Speed of vehicle
The current year is a factor to make early vehicles profitable (e.g. eGRVTS's horse drawn carriages). The "traffic" setting is a value between 1 and 4. You can see that a higher value results in a larger fleet size. This isn;t set in stone. I'll happily change this if someone has a better suggestion.
For large cities that are close together it builds a minimal fleet (i.e. one per station), and for small villages that are very far away it WANTS to build thousands. I had to put a limit in place. I think I can fix this by reducing the distance term in the above calculations, but I still think the whole thing is a bit flawed.
Does anyone have any suggestions?
By the way, although I am very busy at the moment, v6 is still progressing. PathZilla now has crude industry support...
For some wierd reason it keeps building these loops around industries. I never told it to do that! Do you think this is ugly?
Plus I'm still deciding how to reconcile my networking approach with profitable routes that don't jam up very quickly. If I link industries directly then lots of extra roads are added, and support to town grids (2x2/3x3) is ruined, but if I link industries via towns then traffic gets ridiculous. Again, suggestions are welcome.
Fleet sizes are a bit of an issue for me. I have done some tweaking so that v6 will have larger fleet sizes, and I have also added a setting to allow user control. The trouble is that the AI still builds ridiculous fleets. the code to calculate this is a follows...
The inital estimate is...
Code: Select all
fleetSize = (PathZilla.GetSetting("traffic") * minAcceptance / (capacity * 2)) * ((distance * 3) / speed);
local year = AIDate.GetYear(AIDate.GetCurrentDate());
if(year < 1950) {
year = max(year, 1905);
fleetSize = (fleetSize * (year - 1900)) / 50;
}
Code: Select all
local year = AIDate.GetYear(AIDate.GetCurrentDate());
year = min(max(year, 1915), 1950);
local multiplier = (65 - (year - 1900)) / 2;
multiplier /= PathZilla.GetSetting("traffic");
fleetSize = (waitingCargo / (capacity * multiplier)) * ((distance * 3) / speed)
minAcceptance = Total amount of cargo acceptance for all stations in the smallest town in a service
waitingCargo = Total cargo waiting at all stations in all towns of a service
capacity = Cargo capacity of vehicle
distance = Distance between towns
speed = Speed of vehicle
The current year is a factor to make early vehicles profitable (e.g. eGRVTS's horse drawn carriages). The "traffic" setting is a value between 1 and 4. You can see that a higher value results in a larger fleet size. This isn;t set in stone. I'll happily change this if someone has a better suggestion.
For large cities that are close together it builds a minimal fleet (i.e. one per station), and for small villages that are very far away it WANTS to build thousands. I had to put a limit in place. I think I can fix this by reducing the distance term in the above calculations, but I still think the whole thing is a bit flawed.
Does anyone have any suggestions?
By the way, although I am very busy at the moment, v6 is still progressing. PathZilla now has crude industry support...
For some wierd reason it keeps building these loops around industries. I never told it to do that! Do you think this is ugly?
Plus I'm still deciding how to reconcile my networking approach with profitable routes that don't jam up very quickly. If I link industries directly then lots of extra roads are added, and support to town grids (2x2/3x3) is ruined, but if I link industries via towns then traffic gets ridiculous. Again, suggestions are welcome.
PathZilla - A networking AI - Now with tram support.
Re: PathZilla (v5) - A networking AI
That screenshot is great. I'm really looking forward to a new release! I don't think the loops are a problem. I might get the source from google code in the next days and try it out.
I changed the "update fleet" code so it loops through all stations in both towns of a service and adds new vehicles to any stations where the cargo rating is below 55%. If one town has a station with 53%, while the worst rating in the other town is 60%, it still connects those stations even though one station has a good rating. Of course, in order for this to function correctly, I had to disable your "load balancing" feature where all the vehicles of a service are "randomly" (not quite random, but you get what I mean?) distributed between all the stations whenever there is a new station built.
I soon noticed that this approach is not very useful, as it leads to very big traffic jams and useless buying of new vehicles (because of the traffic jam, the station ratings can not possibly go above 55%). So I introduced a limit to the amount of vehicles that are allowed to be connected to a station, but that's not very good either, as there's still a lot of traffic jams and I don't want to lower the limit. A traffic jam detection is what my "mod" needs in order to be efficient. I'm not sure how to do that (measure traveling time between the stations?). But still, I'm not sure if it could be any better than your current approach, just wanted to see how squirrel and your AI works.
I changed the "update fleet" code so it loops through all stations in both towns of a service and adds new vehicles to any stations where the cargo rating is below 55%. If one town has a station with 53%, while the worst rating in the other town is 60%, it still connects those stations even though one station has a good rating. Of course, in order for this to function correctly, I had to disable your "load balancing" feature where all the vehicles of a service are "randomly" (not quite random, but you get what I mean?) distributed between all the stations whenever there is a new station built.
I soon noticed that this approach is not very useful, as it leads to very big traffic jams and useless buying of new vehicles (because of the traffic jam, the station ratings can not possibly go above 55%). So I introduced a limit to the amount of vehicles that are allowed to be connected to a station, but that's not very good either, as there's still a lot of traffic jams and I don't want to lower the limit. A traffic jam detection is what my "mod" needs in order to be efficient. I'm not sure how to do that (measure traveling time between the stations?). But still, I'm not sure if it could be any better than your current approach, just wanted to see how squirrel and your AI works.
Who is online
Users browsing this forum: Google Adsense [Bot] and 16 guests