• Welcome to SC4 Devotion Forum Archives.

new traffic experiments

Started by ldog, October 23, 2009, 06:16:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z

#20
Quote from: ldog on October 25, 2009, 09:50:49 PM
And a...a harder Z mod...I feel all warm and fuzzy now. You decided it would be easier to rewrite the traffic plugin than read any more of my never-ending posts?

Yes.  :D

Well, not really.  Actually, this has been planned for quite a while.  I think it would be useful to go back in my thread and reread this post.  This shows exactly which properties of Simulator Z will be changeable in the NAM Tool.  By changing these, you can make the simulator arbitrarily difficult - you can easily make it too difficult to successfully play any city, if you want.  Since the new NAM Tool isn't ready yet, try taking Simulator Z and adjusting just those properties.  (If you adjust the network capacities, they all need to be adjusted by the same proportion; the same goes for the bus speeds.)  Let me know if you can't get the perfect simulator for you from these adjustments, and if not, what's missing.  I try to please.  ;D

ldog

Been a busy day at work so not a lot of time for reading.

Still going through old posts and also some of the offsite A* stuff.

How did...Mott(it was Mott as best as I can determine)...arrive at .003 as the perfect PH ?
Whatever happened to Mott btw? Is he still around?

If PH= 1/speed of fastest travel type (this would be monorail in all the sims I have seen so far) then doesn't it always change?
.003 would be the perfect PH for a monorail speed of 333, .004 for 250, .005 for 200, etc

I am guessing this is not the correct formula, as it seems Mott started a lot of the discussions and so he threw out ideas that were close but further development by himself and Jason, and then later Steve refined?

I am thinking some of the threads I've been reading even from page 1 actually started elsewhere but it is hard to determine the chronological order of several years of traffic simulator discussion.

z

Tropod was actually the first person to use .003 as the Perfect Pathfinding number, unless there's someone earlier in the forums over at ST who came up with it.  As I gather you've noticed, Mott originally came up with .003, but then ended up with a variable formula, which didn't make sense to me, based on the way that A* works.  So I did experiments.  LOTS of experiments.  And sure enough, I can say with complete certainty that the proper value for Perfect Pathfinding (at least within a few percent) is .003, the same value that Tropod used, and that Mott initially decided on.  From Mott:

Quote from: mott on October 16, 2007, 03:37:46 PM
Conclusion:
The "better" pathfinding version of the NAM plugins still allows some zig-zagging in my experience.  The "perfect" version (heuristic 0.003) doesn't inherently use nearly as much CPU or RAM as it's advertised to in most cases, finds the optimal path in just about every case possible, and will actually receive a performance improvement from the "speeding mod" whereas the default Maxis value would not.  It may actually exceed Maxis's performance in many common cases with that mod.   Stick with the 0.003 heuristic for now, I'd say.

Everything Mott says here is correct.  Unfortunately, he never implemented this in his simulator, not even the alpha versions.  Simulator Z follows Mott's advice exactly here.

To answer your other question, Mott was around only for a few months.  He appears to have left shortly before the release of Simulators A and B; Jason would know more details.

ldog

Quote from: z on October 26, 2009, 03:15:17 PM
Tropod was actually the first person to use .003 as the Perfect Pathfinding number, unless there's someone earlier in the forums over at ST who came up with it.  As I gather you've noticed, Mott originally came up with .003, but then ended up with a variable formula, which didn't make sense to me, based on the way that A* works.  So I did experiments.  LOTS of experiments.  And sure enough, I can say with complete certainty that the proper value for Perfect Pathfinding (at least within a few percent) is .003, the same value that Tropod used, and that Mott initially decided on.  From Mott:

Everything Mott says here is correct.  Unfortunately, he never implemented this in his simulator, not even the alpha versions.  Simulator Z follows Mott's advice exactly here.

To answer your other question, Mott was around only for a few months.  He appears to have left shortly before the release of Simulators A and B; Jason would know more details.

Oh, I didn't think of looking at Simtropolis, but it would make perfect sense discussions started there, since that is the older of the 2 sites.

I've only just started reading about A* and so I am getting a little ahead of myself but if the perfect heuristic value is tied to the lowest terrain entry cost, and our lowest terrain entry cost is 1/speed of fastest network...  &ops  :angrymore: I forgot to multiply by 1.3 for our speed to congestion ratio...which in Z gives us... ::) 0.0030769230769230769230769230769231 or .003 in practical terms :-[

Hey Steve, I bet you didn't know that when you randomly selected .003 that it was the perfect pathfinding heuristic for your simulator? What incredible luck that wasGood job  :thumbsup:
[/sarcasm]

Hey...look how easy that was, a couple short(er) posts from me, you only had to reply 1 time and I understand it.

Since everyone around here seems to like using first names, I'm Lenny by the way.

ldog

Interesting http://simcity.ea.com/about/inside_scoop/traffic.php
Well to me anyway, I'm assuming you and Jason have read it.

Quoth the raven "The Sim has to be able to do things like walk in the opposite direction from work, enter a bus station, come back out in a bus, and travel over the same tiles he just walked on." and "it may be worth it for a Sim to walk in the wrong direction in "
Something I seem to remember y'all saying was never observed in vanilla. No wonder with their PH so high. I'm still trying to find formulae I can understand, because it seems like some final operation was left out. Like taking the square root or something. Which was why I brought up the formula Mott posted cause it's some kind of derivative that I can understand.

This h(n) = |xa − xb| + |ya − yb| not only produces a large number but it also doesn't produce anything consistent. So it doesn't make sense to me. The forum won't display it properly, but it is x with a little a, meaning a variable named xa (it is not x multiplied by a) which is our source X coord, subtract the dest X coord, also take the source y and subtract the dest y and then add them together. The brackets around it just mean to take the absolute value (so a negative number is treated as if it were positive). So either something is missing or we take that value and then plug it into some other formula that I haven't found yet. That is how it is presented though.

We all know the original PH was far from perfect, I wonder if it was even admissible, I am still looking for how that is calculated.

Also, I don't understand how .003 can be "THE" perfect PH if it is tied to lowest terrain entry cost? If you change your highest speed then you have just changed the perfect PH (again by Mott's formula).

For you to verify it by experiment, your experiment would have to have been to count how many tiles a particular trip took along what network and how congested it was to figure out how long it actually took, and then to count all the alternate paths it could have used and also figure out how many time units that would take and compare them, after taking into account travel preference, trip starting cost, etc, etc. That is an AWFUL lot of squinting at tiles and making mathematical calculations. Just to figure out 1 single trip. Of course you'd want a bigger cross section than just 1 trip. You would also have to redo it every time you made a change to the sim. How many MONTHS did that take you?

Something else also occurred to me. The pathfinder does not need to be perfect. This is a traffic simulator, traffic does not use perfect pathfinding. So somewhere between the admissible PH and the perfect PH is really all that should be needed to make the game work well.




ldog

#25
Quote from: jplumbley on October 26, 2009, 07:34:22 PM
No Mott hasnt been around for a long time.  Noone knows what happened he just stopped posting.

That actually sounds like a plausible formula to figure out "perfect pathfinding" and it would make sense due to the fact that it is defining the minimum tile cost allowable in the Simulator and telling it to compare all routes to that increment.

If this truely is the case then 0.005 would be "perfect pathfinding" for Simulator A due to the fact that monorail speed is 175.

I agree with this statement, Simulator A includes "better pathfinding" instead of "perfect pathfinding" because not everyone takes the "perfect" route to work.  Myself, I have about 4 or 5 different routes I take to work or home from work because I don't want the aggravation of driving with the morons on the highway.  Many of these routes take me longer, in fact a couple take me almost twice as long as my 45 minute trip but I would still rather take them than deal with the morons.

This is why I believe "perfect pathfinding" is unrealistic for my purposes and the intent of Simulator A.  In fact, after reading that post on the SC4 site (that I never knew existed) I am tempted to even raise the value a little bit more.  It is at 0.009 and based on your little formula, 0.016 would be the max it really could go with that being the value of the Road cost per tile for cars.  So, thinking about it....  0.009 doesnt sound like a bad place after all.  And it has worked well so far.

I'm sorry I am too tired to break out all the quotes and replys but you can figure out which part is in response to which.

This is also only if I am correct, which I am not convinced one way or the other at this point. I am taking it as a given for the moment that Mott's formula is correct. If was Mott wrong then I am wrong. If Mott was right, I could still be wrong. I have only barely skimmed A* and I could be jumping to incorrect conclusions.

But hell, Maxis set it to .09 and the game didn't blow up, it just sucked. So you can't really hurt anything changing it a little. Don't forget to multiply by 1.3 though! 0.0043956043956043956043956043956044, or .004

I still haven't figured out a formula for admissible ph.

Quoth the Raven,
"If the heuristic function is admissible (meaning it never
overestimates the minimum cost to the goal), then A* is also, like Dijkstra, guaranteed to
find the shortest/cheapest path. It is also of great advantage to use a heuristic that
underestimates the minimum cost as little as possible, as this will result in fewer nodes to
be examined"  and "Nevermore"

This is from Daniel Rolf Wichmann, who other than being associated with the University of Auckland Dept of Computer Science, I don't know if he was a professor, a student or the janitor. I did download his document from Amit Patel's site though, so I would guess he is as trustworthy a source as Patel.

So now we have to sit down and figure out a formula for overestimating the minimum cost to the goal and then we can determine admissible pathfinding heuristics.

Also don't forget that it is assumed it is off the LOWEST cost. While I admit I was wondering just that same thing, what if you went with the perfect PH for roads for example, but I suspect it makes things run crappy, or at least the MT. Think about why would the monorail usage in vanilla be bad, when it is the fastest network there is.

Now, for an experiment I think one could set the perfect ph based around roads and then strongly priveledge MT. That should either cause car use to be high until the congestion gets bad and then MT fills in (which would be kinda cool) OR it will just make the simulator go down the rubbishter.

Like I said though you can't make it any worse than Maxis did with the PH unless you go higher than them.

ldog

Quote from: z on October 25, 2009, 10:44:06 PM
I think it would be useful to go back in my thread and reread this post.  This shows exactly which properties of Simulator Z will be changeable in the NAM Tool.  By changing these, you can make the simulator arbitrarily difficult - you can easily make it too difficult to successfully play any city, if you want.  Since the new NAM Tool isn't ready yet, try taking Simulator Z and adjusting just those properties.  (If you adjust the network capacities, they all need to be adjusted by the same proportion; the same goes for the bus speeds.)  Let me know if you can't get the perfect simulator for you from these adjustments, and if not, what's missing.  I try to please.  ;D

This is out of sequence but I don't see the props in that thread (although I think I know which thread you meant to link, where you did outline a lot of them)

There are some interesting things from the post you did link though(reposted here for ease of discussion):
    * A Bus Usage Multiplier, which would allow the player to control the relative usage of buses in the traffic simulator.  The initial setting would be 1, which would reflect the current usage level, and this value would be calibrated in tenths, with a range of 0.1 to 9.9.  (Zero doesn't actually work as expected if valid paths are available.)
    * A Highway Bus Lanes checkbox, which would simulate the existence of bus lanes on highways, although of course the automata would not reflect this.  But this last fact would not necessarily be obvious; you could also call it a carpool lane, to explain the presence of cars, and some buses would be traveling in other lanes anyway.  This could be combined with the Bus Usage Multiplier to produce a multiplicative effect.
    * Allowing the players to tweak the monthly cost of all the networks.  Although the purchase cost for network tiles is accessible, it's often tied up in exemplars with properties that are changed by other mods, so it's risky to modify those exemplars.  But the monthly costs exist completely within the traffic simulator.  And realistically, cities don't have bundles of cash sitting around for big construction projects anyway.  So the monthly costs can be considered payments on interest-only bonds that the cities issue to build the networks.  These costs can be made more or less expensive to suit the player's preference, and each network can be tweaked individually.
    * Similarly, the players could adjust the fares for each travel type any way they wanted.  As an example, you could make your ferries traveling riverboat casinos, and charge the Sims §100 just to board.  That would solve your financial problems fast.  This wouldn't deter the Sims from taking ferries; they just don't know the value of money.

These are variables that I haven't mentioned but have been thinking about, because ultimately part of tuning the traffic sim for a well balanced game includes adjusting the prices. The playstyle needs to suit the engine. For example you making the subways more expensive is a way to tell the player who was used to over-extensive subways "Hey! You don't need to build all those miles of subway anymore with this sim, in fact you are gonna go broke if you do". So it sends a clear message about one of the things that makes your simulator distinct.

    * The intersection effect could be changed, effectively making more or fewer stoplights and stop signs in cities, making traffic flow smoother, or making a complete mess of it.
This I have been adjusting, in all directions lol. It is also one of those things you can very quickly and clearly see the effects of. Good times!

    * The commute time graph scaling could be changed by the player.  This is useful because the proper scaling depends on the type of region that the player builds; specifically, it is dependent on the number of inter-city commuters.
TBH, I still am having trouble figuring out how this works. The internal documentation doesn't make a lot of sense. Initially I thought you should divide 255 by your max commute time and there is your multiplier (or less if you want to just simulate a certain number like Maxis did, which is what I was talking about when I was throwing out time questions and referencing 2.5 hours or 3 hours ) but fiddling with it seemed to just produce randomness. I noticed Sim Z and A both use 25 even though they both have very different max commute times.
    * Finally, the amount of air pollution emitted by vehicles could be tweaked by any amount in either direction.
Where do you control that? Or are you talking about the clean air ordinance?

Speaking of vars, where is the traffic/noise coefficient? Is that another one like the PH that my reader might be calling another name?

z

#27
Some words of warning from my side, based on extensive experimental results:


  • The value for perfect pathfinding, as implemented in SC4, has absolutely nothing to do with speed or any values in the CvS curve.  It is always .003, regardless of whether or not the city has monorails or just cars.  Remember, we don't know what type of normalization or anything else is going on inside the simulator engine.  Theory here is good only so far as it is backed up by experimental results.
  • The problem with raising the pathfinding heuristic higher than .003 is not that the Sims will not take the absolute best route to work (although that's true).  The problem is that as soon as you raise it above .003, you get increasing numbers of Sims who find no paths to work, even when such paths are available.  This means that as soon as you start going above .003, you start getting abandonment due to commute time, and the higher you go, the more abandonment you get.
  • Values of the PH above .003 don't give more random paths; none of the values give random paths.  The paths are always deterministic; the Sims will follow the same ones again and again.  But the higher above .003 you go, the simpler the paths become, which makes them look less random.

ldog

Quote from: z on October 26, 2009, 10:35:04 PM
Some words of warning from my side, based on extensive experimental results:


  • The value for perfect pathfinding, as implemented in SC4, has absolutely nothing to do with speed or any values in the CvS curve.  It is always .003, regardless of whether or not the city has monorails or just cars.  Remember, we don't know what type of normalization or anything else is going on inside the simulator engine.  Theory here is good only so far as it is backed up by experimental results.
  • The problem with raising the pathfinding heuristic higher than .003 is not that the Sims will not take the absolute best route to work (although that's true).  The problem is that as soon as you raise it above .003, you get increasing numbers of Sims who find no paths to work, even when such paths are available.  This means that as soon as you start going above .003, you start getting abandonment due to commute time, and the higher you go, the more abandonment you get.
  • Values of the PH above .003 don't give more random paths; none of the values give random paths.  The paths are always deterministic; the Sims will follow the same ones again and again.  But the higher above .003 you go, the simpler the paths become, which makes them look less random.

But this can only be determined mathematically. Any other kind of experiment, such as just watching how it runs and making observations will let you determine that you have a value that works well but not that it is the perfect value. I am not discounting what you are saying either, just because Maxis made it possible for us to tweak a bunch of things doesn't mean it shows the whole picture. For example, I strongly suspect the ferrys have their own seperate pathfinding engine. There also really isn't any way for us to tell what kind (if any) of subsampling the pathfinding engine does and some other A* things that you are no doubt familiar with.

I thought about that (no paths) as well but what I am talking about is a SMALL margin of error.
I'm just saying I think it isn't important to have the perfect ph, just to be close.

ldog

Quote from: jplumbley on October 26, 2009, 09:15:24 PM
Eeeks!  Warning....  You can change the budget costs a little bit with the networks, but you don't want to change them too much.  If you start making them too high, you will start throwing the balance the entire budget system, which would include taxes and/or building values of every building in the game.  If you ended up modifying the transportation costs too much then you would have a choice of compensating either threw modifying the tax system which may involve delving into demand (don't go there)....  Or doing a lot of editting of Building Exemplars to raise the Building Values so that you produce more taxes based on higher building values.

It may seem like a harmless thing, but to be honest I don't think anything other than capacity should be in the NAM Tool.  Even then, I think we should just be providing a prooven set of options of different Simulators, instead of letting an end user who has never read one of these threads modify anything in the Simulator.  If anyone has such the desire to modify something, they have the Reader and a lot of information at their disposal on what each property does and how to use the Reader.  We should make it easier by adding choice, not by making a tool that makes it easier to screw up the game.  It will just become a tech support nightmare.

Oops, almost missed this.
Yeah, I know. You can make small changes without tweaking the rest of the game, but after that you are talking about editing many parts of the game. I'm actually considering modding many aspects of the game besides the traffic sim but y'all see how easily I go offtopic and if I started talking about those things in this discussion we would be completely derailed. Just suffice it to say that when I start talking about things like this, you and Steve can rest assured that I have considered the implications to the rest of the game engine.

As far as the NAM tool I will leave that to you guys and the rest of the NAM team.

Part of the reason I moved out of the NAM thread is my traffic sim will likely not be NAMpatible. I really don't use a lot of the features in the NAM. The only thing essential to me is diagonals.
The NAM is mostly about eye-candy and since the map is only so big there is only so much eye-candy you can use. So for example while wider highways and avenues may be very visually appealing and realistic, they also take up too much space for me. Then there is the GLR and the RAM. Besides their visual effects, they add a lot of complexity that I just don't need.

So those are also some of the reasons I want to build my own traffic simulator. It will never be a competitor to Z, A or any other traffic sim, in fact as Steve has basicly said it would be a waste of time. I do see a niche to fill though, and that is to provide completely different options, even if I am the only one who chooses to use such option. In fact because it is probably of such limited appeal that is why I am willing to do it myself. Also if it prompts you and Steve to reexamine your own work and say "maybe there are some new things I can put in A" or even if you reaffirm that "Z is a finished product and there isn't one thing I would change in it" plus if we've all enjoyed this discussion (I hope) then it was not time wasted on anyones part.

z

#30
Quote from: ldog on October 27, 2009, 08:02:06 AM
But this can only be determined mathematically. Any other kind of experiment, such as just watching how it runs and making observations will let you determine that you have a value that works well but not that it is the perfect value.

Yet without the source code, we can't determine it mathematically.  (There's some indication that the .003 value may have been obtained from Maxis, although in a roundabout way.)  Experiments may not determine the absolute perfect value, but I've done enough of them, under enough circumstances, to come within a few percent, as I mentioned previously.  (This was part of my job for 25 years.)  Newton's law of gravitation was obtained solely by experiment; he himself admitted that he had no idea how gravity actually worked.  And Einstein came along a few centuries later and showed that Newton's law was not exactly correct, but it was awfully close.  The gravitational constant, the speed of light - there are many constants in science that have been determined with great accuracy purely by experiment, and for which even today there is no theory to explain them.

Quote
I thought about that (no paths) as well but what I am talking about is a SMALL margin of error.
I'm just saying I think it isn't important to have the perfect ph, just to be close.

How small?  How close?  In different applications of A*, you have more wiggle room.  But my experiments showed that in SC4, you start running into trouble as soon as you depart from a value of .003.

And what's wrong with using .003 in any case?  I see no disadvantage to it whatsoever, only advantages.  And the feedback from users has all been along those lines.

I'm not trying to be aggressive or defensive here; I would just like to ask some pointed questions.  I'm used to doing work that can be justified with a large amount of rigor, and even if you're designing a simulator solely for your own use, I think you'll find that such rigor will serve you well.

ldog

#31
Quote from: z on October 27, 2009, 12:06:59 PM
Yet without the source code, we can't determine it mathematically.  (There's some indication that the .003 value may have been obtained from Maxis, although in a roundabout way.)  Experiments may not determine the absolute perfect value, but I've done enough of them, under enough circumstances, to come within a few percent, as I mentioned previously.  (This was part of my job for 25 years.)  Newton's law of gravitation was obtained solely by experiment; he himself admitted that he had no idea how gravity actually worked.  And Einstein came along a few centuries later and showed that Newton's law was not exactly correct, but it was awfully close.  The gravitational constant, the speed of light - there are many constants in science that have been determined with great accuracy purely by experiment, and for which even today there is no theory to explain them.


