Jump to content

Recommended Posts

Posted (edited)

So I have a flag changing based on this condition:

RANDOM (80)

Which, as I understand it, means that there is an eighty percent chance that this condition will be met and therefore that the ACTION of setting the flag  will pass.

 

I've run the mission over 20 times. Each time it NEVER fails this condition i.e. the flag doesn't get flipped. Each re-test is started by doing LEFT-SHIFT + R.

It’s consistently passing this condition, even when I’ve restarted it so many times it should have failed at least once  

 

My question is: does doing that 'restart' re-randomise the RNG that RANDOM is using or do I have to quit the mission to the main menu and re-launch or do I have to quit DCS completely and restart before the RNG will pick a new seed?

 

Edited by Elphaba
Posted (edited)

Left Shift R completely restarts the mission and acts the same as going back to the ME and start the mission again.

Edit: Misunderstood the trigger

Edited by Nick_17

1)  Asus ROG Strix Z690-A Gaming Wifi D4 / i9 13900K @ 5,5 Ghz / Corsair Vengeance RGB Pro 128 GB DDR4 RAM @ 3200 Mhz / Asus ROG Strix RTX 4090 / 2 x 4 TB SSD Samsung 870 Evo / 2 x 1 TB M.2 SSD Samsung 980 Pro / Meta Quest Pro

2)  Asus ROG Strix Z490-E Gaming / i9 10900K @ 4,9 Ghz / Corsair Vengeance RGB Pro 64 GB DDR4 RAM @ 3200 Mhz / Asus ROG Strix RTX 3090 / 1 TB SSD Samsung 870 Evo / 500 GB M.2 SSD Samsung 980 Pro / HP Reverb G2

Posted (edited)
6 minutes ago, Nick_17 said:

Left Shift R completely restarts the mission and acts the same as going back to the ME and start the mission again. I always understood that random trigger as a 1 in X chance to trigger. So in this case a 1 in 80 chance. Dont know if thats actually the case tho.

So the RNG seed changes with each LSHIFT+R then? So I should have seen the times when it didn’t pass by now?

Edited by Elphaba
Posted
5 minutes ago, Elphaba said:

So the RNG seed changes with each LSHIFT+R then? So I should have seen the times when it didn’t pass by now?

 

Yes

  • Like 1

1)  Asus ROG Strix Z690-A Gaming Wifi D4 / i9 13900K @ 5,5 Ghz / Corsair Vengeance RGB Pro 128 GB DDR4 RAM @ 3200 Mhz / Asus ROG Strix RTX 4090 / 2 x 4 TB SSD Samsung 870 Evo / 2 x 1 TB M.2 SSD Samsung 980 Pro / Meta Quest Pro

2)  Asus ROG Strix Z490-E Gaming / i9 10900K @ 4,9 Ghz / Corsair Vengeance RGB Pro 64 GB DDR4 RAM @ 3200 Mhz / Asus ROG Strix RTX 3090 / 1 TB SSD Samsung 870 Evo / 500 GB M.2 SSD Samsung 980 Pro / HP Reverb G2

Posted

It depends on how you set up your trigger. It can go from checking 1 time in mission (ex : "mission start", or "once" and "time > X seconds" + "time < X+1 seconds", or any condition happening only 1 time), to checking every second if random result is inside 80% until result is in (ex : "random" with no other condition or with "time > X seconds", meaning checking every second after time is more than X seconds) and in this case it will always soon or late trigger the action.

Posted
4 hours ago, toutenglisse said:

It depends on how you set up your trigger. It can go from checking 1 time in mission (ex : "mission start", or "once" and "time > X seconds" + "time < X+1 seconds", or any condition happening only 1 time), to checking every second if random result is inside 80% until result is in (ex : "random" with no other condition or with "time > X seconds", meaning checking every second after time is more than X seconds) and in this case it will always soon or late trigger the action.

I was thinking when unit a is inside a zone, I want an 80% chance it will go to waypoint X, but then a 20% it will go to waypoint Y and turn smoke on.

 

no matter how many times I ran the mission, the 20% chance event never happened. It always had the same 80% result. 
 

