Jump to content
Joe98

Random starting location LARGE BIAS! together with solution:

Recommended Posts

I place a soldier on the map (namely me)  and name him blue1

 

I place Empty>Small> Matchbox on the map and name it box1

 

In the soldier’s init I write :  blue1 setpos (getpos box1);  This means the mission starts with the soldier standing on the matchbox.

 

Now I place 6 markers on the map in a large semicircle.  I group the markers with the matchbox.  This means when the mission starts the matchbox will start either at its original location or on one of the markers.

 

Or to rephrase, the matchbox will start the mission at one of 7 locations selected at random. Which means the soldier will start the mission at one of 7 locations selected at random.

 

Except that the soldier seems to start at the original location more times than at any other place.  So I tested.

 

I start the mission 70 times and note down the starting locations each time.  In theory each location has a 14.3% chance of being selected.

 

Start the mission 70 times (and do this 4 times).   The original location appears 25% to 43% of the time!  Astonishing! The other locations vary from 9% to 19%  which is acceptable.

(I had a similar mission in Arma2: Iron Front and again I found a bias but did not do tests like this).

 

I found a solution and as a stroke of luck the solution proved the bias in the game:

 

I now place 6 more markers on the map and I group these with the matchbox.

 

The 6 new markers are placed directly adjacent the original 6 markers. (The centre of the markers are only half a meter apart so from the soldier’s point of view there is no difference between the first 6 markers and the second 6 markers).

 

From the game’s point of view there are now 12 markers plus the original location.  That is the starting place is one of 13 places selected at random.  From the player’s point of view though there are still only 7 possible starting locations.

 

With 13 starting places the chances of starting at the original location is  1/13  or 7.7%.  The chances of starting at one of the other 6 locations is 2/13   or  15.4%

 

I start the mission 130 times ( and do this twice).  The original location now comes up 18%  and 22% of the time.  Thereby proving bias! The other locations vary from 10% to 15%

 

From the players perspective there are 7 possible locations and they have 14.3% of coming up.  With the extra markers the tests showed the 7 starting locations overall come up 10% to 22% of the time – which is acceptable.

 

This means:

1. I have proven there is a bias

2. I found a work around.

.

 

Share this post


Link to post
Share on other sites

Was this just an experiment, or are you actually trying to have a mission with a random (random as in you wont know which one of however many choices the script has) start point?

 

If the latter, you could use this, Shk MoveObjects script, it works brilliantly.

 

http://www.armaholic.com/page.php?id=22555

Share this post


Link to post
Share on other sites

Or https://community.bistudio.com/wiki/BIS_fnc_findSafePos

 _randomPos = [getPos player,  //center position (Array)
700,  //minimum distance from the center position (Number)
1500,  //maximum distance from the center position (Number)
3,  //minimum distance from the nearest object (Number)
0,  //water mode (Number) 0: cannot be in water 1: can either be in water or not 2: must be in water
20,  //maximum terrain gradient (average altitude difference in meters - Number)
0,  //shore mode (Number): 0: does not have to be at a shore 1: must be at a shore
[], //(optional) blacklist (Array of Arrays)
[] //(optional) default positions
]
call BIS_fnc_findSafePos;

e.g:
_randomPos = [getPos player,700,1500,2,0,20,0] call BIS_fnc_findSafePos;
_randomPos = [getMarkerPos "marker1",0,1500,2,0,20,0] call BIS_fnc_findSafePos;

https://community.bistudio.com/wiki/isFlatEmpty

Share this post


Link to post
Share on other sites

Why not just put all markers into an array (or even use allMapMarkers if no other markers are present) then set both the matchbox and the player to one random marker position?

Like this in the mission init.sqf:

_myStartMarkers = ["StartMarker00", "StartMarker01", "StartMarker02", "StartMarker03",etc];
_myStartPos = getMarkerPos (_myStartMarkers call BIS_fnc_selectRandom);
myMatchbox setpos _myStartPos;
player setpos _myStartPos;

This should give an equal distribution.

On the other hand, can you please upload a picture of the start position notes you took when restarting the mission 130 times?

 

Cheers

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×