• Welcome to SC4 Devotion Forum Archives.

Traffic Signals in SC4--A Discussion Thread

Started by Tarkus, June 29, 2008, 12:11:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blue Lightning

#200
Andreas: Turns out, it wont take anything over 3 frames (it will turn into a regular animation) but there is a workaround that will simulate it: the traffic lights will be normal, but in the same position as the yellow light there is another traffic light that takes the stop data from the crossing traffic and will only be shown during that cross traffic's yellow phase, thus overriding the off yellow on the facing light. (phew run-on sentance)

@Alex and Jayson: Thanks!

EDIT: I will be posting a tutorial here very soon ;)
Also known as Wahrheit

Occasionally lurks.

RHW Project

b22rian

Quote from: Tarkus on August 08, 2009, 05:55:55 PM
Blue, you are officially awesome.  This is fantastic, groundbreaking work here! :thumbsup:

-Alex

I have to fully agree... I think the future of the transit modding in general is going
to be very exciting indeed with Blue around !.. Congratulations on this stunning new
discovery here  &apls

Brian

Ryan B.

Truly groundbreaking.

Blue & Alex - y'all have copies of my signals - feel free to try 'em out and see how they work!  :D

Blue Lightning

#203
Ryan: There is a slight problem: See the model information below.

Custom Traffic Light Tutorial

First off, you are going to need GMAX, BAT, and SC4BAB


Model must be animated in sequence of Green yellow red, one frame per color.

When making the model, you must only have the light console unless the pole is small enough.
Once you are done with the model, group it, center it at 0,0,0, then rotate it to face east. (usually rotate 90 on the Z axis) This is important because the stoplights take stop point data perpendicular to the LE orientation arrow.
Refit your LODs.

Follow the readme until you get to the part with saving the dat. In the Group box, enter in 0x2a2458f9
Leave the IID box as-is (unless you are replacing a maxis stoplight, in this case enter in the IID of the maxis ATC file)

After that, you don't need to edit any other options, as our custom exemplar will replace it.

Now, don't close out just yet. Change the IID to whatever IID -1 on fourth digit.
Example:
0xc8380000 is the first save, c8370000 is the second save.

Hit Save dat, then cancel. Then hit Options, then cancel. This is important because it resets the file name to the new IID.
Save the dat.

Now, you may close out of SC4BAB.

Open the file with the larger IID. You should see an exemplar, an ATC file, and 3 AVP files. Remove the exemplar. Keep this file open.
Next, open up the other file. Copy the ATC and AVP files into the first file. Then, copy the template exemplar (inside the dat attached to this post) into the file.

You should see this on the exemplar:


Give your traffic light a name.
In Resource Key Type 0, enter in the larger of the two IIDs.
In Resource Key Type Misc, enter in the smaller of the two IIDs.

Now, your traffic light is now a functioning animated prop. The hard part will be T21ing it (if the light does not replace a maxis light).
The hard part about it is laying out the traffic light on the tile. It will not appear to rotate in LE. Remember when you rendered that the light faces east?

Table of rotations.


Now, from here you will follow either Swamper77's or Xyloxadoria's T21 tutorial.

And thats pretty much all to it.... you all have it a lot easier than I had (instead of BAB GID and IID editing, I had to edit the ATC and AVP files manually)
Also known as Wahrheit

Occasionally lurks.

RHW Project

MandelSoft

Nice job, Alex and Vince!  :thumbsup:

While you are creating new animated lights, I already created an advanced stoplight setup:
         

As you can see, these stoplights adapt to the situation. And even better: they include pedestrian lights and they are in HD quality! But there's only one downside: they are not animated.

Speaking of lights:

This is an experiment of my new lightcones. Like it?

Best,
Maarten
Lurk mode: ACTIVE

j-dub

Good models, but yeah, animating is hard. I am actually responding about the light cones though. If its possible, could the these light cones be rendered that you see them shining down from the top? Yeah, there is the lit spots on the ramp, but it doesn't look like the street lights are lit up. The highway light cone under the high mast light poles in the middle of the RHW are okay, because those are higher up and are more believable.

sithlrd98

mrtnrln: Two things...love the stoplights! Second ,sorry if this is a dumb question... where did you get the streetlights...are they yours?

Jayson

MandelSoft

