Gyroscope

Just make it.

At the moment when the rope was attached the helicopter/Gyro was abruptly pulled down by the weight of the rope itself. (But of course we would think the rope is always on board). This is now compensated.
Gyro12.blend (2.9 MB)

2 Likes

In this version only the helicopter can use the rope which now has a magnet.
Right mouse button shows the rope and makes it longer,
Left mouse button makes it shorter and hides it finally.
Space key turns the magnet on and off (when in contact).

Camera in Fly-by mode can be rotated with arrow keys. (Mousewheel to zoom)
MiddleMouseButton: Top-down view

Test if you are a good helicopter pilot :slight_smile:

Gyro13.blend (3.1 MB)



View:
    Key 1: Focus on Gyro
    Key 2: Focus on Gyro2
    Key 3: Focus on Helicopter (automatically starts Engine)
 
    
    Key F: Fly-by Camera
            Mouse Wheel: Zoom
            MiddleMouseButton: From Top-View
            Arrow Keys: rotate Camera
        
        
    Key G: Ground Camera (Tower)
    Key H: Helicopter Cockpit Camera (also starts Engine)
    
    ENTER key: restart scene
    
Controls:       
    Precession machine:
        A/D:  rotate red part

    Gyro:
        Space key: Spin and apply lift
        Mouse: rotate direction
        
    Helicopter:
        Control:
        W/S: main Rotor Collective pitch 
        A/D: tail rotor left/right
        Mouse: main Rotor cyclic control   
        Q: Auto-Hover On/Off  (use only at very low speed!)     
        
        Rope:
        Left Mouse Button: make rope shorter and hide rope
        Right Mouse Button: show rope and make rope longer
        Space Key: attach or detach magnet to target
        
  
Visualization of Forces:
    set the properties of object 'ZSE'
        show_gyro_force
        show_heli_force
    to True or False
    
    
Credits:
Helicopter model by SHINN THANT
https://blendswap.com/blend/15976
  • When using the rope a Top-Down View is shown in the top right corner.
  • The Auto-Hover mode (Key Q) is now subtle but helps a lot in keeping height. It is automatically turned off at higher speeds.
    In the bottom left corner you see if it is On/Off

Both help a lot.
The Auto-Stabilizer also is now only active within medium speed. At higher speed it is not active. This allows faster flying.

In the previous version attached bodies to the rope could behave very wild. I hope this is fixed now.
Gyro14.blend (3.2 MB)

1 Like

Reminds me of Kerbal Space Program! Pretty cool.

Example: https://www.youtube.com/watch?v=x62knMKW68k

Haha, funny video! Didn’t know KSP yet.

The wild behaviour of objects attached to the rope magnet is now fixed!!!
Instead of using a fixed 6dof-constraint it’s better to use a ball-constraint and align the Magnet to the face normal.
Gyro15.blend (3.2 MB)

New:

  • Start/stop Helicopter Engine with “E”.
  • When in Ground Camera View (key G) pressing G again switches between 4 different Positions. SHIFT+G goes backwards.
  • In Fly-by-View (F) you can also rotate the camera with CTRL+Mouse

(little update: Top-down camera doesn’t render each frame now to drastically reduce performance hit)

This project file might get updates (UPBGE 0.3):
https://www.dropbox.com/s/ecws8bo1yyczkoc/Gyro_and_Heli_in_Drone-City.zip?dl=0

Don’t get crazy by the traffic :slight_smile:
Helicopter

FirstPerson (swing and grab)


Gyro

View:
    Key 1: Focus on Gyro
    Key 2: Focus on Gyro2
    Key 3: Focus on Helicopter
    Key 4: FirstPerson-View
     
    Key F: Fly-by Camera
            CTRL+MouseWheel: Zoom
            CTRL+Mouse or Arrow Keys: rotate Camera
            MiddleMouseButton: From Top-View            
            Or when in FirstPerson-Modus switch back to FirstPerson-View (from Map-View)
                
    Key G: Ground Camera
            1st View = Map (accident Cars are marked)
            hit G again to switch between 4 different Views 
            SHIFT+G previous Tower
            
    Key H: Helicopter Cockpit Camera
    
    ENTER key: restart scene
    
