• Dear visitors,

    The email issue has been finally solved.
    Thank you for your patience and happy browsing.

    Team ACM.

Working Starting timer for my track

Xuacu

Member
input = one ; is 1 sec yes
flashing_freq = 0.0333 is 1/30
so now we stretched 1 in 30 parts/seconds
in the flashing_lut we switch to percent
at 0.666 * 30secs = 20secs
and we want the light to turn on 'sharply' at that point
...0.666=0|0.666=1...

we could do some 'fade' in:
...0.664=0|0.668=1...

(0.668 - 0.664) = 0.004 * 30sec = 0.12secs fade-in time
I still don´t understand why you streched 1 second in 30 parts of second :oops:. It is because you decided that the loop is 30 seconds? If I want a loop of 50 seconds should I use Frequency=0,02 (1/50)?
 

fughettaboutit

aka leBluem
I still don´t understand why you streched 1 second in 30 parts of second :oops:. It is because you decided that the loop is 30 seconds? If I want a loop of 50 seconds should I use Frequency=0,02 (1/50)?
yes exactly, the idea was rally cars can go off every 30 seconds, 30 was choosen on purpose
 

Xuacu

Member
yes exactly, the idea was rally cars can go off every 30 seconds, 30 was choosen on purpose
Ok! in my case I want to make a traffic lights for real traffic (traffic planner) and I have to time the loop of a standard traffic light.

from the minute 47:33
 
Last edited:

fughettaboutit

aka leBluem
no idea how you sync the cars movement to the green lights, but you would need 6 six different lights and conditions, three for one direction, three for the other direction

i made a table for it and the luts
https://docs.google.com/spreadsheets/d/1oySD6tGoShqi45zFcpu5BKBlLHDHF5Od/edit?usp=sharing&ouid=109009767124286172412&rtpof=true&sd=true

edit: i probably made some error, it might not be fully symetric
i mean not same timespan of green/red for both directions
edit: actually it is, 8 rows red and 7 rows green on both sides :)
 
Last edited:

Xuacu

Member
no idea how you sync the cars movement to the green lights, but you would need 6 six different lights and conditions, three for one direction, three for the other direction

i made a table for it and the luts
https://docs.google.com/spreadsheets/d/1oySD6tGoShqi45zFcpu5BKBlLHDHF5Od/edit?usp=sharing&ouid=109009767124286172412&rtpof=true&sd=true

edit: i probably made some error, it might not be fully symetric
i mean not same timespan of green/red for both directions
edit: actually it is, 8 rows red and 7 rows green on both sides :)

In the Traffic Planer intersection edition you have the option of assigning traffic lights to each entrance, and one option is to assign an emissive element for each signal, red, amber or green. I want to test if it can work but first I have to get the light sequence right.

I already had in mind that I had to do a minimum of 6 conditions for a 2-road intersection.

I have tried your rally traffic light configuration and it works perfectly even though I am having MATERIAL_ADJUSTMENT problems but I don't care too much about that now before I want to do the light loops well
 
Last edited:

fughettaboutit

aka leBluem
ok its more different, i post a complete and tested conditions later

wait, traffic planner has something for that? then we dont need this condition stuff!
 

Xuacu

Member
ok its more different, i post a complete and tested conditions later

wait, traffic planner has something for that? then we dont need this condition stuff!
Yes it has. when you create an intersecction in the "edit connections" of each intersecction you can modiffy parameters and one of the options is "traffic light". But depends your CSP version can enter to the edition or not, in my case 1.1.79 does not work well but 1.2.2 works all intersection configurations
 

fughettaboutit

aka leBluem
note that you need to set
1=1 as last value if first lut-value is =1
and vice versa
1=0 as last value if first lut-value is=0

