Jump to content
Sign In to follow this  
the7trumpets

Pathfinding Engine Testing...

75 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online: A long, long time ago... 
 

DarkMatter, I have downloaded a .NET setup, about 106mb, does that sound about the right size?
If this sounds like the correct download I will install Monday evening or Tuesday as I am away in Paris this weekend.

Just wondering whether interest has disappeared for the pathfinding testing, it has gone all quite recently.

Anyhow, I have updated my little java pathfinding program a bit (got stuck on an area), it now shows journey time and calculations made to find the path. It also shows the distance traveled some times, I am having trouble getting the text box refreshed all the time, for some strange reason it seems to be linked to when it takes a diagonal path when it displayes the route taken

I also tried to get it so that you can create a road layout by importing a jpg of a screenshot from SC4, but gave up when I was unable to rotate the image to align with the grid on the pathfinding program. I only have the image tools that came with WinXP and Office2000.

http://www.rendili.pwp.blueyonder.co.uk/pathfinding/pathfinding.html

Share this post


Link to post
Share on other sites
Posted:
Last Online: A long, long time ago... 
 

Rendilli, it would be easier to try and load in a shot of the traffic data map or the zones map than an actual screenshot of the roads. (Not sure if that's what you were trying to do or not.)

DarkMatter, in a week I will have access to my AI textbook again. I can look through it a bit and see if there are any interesting pathfinding algorithms. Let us know what inputs and outputs a plugin needs to have when you get that part working. 2.gif

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
Ok all. I've figured out A*, for the most part. I now have a working algorithm plugin, and some preliminary code to draw the found path. Currently only works on the first set of start/destination points layed down, all others are ignored for now. It also only runs completely, no single stepping yet. I'm having a hard time getting tile costs to work, but it may just be that I'm not adjusting the cost enough. Either way, adding tiles with a higher cost will eventually cause the algorithm to be disuaded from including them in the final path. Tiles will also have a weight, so for things like road vs. street, you could give them the same cost, but adjust their weight to determine which is chosen.
 
/idealbb/files/pathfinder_path.jpg
 
Magitek and Rendili, I've designed an interface that includes all the methods, properties, and events that an algorithm should implement to integrate properly with the client program. Implementing this interface in your class will allow me to find it, load it, and use it properly. Here is the interface, and as soon as I get the chance, I'll upload all my code to my web server. But this should get you started. Rendili, 106 sounds about right. One thing I didn't tell you is that you need the .NET Framework version 1.0. The new version, 1.1, is out now. I havn't downloaded 1.1 myself, so I can't guarantee that this program will work with it. It SHOULD work, but I don't know for sure.

For everyone, I've attached the latest beta of the pathfinder. I need some testing on tile costs that actually cause the algorithm to be disuaded from using them in favor of less costly tiles.
 
There are some things that I know need to be implemented, and I have plans to make them a reality. One of them is a configuration dialog for algorithms, so we can set the heuristic adjuster and configure other settings for the algorithm. I also want to allow more controls for viewing paths, the open/closed lists, etc. Tile lists arn't yet savable, but a whole entire tile pallette editor is planned. This will allow you to automatically add any tiles in the map that are not on your pallette, update tiles in the map that have the same name as those in the pallette, etc.
 
I did run accross a strange problem, and I don't know why it happens. Whenever you place the starting point in a partially closed area, the algorithm freaks out. My heuristic is currently calculated as the manhatten distance from the tile beeing tested to the destination times a heuristic adjuster set to 1.0: (abs(d.x-t.x) + abs(d.y-t.y))*heuristic. Here is a screenshot: 
 
 
/idealbb/files/pathfinder_path.jpg
 
Any insight as to what would cause this is greatly appreciated.
 
Well, thats about all for now. The new beta is attached, so download and play with it and have fun. 1.gif Its still a long way from finished and particularly useful to us, but its a start. What we have to do now is figure out how to tweak this algorithm or write new ones that simulate SC4's method more closely. Something were also going to have to do to get accurate testing is add a traffic simulator to simulate traffic along the calculated paths. Eventually it would probably be useful to add congestion calculations, multiple kinds of transit (not tiles, but things like mass transit, with their own weights), the ability for a path to change transit modes midway, etc. Well, enough talking. Its 2am and I need to get some sleep. 2.gif

Share this post


Link to post
Share on other sites
Posted:
Last Online: A long, long time ago... 
 
There are three type ways middle is default, left is adding roads, right is left's fastest way.
 
/idealbb/files/ct11.jpg
 
 
and it's commute time left and right are same.
 
 
/idealbb/files/ct3.jpg
 
/idealbb/files/ct4.jpg
 
 
 
 
 
but in left way,my Sim dont take fastest way
So,I could guess my Sim doesnt show real(?) commute way.
they take fasteret way at upwarding
but, at downwarding, they take this way. 
 
/idealbb/files/ct5.jpg
 
 
 
After getting more bigger building use traffic simulater(
 
/idealbb/files/n3.jpg
 

Share this post


Link to post
Share on other sites
Posted:
Last Online: A long, long time ago... 
 
rezi,
 
it's a nice experiment 1.gif. However, I think it's difficult for outsiders to rationalise the path finding algorithm if it has a programming bug, like having a '+' where you're supposed to have a '-', or using '=' instead of '==' in an 'if' statement, etc. Whatever conclusion we try to draw would be flawed, if the rationale simply didn't exist in the first place. I feel that there are still plenty of programming bugs in the code.
 
 

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I have a question. Could I extract the patfinder into a folder in plugins, or does it need to be the plugins folder?

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Abby,

How do you know the commute time was 21 minutes (as stated in post 3 of this thread)?

Share this post


Link to post
Share on other sites
Posted:
Last Online: A long, long time ago... 
 

Hi dmrsunz!
Well, I know the commute time is 21 minutes from the commute time graph. And if you're thinking "Well, how does he know which path they took?", that's a good question. The answer is, it doesn't matter - because every path is equidistant from the destination. I was hoping that by seeing which path they took when there was no incentive for any one in particular. Some pathfinding algorithms wouldn't like the backtracking of the inside path, some would tend to shoot as far toward the destination as possible before being forced to change route, etc. I don't remember the outcome though, it's been a while. I really wanted to try something similiar to rezi's stuff (which is an excellent, excellent idea, btw), but life happened and I got sidetracked. Along with technical difficulties, as well. Glad to see some people are still finding these threads interesting! 1.gif

Share this post


Link to post
Share on other sites
Posted:
Last Online: A long, long time ago... 
 

I posted this already in the Walking abandonment thread, but it does relate to pathfinding, and if maxis fixes this it's crucial to everybody, not just those interestead in the specific walking abandonment thread:

Maxis has made an official reply to the walking abandonment bug. They are asking for us to upload cities where this has an obvious effect to simcityscape. Below is the reply and link:

Author: MaxisFrank
Date: Sep-02-03 02:42 PM PDT
Subject: Re: Something Maxis Should Read

Ralphael (or any others that can help out here),
Any chance of getting someone to post one of these problem cities to SimCityScape and give me a clue where it is there? I'd like to tweak the exemplars on our end and understand what you all are seeing in this city.

Also, I see reference to tweaking one exemplar with one value. If the walking speed is being tweaked, did you tweak all the walking values in this parameter? There should be at least two (one for roads & one for streets).

Thanx,

MaxisFrank


Link: http://simcity.ea.com/bbs/messages.php?&bbsID=61&openItemID=item.261&threadID=0f9d1749cdef413a65f10da4ebbd5044&directoryID=261&startRow=101



Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I'm posting this here as it's the only pathfinding topic I can find that's not been locked, so I'm assuming this is the right place.
Weird path screenshot
At point A I have a MySim who says she works at the high school at nearby point B but complains about living in the bermuda triangle. When I query the house the commute shows long. When I use the route query tool she isn't even going to the high school at all! Instead, she's travelling to the neighbor city to the east - and going a really weird way.
She travels down to point C which is an avenue going over a ground highway. She then mysteriously drives off the bridge and onto the highway (despite there being no onramp there) and travels towards point E at which point she turns around and heads back the other way. Why can't she turn at point D (southbound 1-way street)? She then goes all the way east on the avenue/highway and leaves the city.
I get the same path both with or without the new RH perfect pathfinding mod installed (the perfect pathfinding mod did fix a problem I was having with freight trucks travelling miles away to get to a freight station despite having a nearby road neighbor connection though). I've left it several months and the path hasn't changed.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

That is some strange pathfinding there DaveParker. I've seen lots of different oddities with pathfinding in RH, varying from pretty realistic to downright rediculus. I especially noticed that in a neigboring city (mostly res, with some light density com) the commute time graph oscillated between 120 and 140 minutes every couple of months. Sadly I deleted that city without thinking to snap a few screenshots. I hope 7trumpets et.al. can help fix this once again 24.gif

PS: are you the same Dave Parker who posts on the LAB?

Later,
Don

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Since I'm not sure what LAB is I think that's someone else. But that one screenshot highlights a few problems. I don't think these are new to Rush Hour, but the new route query tool certainly helps to spot what's going wrong.

First, from what I can tell, the house that a MySim lives in, has a different place of work to the MySim (when route queried the path goes to a different place of work to where the MySim says they work). When a MySim complains about a long commute they appear to be referring to this 2nd commute (the path shown by route query, rather than the path to where the MySim claims to work).

Second, sims are able to enter / leave highways even when there are no onramps.

Third, not sure about this, but there may be a problem with MySims turning around on avenues when intersected by a one-way street.

Another bug, not related but it's annoying me so think I'll mention it quickly here: toll booths continue to bring in money even after being destroyed. I have no toll booths in my city but get several thousand $ each month from tolls.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I hate to close this thread but there is a Rush Hour Commute thread that is dedicated to pathfinding. Please put all tests and responses in that thread.

Share this post


Link to post
Share on other sites

Sign In or register to comment...

To comment in reply, you must be a community member

Sign In  

Already have an account? Sign in here.

Sign In Now

Create an Account  

Sign up to join our friendly community. It's easy!  

Register a New Account

Sign In to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections