• Welcome to SC4 Devotion Forum Archives.

A New Traffic Volume View

Started by z, August 05, 2008, 08:27:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

b22rian

Z...

thanks for pointing this out to catty and I about road traffic..

Until you did i was thinking also that road= car traffic.. !

Now of course I see how you have itinerized them ..

and that Car is a separate button...

And if you want to make a change with that to avoid confusion I can understand this..

but sorry it was still more work for you  &cry2

Brian

catty

Quote from: z on August 13, 2008, 04:33:50 PM

@catty:  I'm glad this is working for you.  And thanks for the very nice picture upload!  I was planning to do this eventually, but your picture is as good as anything I would have shown.

A word of caution, though.  I notice that you have the "Road Traffic" view selected.  As the name implies, this shows all road traffic - specifically, cars, buses, and freight trucks.  Buses don't count toward congestion ....

I was in a hurry this morning a lot going on in RL, but did want to take the time however briefly to show you how it looking in someone else's city  &apls, so just took a very quick picture of the Road Traffic" view, but yes I do sometimes forget that view shows everything not just cars.

I having been following this topic and your posts in other places with interest  :thumbsup: as I say a lot going on at the moment, so not posting as much as I should, hopefully that should change in the next couple of weeks, but till then I will be  ()lurker().

Cathy  :)

I meant," said Ipslore bitterly, "what is there in this world that truly makes living worthwhile?" DEATH thought about it. "CATS," he said eventually, "CATS ARE NICE.

b22rian

Quote from: z on August 13, 2008, 04:33:50 PM



EDIT:  OK, the modified files have been created, tested, and uploaded.  You can still download them from the same place on the previous page.  The only thing that's changed is the title of the Road Traffic view.  Functionality is identical.

Ok, Thanks Z...

i think I have the hang now of using the original  uploaded graph..

So im going to just stay with that...

But new people downloading it will be able to avoid the confusion I'm sure...

Brian

z

In this post, I will explain in detail the changes I made to the Traffic Volume View and why I made them, the purpose of this being that it may help people to better utilize this view.  In the second part of this post, labeled "Technical Details," I will describe those technical aspects of the changes that will be useful for people who want to adapt this view for additional simulators, or who simply want to modify it further.  The motivation for these changes has already been described in the first post of this thread, so I will not repeat that information here.

One of the biggest challenges was to choose a color ramp that would preserve fine granularity at lower volume levels, while still scale all the way up into higher volume levels.  I chose 300% for full red because that is a volume level that will certainly be seen occasionally, as you can tell from the picture at the bottom of the previous page.  Although this number is higher than typical congestion volumes you will usually see in Simulators A and B, congestion volumes are based on the total traffic of both periods, so the traffic simulators may allow a lot of traffic in one commute period if there is little or none in the other, which happens not infrequently.  Also, the base number I used was half the network capacity of the underlying network for the travel type selected; this way, the colors and numbers, when averaged (for the colors) and totaled (for the numbers) for the two commute periods would give you a good idea of total daily volume, as well as, in certain cases, the congestion level.  The cases in which the congestion level can be estimated are those where the travel type contains no non-congestion producing types (i.e., no pedestrians, buses, or ferries), and where either it is the sole user of the underlying network (such as subways, as long as you don't have an elevated train running directly overhead), or you sum the travel types that use the underlying network (such as cars and freight trucks for roads, or passenger and freight trains for rail.)  Clear?   ???

Turning back to the color scale, the Maxis color ramp has a maximum of 256 levels, which means that a top number of 300% implies a bottom number no lower than 1.17%.  In order to keep things reasonably simple, in my implementation I made certain choices that resulted in this number's being 1.5%, which is why you see 1.5% as the first level in all the views.  The first three colors of legend correspond to the earlier colors in the old Traffic Volume View.  There are actually two intermediate colors in the color ramp, and in addition, the program interpolates colors, so up to the 10% level, different color shades are separated by about 1.5%.  It's important to note here that all numbers are approximate, including the numbers shown in the legends table; I did my best to make them correspond to the beginning of the range of the color displayed.

After 10%, the next color in the color ramp is actually the pure green shown for 100%.  All intermediate colors are interpolated, including the two shown in the legend, which were calculated manually.  Between 10% and 100%, there's an interpolated color about every 5%.  This 5% range for each color continues up to the pure yellow at 130%.  Between the pure yellow and the pure red, gradations are less important, and color shades are about 10% apart.

For each travel type, I had to decide which network capacity to use for legend colors and volume numbers.  For most travel types, this was quite simple; subways used the subway capacity, etc.  However, since some people might be confused by the difference between travel type and network, I added a little subtext at the bottom of some of the legends.  For example, for passenger train and freight train, I indicated that the percentage numbers referred to rail capacity.  I did this so that people wouldn't think that there was a separate passenger train capacity and a separate freight train capacity.

Roads were trickier, though.  Anything that can travel on roads can also travel on streets and highways, which, just to confuse things, are also shown in the road view, along with the car, bus, and freight truck views.  Since roads are the intermediate capacity network, and since in many cities they are the overwhelming choice for motor vehicles (with streets coming in second), I chose to use road capacity for the car, bus, and road views.  Freight trucks have much smaller traffic volume than cars or buses, so to get meaningful visual data for them, I used street capacity.  Each of these choices is indicated in the subtext below the legend of each view.

Now we come to pedestrians.  Although for many cities, pedestrians are the highest volume travel type, their travel patterns tend to be the most spread out.  As a result, there is relatively little pedestrian volume in any given area.  For this reason, I used street capacity as their volume benchmark; it seems to work out well.

Finally, there are ferries.  There is no underlying network for ferries, there is no capacity limit on them, and they don't contribute to congestion.  For this reason, they are the only travel type not to have percentage numbers in their legend.  Instead, I picked reasonable numbers based on my experience, and plugged them in.  If anyone who uses ferries extensively thinks these numbers need to be changed, please let me know.

In the current simulators, the percentage levels (from 1.5% to 300%) are the same for all travel types.  However, if you ever use a traffic simulator that has networks with capacities above 43,000, then due to limitations in the core SC4 program, it is not possible to display scales all the way up to 300% for those networks.  Exactly what the limit will be depends on the capacity of the network.  Further explanation of this is given in the "Technical Details" section.

Notice that for every travel type, most transit stations are lit up.  This has nothing to do with their usage; this is simply so that you can locate them easily.  If a certain type of transit station doesn't light up, it simply has to do with the way it was designed.

Technical Details - First, I'll tell you all what you're dying to know most:  What's that fourth number really mean in the color code for this view?  First, jplumbley said that the color code was RGB, with the fourth number transparency:

11223344

But it was clear from looking at it that this wasn't correct, for reasons I described on the previous page.  Instead, I said it looked to me to be a BRG (BRG? ???) code, with the fourth number once again transparency:

11223344

Close, but no cigar.   $%Grinno$%  (Besides, who ever heard of BRG?  ::) )  Instead, it actually is RGB, with the first number being some sort of transparency factor.  Like this:

