Browse Source

Merge branch 'physics_updates_2018' of Shuvit-Org/shuvit into dev

tis what it tis
shuvit 5 years ago
parent
commit
7674c7295a

+ 2
- 2
.gitignore View File

40
 ######################
40
 ######################
41
 *.blend1
41
 *.blend1
42
 shuvit_working.blend
42
 shuvit_working.blend
43
-.pyc
44
-replay.dat
43
+*.pyc
44
+*replay.dat

+ 0
- 2
Recordings/shuvit replay.dat
File diff suppressed because it is too large
View File


+ 2
- 2
assets/ground_tiles.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:5722ddc1fd5506ed0edf2a1eaebff9235ce1e0f6d493083b6d7978a48d57cfa0
3
-size 362010796
2
+oid sha256:9a2e2a33d6ac41ce916e90fb32558ccd8731ba489fbdb8d09ca0d0451cca5914
3
+size 244357568

+ 2
- 2
assets/sc.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:991b78d9292032bb795a33fe3a753a09b3469acb608e80fe1e9e0f9eb83a17f9
3
-size 8618540
2
+oid sha256:b435dd53ddd57602bd250de6ea3d4539a372c5ba88df92cf4c33d340e2c8067a
3
+size 8596056

+ 31
- 31
config.ini View File

20
 
20
 
21
 #level
21
 #level
22
 ######
22
 ######
23
-level = user1
23
+level = user2
24
 #------------
24
 #------------
25
 
25
 
26
 #replay recorder
26
 #replay recorder
48
 #character settings
48
 #character settings
49
 ###################
49
 ###################
50
 
50
 
51
-character = becky
51
+character = annie
52
 
52
 
53
-shirt_logo = 3
53
+shirt_logo = 5
54
 
54
 
55
-shirt_color_r = 0.61
56
-shirt_color_g = 0.61
57
-shirt_color_b = 0.61
55
+shirt_color_r = 0
56
+shirt_color_g = 0.16
57
+shirt_color_b = 0
58
 
58
 
59
-shoe_color_r = 0.16
60
-shoe_color_g = 0.02
59
+shoe_color_r = 0.08
60
+shoe_color_g = 0.05
61
 shoe_color_b = 0.02
61
 shoe_color_b = 0.02
62
 #-----------------
62
 #-----------------
63
 
63
 
64
 #deck settings
64
 #deck settings
65
 ##############
65
 ##############
66
-deck_index = 2
67
-deck_color_r = 1
68
-deck_color_g = 1.0
69
-deck_color_b = 1
70
-trucks_r = 0.95
71
-trucks_g = 1.0
72
-trucks_b = 1
73
-
74
-wheel1_r = 0.4
75
-wheel1_g = 0.08
76
-wheel1_b = 0.08
77
-wheel2_r = 0.08
78
-wheel2_g = 0.34
79
-wheel2_b = 0.08
80
-wheel3_r = 0.08
81
-wheel3_g = 0.08
82
-wheel3_b = 0.54
83
-wheel4_r = 0.4
84
-wheel4_g = 0.37
85
-wheel4_b = 0.08
66
+deck_index = 7
67
+deck_color_r = 0.28
68
+deck_color_g = 0.1
69
+deck_color_b = 0
70
+trucks_r = 0
71
+trucks_g = 0.41
72
+trucks_b = 0
73
+
74
+wheel1_r = 0.31
75
+wheel1_g = 0.16
76
+wheel1_b = 0
77
+wheel2_r = 0.31
78
+wheel2_g = 0.16
79
+wheel2_b = 0
80
+wheel3_r = 0.31
81
+wheel3_g = 0.16
82
+wheel3_b = 0
83
+wheel4_r = 0.31
84
+wheel4_g = 0.16
85
+wheel4_b = 0
86
 #-------------------
86
 #-------------------
87
 
87
 
88
 #2d filter settings
88
 #2d filter settings
90
 
90
 
91
 #brightness / contrast
91
 #brightness / contrast
92
 bc = 1
92
 bc = 1
93
-BC_BRIGHTNESS = 1.0
93
+BC_BRIGHTNESS = 1.05
94
 BC_CONTRAST = 1.0
94
 BC_CONTRAST = 1.0
