• Welcome to SC4 Devotion Forum Archives.

NAM Traffic Simulator Development and Theory

Started by z, August 02, 2008, 05:07:50 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

tamorr

   Thanks that is what I wanted to know. Good to see I don't need it anymore per say. So I would have to use the regualer version then or not use it at all with BTM... Anyways it is a nice assessment in comparison between the two I understand, and is why I was asking to know if compadible to partial or the whole mod. I don't pretend to know what the BTM changes, as I really don't know the full layout of it.
   So it is good seeing that the speed/workings portion of the Mod is indirectly implimented. So no worries there. Glad you did stay in so much research has been greatly appreciated, and helping me even understand how things work in the simulator. Always liking knowing how things work. :)
  "It is wiser to think about your actions before doing them, but be warned One must act quickly before another takes action for you."
  "Knowledge may be Power, but it is how you use that Knowledge that makes One Powerful."
  "I am a Philosopher, Punnist, Poet, and Rambler so keep in mind I think ahead and backwards to point where communication is sometimes not completely understood, even if Enlish is my primary language, it doesn't mean I know it well N proper."
  "Always do your best to acheive your goals and Dreams one at a time."
"Patience is a virtue."

Shadow Assassin

OK.

Played a city tile with the updated version of Z medium.

I noticed an immediate improvement with travel paths being taken - traffic is more evenly spread across the entire map.

The farm that had the freight going across the entire map, passing a neighbour connection on the way, has it going via that neighbour connection now. That farm is 'stressed', but still has jobs and freight. The area is low-desirability for farms anyway (industrial area next to it now)...

But most importantly: a massive speed boost to my game. It runs much, much better now in Cheetah mode, for instance.
New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dedgren ♦ dmscopio ♦ Ennedi
emilin ♦ Heblem ♦ jplumbley ♦ moganite ♦ M4346 ♦ papab2000
Shadow Assassin ♦ Tarkus ♦ wouanagaine
See my uploads on the LEX!

z

#442
Release of Simulator Z v2.1 - European Version

In the announcement of the Simulator Z v2.0 release, I stated that bus speeds had been increased by 50% on most networks.  That was the original plan.  However, this was also the release that saw the increase in one-way road speeds.  In the build process, the two increases ended up conflicting, and I ended up with about a 10% increase in bus speeds, although the one-way road speeds were indeed increased by 50%.  So there was never a version of Simulator Z released with a 50% increase in bus speeds.  However, subsequent testing has shown that the 10% increase was just about right for the standard version of Simulator Z - it helped everything work just a little bit better.  As a result, I am going to keep it as it is.

Nevertheless, this still leaves the need for a version of Simulator Z that is much more heavily oriented toward mass transit in general, including buses specifically.  Originally, this option was going to be available in the NAM Tool.  However, GoaSkin disappeared a while ago, and it's not clear when we'll see him again.  So for now I am creating a special European version of Simulator Z.  (Although it's called "European," it's actually intended for any environment in which very high mass transit usage is desirable.)  Rather than modifying vehicle speeds to accomplish its goal, it works by modifying the Sims' preference for their type of transport; this avoids negative effects in other parts of the simulator.  In this new version, the Sims' preferences are what they were in the Maxis simulators.  So this is the standard version of Simulator Z v2.1, but with the mass transit preferences of Simulator E.  Where there are extensive bus routes, car usage drops significantly.  For example, in a test city on a large tile that is saturated with bus stops, bus usage increased from 20% more than car usage to 300% more than car usage, providing a traffic patter essentially identical to that of Simulator E.  On the other hand, if a player does not use many bus stops, the increase in bus usage will be much less, but other mass transit will still be more heavily used.  And where it is significantly faster for Sims to get to their destination by car, they will do so.  They will still take the fastest routes, but these routes are now biased by a strong preference for mass transit.

It is not expected that this version of Simulator Z will appear in the NAM, as it includes all five versions of the simulator, and the NAM is rather full of traffic simulators already.  However, one way or another, this new version of Simulator Z will be distributed widely; an upload on the LEX is one possibility.  First, though, I would like people who are looking for a traffic simulator that emphasizes mass transit more to try this one out, and let me know if this meets your needs.  Specifically, does this seem realistic for older European cities or their equivalent?  It is very easy to tweak the percentage of mass transit at this point, but if this needs to be done, it would be good to do it now, before I give wider distribution to this version of Simulator Z.