between each test I did lshift r and my question wasn’t about triggers, but how and when did the RNG get re-rolled/seeded - if if didn’t between each lshift+r then i could be restarting for infinity and getting the same result. 
 

do you understand the question now?

Posted
2 hours ago, Elphaba said:

...my question wasn’t about triggers, but how and when did the RNG get re-rolled/seeded...

do you understand the question now?

I didn't answer to this question. @Nick_17 did. I told you that your trigger may be badly set up :

2 hours ago, Elphaba said:

I was thinking when unit a is inside a zone, I want an 80% chance it will go to waypoint X, but then a 20% it will go to waypoint Y and turn smoke on.

no matter how many times I ran the mission, the 20% chance event never happened. It always had the same 80% result...

Example attached for random to be checked only one time when unit is in zone. (on your trigger the "dice" is thrown every second that unit passes in zone = many chances to hit below 80%)

test-zone-random-action.miz

Posted

Thanks for taking the time to do that.

But that isn’t the solution that I’m looking for, I only need the dice to be rolled once otherwise I’m not actually having an 80% likelihood that it will change way points because if it’s rolling the dice every Second then all the time it’s in that zone it’s going to be rolling the dice and therefore it’s gonna fail a lot more often and I don’t want that to happen. It’s important that one dice gets rolled and if it’s below eight then it changes waypoints and if it’s above eight that it carries on - on a 10 sided dice that is. The problem that I’m seeing is that when it enters the trigger zone and the dice gets rolled it always comes as a number inside the 80% chance so it changes waypoints and in the 22 times that I’ve done left shift R and restarted the mission it does the same thing it never changes - it always changes waypoints - it never fails that probability test so my question is = does the fact that restarting the mission not change the way that the random number generator re-seeded and therefore I’m always going to get the same results from a random number generator built into the triggers or does it actually change each time and I’m just getting incredibly unlucky?

It doesn’t help that there is no way for me to see the number that gets rolled by the internal dice and I can’t write that out to a message on the screen heavens forbid that it would be useful to actually see the value of a flag while you’re playing the game 

Posted

@Elphaba, why don't you try with a random flag value, from 1 to 100?

Something like:

ONCE > some condition > SET RANDOM FLAG VALUE 1 to 100

ONCE > flag is less than 80 > do something 1

ONCE > flag is more than 80 > do something 2

  • Like 2
Posted

Yeah that would work too.

But the same question still applies. Does the random number generator re-seed on mission restart.

Because I've done this four different ways so far, and it constantly passes the RNG condition, it never fails it - even if the RNG condition is set as low as 60%.

Posted (edited)

Hmm, if you want to have a more clear picture (see flag value) then execute a small LUA code:

ONCE > some condition > SET RANDOM FLAG [200] VALUE 1 to 100

 ONCE > flag is less than 80 > do something 1 + do Script

ONCE > flag is more than 80 > do something 2 + do Script

in the do script field add:

do
	local myRandomNumber = trigger.misc.getUserFlag(200)
	trigger.action.outText('Random flag value is: '..myRandomNumber, 10)
end

You will see that each time you restart the mission, the value will change

Edited by dark_wood
  • 3 weeks later...
Posted
14 minutes ago, SUNTSAG said:

The process I use can be found in the attached .miz and it seems to work well for me at least.


thanks a lot for this tip, will try it on my missions 👍

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar

Mobile: iPad Pro 12.9" of 256 GB

  • 8 months later...
Posted

The only way it seems to reliably get random to work is to have it set a flag at mission start. So I would have a whole bunch of different random flags set at the beginning and then use one of those as a flag true or false later on with whatever I wanted done randomly.

It seems as through if random is coupled with another condition then it just always returns as true. Seems to be the only way to get random to work is to keep it alone in the condition.

  • 11 months later...
Posted
On 10/2/2022 at 11:31 AM, TEMPEST.114 said:

Yeah that would work too.

But the same question still applies. Does the random number generator re-seed on mission restart.

Because I've done this four different ways so far, and it constantly passes the RNG condition, it never fails it - even if the RNG condition is set as low as 60%.

A bit late. If the flag was set to true and you had a trigger "once" with conditions "flag is true" and "random" it will check each second for that random to be true since the flag already is true and it will execute the action without fail.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...