11223344

This makes a lot more sense, as you can see that the first number is fairly similar across all colors.

Now on to more mundane topics.  There are only two more items in the exemplar that need explaining.  The first is the "DataView: Highlight mode" property, with which many of you may be familiar.  In this case, setting it to 9 causes all the transit stations to light up in the current view.

The second item is "DataView: Maximum scale."  I have scaled the color ramp and the legend color in such a way so that in order to get proper results, this property should be set to exactly twice the nominal capacity of the relevant network.  There's nothing special about two; it just allows me to make greatest use of the color ramp range while using an integral multiple of the network capacity here.

So that's about it... except for the notorious (and very obscure) Network Volume Cap.  (Boy, was this a pain to find and fix.   ::) )  As you know, you can set your network capacities to whatever you want, since they're Float32's.  But what many people don't know is that network volume is a whole different story.  It turns out that the game stores network volume per commute period per tile internally as a Uint16.  This means that you will never see a network volume go higher than 65,535.  The total daily commute figures are not subject to this 64K limit, however, so you'll still see congestion where you'd expect it.  In fact, it appears that the total daily commute figures have the actual traffic volume incorporated in them, even if it exceeds 64K during a commute period.   ()what()

What are the practical applications of this?  As long as your network capacity is no higher than 43,000, you won't run into any trouble.  Even though the "DataView: Maximum scale" number for such a network would be 86,000, this is actually an artificial number, as explained above, and causes no problems.  If your network capacity is 64K or higher, though, problems can arise.  If you use the standard 300% upper limit in the volume views with such a network, then as soon as a commute period volume reaches 64K, the cute little moving white dots disappear from that particular volume view (and only that view).  If the volume drops back below 64K, they come back.

The solution here is simple, and only slightly draconian.  In such a case, the "DataView: Maximum scale" number should be set to 0xFFFF, and the top of the legend color scale needs to be set to no more than 64K.  All the percentages in the legend need to be adjusted appropriately.  The color ramp for that network then needs to be redone so that the index for pure red is 255, instead of the standard 195 for this view.  So you can have network capacities higher than 64K, just not too much higher.  For example, if you used 128K, the Data Volume View would never show anything higher than green.  In practice, I find that 80,000 is a reasonable maximum.  And yes, I've actually tested all this out - it's in my default simulator.