As for the other various customizations of Simulator Z that were planned to be in the NAM tool, I still plan to get them done, one way or another.  Something in the style of the NAM tool would be best, but unfortunately, I do not have the time to program such a tool.  Are there other programmers out there who would be interested in such a task?  I have all the specs drawn up, and for someone who is familiar with programming for SC4, this should not be a big project at all.  Otherwise, there are other ways of making these customizations available, but they would require more work to use.

Meanwhile, here's the European version of Simulator Z v1.2.  Please let me know what you think.  Thanks!

woodb3kmaster

Apologies on not performing this test sooner, Steve - I hope I haven't made you too anxious to find out how Simulator Z 2.1 and CAM 2.0 have affected my main quad. In my defense, it took a while for me to sort out a technical difficulty I was having in getting CAM 2.0 installed, and I was distracted for a while by BATting.

That being said, I have just finished another 10-year playing session, my first with both new mods installed. In summary, it looks like your adjustments to Simulator Z have improved the situation in central Nyhaven. Here's a breakdown of how the gameplay went:

The first 21 months of gameplay, which began in June or July of year 150, there were no zots at all and therefore no abandonment. In fact, I saw many abandoned buildings get repopulated, and many dilapidated buildings upgraded, in some cases to their original wealth level. Beginning in April of year 152, however, the all-too-familiar 9-to-11-month cycle of zots and abandonment in the northernmost fourth of the map returned. The first such cycle was pretty mild (i.e. there was little abandonment), but the second was by far the worst. It looked as if almost all of the lots in certain areas were abandoned. I was relieved, though, to see that many of the lots abandoned in this cycle were repopulated, in some cases at their original wealth level, within a year or so of their abandonment - this recovery came far sooner than it did in previous playing sessions. After that, the areas plagued by cyclical abandonment shrank with each successive cycle, and by the end of the session in June 160, the zots had stopped appearing in the north-central part of the map entirely (much to my relief, as there are several residential mega-lots in that area).

My next step will be to expand the subway system in the problem areas, since the addition of the orbital line helped reduce abandonment. While my troubles are not completely gone, the degree to which the new version of Simulator Z and CAM 2.0 have reduced them is truly remarkable. Great work!

Feel brand new. Be inspired.
NYHAVEN - VIEWS FROM WITHIN
Nuclear City - 5/8

z

I'm very happy to hear that the new version of Simulator Z has worked out for you, Zack!

Quote from: woodb3kmaster on January 06, 2010, 12:36:08 AM
The first 21 months of gameplay, which began in June or July of year 150, there were no zots at all and therefore no abandonment. In fact, I saw many abandoned buildings get repopulated, and many dilapidated buildings upgraded, in some cases to their original wealth level. Beginning in April of year 152, however, the all-too-familiar 9-to-11-month cycle of zots and abandonment in the northernmost fourth of the map returned. The first such cycle was pretty mild (i.e. there was little abandonment), but the second was by far the worst. It looked as if almost all of the lots in certain areas were abandoned. I was relieved, though, to see that many of the lots abandoned in this cycle were repopulated, in some cases at their original wealth level, within a year or so of their abandonment - this recovery came far sooner than it did in previous playing sessions. After that, the areas plagued by cyclical abandonment shrank with each successive cycle, and by the end of the session in June 160, the zots had stopped appearing in the north-central part of the map entirely (much to my relief, as there are several residential mega-lots in that area).

What you saw was essentially identical to what I saw when I applied the new simulator the the area of my city without subways that was having problems very much like yours.  I expected that you would get the same results that I did, but I appreciate hearing directly from you that you did.  Basically, the new value for perfect pathfinding causes the destination finder to work harder to get jobs for the Sims.  It takes it a while, though, as it has to shuffle some things around - that's why you still saw the abandonment cycles, but they gradually shrank over time.  With enough subway service, they eventually shrink down to nothing.

Why are subways needed, when commute time is essentially unlimited?  This is a question that philosophers have pondered for centuries.  (That's Sim centuries, of course.)  It seems to be related to another longstanding question:  Why did Maxis pick six minutes as the maximum one-way commute time in their original simulator?  It turns out that in the original simulator, six minutes was just long enough for a subway to traverse a large tile from one corner to the opposite corner (3 1/2 minutes), and still leave time for the Sims to walk a few squares to or from a station at either end (1 1/4 minutes in each case).  So even though the destination finder pays close attention to the maximum commute time specified in the simulator, in its heart of hearts, it apparently still thinks that Sims have only six minutes to get where they're going, and in a first pass, it uses this "information" to exclude destinations beyond this limit.  Subways are the easiest way of overcoming this limitation; it's not clear at this point whether or not other high-speed networks would work as well, as it's difficult to implement them in high enough densities to have the same effect.

The pathfinder is bound by no such limitations, though, and once a sufficient number of subway lines exist, I have seen Sims happy to commute by car using only roads for about 500 squares, which is about the distance from one corner of a large tile to the opposite corner.

Quote
My next step will be to expand the subway system in the problem areas, since the addition of the orbital line helped reduce abandonment.

I agree that that would be the next logical step.  I have found that with sufficient subway lines and properly balanced demand, abandonment due to commute time can be completely eliminated with this version of Simulator Z.  Good luck! :)