If you had said "I think this is the perfect pathfinding heuristic" or even "I know I am pretty close to the perfect pathfinding heuristic" I wouldn't even challenge it.
When you say things like "complete certainty within a couple percent", it is not something I am going to just accept as a given, especially when you just say "I've done extensive testing" without going into detail what your test methods were. You make the perfect pathfinding heuristic sound like it is a religion.

...and then others have come along and said Einstein was not exactly correct, and on and on. The development of science has not stopped, it is an ongoing refinement. As we learn more, we can become more accurate. Also as things develop the tolerance range for inaccuracy becomes smaller.

Didn't Einstein also say something along the lines of "We don't truly understand anything if we can't explain to a 3 year old."
Of course I don't see the point of explaining computer science to a 3 year old, but if we look at a 3 year old as if they were an adult, we could replace 3 year old with "an idiot with a very short attention span".

Quote from: z on October 27, 2009, 12:06:59 PM
How small?  How close?  In different applications of A*, you have more wiggle room.  But my experiments showed that in SC4, you start running into trouble as soon as you depart from a value of .003.
As I said no higher than the admissible value. How small and how close I couldn't say without knowing the range between admissible and perfect. I also admitted I haven't figured that out yet.
I think very small and very close. Yours is the only one that uses a value low though (I will let other people draw the inferences). Also if that is the case then I would think it means .003 is not the perfect ph, but the edge of admissible. We know Maxis default wasn't admissible because the sims won't take a longer route even when it would be quicker.

Quote from: z on October 27, 2009, 12:06:59 PM
And what's wrong with using .003 in any case?  I see no disadvantage to it whatsoever, only advantages.  And the feedback from users has all been along those lines.

Pathfinding performance may not be optimal. CPU performance may not be optimal. I am not throwing that out there because I care much about it (it just needs to be tolerable) just answering your question truthfully and objectively.

