Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Mar 25, 2019 5:08 am

All times are UTC




Post new topic  Reply to topic  [ 167 posts ]  Go to page Previous 15 6 7 8 9
Author Message
PostPosted: Wed Feb 24, 2016 3:27 am 
Offline
Engineer
Engineer
User avatar

Joined: Mon May 19, 2008 9:48 pm
Posts: 18
Location: Peterborough, Ontario
Hi,

I don't have a rock-steady case for reproducing the issue, but the AI I'm working on seems to run into it eventually on big enough maps. Where can I download your patch for testing?

Thanks for the guidance regarding making patches - I have a bit of knowledge of git but am still learning all the ins and outs, so I appreciate the information.


Top
   
PostPosted: Wed Feb 24, 2016 7:59 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4549
Location: /home/sweden
Hey,

I forgot to attach the patch file. I've edited my post and added it now. :-)

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


Top
   
PostPosted: Wed Feb 24, 2016 8:39 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon May 19, 2008 9:48 pm
Posts: 18
Location: Peterborough, Ontario
Perfect, thanks, I've got it now.

At a glance, it seems to match my changes. I'll spend some time testing your patch and report back.

EDIT:

Running your patch throws an error - the iterator falls out of scope after the end of the for... loop in DoPathfinding. The attached patch just moves the declaration if it a line earlier. With that applied, it looks like everything works well and the issues in my last post are all resolved.

I'm going to keep poking around and see if anything else comes up, but for now it looks good to me.


Attachments:
File comment: Apply after zuu's patch
error.patch [430 Bytes]
Downloaded 62 times
Top
   
PostPosted: Tue Dec 20, 2016 8:36 pm 
Offline
Engineer
Engineer

Joined: Fri Dec 16, 2016 2:11 pm
Posts: 13
Is somewhere documentation please?


Top
   
PostPosted: Wed Dec 21, 2016 12:25 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4549
Location: /home/sweden
The documentation is included in the tar file. There is a readme file with introduction and pointers for where to find further documentation.

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


Top
   
PostPosted: Sat Apr 01, 2017 9:45 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4549
Location: /home/sweden
Version 40
I have made an update to SuperLib that fixes that RoadBuilder would not timeout.

If you use SuperLib.RoadPathFinder directly in your AI or library, you need to update your code, as I have fixed it to now behave as documented. If you only use RoadBuilder, then the interface has not changed.

Changelog:
Code:
Fix:
- RoadPathFinder::FindPath and ::GetFindPathError was not responding as documented
- RoadBuilder timeout was not working
- Road::GrowStation was connecting added stop in a suboptimal way
- Town::GetTownProducedCargoList and Town::GetTownAcceptedCargoList now neturn a new
  list instance each time, so that if you modify the returned list, it will not affect the next
  call to the method.
- A few debug messages printed using AILog was fixed to use the Log system

Thanks to yorg for debugging and posting patches that contributed towards
solving the timeout problem.



The update is available on bananas

Edit: Forgot to include Town::GetTownProducedCargoList and Town::GetTownAcceptedCargoList in changelog.


Attachments:
File comment: GS version
NoGoSuperLib-v40.tar [346 KiB]
Downloaded 53 times
File comment: AI version
SuperLib-v40.tar [350 KiB]
Downloaded 45 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
PostPosted: Fri Dec 21, 2018 11:37 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4549
Location: /home/sweden
A word of advice.

If your AI is using RoadBuilder and was using SuperLib pre 40 and then changed to 40, review your max_loops parameter if you set it explicitly when you call RoadBuilder.Init. If you used a too low limit in past versions of your AI it was not a problem in SuperLib 39 because it had a bug that it would not abort at max_loops, so you didn't notice that you used a too low limit. Now with SuperLib 40, you need to take care to not use a too low limit in relation to how long distance your routes are. The SuperLib default value is 4000, but please play around and find a value that suits your AI.

Parameters of the Init method:
Code:
function Init(tile1, tile2, repair_existing = false, max_loops = 4000, forbidden_tiles = []);

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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 167 posts ]  Go to page Previous 15 6 7 8 9

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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-2019 phpBB Limited

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