gabrielbyrnei

There must be a problem with Wine under Linux using these complex calculations for transport. When a city gets near to 1 million people, simulation gets awfully slow, this is on a quad core Phenom 9500, 2 GB ram. It may be just because Wine isnt meant to run CPU intensive programs such a SC4, specially using Plugged in traffic simulators.

z

The traffic simulator plugins are just a different set of parameters to the Maxis traffic simulator engine, so there's no performance loss by using a plugin rather than the original simulator.  However, I think you're right that the slowdown is due to Wine.  The only other time I've heard of such a slowdown was from someone else who was using Wine as well.  And the traffic simulator is definitely very CPU intensive.

The v2.1 version of Simulator Z has been found through tests to be faster than any of the other NAM simulators, with the exception of the original Maxis Simulator and its capacity variations (Simulator C), where performance is very close.  So I don't see that you can overcome this problem easily.  Maybe you'd want to consider a dual boot?

gabrielbyrnei

Yes, im thinking about it, But would SC4 work on Windows 7?

z

Yes, SC4 works fine on Windows 7 - that's what I'm running.

Another option you might want to consider is the VMware Player, which is free.  From my short experiments, it seems to run SC4 fine.  And since it uses hardware virtualization, I would expect it to be much faster than Wine.


pierreh

This is a report about comparative testing of the 'normal' and Euro variants of the Z Simulator Version 2.1.

I ran each test for about 8 years, which should be enough for the simulators to settle, while making the 10-year graphs fairly clear. The previous version of the simulator was the normal 1.2 version. The setting is High in all cases. CAM is not used. Actions on the cities during the normal tests were restricted to some maintenance, bulldozing a few abandoned buildings and replacing aging power plants; in the Euro tests most of these actions were done at the beginning before starting the clock (thus there was very little abandonment during the Euro tests).

1. Tests on city « Anterne »

This is a fairly mature city with some room for expansion. Most of the residential areas are zoned with medium density and with many parks and green areas. The central business district started with medium density zoning, later changed mostly to high density but without bulldozing of the existing buildings aside from a few exceptions.

From the start the city had an extensive bus coverage with many bus stops (generally within walking distance of most buildings, residencies, factories, etc); railway, planned and laid out at the very start of the city was used for linking with two neighbor cities and featured a central station in the CBD and suburban stations in various residential areas, which led to some usage of the trains as 'local express lines'. At a later stage a GLR network was implemented on some main avenues and roads, linking residential, commercial and industrial areas; the development of that network was largely intuitive although the level of usage of buses was taken into consideration.

The city suffers from the 'eternal commuters' syndrome (verified with the Census data), since it has two neighbor cities and many Sims travel in triangular fashion between them. I mention it, since it may have an effect on some test results.

Global test results:
- Population at start of tests: 161'749
- Population at end of normal test: 166'339
- Population at end of Euro test: 165'174

The maps and graphs were taken at the end of the tests; for each pair the normal results are above the Euro ones. Since 10-year graphs are used, the period of the test starts at 1/5th of the horizontal axis. I assume that the first increases or decreases in the curves, which seem to take place a bit less than one year after the start of the tests, express the time when the first computations with the new version of the Simulator are done.

Car volumes




Bus volumes




GLR volumes




Train volumes




In general it can be said that there is little perceptible difference in the various volumes between the two tests.

Travel time graph




What I find striking in the above graphs is the amplitude of the variation in travel time, especially in the normal test; in the Euro test there is a general trend towards a decrease im travel time.

Traffic density graph




Again striking in the above graphs are the variations for all types of public transportation and for pedestrian trafic, whereas car trafic density shows considerable stability. The variations are extreme in the normal test, a little less so in the Euro test.


2. Tests on city « Hermone »