95
 
95
 
96
 #HDR
96
 #HDR
117
 
117
 
118
 #sun settings
118
 #sun settings
119
 #############
119
 #############
120
-sun_strength = 0.15
121
-ambient_strength = 1.25
120
+sun_strength = 1.05
121
+ambient_strength = 0.35
122
 sun_rot_x = -0.05
122
 sun_rot_x = -0.05
123
 sun_rot_y = -0.05
123
 sun_rot_y = -0.05
124
 shadow_on = 0
124
 shadow_on = 0

BIN
scripts/__pycache__/Manager.cpython-36.pyc View File


BIN
scripts/__pycache__/Record.cpython-36.pyc View File


BIN
scripts/__pycache__/Settings.cpython-36.pyc View File


BIN
scripts/__pycache__/SortData.cpython-36.pyc View File


BIN
scripts/__pycache__/Startup.cpython-36.pyc View File


BIN
scripts/__pycache__/active_camera_loc.cpython-36.pyc View File


BIN
scripts/__pycache__/bike.cpython-36.pyc View File


BIN
scripts/__pycache__/co_ActionState.cpython-36.pyc View File


BIN
scripts/__pycache__/colors.cpython-36.pyc View File


BIN
scripts/__pycache__/controller2.cpython-36.pyc View File


BIN
scripts/__pycache__/grindV2.cpython-36.pyc View File


BIN
scripts/__pycache__/inputs.cpython-36.pyc View File


BIN
scripts/__pycache__/joy_sens.cpython-36.pyc View File


BIN
scripts/__pycache__/load_char.cpython-36.pyc View File


BIN
scripts/__pycache__/load_npc.cpython-36.pyc View File


BIN
scripts/__pycache__/logo_fades.cpython-36.pyc View File


BIN
scripts/__pycache__/menuV3.cpython-36.pyc View File


BIN
scripts/__pycache__/pause_menu2.cpython-36.pyc View File


BIN
scripts/__pycache__/scene_init.cpython-36.pyc View File


BIN
scripts/__pycache__/stance.cpython-36.pyc View File


BIN
scripts/__pycache__/walk.cpython-36.pyc View File


+ 72
- 19
scripts/controller2.py View File

1811
             wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=2)
1811
             wheel3.playAction("roll2.001", 20,1, layer=2, play_mode=1, speed=2)
1812
             wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=2)
1812
             wheel4.playAction("roll3.001", 20,1, layer=2, play_mode=1, speed=2)
1813
             wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=2) 
1813
             wheel1.playAction("roll4.001", 20,1, layer=2, play_mode=1, speed=2) 
1814
-
1815
-    def transspeed():
1816
-        num1 = .1
1817
-        num2 = .4
1818
-        speed = 20
1819
         
1814
         
1820
     def turn():   
1815
     def turn():   
1821
         #rotamt = .02
1816
         #rotamt = .02
1837
         if lUD > turnsens or lUD < -turnsens:
1832
         if lUD > turnsens or lUD < -turnsens:
1838
             own["turnud"] = 1
1833
             own["turnud"] = 1
1839
         else:
1834
         else:
1840
-            own["turnud"] = 0        
1835
+            own["turnud"] = 0
1836
+
1837
+        turnVel = .01                
1841
     #light  
1838
     #light  
1842
     #if manual and grindhit = true  
1839
     #if manual and grindhit = true  
1843
         if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):       
1840
         if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):       
1876
             if r_ground.triggered == True:
1873
             if r_ground.triggered == True:
1877
                 #print("med turn")
1874
                 #print("med turn")
1878
                 if STANCE == 0:   
1875
                 if STANCE == 0:   
1879
-                    own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1876
+                    own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y - turnVel, linVelocity2.z], 1)
1880
                 if STANCE == 1:   
1877
                 if STANCE == 1:   