Code:
[CONDITION_...]
NAME=T1_RED
INPUT=ONE
FLASHING_FREQUENCY=0.02
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=1|0.50=1|0.50=0|1=0|1=1)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T1_YELLOW
INPUT=ONE
FLASHING_FREQUENCY=0.02
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.49=0|0.49=1|0.50=1|0.50=0|0.99=0|0.99=1|1=1|1=0|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T1_GREEN
INPUT=ONE
FLASHING_FREQUENCY=0.02
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.50=0|0.50=1|1=1|1=0)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T2_RED
INPUT=ONE
FLASHING_FREQUENCY=0.02
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.50=0|0.50=1|1=1|1=0)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T2_YELLOW
INPUT=ONE
FLASHING_FREQUENCY=0.02
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.49=0|0.49=1|0.50=1|0.50=0|0.99=0|0.99=1|1=1|1=0)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T2_GREEN
INPUT=ONE
FLASHING_FREQUENCY=0.02
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=1|0.50=1|0.50=0|1=0|1=1|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1
 
Last edited:

Xuacu

Member
note that you need to set
1=1 as last value if first lut-value is =1
and vice versa
1=0 as last value if first lut-value is=0

Code:
[CONDITION_...]
NAME=T1_RED
INPUT=ONE
FLASHING_FREQUENCY=0.2
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=1|0.5=1|0.5=0|1=0|1=1)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T1_YELLOW
INPUT=ONE
FLASHING_FREQUENCY=0.2
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.48=0|0.48=1|0.5=1|0.5=0|0.96=0|0.96=1|1=1|1=0|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T1_GREEN
INPUT=ONE
FLASHING_FREQUENCY=0.2
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.52=0|0.52=1|1=1|1=0|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T2_RED
INPUT=ONE
FLASHING_FREQUENCY=0.2
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.52=0|0.52=1|1=1|1=0|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T2_YELLOW
INPUT=ONE
FLASHING_FREQUENCY=0.2
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=0|0.46=0|0.46=1|0.5=1|0.5=0|0.98=0|0.98=1|1=1|1=0|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1

[CONDITION_...]
NAME=T2_GREEN
INPUT=ONE
FLASHING_FREQUENCY=0.2
FLASHING_SYNCED = 1
FLASHING_LUT= (|0=1|0.52=1|0.52=0|1=0|1=1|)
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1
Thank you so much, I will try it! but at the end i will calculate the time of a real traffic lights because depends the main road and secundary roads preference time
 

Xuacu

Member
Hello! here is my current traffic light status with some problems


The problem is that I defined a loop of 90" but in AC the loop takes 141,5" and I dont understand why. The time of the green and yellow matches with my calculation but the red light spend much more time but matches with the start of the loop correctly...

I can change the FLASHING_FREQUENCY (in my case is: 1/90 = 0,0111) and
and approach the real time of 90" in AC but the green and yellow correct times I would waste and would be a mess recalculate at a guess.

Below I explain my calculations (if I get everything working I will make a tutorial on YouTube explaining everything step by step):


This is my loop. Traffic lights A+B are those on the main road, C and D are on the secondary one that cross and operate one after the other.



In Asseto Corsa I have only tried the AB timeline so we discard the rest for the moment



The green traffic light starts at 0 and ends at 23" then amber lasts 3" and red from second 29 to second 90

1/90= 0,0111 is the frequency. To calculate the LUT I divide each on/off time by 90 and these are the values: 23"/90=0.255; 26"/90=0.288 so the LUT looks like this:

AB_GREEN
FLASHING_LUT= (|0=1|0.25=1|0.25=0|1=0|)

AB_YELLOW
FLASHING_LUT= (|0=0|0.25=0|0.25=1|0.28=1|0.28=0|1=0|)

AB_RED
FLASHING_LUT= (|0=0|0.28=0|0.28=1|1=1|)

But the problem is that the loop lasts much longer than I calculated and I don't understand why.

Below I leave all the traffic light configuration:

----------------------------------------------------------------------------------------------------------------------------