Controls:       
    Precession machine:
        A/D:  rotate red part

    Gyro:
        Controls:
        Space key: Spin and apply lift
        Mouse: rotate direction
        
        Rope:
        Left Mouse Button: attach rope
        Right Mouse Button: detach rope
        MouseWheel Down: make rope longer
        MouseWheel Up: make rope shorter
        
    Helicopter:
        Controls:
        R: start/stop Rotor-Engine
        W/S: main Rotor Collective pitch 
        A/D: tail rotor left/right
        Mouse: main Rotor cyclic control   
        Q: Auto-Hover On/Off         (also turns on Auto-Stabilizer)                                      
        E: Auto-Stabilizer On/Off      
        
        Rope:
        Left Mouse Button: make rope shorter and hide rope
        Right Mouse Button: show rope and make rope longer
        Space Key: attach or detach magnet to target
        T: Extra Top-View On/Off
        
    FirstPerson-View:
        Controls:
        Mouse: View
        W/A/S/D: Move
        Shift: Run
        Space: Jump
                
        Rope:
        Left Mouse Button: attach rope
        Right Mouse Button: detach rope
        MouseWheel Down: make rope longer
        MouseWheel Up: make rope shorter        
          
Visualization of Forces:
    set the properties of object 'ZSE'
        show_gyro_force
        show_heli_force
    to True or False
    
Sensibilty of Helicopter Controls:
    set the properties of object 'Bell'
    
    
Credits:
Helicopter model by SHINN THANT
https://blendswap.com/blend/15976

drone City by Voxelatio
https://blendswap.com/blend/27360

Low Poly Car Pack by Hexalore
https://blendswap.com/blend/28523

Sounds:
    https://www.pacdv.com/sounds/
    https://freesound.org

“Gameplay” - very unoptimized

Gyroscopic effect on a bicycle.
It corrects its steering automatically.
Bike2.blend (2.3 MB)

View:     
    Key F: Fly-by Camera
            CTRL+MouseWheel: Zoom
            CTRL+Mouse or Arrow Keys: rotate Camera
            MiddleMouseButton: From Top-View            
                
    Key G: Ground Camera
            hit G again to switch between 4 different Views 
            SHIFT+G previous Views
    
    ENTER key: restart scene
    
Controls:       
        W:  pedal 1 time
             
Credits:
    Bicycle (low Poly) by farcgs
    https://blendswap.com/blend/3980

(more to come)

Steering by balancing weight with mouse. (This is only simulated by applying torque on the bike. A real weight shift is too complicated.)

Bike3.blend (2.5 MB)

View:     
    Key F: Fly-by Camera
            CTRL+MouseWheel: Zoom
            CTRL+Mouse or Arrow Keys: rotate Camera
            MiddleMouseButton: From Top-View            
                
    Key G: Ground Camera
            hit G again to switch between 4 different Views 
            SHIFT+G previous Views
    
    ENTER key: restart scene
    
Controls:       
        W:  pedal 1 time
        LEFT MouseButton: Front break
        RIGHT MouseButton: Back break
        MouseMove: Balance Left/Right/Front/Back
        
        
        
Credits:
    Bicycle (low Poly) by farcgs
    https://blendswap.com/blend/3980
        
    Sounds
    https://freesound.org

Hurrah, my Joystick (MS SideWinder Force Feedback 2) works in UPBGE!
And looking around in the Cockpit is now also possible.

You can use a joystick for the helicopter by setting
the property “use_joystick” on the object “ZSE” to True

(Better use a joystick and not a gamepad because you want to control the pitch without a centering force)

