❄️🎁⛄ The Winter Games Tournament is Live! 🎄🎅❄️
Jump to content

Recommended Posts

Posted

5.0.2 beta

  • Fixed a bug where max acceleration was being ignored in player physics.
  • Added missing Entity:GetAngularVelocity method to Lua API.
  • Like 2

Let's build cool stuff and have fun. :)

Posted

5.0.2 beta

  • Added program:SetViewportLayout() to editor scripting API.
  • Start scripts will execute later in the program startup sequence now, right before the main window is shown.

Let's build cool stuff and have fun. :)

Posted

5.0.2 beta

I found a new library Microsoft has for low-latency thread-safe device input that doesn't clog the event queue with thousands of events. This is exactly what we need to support gaming mice with the lowest possible latency. However, there are two downsides to it:

  • When this is implemented, C++ projects will require the GameInput nuget package be added to them.
  • The feature is not guaranteed to be installed on all versions of Windows. There's a redistributable you can include in your installer, but we have seen from experience users will not install it, or the install will occasionally fail, or they will disable the feature, etc.

Still, the Microsoft GameInput library is the ONLY way to do what we want. Therefore we will roll this out gradually.

  • The new project template includes the GameInput nuget package by default, but existing projects do not yet require this to compile.
  • Window::GetMouseAxis is removed from the API, to be replaced in the future with another command.
  • The experimental Camera::SetMouseLook feature is removed, to be implemented in the future using GameInput.
  • The only stock script that was using Window::GetMouseAxis was the CameraControls script. That code has been updated to do away with the calls to GetMouseAxis.

The idea here is to make it so new C++ projects by default will be compatible with future GameInput support, but I don't think this feature justifies the introduction of incompatibility with existing C++ projects yet.

If you want to add the package to your project, just select the Tools > NuGet Package Manager > Manage Nuget Packages for Solution... menu item, search for "GameInput" and apply to the project. YOU DO NOT NEED TO DO THIS.

image.thumb.png.a8a062c9943879788f3a09be4a180fa6.png

Even when this feature is completed, you will still need to check to see if the feature is installed on the user's computer, so if you want to support high-DPI gaming mice, you will still need a fallback mode in case the feature is not supported on the user's machine. For now I strongly recommend just relying on standard mouse input (Window::GetMousePosition).

  • Like 1

Let's build cool stuff and have fun. :)

Posted

5.0.2 beta

I came up with a way of handling the camera mouse look feature in a way that makes things easy on the developer. If the Windows GameInput service is not available, the mouse look will be performed in the main thread using low-resolution mouse input. If the GameInput service is available, the mouse look will be performed in the rendering thread using high-DPI mouse input, and the sensitivity will be adjusted to match the current Windows mouse speed setting. This will produce the same results on the same machine, with GameInput on or off. This way you don't have to check if the feature is supported, and you can just use it without worrying.

The function definition Camera::SetMouseLook is slightly different now:

void SetMouseLook(bool mode, float mouselookspeed = 0.1, const float smoothing = 1.0, bool invertmouse = false, Vec2 pitchlimits = Vec2(-90, 90) )

In this build, the NuGet package GameInput is required. To do this, select the Tools > NuGet Package Manager > Manage Nuget Packages for Solution... menu item, search for "GameInput" and apply it to the project.

https://leadwerksstorage.s3.us-east-2.amazonaws.com/monthly_2026_01/image.png.242df5c66a00cadb1b40800f73a1ad65.png

  • Like 1

Let's build cool stuff and have fun. :)

Posted

5.0.2 beta

If the world render call uses one single synced frame, then camera mouse looking will be updated in the main thread, which eliminates the latency of the rotation coming back from the rendering thread. This provides the absolute highest precision for tightly synced games.

Added Window::GetMouseAxis back in. It will return the mouse position and print a warning the first time it is called, stating the command is deprecated. But old code will still compile without changes.

Let's build cool stuff and have fun. :)

Guest
This topic is now closed to further replies.
×
×
  • Create New...