From a practical standpoint, there is nothing wrong with it. This your experiments can conclude. Simple experiments can conclude this. Very simple ones. Like just playing the game simple. Every person who has used your simulator (myself included) can attest that .003 is an admissible ph. Everyone who has played with Jason and Mott's and probably all the other ones would also say that .009 is admissible as well.

What is wrong is conclusively calling it the perfect ph, especially for all circumstances.

Quote from: z on October 27, 2009, 12:06:59 PM
I'm not trying to be aggressive or defensive here; I would just like to ask some pointed questions.  I'm used to doing work that can be justified with a large amount of rigor, and even if you're designing a simulator solely for your own use, I think you'll find that such rigor will serve you well.

That's fine. I am not either. I certainly appreciate your feedback. You originally said you would meet me halfway. You have gone much farther.
Even if I think you don't know everything, I certainly think you know a lot more than I do. And you have turned out a traffic simulator that is very useable to very many people. Part of why I am being such a pain in the ass is because in my work experience, proper (one could say rigorous) planning makes doing the actual work go very smoothly. Poor planning makes mountains out of molehills.

z

Quote from: ldog on October 27, 2009, 03:37:37 PM
When you say things like "complete certainty within a couple percent", it is not something I am going to just accept as a given, especially when you just say "I've done extensive testing" without going into detail what your test methods were.

You don't have to.  And I'd be happy to go into detail about my test methods were it not for the time issue.  The tests are extensive.  (I seem to recall mentioning that my time was limited...)  There is a point where this may come before the NAM Team, in which case I will go into my testing methods in detail.

QuoteYours is the only one that uses a value low though (I will let other people draw the inferences). Also if that is the case then I would think it means .003 is not the perfect ph, but the edge of admissible.

No; fully a third of Tropod's simulators used the same value.  This is the value that causes improper abandonment due to commute time to disappear, and if you look through the various threads with comments about Simulator Z, you will see that the users concur.

QuoteEveryone who has played with Jason and Mott's and probably all the other ones would also say that .009 is admissible as well.

There are plenty of people who have said that Simulator A with its value of .009 produces too much abandonment, and if you look through the threads, you will find them.  Here's just one sample quote, from sumwonyuno:

QuoteSince I started using NAM, I've used a variety of the included simulators (and tweaked them to my liking), experimenting with capacities, speeds, commute distances, etc.  I settled on Simulator A when that came out as an option.

Ever since I bought SC4 Deluxe, I've been trying to recreate the Hawaiian island of O'ahu in the game.  Late last year, I ran into problems with abandonment (because of eternal commuters from removing the Residential Halver) and traffic simulation (neither optimal IMO nor vaguely resembled RL).  Then I found z's thread, and I received help from both my problems in there.  Without Simulator Z, I don't believe I could have finished building the island because decent multi-tile commutes would not be possible without it.

Because SimCity is not real life, there are game limitations (no traffic sim at the region level) and the simulator isn't custom-tailored, traffic isn't going to act the way I want it to.  Simulator Z has done a fine job of being the best thing out there (yet), to get the traffic simulator to contribute postively to the overall SimCity game experience.

QuoteWhat is wrong is conclusively calling it the perfect ph, especially for all circumstances.

Higher values cause abandonment, which is essentially the result of a bug.  Lower values simply increase CPU and memory usage.  That's why the .003 value is called "Perfect Pathfinding" (starting long before me). :)

ldog

Quote from: z on October 27, 2009, 05:24:51 PM
You don't have to.  And I'd be happy to go into detail about my test methods were it not for the time issue.  The tests are extensive.  (I seem to recall mentioning that my time was limited...)  There is a point where this may come before the NAM Team, in which case I will go into my testing methods in detail.

I know doing the kind of proper testing would take a tremendous amount of time.
Detailing the methods would also take quite a bit of time.
I recall that as well and I also recall saying that I respect your time.
So I will drop the issue (for now anyway :P )
When/if it comes before the NAM Team, please make that information available to me as well though?

Quote from: z on October 27, 2009, 05:24:51 PM
Higher values cause abandonment, which is essentially the result of a bug.  Lower values simply increase CPU and memory usage.  That's why the .003 value is called "Perfect Pathfinding" (starting long before me). :)

You feel it is a bug, Jason feels it is a feature. I haven't put enough time and thought into it to have a strong opinion, but I feel a little bit is a good thing, a lot is a bad thing.