For a Microsoft SideWinder Force Feedback 2 to be recognized by Blender add this SDL2 code:
030000005e0400001b00000000000000,SideWinder Force Feedback 2 Joystick,platform:Windows,a:b7,b:b4,x:b6,y:b5,leftshoulder:b2,rightshoulder:b3,leftstick:b0,rightstick:b1,leftx:a2,lefty:a3,rightx:a0,righty:a1,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
to the file:
UPBGE-0.30-windows-x86_64->3.0->datafiles->gamecontroller->gamecontrollerdb.txt

Or for your joystick create a SDL2 code with one of these Tools:
https://generalarcade.com/gamepadtool/
https://github.com/AntiMicroX/antimicrox
and edit your joystick axes in the movement.py in this .blend.

View:
    Key 1: Focus on Gyro
    Key 2: Focus on Gyro2
    Key 3: Focus on Helicopter
    Key 4: FirstPerson-View
     
    Key F: Fly-by Camera
            CTRL+MouseWheel or PgUp/PgDown or JoyButon 7/8: Zoom
            CTRL+Mouse or Arrow Keys or JoyHat: rotate Camera
            MiddleMouseButton or JoyButton 2: From Top-View            
            Or when in FirstPerson-Modus switch back to FirstPerson-View (from Map-View)
                
    Key G: Ground Camera
            1st View = Map (accident Cars are marked)
            hit G again to switch between 4 different Views 
            SHIFT+G previous View
            
    Key H: Helicopter Cockpit Camera
            CTRL+Mouse or Arrow Keys or JoyHat: Look around
            MiddleMouseButton or JoyButton 2: Center View
    
    ENTER key: restart scene
    