1881
-                    own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)  
1878
+                    own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y - turnVel, linVelocity2.z], 1)  
1882
         if (lLR < (-turnsens * 1.3) or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1879
         if (lLR < (-turnsens * 1.3) or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1883
             #turn right
1880
             #turn right
1884
             if rot.z < .4:
1881
             if rot.z < .4:
2628
     air() 
2625
     air() 
2629
     stance()
2626
     stance()
2630
     turn()
2627
     turn()
2631
-    rotmult()
2628
+    #rotmult()
2632
     airup()
2629
     airup()
2633
     onramp()
2630
     onramp()
2634
-    speedmult()
2631
+    #speedmult()
2635
     coping()
2632
     coping()
2636
     resetjumpstance()
2633
     resetjumpstance()
2637
     grass()
2634
     grass()
3603
             if STANCE == 0:
3600
             if STANCE == 0:
3604
                 yvel *= -1
3601
                 yvel *= -1
3605
             try:    
3602
             try:    
3606
-                dist = r_ground.hitObject.worldPosition - own.worldPosition
3603
+                #dist = r_ground.hitObject.worldPosition - own.worldPosition
3607
                 #print('ground dist', dist)
3604
                 #print('ground dist', dist)
3608
                 if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3605
                 if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3609
                     own.applyRotation([0,0,yvel], True)
3606
                     own.applyRotation([0,0,yvel], True)
3614
                 pass       
3611
                 pass       
3615
         else:    
3612
         else:    
3616
             if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3613
             if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3617
-                linVelocity4 = own.getLinearVelocity(True)
3618
-                newy = linVelocity4.y * ylimit   
3619
-                force = [linVelocity4.x, newy, linVelocity4.z]
3620
-                own.setLinearVelocity(force, True) 
3614
+            #     linVelocity4 = own.getLinearVelocity(True)
3615
+            #     newy = linVelocity4.y * ylimit   
3616
+            #     force = [linVelocity4.x, newy, linVelocity4.z]
3617
+            #     own.setLinearVelocity(force, True) 
3618
+                yvel = own.linearVelocity.y
3619
+                yvel = yvel *.03
3620
+                if STANCE == 0:
3621
+                    yvel *= -1
3622
+                try:    
3623
+                    if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3624
+                        own.applyRotation([0,0,yvel], True)
3625
+                    
3626
+                except:
3627
+                    pass 
3628
+
3621
         #print(ylimit, 'ylimit')       
3629
         #print(ylimit, 'ylimit')       
3622
 
3630
 
3623
     def getoffboard():
3631
     def getoffboard():
3934
             cont.deactivate(own.actuators['grindoutRight'])
3942
             cont.deactivate(own.actuators['grindoutRight'])
3935
             cont.deactivate(own.actuators['grindoutLeft'])  
3943
             cont.deactivate(own.actuators['grindoutLeft'])  
3936
         if (LAST_GRIND == True and jumping == None and sincegrinding > 20 and ground_since > 20) or own['invert_on'] == True and LAST_GRIND == 1:
3944
         if (LAST_GRIND == True and jumping == None and sincegrinding > 20 and ground_since > 20) or own['invert_on'] == True and LAST_GRIND == 1:
3945
+
3946
+        #own['grindTouch']      
3947
+
3937
             outloc = 0.022
3948
             outloc = 0.022
3938
             bsoutloc = .07
3949
             bsoutloc = .07
3939
             bsoutvel = .1
3950
             bsoutvel = .1
4304
     onboard()   
4315
     onboard()   
4305
     #wallhit() 
4316
     #wallhit() 
4306
     linvelx = own.getLinearVelocity(True)
4317
     linvelx = own.getLinearVelocity(True)
4307
-    land_boost()
4318
+    #land_boost()
4308
     own["linvelx"] = linvelx.x
4319
     own["linvelx"] = linvelx.x
4309
     LAST_STANCE = STANCE
4320
     LAST_STANCE = STANCE
4310
     LAST_STANCE = own["stance"]
4321
     LAST_STANCE = own["stance"]
4342
     own["last_sel"] = own["sel"]
4353
     own["last_sel"] = own["sel"]
4343
     own["sel"] = bkBut  
4354
     own["sel"] = bkBut  
4344
 
4355
 
4345
-    if r_ground.triggered and own["jump_timer"] < 20:
4356
+    if r_ground.triggered and own["jump_timer"] < 20 and own['rotz'] > .65:
4346
         force2 = [0.0, 0, dict['antibounce']]
4357
         force2 = [0.0, 0, dict['antibounce']]
4347
-        own.applyForce(force2, True)
4358
+        #own.applyForce(force2, True)
4359
+
4360
+        gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))  
4361
+        #print(gdist)
4362
+        if gdist < .2875 and gdist > .1:
4363
+            #move = 2.875 - gdist
4364
+            move = (.2875 - gdist)*.33
4365
+            #move = (own.worldPosition.z + gdist)
4366
+            if move > 0:
4367
+                own.worldPosition.z = own.worldPosition.z + move
4368
+            else:
4369
+                own.worldPosition.z = own.worldPosition.z - move    
4370
+            own.linearVelocity.z = 0
4371
+           
4372
+
4373
+    Axis = 2 
4374
+    Distance = -10
4375
+    # X axis is zero
4376
+    # Y is 1
4377
+    # Z is 2
4378
+    End = own.worldPosition + (own.worldOrientation.col[Axis]*Distance)
4379
+    Start = own.worldPosition
4380
+    localRay = own.rayCast(End,Start,0,'ground',1,0,0)
4381
+    #print(localRay)
4382
+    if localRay[0]:
4383
+        localHitDist = (own.worldPosition - localRay[1]).length
4384
+        #print(localHitDist)
4385
+        #print(localRay[2])
4386
+        if localHitDist < .287:
4387
+            own.localPosition[2] += (.287 - localHitDist)
4388
+            if localRay[2] != [0,0,-1] and grindHit == 0:
4389
+                own.alignAxisToVect(localRay[2], 2, .5)
4390
+                #print('moving local')
4391
+
4392
+
4393
+    #rend = bge.render
4394
+    #rend.drawLine(Start, End, [1,0,0,1])
4395
+    #print(own['rotz'])
4396
+
4397
+    if own.linearVelocity.x > 10:
4398
+        own.linearVelocity.x = 10
4348
     if (grindDar == False and r_ground.triggered and own['grindTouch'] == False) or own['jump_timer'] > 40:
4399
     if (grindDar == False and r_ground.triggered and own['grindTouch'] == False) or own['jump_timer'] > 40:
4349
         own['grindType'] = ''
4400
         own['grindType'] = ''
4350
     
4401
     
4351
-    dict['walk'] = 0  
4402
+    dict['walk'] = 0  
4403
+
4404
+    print(own["LAST_GRIND"])

+ 8
- 8
scripts/grindV2.py View File

540
         #print(lastobj.worldPosition)
540
         #print(lastobj.worldPosition)
541
         if dist < grind_dist and dropin == 0 and manual == 0 and no_grind == 0 and own['grindoutturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 40 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0 and own['last_invert'] == False and own['grindjumpturn'] == 0 and grind_jump == 0 and own['airup'] == 0:
541
         if dist < grind_dist and dropin == 0 and manual == 0 and no_grind == 0 and own['grindoutturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 40 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0 and own['last_invert'] == False and own['grindjumpturn'] == 0 and grind_jump == 0 and own['airup'] == 0:
542
             #print('grind')      
542
             #print('grind')      
543
-            hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
544
-            if grindold == 0:     
545
-                if grindTouch.triggered:
546
-                    nearpos = nearestObject.worldPosition
547
-                    if hitNormal != None:
548
-                        stre = .45
549
-                        own.alignAxisToVect(hitNormal, 2, stre) 
543
+            # hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
544
+            # if grindold == 0:     
545
+            #     if grindTouch.triggered:
546
+            #         nearpos = nearestObject.worldPosition
547
+            #         if hitNormal != None:
548
+            #             stre = .45
549
+            #             own.alignAxisToVect(hitNormal, 2, stre) 
550
                         #print("align")                   
550
                         #print("align")                   
551
-                    own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
551
+                    #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
552
                     #print('moving world')
552
                     #print('moving world')
553
             #print("grinding")
553
             #print("grinding")
554
             grind_height_dif = (own.worldPosition[2] - nearestObject.worldPosition[2]) - .287
554
             grind_height_dif = (own.worldPosition[2] - nearestObject.worldPosition[2]) - .287

+ 26
- 4
scripts/walk.py View File

667
             own["spawn_stance"] = stance   
667
             own["spawn_stance"] = stance   
668
     def falldeck():
668
     def falldeck():
669
         throw_deck_empty = scene.objects["throw_deck_empty"]
669
         throw_deck_empty = scene.objects["throw_deck_empty"]
670
+        throw_deck_empty.worldPosition.y += .5
671
+        throw_deck_empty.worldPosition.x += .5
670
         deckact = deck.actuators["Visibility"]
672
         deckact = deck.actuators["Visibility"]
671
         trucksact = trucks.actuators["Visibility"]
673
         trucksact = trucks.actuators["Visibility"]
672
         wheel1act = wheel1.actuators["Visibility"]
674
         wheel1act = wheel1.actuators["Visibility"]
788
             falldeck()        
790
             falldeck()        
789
             if STANCE == 1:
791
             if STANCE == 1:
790
                 own['requestAction'] = 'fak_air-walk_air'            
792
                 own['requestAction'] = 'fak_air-walk_air'            
791
-                own.setLinearVelocity([3,2,0], True)
793
+                #own.setLinearVelocity([3,2,0], True)
792
             else:
794
             else:
793
                 own['requestAction'] = 'reg_air-walk_air'
795
                 own['requestAction'] = 'reg_air-walk_air'
794
-                own.setLinearVelocity([-3,-2,0], True)    
796
+                #own.setLinearVelocity([-3,-2,0], True)    
795
             own['fall'] = False
797
             own['fall'] = False
798
+            own.worldPosition.z += .3
796
 
799
 
797
     def sit():
800
     def sit():
798
         #turn off sit
801
         #turn off sit
1105
             own['lF_ground_frame'] = own['framenum']
1108
             own['lF_ground_frame'] = own['framenum']
1106
             if 'grind' in r_ground.hitObject:
1109
             if 'grind' in r_ground.hitObject:
1107
                 if own['framenum'] - own['last_fall_frame'] < 90:
1110
                 if own['framenum'] - own['last_fall_frame'] < 90:
1108
-                    own.applyForce([0,100,0], True)
1111
+                    #own.applyForce([0,100,0], True)
1112
+                    pass
1109
                     #print('moving away from rail')
1113
                     #print('moving away from rail')
1110
                     
1114
                     
1111
             yvel = own.linearVelocity.y
1115
             yvel = own.linearVelocity.y
1216
     if own['requestAction'] == 'reg_walkFast_nb' and own.linearVelocity.x > (wts * -1):
1220
     if own['requestAction'] == 'reg_walkFast_nb' and own.linearVelocity.x > (wts * -1):
1217
         own['requestAction'] = 'reg_walk_nb' 
1221
         own['requestAction'] = 'reg_walk_nb' 
1218
     if own['requestAction'] == 'fak_walkFast_nb' and own.linearVelocity.x < wts:
1222
     if own['requestAction'] == 'fak_walkFast_nb' and own.linearVelocity.x < wts:
1219
-        own['requestAction'] = 'fak_walk_nb'                         
1223
+        own['requestAction'] = 'fak_walk_nb'   
1224
+
1225
+
1226
+    if r_ground.triggered:
1227
+        #force2 = [0.0, 0, dict['antibounce']]
1228
+        #own.applyForce(force2, True)
1229
+
1230
+        gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))  
1231
+        #print(gdist)
1232
+        if gdist < .3 and gdist > .1:
1233
+            #move = 2.875 - gdist
1234
+            move = (.3 - gdist)*.5
1235
+            #move = (own.worldPosition.z + gdist)
1236
+            if move > 0:
1237
+                own.worldPosition.z = own.worldPosition.z + move
1238
+            else:
1239
+                own.worldPosition.z = own.worldPosition.z - move    
1240
+            own.linearVelocity.z = 0        
1241
+
1220
     onboard() 
1242
     onboard() 
1221
     jump()
1243
     jump()
1222
     dropin()
1244
     dropin()

+ 2
- 2
shuvit.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:2a6cee59049ae4f760ee3d6ca3d0270335b6ed7422cf02346bbf3729cf009e5d
3
-size 180312212
2
+oid sha256:89a7916e8f873d5e06151821952acee98d9265847c3e5feb48fb0791cf129373
3
+size 180306096

Loading…
Cancel
Save