I know other people started calling it perfect pathfinding before you did, I was asking if you just took their word for it or you verified it.
A week ago I didn't know what perfect pathfinding heuristic actually meant. You were correct in your initial assertion that "I didn't have a clue" at the time, of course my initial assertion was just as correct, since like Newton in your example it really didn't matter if I had a clue or not, I could still observe certain effects and do certain experiments (no matter how limited).
Of course having read about A* which I am still no expert in, you and I both know the perfect pathfinding heuristic isn't called that just because it works good (how good? really good...mmmmmhhhhh...dat's good!) </Jimmy Walker impression>. It is an absolute value. I really don't think it is possible to nail down the perfect ph by in game experiments without an incredible amount of work..and probably stripping as much as possible out of not just the game but the traffic simulator controller as well.

Admissible values for the pathfinding heuristic are a whole nother story. They are the range of ph between perfect and where the game is fubar. You would think that Maxis would have used a value that was at least admissible but I think we can all agree they didn't.


z

Quote from: ldog on October 27, 2009, 05:51:21 PM
When/if it comes before the NAM Team, please make that information available to me as well though?

Yes, I will be happy to do so.

QuoteAdmissible values for the pathfinding heuristic are a whole nother story. They are the range of ph between perfect and where the game is fubar. You would think that Maxis would have used a value that was at least admissible but I think we can all agree they didn't.

There's a very simple explanation for this.  At the time the game came out, almost seven years ago, .09 was the lowest Maxis could go on PCs of that day (the minimum requirement was a 500 MHz Pentium III).  Tropod came along with his simulators a while later, when most PCs were better.  He made a third of his simulators use the original PH, as their were still a lot of old PCs around; a third used a "Better Pathfinding" heuristic, which was suitable for most of the PCs of that time; and a third used Perfect Pathfinding, which was usable only by leading-edge PCs back then.

Now a number of more years have passed, and any PC can use Perfect Pathfinding, especially with the tuning I put into Simulator Z that makes it run several times faster than Simulator A using a .009 PH.  So that's why the .003 value is standard throughout Simulator Z.

ldog

Could be. I'm not even going to argue with you for a change :P

So I was short on humor today. I "know" that's why we have all those views of the thread even though it is just the 3 of us, people just come for my bad jokes  :satisfied:

So noticing what a bunch of old geezers we are around here...
This was probably a marketing slogan Tilted Mill should have considered:
"Sim City Societies: This is not your fathers Sim City"

I decided I had better put in some play time today (I didn't yesterday, between reading, posting and the wife demanding some time)
Of course I had to tweak my vanillaish simulator a bit first. Still undecided on the PH. I decided to go with .005 for now. I made all the rail MT (rail, sub, el, mono) not affected by traffic. I also left their capacitys at defaults (if y'all remember I doubled the roads/ave/hwy/etc). So 1/200 since the monorail runs at stated speed is .005 I know what you are gonna say (about the PH) but I think it makes more sense to see how it does with a less than perfect PH and then switch to the perfect PH instead of viceversa.

I didn't make the no congestion change because of the PH of course. Just an idea I had to try out. Giving the MT a lower capacity but no congestion it "should" be possible to tune it to produce the desired effect, which of course may have no noticeable difference on game play...but it's a thought.

Another theory I've got about MT is related to the travel type preferences. All things being equal (you didn't have a desire for your different wealth sims to have different prefs) I'd think you would only need car and fastest. If the traffic is bad on the road (and when isn't it) then the MT should be fastest route. Of course I do think the different wealth levels should have different preferences. I just conservatively (10% total) tweaked these today. R$$$ no pref for MT, extra 10 for car. R$$ also no MT pref, another 10 for car. R$ 10 less for MT, 10 more for fastest. Of course I will eventually wind up with values closer to yours and Jasons in all likelihood. Being as we really shouldn't be building much MT until the roads are overloaded it should usually win by virtue of being fastest route.