Controls:       
    Precession machine:
        A/D:  rotate red part

    Gyro:
        Controls:
        Space key: Spin and apply lift
        Mouse: rotate direction
        
        Rope:
        Left Mouse Button: attach rope
        Right Mouse Button: detach rope
        MouseWheel Down: make rope longer
        MouseWheel Up: make rope shorter
        
    Helicopter:
        Controls:
        R: start/stop Rotor-Engine
        W/S or JoyThrottle: main Rotor Collective pitch 
        A/D or JoyZ-Axis: tail rotor left/right
        Mouse or Joy-Axes: main Rotor cyclic control   
        Q or JoyButton 6: Auto-Hover On/Off         (also turns on Auto-Stabilizer.                                    
        E or JoyButton 5: Auto-Stabilizer On/Off   
        
        When in Hover-Mode the Collective pitch is controlled completely by Autopilot:
         W/S: in-/decrease target height       
        
        Rope:
        Left Mouse Button or JoyButton 3: make rope shorter and hide rope
        Right Mouse Button or JoyButton 4: show rope and make rope longer
        Space Key or JoyButton 1: attach or detach magnet to target
        T: Extra Top-View On/Off
        
    FirstPerson-View:
        Controls:
        Mouse: View
        W/A/S/D: Move
        Shift: Run
        Space: Jump
                
        Rope:
        Left Mouse Button: attach rope
        Right Mouse Button: detach rope
        MouseWheel Down: make rope longer
        MouseWheel Up: make rope shorter        
          
Visualization of Forces:
    set the properties of object 'ZSE'
        show_gyro_force
        show_heli_force
    to True or False
    
Sensibilty of Helicopter Controls:
    set the properties of object 'Bell'
    
    
Credits:
Helicopter model by SHINN THANT
https://blendswap.com/blend/15976

drone City by Voxelatio
https://blendswap.com/blend/27360

Low Poly Car Pack by Hexalore
https://blendswap.com/blend/28523

Sounds:
    https://www.pacdv.com/sounds/
    https://freesound.org

Coming soon :slight_smile:

Helicopter Alouette II Christmas special.
Working instruments and Slalom course:

Enter/Exit through the doors.

Lighten the candles:

Hi,
here is the Alouette II Christmas Special.

Took the model by Helijah, made it flyable and animated most instruments.
The Heli will consume Fuel. Refuel on the Helipads.
The Alouette II is a wonderful Helicopter without electronic stabilization helpers but direct control and used for flight educatiion.

The Slalom Course
(with volumetric clouds turned off (key C) for better performance)
The next goal/waypoint is also indicated by the heli instruments. You can try to beat your own time.

The Christmas Tree
When all Candles are lit, the Star shines.
(with volumetric clouds enabled (= low fps). Can be turned off with key C)

Welcome:
    Enter the helicopter through the right door(E), close the door, start the Engine (E), 
    -Fly the slalom - try to beat your own time, (the next way point is also indicated by the Heli instruments.)
        Your flight will be recorded and played back the next time you fly the slalom: You can see how you flew.
        You can turn off the Slalom recorder by setting the property 'slalom_recorder' of the object 'ZSE' to false.
    -Lighten the Christmas-Tree Candles (by "shooting" with JoyButton 1 or LeftMouseButton).
        When all candles are lit, the Star shines.
    The helicopter will consume Fuel. Refuel on the Helipads.
    Exiting the helicopter is only possible with stopped Engine (E).

Default is Joystick for the helicopter.
You can use the mouse instead for the Aircraft unplugging all joysticks or by setting
'Controller-Joystick' to None in Joystick Menu (key J)
In this menu you can also choose a 'Tracking-Joystick' for HeadTracking in Cockpit view
More info about Joysticks down below.


Joystick Assignment:
    Key J:  Open/Close Menu
            On Top choose Controller-Joystick with LeftMouseClick
            Left Mouse Button:  enable/disable listening, then move Axis to full extend or press Button 
            Right Mouse Button: delete Entry
            
            Axes Sensitivity: MouseWheel up/down. LeftClick to reset to 100.
            
            You can test buttons and Axes:  assigned function will highlight in pink 
            
            On Bottom Choose HeadTracking-Joystick with LeftMouseClick   
                     
            When Menu is closed the settings are saved to disk ('name'.bgeconf)
            
            
View:     
    Key F or JoyButton 7: Fly-by Camera
            (CTRL+)MouseWheel or PgUp/PgDown or JoyButton 3/4: Zoom
            (CTRL+)Mouse or Arrow Keys or JoyHat: rotate Camera
            MiddleMouseButton or JoyButton 2: From Top-View            
            Or when in FirstPerson-Modus switch back to FirstPerson-View (from Ground-Camera)
                
    Key G: Ground Camera
            hit G again to switch between 4 different Views 
            SHIFT+G previous View
            
    Key H or JoyButton 8: Helicopter Cockpit Camera
            (CTRL+)MouseWheel or PgUp/PgDown or JoyButton 3/4: Zoom
            (CTRL+)Mouse or Arrow Keys or JoyHat: Look around  (disabled when using HeadTracking-Joystick)
            MiddleMouseButton or JoyButton 2: Center View
            
    Key C: Clouds On/Off
    
    ENTER key: restart scene
    
Controls:       
        
    Helicopter:
        Controls:
        E or JoyButton 5: start/stop Rotor-Engine
        W/S or JoyThrottle: main Rotor Collective pitch 
        A/D or JoyZ-Axis: tail rotor left/right
        Mouse or Joy-Axes: main Rotor cyclic control                                      
        Q or JoyButton 6: Auto-Stabilizer On/Off   
        
        Left Mouse Button or JoyButton 1: Lighten the Christmas Candles
                
    FirstPerson-View:
        Controls:
        Mouse: View
        W/A/S/D: Move
        Shift: Run
        Space: Jump
        
        E or JoyButton 5: Open/Close Helicopter Door 
           Enter/Exit Helicopter
           Start/Stop Helicopter Engine
           
Manual recorder:
    Key O: start recording
    Key P: (stop recording and) playback recording
    
Debug shortcut keys:
    Key 1: 1st person View
    Key 2: Focus on Alouette
    Key 3: Focus on Alouette Dummy  (useful when playing back manual recording)
                          
Visualization of Forces:
    set the properties of object 'ZSE'
        show_heli_force
    to True or False
    
Sensibility of Helicopter Controls with mouse:
    set the properties of object 'Alouette'

    
About Controller-Joystick:
For a Microsoft SideWinder Force Feedback 2 to be recognized by Blender add this SDL2 code:
030000005e0400001b00000000000000,SideWinder Force Feedback 2 Joystick,platform:Windows,a:b7,b:b4,x:b6,y:b5,leftshoulder:b2,rightshoulder:b3,leftstick:b0,rightstick:b1,leftx:a2,lefty:a3,rightx:a0,righty:a1,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,
to the file:
UPBGE-0.30-windows-x86_64->3.0->datafiles->gamecontroller->gamecontrollerdb.txt

Or for your joystick create a SDL2 code with one of these Tools:
    https://generalarcade.com/gamepadtool/
    https://github.com/AntiMicroX/antimicrox
and edit your joystick Axes and Buttons in the Joystick Menu (Key J)
    
About HeadTracking-Joystick:
Setup your favorite HeadTracking software (TrackIR, OpenTrack, FreeTrack, LinuxTrack) to output to a virtual Joystick (vJoy, PPJoy). And set 'Center-Button' to the same as in this game (Joystick-Button 2)
E.g. on Windows you can use TrackIR->FreePie->vJoy. For FreePie the Python script from here is used:
https://www.avsim.com/forums/topic/497411-workaround-trackir-chaseplane-vjoy-freepie/
I use my TrackIR3 Device with Freetrack->FreePie->vJoy with another script.
You can find a copy of both scripts for FreePie in this blend here.
    
    
Credits:
Landscape and helicopter sound by SHINN THANT
https://blendswap.com/blend/15976

Helicopter model by Helijah
SNCASE SE.3130 Alouette II  by Helijah
https://blendswap.com/blend/27593
License: CC-BY

Christmas Tree by uwepost
https://blendswap.com/blend/22384
License: CC-0

Music by evanjones4
411651__evanjones4__film-for-a-music
https://freesound.org/people/evanjones4/sounds/411651/
License: CC-0

Sounds:
    https://www.pacdv.com/sounds/
    https://freesound.org

Added a recorder and playback.
Your Slalom flight will automatically recorded.
The next time you fly it again, you see a “ghost” of your previous flight and can chase yourself :slight_smile:
For this video I did a stop at the helipad.
(low fps only because of video recording)

Added an additional manual flight recorder.
Key O: start recording
Key P: (stop recording and) start Playback.

So you can inspect your perfomance at any time.

Added Joystick Configuration menu with blf-code.
No need to try your hands on python code for getting your joystick to work.

Joystick Assignment:
    Key J:  Open/Close Menu
            Left Mouse Button:  enable/disable listening, then nmove Axis to full extend or press Button 
            Right Mouse Button: delete Entry
            
            Axes Sensitivity: MouseWheel up/down. LeftClick to reset to 100.
            
            You can test buttons and Axes:  assigned function will highlight in pink          
            When Menu is closed the settings are saved to disk ('name'.bgeconf)
1 Like
  • Joystick Configuration Menu (blf-code)
  • Manual Flight Recorder/Playback
  • Better Cockpit Instruments Rendering
1 Like

Wow! Amazing.

You’ve made huge progress. It’s been a while.

1 Like

Cockpit-View now supports HeadTracking (via a Virtual Joystick).

Setup your favorite HeadTracking software (TrackIR, OpenTrack, FreeTrack, LinuxTrack) to output to a virtual Joystick (vJoy, PPJoy). And set ‘Center-Button’ to the same as in this game (Joystick-Button 2)
E.g. on Windows I use TrackIR->FreePie->vJoy. For FreePie the Python script from here is used:

You can find a copy of that script in this blend here.

(vJoy has the big advantage that it is recognized by UPBGE out of the box.)
The Joystick Configuration menu now allows to enable/disable different connected Joysticks.

1 Like