Game Developer

From Sinden Lightgun
Jump to navigation Jump to search

Integrating Sinden Lightgun With Your Own Game Or Software

Sinden Lightgun should work well when writing software in all the major game development environment engines including Unreal Engine and Unity 3D.


Reading Movement

The easiest way to use the lightgun is just using the default mouse cursor and reading that directly in the game.  Both Unreal and Unity work fine with this.  However reading 2 lightguns doesn't work so well as there is only one mouse cursor.  It is possible to try and utilise "Raw Input" to read 2 mice devices using plugins but this can be complicated. So there is also an option to switch the lightguns into joystick mode. The engines deal with 2 of these much better.

To enable joystick mode, you need to enable the joystick functionality on the "Firmware Upgrade" tab and reconnect.  Then enable joystick mode with the tick box on the "Main tab" where the video screens are. Then finally you can assign the trigger and buttons to joystick actions on the button assignment tab.

Border

In terms of integrating the lightgun functionality in your game, you can draw the border yourself as an option, the default we use for best performance is 2% of the screen height with a white border and 3% of the screen height with a black border round the edge. You could make this configurable, another option is to allow "full screen window", this usually means that when pushing the back right Sinden button, the border will show over the top of the game.


Controlling Recoil

The default Sinden Lightgun Recoil responds to trigger events and other actions customizable in the Sinden software. In the latest version of the Sinden windows software you can now control the recoil directly from your game/software. The communication interface is TCP ports. There is a readme file in the windows folder called RecoilTcpServerReadme.txt. It explains how to use TCP ports to speak directly to the recoil and do some cool different things.  You should be able to interface into it in any of the major engines. The feature is quite new (September 2025) and was only added to the new release so might be a few quirks still that haven't been fed back yet but performance so far looks good.


Future Functionality

It is in the development pipeline to also expose an interface for querying and controlling the lightguns. For example how many are connected and starting/stopping them and changing settings. This means settings can be controlled in your game/software. This is hopefully planned for the first release in Q1 2026.