youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

Added a check during infection #49

Closed maccxs closed 4 years ago

maccxs commented 4 years ago

If the colliders come into contact, we addtionally check if the distance between the humans is less than the infection radius. Since with social distancing we have larger colliders, we do not want this to lead to the same number of infections.

ghost commented 4 years ago

Right now, your distance check dist < InfectionRadius will always evaluate to true. OnTriggerEnter2D is called on human A when another human B enters A's infection radius, and at that moment, their distance is already much smaller (dist ~= 0.6, infectionRadius = 4). I believe this is because the distance is measured in world space, and the radius is measured in some weird interpretation of local space.

I tried to find a good scaling factor by trial and error, but now it seems that the effect of social distancing is still binary: Up to about 80% social distancing, every contact leads to infection, and above 80%, the infection won't spread at all. Only around the 80% mark it really appears to 'flatten the curve'.

Still, I think we should go with what we have right now for the first release.