@sithlrd98: Funny you ask that (you can really see in my signature that I'm the creator of the Light Replacement Mod ;)) but just to be sure: the small white ones are a modded version of Interstate80's Great American Streetlight Mod (this one can be downloaded at his thread at the ITC Creations section, although the pack still contains bugs). The green ones in the middle is an yet unreleased Belgium-styled motorway light.

Best,
Maaren
Lurk mode: ACTIVE

Leodido

your traffic lights are awesome, great job, any chance you'll release them sometime?

Omnia, my first MD. Check it out!

MandelSoft

Quote from: Leodido on August 11, 2009, 04:36:21 AM
your traffic lights are awesome, great job, any chance you'll release them sometime?

Well, I'm planning to do that, but I just need to finish the T21's for some puzzle pieces.
Lurk mode: ACTIVE

jmvl

#210
Unfortunately my ADSL modem broke down last week, so I wasn't able to use Internet (and use my web tools to make some Puzzle Pieces) at all :(. So I decided to find out how if there's a possibility to make traffic lights with more "sessions" (I don't know a better word for it). If you look to the standard road X road intersection, you'll notice that the vehicles may drive in two sessions, like this:



1st session: vehicles on the green arrows may drive
2nd session: vehicles on the red arrows may drive

On all other traffic light controlled road X road, avenue X road and avenue X avenue intersections vehicles may drive in two sessions too.

Since there're two mods being made which allows user to create an advance turn lane setup, namely the TuLEP and Maarten's PRA, these two sessions aren't enough in my view. Look at this example using two sessions:


I simply can't draw roads on the computer using Paint, so I decided to do what I always did when I was 6, 7, 8, 9 years old: simply drawing roads as a grayscale image on a paper. For signs and other stuff I used colors, but I've left these things in this image. Please notice that the image isn't to scale.

1st session: vehicles on the green lines may drive
2nd session: vehicles on the red lines may drive

In my opinion this is a very dangerous traffic light controlled intersection, because left turning vehicles still have to yield and wait for straight on driving vehicles (at some places on the intersection on multiple lanes). So, I think what we need is four sessions, like this:



1st session: vehicles on the green lines may drive
2nd session: vehicles on the red lines may drive
3rd session: vehicles on the yellow lines may drive
4th session: vehicles on the blue lines may drive

That's why I've searched for a possibility to change something in the SC4Path files that control the road x road intersection to make four sessions instead of two. Unfortunately there wasn't a possibility to make four sessions by changing the contents of the SC4Path files at all.  Maybe you've to change the contents of another file to make traffic light controlled intersections with more than 2 "sessions". Does anybody know which file that could be? Thanks in the advance. I hope so it's a file which we can simply and it isn't a limitation of the EXE (unless Maxis is going to change this, but I guess that's very unlikely to happen). It would be great to make traffic light controlled intersections with more than 2 "sessions"; this will add much more realism to the game. If this isn't possible, I think very much intersections of the TuLEP and Maarten's PRA are unrealistic, because there're too little "sessions" and many accidents will happen which isn't the case in real life.

And Maarten, I really like the traffic lights you've made. :thumbsup: I hope there will be a possibility to operate them in 4 sessions, like it's in real life.

Tarkus

Joris (jmvl), I like the ideas you've come up with here.  The way the game controls signals and the stop points in the paths, unfortunately, is very rudimentary.  In doing some further examination into the way the game's default signal animations work, which are supposedly synchronized with the stop points, even they don't work as intended.  If you rotate the view in-game, the animations actually start over and the phases get completely out of synchronization. 

The stop points also have no affect on the game's traffic simulation, either, from every indication, so they are basically just "eyecandy" built into the path files to make the automata occasionally stop at certain intervals defined in the Automata Tuning Exemplar (with the properties Street Go Time, Road Go Time and Avenue Go Time), which sort of synchronize with the game signals.  These values are set to 1.5, 6, and 8 second by default, which isn't even a really accurate figure for a typical signal phase, either. 

An Avenue/Avenue +-intersection would have a total 24 second phase as per the 8 second Avenue Go Time figure.  Such an intersection in RL would likely have a phase lasting substantially longer.  The US Federal Highway Administration (FHWA)'s Manual Of Uniform Traffic Control Devices (MUTCD) mandates a yellow time of 3-6 seconds.  The high end of that figure is the same as the entire phase length accounted for in the Road Go Time setting.

Yes, we could theoretically increase the appropriate properties in the Automata Tuning Exemplar.  But we're still stuck with two phases that are unreliable.  And further, stop points are completely useless on the One-Way Road and RHW networks.

At this point, given this information right now, I am in favor of forgetting the game's stop point synchronization system and animating signals according to RL phasing guidelines, going forward in the realm of signal development.  Yes, this means that there's a good possibility things won't sync with the automata.  But they don't really sync well with the automata as it is, so I don't think we're really losing anything.  And we're gaining animated left turn signal phases, and additional "realism points".

Just thought I'd add my $4.35 to the conversation here.

-Alex

Tarkus

Double posting ::)--though I have further development to share.  For my fellow North Americans, I've managed to fix the positioning of the signals with some creative positioning and using a multi-tile prop setup on single intersection tiles with the T21s. 



These are the "pseudosynch" lights I showed earlier, which don't have the strict positioning requirements of the game's "autosynch" signals.  The signals are modularized, so they're not built onto the mast arm.  This means that they can be easily placed in a variety of different mounting setups (different mast arms, post-mounted, wires, overpasses, etc.).

As evidenced by this image, Avenue/Avenue intersections will finally be able to have the proper North American positioning with the signals on the far side of the intersection.  Now to get arrow signals in place. ;)

-Alex

jmvl

Alex, thank you so much for sharing this very useful information with us. I regret that we can't make traffic light controlled intersections with four phases, but there's no way around it because you can't change it in any file so it's a limitation of the EXE. I also regret the way Maxis had programmed the traffic lights and its phases. If Maxis is going to modify the EXE, which they probably aren't going to do, I think they should also add a possibility to define the phases at traffic light controlled intersections, e.g. by adding some rules in the SC4Path files which define the phases.

Yesterday I tried to change the property "Road Go Time". I totally agree with you, 6 seconds isn't enough and very unrealistic. So I changed it to 45 seconds, so every phase takes 45 seconds. While phase A was allowed to drive, phase B had to wait. Because phase B had to wait so long, cars just disappeared from the road after they waited around 5 seconds. We should increase the property "Road Go Time" to add more realism in the game, but we don't like to see how cars disappear from the road. Does anyone know if this "disappearance of cars" is controlled by a property in a file or that this is also a limitation of the EXE?

I don't like your idea to make traffic lights that doesn't sync with the automata at all. Ok, at the moment they don't sync very well with the automata, but they still sync a bit. So when the traffic light turns green, cars often drive. If you make traffic lights (with four phases) that doesn't sync with the automata at all, cars are just driving when you shouldn't expect that. To my opinion this will show very strange results in the game and furthermore it will cause confusion for the player when (s)he is playing in the UDI modus because (s)he don't know when (s)he may drive. Also, the UDI player will cause often an accident.

Thus to my opinion we still have to make traffic lights with two phases. Unfortunately this doesn't allow us to make realistic advanced traffic light controlled intersections (with 4 sessions), but if we can't do this I think we should do something else: we should start creating traffic light controlled roundabouts. Or we should make Puzzle Pieces that allows the user to create setups like a Michigan left or a Superstreet.


A schematic Michigan left setup. Please notice that the "straight on" arrows are just to show you how the vehicles will drive through the setup, these arrows can be omitted in real life.

One of the benefits of traffic light controlled roundabouts, Michigan lefts and Superstreets is that two traffic light phases are enough and it still looks realistic in the game.

P.S.: I like the traffic lights (including their right North American position) you've T21-ed today.

j-dub

Oh my God Alex, that looks so much better.  :thumbsup: As for arrow signals, while the arrows don't function, below is something I have ehbk2006 animated. I can't find the post where he put it that shows the animation, but I have this screen shot. The traffic light's red and green sequence occasionally imitated the Maxis ones, despite not being connected to anything. It would not turn red until after at least a full game's year would pass, but at least it could be placed after RHW and avenues, and still turn red.

At that time, it was the only turning arrow style traffic light with animations. While the turning arrow lights were just dummy models, it at least had some animation to it, if nothing else. I think it may be even closer scaled to the traffic lights you made Alex.

Now, I assume your turning arrow style light will replace the signal on the left of that pole with dummy models attached to the signal where your allowed left turn yield on green, or a third light, like you already have on the poles, except with a sign for left turn on green arrow only? Not that the sequence is there to allow it, but just the sign next to it?

Tarkus

Quote from: jmvl on August 30, 2009, 10:05:17 AM
Because phase B had to wait so long, cars just disappeared from the road after they waited around 5 seconds. We should increase the property "Road Go Time" to add more realism in the game, but we don't like to see how cars disappear from the road. Does anyone know if this "disappearance of cars" is controlled by a property in a file or that this is also a limitation of the EXE?

That'd be controlled by the Automata Tuning Exemplar (modified in the NAM Automata Plugins).  That being said, the game's time-scale is kind of messed up as it is, so I'm not as sure on changing the Go Time properties.

Quote from: jmvl on August 30, 2009, 10:05:17 AM
I don't like your idea to make traffic lights that doesn't sync with the automata at all. Ok, at the moment they don't sync very well with the automata, but they still sync a bit. So when the traffic light turns green, cars often drive. If you make traffic lights (with four phases) that doesn't sync with the automata at all, cars are just driving when you shouldn't expect that. To my opinion this will show very strange results in the game and furthermore it will cause confusion for the player when (s)he is playing in the UDI modus because (s)he don't know when (s)he may drive. Also, the UDI player will cause often an accident.

I hadn't thought about the UDI, but from the experiences I've had with it, even watching the signals, it can be hard to tell when cars are supposed to be going.

My "pseudo-synchronized" technique basically involves non-autosync signals that have been manually calibrated to fit within the Go Time figures in the Automata Tuning Exemplar.  My plan with the "additional phases" was to kind of "fudge it", leaving the main signals on red for a small fraction of their Go Time so as to sneak a left turn phase in.  I'm not completely 100% certain about implementing this, though.

Quote from: jmvl on August 30, 2009, 10:05:17 AM
Or we should make Puzzle Pieces that allows the user to create setups like a Michigan left or a Superstreet.

I've been thinking about the Michigan Left setup, as well as the Continuous Flow Intersection (CFI) as potential expansions of the TuLEPs project, actually, so things would tie in nicely.

Quote from: j-dub on August 30, 2009, 10:36:25 PM
Now, I assume your turning arrow style light will replace the signal on the left of that pole with dummy models attached to the signal where your allowed left turn yield on green, or a third light, like you already have on the poles, except with a sign for left turn on green arrow only? Not that the sequence is there to allow it, but just the sign next to it?

Well, I just built an animated "flashing yellow arrow" protected-permitted signal (which is becoming the norm here in Oregon--ODOT's declared "doghouse" setups "obsolete").  One of the main purposes here was to see if the arrow was actually even visible at that scale.  Here's a pic from in the Lot Editor.  (The reason everything is showing up backwards is because that's actually how you have to orient the signals for them to show up the correct direction.)



For my money, the arrow's not really all that visible and the result is not great.  So I'm leaning toward just doing a solid colored light and fudging it.

-Alex

j-dub

Quote(The reason everything is showing up backwards is because that's actually how you have to orient the signals for them to show up the correct direction.)
Wow. All this time, I had no idea, but in this pic, it looks like you still have them set before the intersection.

QuoteFor my money, the arrow's not really all that visible and the result is not great.  So I'm leaning toward just doing a solid colored light and fudging it.
For a time, my state used to have the green and yellow arrows in the same light, but that no longer is the case anymore when they are replaced. In comparison to Oregon's lights, would this be possible instead? It sounds like you got the flashing arrow to come on when the light turns green?



Quote
My "pseudo-synchronized" technique basically involves non-autosync signals that have been manually calibrated to fit within the Go Time figures in the Automata Tuning Exemplar.  My plan with the "additional phases" was to kind of "fudge it", leaving the main signals on red for a small fraction of their Go Time so as to sneak a left turn phase in.  I'm not completely 100% certain about implementing this, though.
This sounds like an interesting experiment, can't wait to hear how it works.

QuoteI hadn't thought about the UDI, but from the experiences I've had with it, even watching the signals, it can be hard to tell when cars are supposed to be going.
I swear, I have seen the cars blow full reds in this game with the Maxis signals, looking straight down, not in UDI. But when I'm in UDI, this is why I use the horn.

jjeffrey

Quote from: Tarkus on June 29, 2008, 12:11:55 PM
Stop Points do not work on the One-Way Road and RHW Networks.
-Alex (Tarkus)

I just noticed that traffic on a one-way road never stops at an intersection causing constant crashing.

Is this normal behavior?

It seems to make one-way roads unusable (except to watch the cars crash).

-Jeff
Jeffrey

Tarkus

Quote from: jjeffrey on September 01, 2009, 10:14:26 PM
I just noticed that traffic on a one-way road never stops at an intersection causing constant crashing.

Is this normal behavior?

Yes, and it's because Maxis never made the stop points functional on the OWR network.  You'll see the same thing with the RHW, or Maxis Highways.  I think with the OWR, it's partly because of the "reversal" system that they put in place.  When reversing a One-Way Road, it does not change the rotation of the textures, so the game really has no way of telling which side to put the stop points on.

Quote
It seems to make one-way roads unusable (except to watch the cars crash).

Functionally, it still has quite a bit of use.  What you see can be a bit visually jarring, but it has no effect on the network's ability to function.  Your sims can still use it and it will get them to work.  And as you'll notice most of the time, the cars pass right through one another, and the only real "crashes" occur when the network/intersection is overcapacity.

-Alex

jjeffrey

Cool. I really didn't want to remove all of the OWR's I've got.

Thanks, Alex.

-Jeff
Jeffrey