This is a mature city occupying entirely its tile with no room for further expansion (the city could only grow significantly further with CAM, which may or may not happen, I am still undecided about it). Most residential and commercial zoning is high density. Bus stations were installed from the start, using the same method as for Anterne. Railway lines were planned laid out at the start of the development, with a single central station; later a suburban station was added on one branch. Subway construction was started when the city passed 200'000 sims and, from that point on, kept pace with the development. The subway layout was rather intuitive, based on what I perceived (or decided) the main commuting flows to be; by and large usage was satisfying on most sections.

Hermone also suffers from the 'eternal commuters' syndrome, since it is one of the three cities involved in triangular commuting, as explained for Anterne above, and it may also be involved in another triangle.

Global test results:
- Population at start of tests: 781'242
- Population at end of normal test: 803'670
- Population at end of Euro test: 791'898

Again the maps and graphs were taken at the end of the tests; for each pair the normal results are above the Euro ones.

Car volumes




Bus volumes




Subway volumes




Train volumes




Travel time graph




Traffic density graph




Globally the same observations can be made as for the other city. There is little observable difference in the volumes. in both tests the graphs show variations of much less amplitude than in the other city. All in all, the difference in behavior between the normal and the Euro variants of the Simulator is not very significant.

I will be very interested in the interpretation of these testing results, and I am ready to undertake more testing, either using the same versions but with other observations, durations, cities (although the choice is limited...) etc, or/and with newer versions.

z

Thanks for all of your detailed testing and reporting, Douzerouge!  You certainly have a strange situation there.  When I took my Logan Square city, which is saturated with bus stops and has essentially no subways but lots of trams and some el rail, and I switched from Simulator Z v2.1 to v2.1 (Euro), this is what I got:


You can see where the switch was made, right in the middle of the graph.  All forms of mass transit usage increased, while car usage plummeted.  The result was the approximately 4:1 ratio of bus passengers to car passengers that I had mentioned earlier.  This is a somewhat extreme case, since I had bus stops all over the city, but it certainly shows the difference that the Euro version can make.

So why didn't you see such a difference?  I think a big part of the reason has to do with the wavy lines in your Traffic Volume Graphs.  The frequency of the waves corresponds to the time it takes to run through two cycles of the traffic simulator.  So in the first cycle, all the Sims pile into the various forms of mass transit, while in alternate cycles, a lot of them leave it.  But the increases and decreases are synchronized across mass transit forms, which means that the total amount of mass transit trips is increasing and decreasing with each run of the traffic simulator.  Where are all these Sims coming from when traffic increases?  Where do they all go when it decreases?  I think a big clue is in what you said here:

QuoteThe city suffers from the 'eternal commuters' syndrome (verified with the Census data), since it has two neighbor cities and many Sims travel in triangular fashion between them. I mention it, since it may have an effect on some test results.

I think you are quite correct here.  I've seen plenty of eternal commuter loops, but never any that had a marked effect on the Traffic Volume Graph.  It appears that your eternal commuter traffic may be having a big effect on your whole region, in which case these tests aren't really providing us with useful data.

I'm fairly sure that the problem is not in Simulator Z, but there's one thing you can do to rule that out.  Could you please rerun your first city, but use Simulator E (5x)?  This is the traffic simulator that is closest to the version of Simulator Z you used, but at the same time, it is extremely different.  If you still get any wavy lines in your Traffic Volume Graph, then you have some underlying problems in your region that need to be addressed.  In general, Simulator E should should show traffic volume patterns very similar to Simulator Z (Euro).

In any case, you're going to need to break your eternal commuter loop.  The most surefire way of doing so is to sever all connections between any two cities in the loop.  You can often get away with less than that by leaving some connections near the centers of tiles, especially if they connect to business areas.  But large eternal commuter loops will cause you problems, and need to be dealt with.

So I would be very interested to see what happens if you try Simulator E in the way I suggested.  I would also really like to hear from other people who have tried the Euro version of Simulator Z in their cities; a simple post of the Traffic Volume Graph before and after the switch (such as I have done) would be very helpful.  I've tried this version in many of my cities and gotten the expected results; I'd really appreciate hearing how this has worked for others.

pierreh

#451
Thanks a lot for the interpretation of the tests and the advice.

I will run the Sim E test on Anterne and produce results. This will probably have to wait until at least tomorrow evening, possibly later, because of RL commitments. Later I will address the eternal commuter syndrome, which I intended to do anyway at some point but was always postponing. It will change markedly the global layout of my region, and require some solid modifications to the affected cities, but it is an interesting challenge.

gabrielbyrnei

Quote from: z on January 07, 2010, 04:19:09 PM
Yes, SC4 works fine on Windows 7 - that's what I'm running.

