- Comment out getrandom in addgear for hedgehog, causes preview-game desync
authorunc0rr
Sat, 15 Nov 2014 01:30:40 +0300
changeset 10495 6d61b44a5652
parent 10494 0eb97cf4c78e
child 10496 ba166d4e66f3
- Comment out getrandom in addgear for hedgehog, causes preview-game desync - New formula for minDistance - Some trials on dab formula, commented
hedgewars/uGearsList.pas
hedgewars/uLandGenTemplateBased.pas
--- a/hedgewars/uGearsList.pas	Fri Nov 14 17:00:47 2014 +0300
+++ b/hedgewars/uGearsList.pas	Sat Nov 15 01:30:40 2014 +0300
@@ -247,10 +247,10 @@
                 //gear^.Tint:= (($e0+random(32)) shl 24) or
                 //             ((random(80)+128) shl 16) or
                 //             (($d5+random(32)) shl 8) or $ff
-                c:= GetRandom(32);
+                {c:= GetRandom(32);
                 gear^.Tint:= (($e0+c) shl 24) or
                              ((GetRandom(90)+128) shl 16) or
-                             (($d5+c) shl 8) or $ff
+                             (($d5+c) shl 8) or $ff}
                 end;
        gtShell: begin
                 gear^.Elasticity:= _0_8;
--- a/hedgewars/uLandGenTemplateBased.pas	Fri Nov 14 17:00:47 2014 +0300
+++ b/hedgewars/uLandGenTemplateBased.pas	Sat Nov 15 01:30:40 2014 +0300
@@ -262,6 +262,8 @@
     // don't move new point for more than length of initial segment
     // adjust/parametrize for more flat surfaces (try values 3/4, 1/2 of dab, or even 1/4)
     d:= dab;
+    //d:= dab * (1 + abs(cFeatureSize - 8)) div 6;
+    //d:= dab * (14 + cFeatureSize) div 20;
     if distL > d then distL:= d;
     if distR > d then distR:= d;
 
@@ -342,7 +344,7 @@
         for x:= 0 to LAND_WIDTH - 1 do
             Land[y, x]:= lfBasic;
     
-    minDistance:= max(cFeatureSize*5,12);
+    minDistance:= sqr(cFeatureSize) div 8 + 10;
     MaxHedgehogs:= Template.MaxHedgehogs;
     hasGirders:= Template.hasGirders;
     playHeight:= Template.TemplateHeight;