Earlier, I mentioned a limit of 43,000.  This number comes up because it's the Network Volume Cap times two (for two commute periods) divided by three (because the default scale goes up to 300%).  If you use a network capacity between 43,000 and 64K, I believe you run into some problems that need to be fixed, but I've never tried this out, so I can't say any more than that.

So that's it.  Any questions?   :)

b22rian

Quote from: z on August 15, 2008, 03:06:18 AM

Earlier, I mentioned a limit of 43,000.  This number comes up because it's the Network Volume Cap times two (for two commute periods) divided by three (because the default scale goes up to 300%).  If you use a network capacity between 43,000 and 64K, I believe you run into some problems that need to be fixed, but I've never tried this out, so I can't say any more than that.

So that's it.  Any questions?   :)

No questions so far Z.. You have done your usual through job of explaining everything.. And its much
appreciated with all the time you have already put into this..

I do have one network which is quite congested with a reading over 30 K in my city ( one commute- evening)..
Believe it or not a monorail line using the double high new puzzle pieces from the nam.. ( I tried to build my
largest city using monorail and a lot of hsr and ghsr is why..)  But i will let you know if anything strange happens
if i eventually get any network lines over this 43 K figure you mention.

Thanks Brian

z

#25
The 43,000 refers to network capacity, not volume.  Nothing unusual happens if a network happens to pass that volume, regardless of its capacity.  The volume is affected only at the 64K limit.  So the only time you'll see an anomaly is if your network volume for a given commute period hits 65,535 (which is extremely unlikely in the current simulators).  And even if that happens, the only thing unusual that happens is that the volume on that network will never appear any higher than that number.  The little white moving dots don't go away, because the network capacity for all networks in Simulators A and B is under 64K.

As for what's really going on in a network where the volume appears stuck at 64K, it's hard to say definitively, but it appears that everything is working OK except for the volume number that is reported.  It does not appear that Sims are waiting to enter the network because it's full.  I've briefly seen a network with capacity of 80,000 hit full red on the Maxis congestion scale, which would imply a total daily traffic volume of around 200K.  This implies that part of the program is still accurately keeping track of every Sim that enters and leaves the network.

b22rian

OK, Thanks for explaining that Z..

Ya, I doubt I will ever have a network over 64 K too.. I generally try to avoid congested networks in my
city.. I dint try to cause them to get congested..

Thanks Brian


b22rian

Z, .. I just wanted to give you an update, because i've been using the traffic volume view for awhile now..
      But its working great.. no problems at all, and a wonderful new addition to the game !   &apls

Brian

b22rian

 Hi Z...

i was reading all the wonderful comments and reactions that your Volumes graph got over at simtropolis..
and there all so well deserved too..

I think for a single modification in the game, its really 1 of the greatest improvements from the original game
which maxis put out 5 years ago.. Its right up there with the new traffic sims, with the rural highway  ect..
I think its that significant of an improvement to this game.. and I strongly encourage everyone out there  reading
this to dl it from simtroplis exchange , and try this out .. you wont be disappointed i will promise you !!,

Thanks again Z for all the work and time you put into this , although i suspect now you think it was worth it..

Regards, Brian

j-dub

This looks like it was extremely difficult to do. I guess it was so hard Maxis couldn't figure it out (maybe they eventually could of, if EA wasn't in such a rush all the time). Your very smart Z. This is a major improvement. Good job.

z

Quote from: j-dub on August 21, 2008, 01:22:26 PM
This looks like it was extremely difficult to do.