[MATERIAL_ADJUSTMENT_...]
ACTIVE=1
DESCRIPTION = Green AB Traffic Light
MATERIALS= Disco_Verde
KEY_0=ksEmissive
VALUE_0=0,150,0,1.09
VALUE_0_OFF=0, 0, 0
KEY_1= ksAlphaRef
VALUE_1=0
VALUE_1_OFF=100
RANGE=25
CONDITION= BLINKGREEN

[MATERIAL_ADJUSTMENT_...]
ACTIVE=1
DESCRIPTION = Amber AB Traffic Light
MATERIALS= Disco_naranja
KEY_0=ksEmissive
VALUE_0=255,150,0,5.09
VALUE_0_OFF=0, 0, 0
KEY_1= ksAlphaRef
VALUE_1=0
VALUE_1_OFF=100
RANGE=25
CONDITION= BLINKYELLOW

[MATERIAL_ADJUSTMENT_...]
ACTIVE=1
DESCRIPTION = Red AB Traffic Light
MATERIALS= Disco_Rojo
KEY_0=ksEmissive
VALUE_0=255,0,0,1.09
VALUE_0_OFF=0, 0, 0
KEY_1= ksAlphaRef
VALUE_1=0
VALUE_1_OFF=100
RANGE=25
CONDITION= BLINKRED

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

CONDITIONS

[CONDITION_5]
NAME=BLINKRED ;
INPUT=ONE
FLASHING_LUT=(|0=0|0.28=0|0.28=1|1=1|)
FLASHING_FREQUENCY=0.0111 ; loop 90 seconds
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1
FLASHING_SMOOTHNESS=1


[CONDITION_6]
NAME=BLINKYELLOW ;
INPUT=ONE
FLASHING_LUT=(|0=0|0.25=0|0.25=1|0.28=1|0.28=0|1=0|)
FLASHING_FREQUENCY=0.0111 ; loop 90 seconds
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1
FLASHING_SMOOTHNESS=1


[CONDITION_7]
NAME=BLINKGREEN ;
INPUT=ONE
FLASHING_LUT=(|0=1|0.25=1|0.25=0|1=0|)
FLASHING_FREQUENCY=0.0111 ; loop 90 seconds
FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1
FLASHING_SMOOTHNESS=1

----------------------------------------------------------------------------------------------------------------------------


On the other hand, I don't know what these values mean and if they affect the loop (I copied them from your first example):

FLASHING_SKIP_OFF_STATE=1
FLASHING_SKIP_DOWNHILL_STATE=1
FLASHING_SMOOTHNESS=1


Afterwards I tried to set these values of fughettaboutit excel and the loop when stopping stays static at the red light and does not start again, perhaps the problem is in these lines, I don't know...

FLASHING_SYNCED = 1

If it occurs to you what the problem could be, it would be of great help to continue. I haven't yet tested if the traffic lights work with traffic planer, during the week I don't have much time to experiment.

Thank you very much in advance
 

Attachments

Last edited:

Xuacu

Member

Rob Pawn

Active Member
more than a year ago i tried this, with the same result.
and my intersection looked the same like yours (with more than 4 sides)

now i was curious again and made a test.
it seams to work for me somehow?! is it gambling tho?! i dunno...

but i suggest try it with a normal 4 sided square intersection
if this is not the solution like i think it is, maybe try messing around with the priority offsets.
basically that every side/lane has another priority (in intersection menu)

upload_2024-3-31_11-34-28.png


but anyway, main focus is on multiplayer traffic. isn't it?
 

Xuacu

Member
more than a year ago i tried this, with the same result.
and my intersection looked the same like yours (with more than 4 sides)

now i was curious again and made a test.
it seams to work for me somehow?! is it gambling tho?! i dunno...

but i suggest try it with a normal 4 sided square intersection
if this is not the solution like i think it is, maybe try messing around with the priority offsets.
basically that every side/lane has another priority (in intersection menu)

View attachment 8399

but anyway, main focus is on multiplayer traffic. isn't it?
Thank you very much! I have to try it!
 
Top