Another option you might want to consider is the VMware Player, which is free.  From my short experiments, it seems to run SC4 fine.  And since it uses hardware virtualization, I would expect it to be much faster than Wine.




Tried SC4 on Windows 7, even worse than on Linux while playing a big city tile, it is taking up to a 1 minute per month at cheetah speed (extremely slow IMO)

tamorr

   I was wondering what Dataview I should be using for the Euro v2.1, would the ones included in the standard v2.0 be fine? I can't really do any testing, but I know that is the one I'd like to use when I do intend to play, or rather am able to. So which Dataview should I be using?

Thanks for all your hard work. :)
  "It is wiser to think about your actions before doing them, but be warned One must act quickly before another takes action for you."
  "Knowledge may be Power, but it is how you use that Knowledge that makes One Powerful."
  "I am a Philosopher, Punnist, Poet, and Rambler so keep in mind I think ahead and backwards to point where communication is sometimes not completely understood, even if Enlish is my primary language, it doesn't mean I know it well N proper."
  "Always do your best to acheive your goals and Dreams one at a time."
"Patience is a virtue."

z

Quote from: gabrielbyrnei on January 10, 2010, 06:06:34 PM
Tried SC4 on Windows 7, even worse than on Linux while playing a big city tile, it is taking up to a 1 minute per month at cheetah speed (extremely slow IMO)

I used to average almost that much on my old machine, although I'm down to about 13 seconds/month average on my new one.  So it does depend a lot on the hardware.  Linux takes up a lot less memory than Windows 7, and I would imagine that that's true even when you add Wine to it.  For that reason, I would think you're having worse performance with Windows 7 because you have less memory available for the game; the traffic simulator is especially memory intensive.  For example, if you have only a gigabyte of memory, I think that would definitely be a large part of part of your problem, and I'd recommend picking up another gigabyte.

Also, the game was built with its own internal scheduler, so to the outside world, it appears to be single-threaded.  So three of your four cores are going unused by the game.  That's too bad, because something like the traffic simulator is just begging for massively parallel processing.

Quote from: tamorr on January 11, 2010, 05:05:25 PM
   I was wondering what Dataview I should be using for the Euro v2.1, would the ones included in the standard v2.0 be fine? I can't really do any testing, but I know that is the one I'd like to use when I do intend to play, or rather am able to. So which Dataview should I be using?

The data views are the same as for the standard versions, so the ones that came with v2.0 would be the ones to use.  The data views are differentiated only by network capacities, which are identical here.

Quote
Thanks for all your hard work. :)

You're welcome! :)

sumwonyuno

Running a guest OS on top of a host OS will (almost) always have major performance hits.  On top of that, if you're doing 3D, it's going to have worse performance than with wine.  Wine is a compatibility layer and it'll translate instructions for one program... that's where the performance hit is.  Virtualization attempts to translate instructions for the whole OS and all programs you run on the OS... so that's why performance is hit really hard.

I agree with z, even though gabrielbyrnei has a really good hardware setup (at the moment), the code that SimCity 4 written in will not take advantage of modern hardware.  Plus, the size of gabrielbyrnei's city and slow performance shouldn't be surprising.


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

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

gabrielbyrnei

Yeah guess going from 2 GB to 4 GB memory could help, maybe not.


Its just not fun IMO for the game to take 1 full minute or even a bit more for 1 month of ingame time. I by far like much more the responsiveness of a medium size tile city.
My plugins folder, datpacked, weights around 1.7 GBs

pierreh

#457
The test with the E (5x) Simulator was run on Anterne. The graphs are very similar to the ones shown in my earlier post: very heavy fluctuations of both the travel time and the traffic densities:




So it looks like the eternal commuter syndrom is affecting that city very seriously.

I should however mention that last Sunday I played on another computer, using a city (in a different region) that has also the eternal commuter syndrom; using the 2.1 Z High Simulator for a duration of about 3 years I had no heavy variations on the graphs - the curves were quite smooth. I did not have time to play the game longer, so I draw no conclusion from that session.

I assume that I should now undertake the modifications to my cities, at least to the ones involved in the recent tests, to break the eternal commuting loops. It may take me a while, and I will only return after having completed that work.

plutino

My first post on this thread.  First of all, it is a greater simulator and my traffic pattern and usage are now much more realistic.  Great work, and thanks to z. 

My question is, should bus usage be discounted for its contribution to congestions? Say, ten bus usages count as one car usage?  Isn't this more reasonable?  With the current 1:1 ratio (I assume), there isn't much reason to use bus to solve traffic problem. 

xxdita

There isn't an option as to how much traffic busses can create, only whether or not they create traffic.