Of course I've got a bad plugin installed again. The game is locking up my computer entirely after a random amount of time. So I didn't get to do much playing :(


sumwonyuno

#36
I know, I'm going to stray away from the thread, but I've been referenced.

I admit I haven't delved that deeply into the traffic simulator as much as you all.  I've read things here and there, but I don't claim to be able to say anything about it with much credibility.  I have done some big mistakes in my region that causes problems in my region with respect to demand and eternal commuters.  I know the simulated behaviors in the game are interconnected.  So I understand that abandonment is caused by numerous factors.

Referring back to when I had used Simulator A, I had abandonment problems with the Capitalis region.  It wasn't because of a lack of jobs.  I was trying to make Honolulu in the game, and I built the development and transportation to mimic RL.  But, I understand that the game isn't meant to be RL.  The game has its differences with RL with respect to transporation network capacity and residents/jobs.  I understand that the game must be understood in terms of one city tile (X km by X km).

So the result of my region is an exaggeration compared to RL, and the transporation network is overwhelmed.  Since the transportation network capacity is exceeded (over 300%), many commuters in certain parts of the city tile can not get to their jobs within the maximum commute time, and the buildings in that certain area abandon.  These areas of the city tile that abandon are areas where all shortest path to available jobs are way over capacity.

I have to agree with jplumbley on the difference in commute time contributes to lessen the abandonment problem.  I don't discount all the other things that z has done to tweak the traffic simulator to make it run faster.  With Simulator Z the max commute time is raised high enough that Sims can get to that closest job, despite congestion.

I like that the sandbox effect of Simulator Z has helped me build my region.  Though, from the standpoint of game mechanics, the lack of abandonment in existing conditions doesn't disprove other things are wrong.  There are instances where there are jobs and residential demand in the same city tile, but new housing development abandons.  Also, since commute times are so high, commuters will gladly crowd (unintended) neighbor connections because it's the closest job (sending commuters to the "wrong" city tile), while job buildings with no workers are common when they are far away from residential and neighbor connections.


The City & County of Honolulu, a Mayor Diary based on Honolulu, Hawai'i.

mark's memory address - I've created a blog!

z

Quote from: jplumbley on October 27, 2009, 09:12:48 PM
I would like you to proove this...

That's certainly a reasonable request.  I will do so, but in the NAM thread, where the rest of the team will see it, since we are discussing what to do with the simulators long-term.  It will also take me a little while, as I'm currently in the middle of a computer build.  But I promise you that I will address this thoroughly before resuming my RTMT work, so it won't be that long.

QuoteI have not had any problems what-so-ever with abandonment in my cities due to the PH being higher than yours.

This is quite understandable, and my experience is that if you build cities that work well with Simulator A, you generally won't get that problem.  Even in my cities, the abandonment happens only in certain areas.  But in certain situations, it can be bad enough to make a stable neighborhood unsustainable.  Again, I will elaborate more on this later, and explain the experiments that were done to show that this was specifically due to the value of the PH.

QuoteAbandonment is not caused by one simple factor, it is caused by many, mostly Commute Time and Congestion in your City.

Definitely.  I would say that at least two thirds of the abandonment I have seen has been due to commute time limitations, which are then exacerbated by congestion.  And this, of course, is one of the things that sumwonyuno is saying.  I think we're all in agreement here.  My experiments here always tested only one variable at a time, as that's the only way to isolate the cause of the problem.  Again, I will go into details later.

QuoteAnd if you want to do this test there is absolutely no way you can compare Simulator A and Z you must do it with one or the other.

Absolutely.  And that's what I did.

So it sounds like we're in basic agreement about how to proceed.  I will get back to you as soon as possible with more on this.

RippleJet

Oh, I'm pretty confident Steve meant his public Traffic Simulator Z Development thread, in the NAM Place, as opposed to this thread which is in MODding Game Simulators Help requests.

ldog

#39
I know I said I would leave this alone but, since you guys are gonna argue it anyway...the more I read about A* the more I think we (starting with Tropod and going all the way down the line to me) are all wrong.

Ok, so I found the Manhatten Heuristic formula stated reslightly at http://www.policyalmanac.org/games/heuristics.htm

The equation, where abs = absolute value, is:
H = 10*(abs(currentX-targetX) + abs(currentY-targetY))

Now 10 I am completely certain within a couple percent :P (sorry Steve, I couldn't resist) in this instance is our lowest terrain cost, because this was a sidebar to an article where the author had only 1 terrain cost, which was 10. This is the formula that I quoted earlier, except that it was missing "multiply by lowest terrain cost"

Going to quote Patel here, since his work was considered by everyone who came here before me and one could say is part of the foundation of this community's understanding of the traffic simulator.

"So we have an interesting situation in that we can decide what we want to get out of A*. At exactly the right point, we'll get shortest paths really quickly. If we're too low, then we'll continue to get shortest paths, but it'll slow down. If we're too high, then we give up shortest paths, but A* will run faster.

In a game, this property of A* can be very useful. For example, you may find that in some situations, you would rather have a "good" path than a "perfect" path. To shift the balance between g(n) and h(n), you can modify either one. "

Also, it is too long to quote but http://realtimecollisiondetection.net/blog/?p=56 in a nutshell for those of you not interested enough to read it, it just supports "my" theory that the perfect pathfinding heuristic is irrelevant (in so far as actually using it; it is still worth knowing because it gives us a baseline). Now I feel no personal attachment to any of my (mostly half-baked) theories, so I am not just presenting this because it supports what I said. Right now I just care about how things work, I don't have time to get an ego about it, there'll be plenty of time to do that after the work is done :P