That's the funny thing - it wasn't.  I got the original graph working with all the current colors in about two hours.  Getting the legends done properly was harder - I had to learn about LTEXT (I'm still a real novice in most areas here), and the two interpolated colors in the legend below the green had to be essentially figured out on a brute force basis.  But the most time consuming thing is something that doesn't even show up in the current version, and this was figuring out how to make it work with networks whose capacitiy is greater than 64K.  (This is actually necessary for my new traffic simulator, which is what I use all the time.)  Still, with everything put together, I've spent more time writing about this view in this thread than working on it, which seems somewhat ironic.

The original Traffic Volume View was introduced with Rush Hour, and as you point out, it looks like a rushed job.  My guess is that Maxis had very little time to do this, and what they did was certainly a lot better than nothing.

Thanks for the kind words, and also those from Brian, as always.

TheTeaCat

very nice addition to the game :thumbsup:

Been using it no probs whatsoever , excellent work. &apls
thanks for sharing this with the community :thumbsup:

well worth this


:satisfied:
TTC
Kettle's on. Milk? Sugars?    ps I don't like Earl Grey  $%Grinno$%
Reduce, Reuse, Recycle - If you're not part of the solution , you're part of the problem!
"Never knock on Death's door: Ring the bell and run away! Death really hates that!"
Tales at TeaTime      Now A proper NUT      TTC plays GRV II

b22rian

Quote from: z on August 21, 2008, 02:01:51 PM
That's the funny thing - it wasn't.  I got the original graph working with all the current colors in about two hours.  Getting the legends done properly was harder - I had to learn about LTEXT (I'm still a real novice in most areas here), and the two interpolated colors in the legend below the green had to be essentially figured out on a brute force basis.  But the most time consuming thing is something that doesn't even show up in the current version, and this was figuring out how to make it work with networks whose capacitiy is greater than 64K.  (This is actually necessary for my new traffic simulator, which is what I use all the time.)  Still, with everything put together, I've spent more time writing about this view in this thread than working on it, which seems somewhat ironic.



Yes, that was thing that really amazed me Z, was how fast you did all this.. I think to some of us..who obviously
don't have your technical know- how with this stuff.. it looked very impressive how fast you overhauled this
important graph we have been using for the better part of 5 years and u did it seemingly fast too !

And also I sensed much of this was all new to you as you have been saying in some of your posts..
You have some very special abilities Z, and i dont think im overstating it to say you are one of the smartest
and most talented modders this board has ever seen before.. And as long as you enjoy what your doing here
and the game  ect.. nothing you can accomplish with any of this would surprise me any more..

it also very nice of you to give some of the detailed explanations ( and I realize takes time to write them),
such that those who dont share the gifted abilities you have can enjoy some of the learning processes of this
game..

Brian

z

There is now an updated version of the new Traffic Volume View.  It contains support for additional traffic simulators, as well as a bug fix.  You can find it here.

The new traffic simulators supported are all the remaining ones in the current NAM, as well as the original Maxis traffic simulator.  This means that this view can now be used on machines that don't have NAM installed.  Full details are in the Readme file.

While testing the view for the additional simulators, I discovered a bug that was present in all versions of the Traffic Volume View.  The colors displayed in the subway view (and only that view) were off by a little bit; this is now fixed in the current version.  I also adjusted the two interpolated colors in the Legend to be more accurate; these are the two colors above bright green.

So there are no serious problems in the original version, but for greatest precision and ease of use (due to the improved Legend), I would recommend the new version.

b22rian

ok, thanks Z..

I don't think I even bothered to check the subway out much before.. but your improvements are
appreciated..

Thanks, Brian

Cougar2004

#36
Does anyone know if this new traffic volume view mod is compatable with:

1. Tropod's Graph Mod v2.0
2. Tropod's Dataview Mod (RushHour Version)
3. Thalassicus's DataView Detail Mod

These are the three I have always used. I'd hate to break anything.  Thanks.

Oh and also.... this new mod says I have to choose the correct one to complement my choices from when I installed the NAM.  However I'm still not sure (from the readme.txt) which file to use.  I can tell you that I use NetworkAddonMod_Traffic_Plugin_D_BetterPathfinding.dat - It mentioned A and B but did not mention D in the instructions.  Can anyone shed some light on which I should be using?  Thanks.

z

The plug-in is compatible with everything except Tropod's Dataview Mod.  However, like that mod, it does have the station-highlighting feature on the main map.

The C and D traffic plug-ins are named differently in the installation than in the actual files, which is where the confusion lies.  But the basic rules in the ReadMe still apply.  Since your plug-in doesn't end in 2x or 5x, you are using a standard capacity plug-in, and should choose the Standard file.

z

I am pleased to announce that my Traffic Volume View has been approved for the LEX, and is now available for downloading from there at this location.  Although the Traffic Volume View was originally submitted in August, there were some snafus in the evaluation process, but now they have been completely resolved.  So if you were waiting for the official LEX seal of approval before downloading this file, it's here!  And if you download the Traffic Volume View and use it, I would appreciate it very much if you would rate it.

z

Q:  What do you get when you cross the Traffic Volume View with the Subway View?

A:  This:



For quite a while, I've been considering extending the Traffic Volume View to include the Subway View.  The results would look like what you see above, with the colors being the standard colors for the traffic simulator you're using.  The standard legend would also show up on the minimap, showing the various numeric and percentage levels, as long as the minimap was open and any of the Data Views were selected before entering the Subway View.  When you left the subway view, the minimap would return to showing whatever it had been showing previously.

The pros for such an addition are simple:  If you're building new subways, you get to see what current subway usage is while you're building the subways.  This can be very helpful in deciding where to place your new subways.

There's only one downside to this addition, and that is that it becomes a permanent part of the Subway View.  Whenever you entered the Subway View, the colors would be there.  There would be no way to turn them off.

So considering the pros and cons, would people want this feature or not?