Jack McCoy Posted May 16, 2009 Posted May 16, 2009 Random number generation technique Ok, I admit I was a bit testy, but I'm cool now. :) Let me try to be more constructive. Check this mission out. Enjoy.RandomNumberTechnique-JackMcCoy.miz i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
Weta43 Posted May 16, 2009 Posted May 16, 2009 (edited) To avoid the "none appear" or "all appear at once" problem, create 2 flags (F1, F2) both with 50% chance of being true. Create 4 more flags - 10, 20, 30, 40 Set Flag10 if F1T, F2T (25%) Set Flag20 if F1T, F2F (25%) Set Flag30 if F1F, F2T (25%) Set Flag40 if F1F, F2F (25%) Use these flags to drive your scenarios. Mutualy exclusive, and one is always true Do the same with 3 flags for 8 different outcomes (etc, etc), fiddle with the original flags' probabilities to weight some scenarios more heavily.. Leave a couple empty if wanted, or use these in conjunction with other randomisers to get random events specific to each scenario. Look in the stock Clear Tkvarcheli mission (& loads of others) for an example. Edited May 16, 2009 by Weta43 Cheers.
DMarkwick Posted May 16, 2009 Posted May 16, 2009 I got the probability all ass about face :D However, sort of back OT, I cannot get the trigger functionality mentioned in the GUI manual where I make a vehicle's existence 50% variable via a trigger. I've set up the parameters exactly as I see them in the manual, but I get 100% vehicle existence over several mission runs. Can anyone confirm they've got this functionality to work?
Dusty Rhodes Posted May 16, 2009 Posted May 16, 2009 DM, how do you know it is not working? If the probability is set to 50% then the numbers roll of the dice might have come up each time. That is the problem with trouble shooting something like this. You need to take a large sample to see if it is indeed working. Dusty Rhodes Play HARD, Play FAIR, Play TO WIN Win 7 Professional 64 Bit / Intel i7 4790 Devils Canyon, 4.0 GIG /ASUS Maximus VII Formula Motherboard/ ASUS GTX 1080 8 GB/ 32 Gigs of RAM / Thrustmaster HOTAS Warthog / TrackIR 5 / 2 Cougar MFD's / Saitek Combat Pedals/ DSD Button Box FLT-1
DMarkwick Posted May 16, 2009 Posted May 16, 2009 Because I re-ran the same mission about 20 times, just endlessly restarting it. I didn't see any evidence of a 50% probability of existence, just a 100% one.
Jack McCoy Posted May 16, 2009 Posted May 16, 2009 (edited) What Weta43 describes is implemented in the mission I uploaded. I'd like to point out that any subset of random bits is also random. For example, given 3 random bits (50%), B1, B2, B3, you have: B1-B2-B3 -> random 1-8 B1-B2 -> random 1-4 B1-B3 -> another random 1-4 B2-B3 -> another random 1-4 B1 -> random 1-2 (50%) B2 -> another random 1-2 B3 -> another random 1-2 The subgroups are not independant from the largest total, but if it's not important for your application, it saves a few trigger statements. DMarkwick, I'm sure you set up something like this: ONCE(popupAA) RANDOM(50) ACTIVATE(AAgroup) This will always eventually be true, because ONCE is evaluated every second until it's TRUE, then finally removed. To generate your random bits, use MISSION START. To get values from these bits, my example uses ONCE, but for FALSE conditions, they'll stay and be evaluated to FALSE until the end of the mission. If we were assured that the MISSION START statements are process in the order entered in the editor, it'd be better to use MISSION START for all, randomizing the bits first and getting the values afterwards. Edited May 16, 2009 by Jack McCoy i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
Speedbrake Posted May 16, 2009 Posted May 16, 2009 Jack McCoy, I will be the first to say that I haven't dug into the manual on this yet but I tried your mission and also looked at it in the mission editor. If you are trying to get one of four "units" to show up based on a randon selection, don't you have to have four (4) units defined? Under units you only have the one, a Ural-375 truck????? On the trigger listing you say "random 1 of 4, 2 of 4, etc. Of course I may be missing your whole attempt here.
DMarkwick Posted May 16, 2009 Posted May 16, 2009 DMarkwick, I'm sure you set up something like this: ONCE(popupAA) RANDOM(50) ACTIVATE(AAgroup) Indeed I do, as it's explicitly described so in the manual :) This will always eventually be true, because ONCE is evaluated every second until it's TRUE, then finally removed. So the manual is in errata on this matter? Oh well, thanks for the pointer, I will try it out with the MISSION START trigger type :) thanks.
Jack McCoy Posted May 16, 2009 Posted May 16, 2009 (edited) "If you are trying to get one of four "units"... " Yes, you'd need 4 different groups if that's what you wished for. Since it was 2:00 am and I was just to help out someone, I created only one group, with random playing on the time of appearance (look at TIME MORE). Cool? Edited May 16, 2009 by Jack McCoy i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
Dusty Rhodes Posted May 16, 2009 Posted May 16, 2009 Because I re-ran the same mission about 20 times, just endlessly restarting it. I didn't see any evidence of a 50% probability of existence, just a 100% one. Well I would say that indeed that is an FBI clue that something is amiss somewhere. I never really fingered out that part of the mission builder as is evident. I would say to go back and disect some of the missions that came with the sim and see how they did the probability thing. I learned loads on mission building with the new features by just dissecting the campaign and single missions that came with the sim. Dusty Rhodes Play HARD, Play FAIR, Play TO WIN Win 7 Professional 64 Bit / Intel i7 4790 Devils Canyon, 4.0 GIG /ASUS Maximus VII Formula Motherboard/ ASUS GTX 1080 8 GB/ 32 Gigs of RAM / Thrustmaster HOTAS Warthog / TrackIR 5 / 2 Cougar MFD's / Saitek Combat Pedals/ DSD Button Box FLT-1
Weta43 Posted May 16, 2009 Posted May 16, 2009 (edited) Jack - sorry, didn't look at your mission & wasn't trying to steal your thunder, but I knew the same thing was in the stock missions that everyone has... because ONCE is evaluated every second until it's TRUE, then finally removed Could be wrong, but I'm fairly sure it's every 5 seconds, which is in itself usefull, because you can use it together with the probability to set rough bounds around when something will spawn - after a flag is true, then a low probability once trigger to cause an action with a likely time envelope between T=0 and T= (1/probability)*5sec (although it might not happen till after that - in a "roll 6 dice & on average you should get 1 six, but that might not happen this turn sort of way) ... - I think that's also used in that Clear Tkvarcheli mission. OP If you've set the units on a spawn from a trigger, and they are still appearing every time the mission is run, odds are you've still got the unit start time set to zero. Set the start time for the units you want to randomise to 23:00 (just as for LOMR) Edited May 16, 2009 by Weta43 1 Cheers.
Jack McCoy Posted May 16, 2009 Posted May 16, 2009 (edited) Could you confirm it's every 5 seconds? It could enable us to make more accurate calculations. This is good advice, but very difficult for the neophite to grasp. It would be known as a Poisson probability distribution: http://en.wikipedia.org/wiki/Poisson_distribution The key would be to keep the random very low, as you said. 50% every 5 seconds would yield very early triggers. And OMG, I can't believe I forgot to mention Hold Time 23:00:00! Good call! Edited May 16, 2009 by Jack McCoy i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
joker62 Posted May 18, 2009 Author Posted May 18, 2009 Thank You very much for your replies. and sorry for my delay, but i've good internet connection only in office. I'll investigate your tips and I'll try. best regards. antonio
joker62 Posted May 20, 2009 Author Posted May 20, 2009 (edited) To avoid the "none appear" or "all appear at once" problem, create 2 flags (F1, F2) both with 50% chance of being true. Create 4 more flags - 10, 20, 30, 40 Set Flag10 if F1T, F2T (25%) Set Flag20 if F1T, F2F (25%) Set Flag30 if F1F, F2T (25%) Set Flag40 if F1F, F2F (25%) Use these flags to drive your scenarios. Mutualy exclusive, and one is always true Do the same with 3 flags for 8 different outcomes (etc, etc), fiddle with the original flags' probabilities to weight some scenarios more heavily.. Leave a couple empty if wanted, or use these in conjunction with other randomisers to get random events specific to each scenario. Look in the stock Clear Tkvarcheli mission (& loads of others) for an example. Weta43, I've looked in Clear Tkvarcheli mission and I've created my own mission, but random flags don't work. I've attached my "enemy column.miz" Please, can You help me? thanks in advance. best regards. antonioenemy column.miz Edited May 20, 2009 by joker62 DO! I've forgotten .miz file
Jack McCoy Posted May 20, 2009 Posted May 20, 2009 Set the start time for the units you want to randomise to 23:00 (just as for LOMR) And OMG, I can't believe I forgot to mention Hold Time 23:00:00! Good call! Please read our replies... You may find a hint. If you miss it, let me just say that Time Hold 23:00:00 is not set in your mission. i7-7700K@4.8GHz, 16Gb-3200, GTX-1080Ti-Strix-11Gb, Maximus IX Hero, Oculus Rift, Thrustmaster Warthog+F/A-18C, Logitech G940 Pedals.
DMarkwick Posted May 20, 2009 Posted May 20, 2009 Weta43, I've looked in Clear Tkvarcheli mission and I've created my own mission, but random flags don't work. I've attached my "enemy column.miz" Please, can You help me? thanks in advance. best regards. antonio Joker, the thing I was doing wrong was setting the flag type to "ONCE". Although that's what it says in the manual, the correct flag type is "MISSION START".
joker62 Posted May 21, 2009 Author Posted May 21, 2009 Please read our replies... You may find a hint. If you miss it, let me just say that Time Hold 23:00:00 is not set in your mission. thank You very much, McCoy. just yesterday evening, deeply investigating in clear tkvarceli I've found it. now mission work very well... this really open infinite possibilities. thanks again. best regards. antonio.
Recommended Posts