Skip to content

Commit

Permalink
Merge pull request #24 from sammyfreg/dev
Browse files Browse the repository at this point in the history
Releasing UnrealNetImgui 1.11
  • Loading branch information
sammyfreg authored May 21, 2023
2 parents b83f633 + 62a9210 commit f102f79
Show file tree
Hide file tree
Showing 94 changed files with 33,815 additions and 3,960 deletions.
4 changes: 2 additions & 2 deletions NetImgui.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 10,
"VersionName": "1.10",
"Version": 11,
"VersionName": "1.11",
"FriendlyName": "Unreal NetImgui",
"Description": "Plugin exposing Dear ImGui library for drawing 2D menus. These menus are displayed and controlled from an external application but processed from this engine code.",
"Category": "2D",
Expand Down
Binary file modified NetImguiServer/netImguiServer.exe
Binary file not shown.
46 changes: 39 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<p align="center" style="font-size:30px"><b>Unreal NetImgui</b></p>
<p align="center" style="vertical-align:middle">
<img src="https://avatars3.githubusercontent.com/u/6615685?s=200&v=4" width=128 height=128>
Expand All @@ -8,7 +9,7 @@
# Summary
### Support of [NetImgui](https://github.com/sammyfreg/netImgui "NetImgui") in [Unreal Engine 4 & 5](https://github.com/EpicGames)

**UnrealNetImgui** is a plugin adding remote debug GUI interface to **Unreal Engine** using the [**Dear ImGui**](https://github.com/ocornut/imgui "Dear ImGui") paired with [**NetImgui**](https://github.com/sammyfreg/netImgui). Allows **UE** users to remotely display and control some custom GUI on the dedicated **NetImgui Server** application. This proves convenient with games running on limited inputs/display hardware, such as gaming consoles and smartphones. Also reduces the game screen clutter of debug informations contents.
**UnrealNetImgui** is a plugin adding remote debug GUI interface to **Unreal Engine** using the [**Dear ImGui**](https://github.com/ocornut/imgui "Dear ImGui") paired with [**NetImgui**](https://github.com/sammyfreg/netImgui). Allows **Unreal Engine** users to remotely display and control some custom GUI on the dedicated **NetImgui Server** application. This proves convenient with games running on limited inputs/display hardware, such as gaming consoles and smartphones. Also reduces the game screen clutter of debug informations contents.

![NetImgui](https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/UnrealNetImgui.gif)

Expand All @@ -19,6 +20,25 @@
# Fonts and Icons
The plugin comes packaged with various Latin fonts, a Japanese Mincho font, [Kenney's Gaming Icons](https://kenney.nl/assets/game-icons "gaming icons"), [Font Awesome](https://fontawesome.com "Font Awesome") (the free subset) and [Google Material Designs icons](https://github.com/google/material-design-icons "Google Material Designs icons"), for a nice selection of useful icons. The screenshot above shows a small subset of available icons. Mixing latin text, kanjis and icons is kept straightforward using utf8 strings.

# Dear ImGui extensions
Additional to the inclusion of extra fonts and icons, some Dear ImGui extension are already integrated and ready to use.
### ImPlot
From the author :
> ImPlot is an immediate mode, GPU accelerated plotting library for [Dear ImGui](https://github.com/ocornut/imgui). It aims to provide a first-class API that ImGui fans will love. ImPlot is well suited for visualizing program data in real-time or creating interactive plots, and requires minimal code to integrate. Just like ImGui, it does not burden the end user with GUI state management, avoids STL containers and C++ headers, and has no external dependencies except for ImGui itself.
>
><img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/ImPlot-pie.gif" width="32%">
><img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/ImPlot-tables.gif" width="32%">
><img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/ImPlot-controls.gif" width="32%">
https://github.com/epezent/implot

### Node-Editor
From the author :
> An implementation of node editor with ImGui-like API. Project purpose is to serve as a basis for more complex solutions like blueprint editors.
> <img src="https://raw.githubusercontent.com/wiki/sammyfreg/netImgui/Web/img/Node-Editor.gif">
https://github.com/thedmd/imgui-node-editor

# Connecting to the NetImgui Server
There are mutliple ways of connecting your game to the **NetImguiServer**.

Expand Down Expand Up @@ -75,10 +95,10 @@ This plugins comes with ***Imgui Unreal Commands***, adding Unreal Commands brow
- **Dear ImGui's** menu content created in your code, will be displayed and controlled in it (after a connection is established).
- The client list comes pre-configured with 3 clients configuration (game, editor, server) that will be automatically connected to when detected. For remote PCs, game consoles or others, create a new client configuration with proper address settings.

6. You can now invoke **Dear ImGui** drawing functions to generate your GUI every frame.
- Any code running on the Game Thread can now invoke make drawing calls (as long as `NetImguiHelper::IsDrawing()` is true)
6. You can now use **Dear ImGui's** drawing functions to generate your GUI every frame.
- Any code running on the Game Thread can make drawing calls (as long as `NetImguiHelper::IsDrawing()` is true)
- You can also add a callback to `FNetImguiModule::OnDrawImgui` to be invoked by **UnrealNetImgui** when some drawing is expected.
- The define `NETIMGUI_ENABLED` allows to selectively disable code if planning to remove **NetImgui** on certain game configurations (shipping, ...)
- The define `#if NETIMGUI_ENABLED` allows to selectively disable code if planning to remove **NetImgui** on certain game configurations (shipping, ...)

7. The Unreal build file `NetImgui.Build.cs` contains many option to toggle features/fonts.

Expand Down Expand Up @@ -108,7 +128,7 @@ void AMyImGuiActor::Tick(float DeltaTime)
#if NETIMGUI_ENABLED
//---------------------------------------------------------------------------------------------
// Avoid drawing ImGui menus when not expecting a new frame, reducing CPU cost.
// Mandatary when 'bSupportFrameSkip' is emabled in 'NetImgui.Build.cs', otherwise
// Mandatary when 'bSupportFrameSkip' is enabled in 'NetImgui.Build.cs', otherwise
// 'Dear ImGui' will assert on a missing 'ImGui::NewFrame()'
//---------------------------------------------------------------------------------------------
if( NetImguiHelper::IsDrawing() )
Expand Down Expand Up @@ -149,9 +169,17 @@ void AMyImGuiActor::Tick(float DeltaTime)
#endif
}
```
# Release notes 1.10
- Updated to [Dear ImGui 1.89.5](https://github.com/ocornut/imgui/releases/tag/v1.89.5) (docking branch)
- Updated to [NetImgui 1.19](https://github.com/sammyfreg/netImgui/releases/tag/v1.9.0)
- Tested on **Unreal Engine 4.27, 5.0, 5.2** *(other versions should be supported without issues)*
- Added support for [ImPlot](https://github.com/epezent/implot)
- Added support for [Node-Editor](https://github.com/thedmd/imgui-node-editor)
# Release notes 1.9
- Tested with **Unreal Engine 5**
- Updated **Font Awesome** icons (v5 -> v6)
# Release notes 1.8
- Added Japanese Font
- Added Kenney's gaming icons
Expand All @@ -169,7 +197,7 @@ void AMyImGuiActor::Tick(float DeltaTime)
- Added ***Imgui Unreal Commands*** support (browse and execute Unreal Commands)
- Upgraded to **Dear Imgui 1.83** *(docking branch)*
- Upgraded to [**NetImgui 1.5**](https://github.com/sammyfreg/netImgui/releases/tag/v1.5.0) *(more details in link)*
- Tested on **Unreal 4.26** *(other versions should be supported without issues)*
- Tested on **Unreal Engine 4.26, ** *(other versions should be supported without issues)*
- **NetImgui Server** now requires less CPU/GPU
# Credits
Expand All @@ -184,4 +212,8 @@ Various icons have been integrated to **UnrealNetImgui** existing fonts and acce
- [Kenney's Gaming Icons](https://kenney.nl/assets/game-icons "gaming icons") for his set of useful game related symbols.
- [Font Awesome](https://fontawesome.com "Font Awesome") (the free subset) for the nice selection of every day use icons.
- [Font Awesome](https://fontawesome.com "Font Awesome") (the free subset) for the nice selection of every day use icons.
**Dear ImGui Extensions**
- [ImPlot](https://github.com/epezent/implot) by [Evan Pezent](https://github.com/epezent).
- [Node-Editor](https://github.com/thedmd/imgui-node-editor) by [Michał Cichoń](https://github.com/thedmd).
84 changes: 65 additions & 19 deletions Source/NetImgui.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//-------------------------------------------------------------------------------------------------
// Plugin exposing Dear ImGui library for drawing 2D menus. These menus are displayed and
// controlled from an external application ("Plugin\UnrealNetImgui\NetImguiServer\netImguiServer.exe")
// but processed from this engine code. Works on various platform supported by UE4
// but processed from this engine code. Works on various platform supported by UE4 and UE5
//
// Note: Displaying Dear ImGui menus InGame, can be done by using the plugin UnrealImgui instead
// (https://github.com/segross/UnrealImGui). It was designed for local display of
Expand Down Expand Up @@ -42,8 +42,9 @@
// "-netimguiserver 192.168.1.2:60" Try connecting to NetImguiServer at '192.168.1.2 : 60'
//
//-------------------------------------------------------------------------------------------------
// Dear ImGui Library : v1.88 (https://github.com/ocornut/imgui)
// NetImGui Library : v1.8 (https://github.com/sammyfreg/netImgui)
// Dear ImGui Library : v1.89 docking (https://github.com/ocornut/imgui)
// NetImGui Library : v1.9 (https://github.com/sammyfreg/netImgui)
// Tested on Unreal Engine 4.27, 5.0, 5.2
//=================================================================================================

public class NetImgui : ModuleRules
Expand All @@ -64,63 +65,94 @@ public NetImgui(TargetInfo Target)
List<string> PublicDefinitions = Definitions;
#endif

//---------------------------------------------------------------------
//=========================================================================================
// User Configuration: Basic settings
//---------------------------------------------------------------------
//=========================================================================================

// Toggle NetImgui support here
bool bNetImgui_Enabled = true;

//---------------------------------------------------------------------

// When true, only redraw Dear ImGui when needed, saving processing.
// When enabled, user must check "NetImguiHelper::IsDrawing()" before emiting ImGui draws
bool bFrameSkip_Enabled = true;
//---------------------------------------------------------------------

// When true, the plugin will automatically start listening for a connection from the NetImguiServer
// You can disable it, and rely on launching the game with netimgui commandline options
// or using a UnrealCommand to connect/start listening
bool bAutoWaitConnection_Enabled = true;
//---------------------------------------------------------------------

// When true, use the 'FreeType' library to generate the font texture
// This means including the Freetype library (already included with editor) in the build
// Generates sligthly better result than the default stb_truetype default code
bool bFreeType_Enabled = true;
//---------------------------------------------------------------------

// When true, the Dear ImGui demo window will be available in the NetImgui mainmenu bar.
// Usefull as a reference on what programmer can do with Dear ImGui
bool bDemoImgui_Enabled = true;
//---------------------------------------------------------------------

// When true, the demo actor 'ANetImguiDemoActor' will be available to use in your game.
// Can be found in 'NetImguiDemoActor.cpp', demonstrating how to use NetImgui in your own project
bool bDemoActor_Enabled = true;

//=========================================================================================
// User Configuration: Dear Imgui extensions
//=========================================================================================

// When true, enable the Dear Imgui 'ImPlot' library extension.
// Usefull to generates real time plot of data
// See https://github.com/epezent/implot for more info
// Note: Plugin user code can rely on the 'NETIMGUI_IMPLOT_ENABLED'
// define to know if this extension is active
bool bImPlot_Enabled = true;
//---------------------------------------------------------------------

// When true, enable the Dear Imgui 'Node-Editor' library extension.
// Usefull to generate node based editors
// See https://github.com/thedmd/imgui-node-editor for more info
// Note: Plugin user code can rely on the 'NETIMGUI_NODE_EDITOR_ENABLED'
// define to know if this extension is active
bool bNodeEditor_Enabled = true;

//=========================================================================================
// User Configuration: Fonts
//---------------------------------------------------------------------
//=========================================================================================
// See 'NetImguiModule.h' for more details
// Note: Can either have IconAwesome or IconMaterialDesign enabled, not both

//---------------------------------------------------------------------
// Will load Japanese font
// Note: If not using Japanese, set this to false, saves on memory (avoids 6MB font data table source include)
bool bFontJapanese_Enabled = true;
//---------------------------------------------------------------------

// Will load the 'Kenney Game Icons' font
// Gaming oriented icons
bool bFontIconGameKenney_Enabled = true;
//---------------------------------------------------------------------

// Will load the 'FontAwesome 6' font ('free' subset)
// Contains various icons for every use
bool bFontIconAwesome_Enabled = true;
//---------------------------------------------------------------------

// Will load 'Google Material Designs icons' font
// Contains various icons for every use
bool bFontIconMaterialDesign_Enabled = false;

//---------------------------------------------------------------------
//=========================================================================================
// User Configuration: Network
//---------------------------------------------------------------------
//=========================================================================================

// Com Port used by this client, to try connecting to the remote NetImgui Server (8888 by default)
// Used when engine is launched with command line parameter 'netimguiserver' to request a connection
// attempt, instead of waiting for server to reach the game
string kRemoteConnectPort = "(NetImgui::kDefaultServerPort)";
//---------------------------------------------------------------------

// Com Port used by Game exe to wait for a connection from netImgui Server (8889 by default)
// NetImgui Server will try to find running game client on this port and connect to them
Expand All @@ -130,18 +162,20 @@ public NetImgui(TargetInfo Target)
// Alternatively, you can modify the connection code in 'FNetImguiModule::StartupModule()'
// to let the client connect directly to NetImGui server using 'NetImgui::ConnectToApp(ServerIP)'
string kGameListenPort = "(NetImgui::kDefaultClientPort)";
//---------------------------------------------------------------------

// Com Port used by Editor exe to wait for a connection from netImgui Server (8890 by default)
// NetImgui Server will try to find running editor client on this port and connect to them
string kEditorListenPort = "(NetImgui::kDefaultClientPort+1)";
//---------------------------------------------------------------------

// Com Port used by Dedicated Server exe to wait for a connection from netImgui Server (8891 by default)
// NetImgui Server will try to find running dedicaed server client on this port and connect to them
string kDedicatedServerListenPort = "(NetImgui::kDefaultClientPort+2)";
//---------------------------------------------------------------------

//=========================================================================================
// Plugin setup (no edit should be needed)
//---------------------------------------------------------------------
//=========================================================================================

// Developer modules are automatically loaded only in editor builds but can be stripped out from other builds.
// Enable runtime loader, if you want this module to be automatically loaded in runtime builds (monolithic).
Expand All @@ -156,6 +190,8 @@ public NetImgui(TargetInfo Target)

bFreeType_Enabled &= bNetImgui_Enabled;
if (bFreeType_Enabled){
AddEngineThirdPartyPrivateStaticDependencies(Target, "UElibPNG");
AddEngineThirdPartyPrivateStaticDependencies(Target, "zlib");
AddEngineThirdPartyPrivateStaticDependencies(Target, "FreeType2");
}

Expand All @@ -170,9 +206,11 @@ public NetImgui(TargetInfo Target)
PublicDefinitions.Add(string.Format("NETIMGUI_ENABLED={0}", bNetImgui_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FRAMESKIP_ENABLED={0}", bFrameSkip_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_WAITCONNECTION_AUTO_ENABLED={0}", bAutoWaitConnection_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FREETYPE_ENABLED={0}", bFreeType_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_IMGUI_ENABLED={0}", bDemoImgui_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_ACTOR_ENABLED={0}", bDemoActor_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_FREETYPE_ENABLED={0}", bNetImgui_Enabled && bFreeType_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_IMPLOT_ENABLED={0}", bNetImgui_Enabled && bImPlot_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_NODE_EDITOR_ENABLED={0}", bNetImgui_Enabled && bNodeEditor_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_IMGUI_ENABLED={0}", bNetImgui_Enabled && bDemoImgui_Enabled ? 1 : 0));
PublicDefinitions.Add(string.Format("NETIMGUI_DEMO_ACTOR_ENABLED={0}", bNetImgui_Enabled && bDemoActor_Enabled ? 1 : 0));

// Fonts support
PublicDefinitions.Add(string.Format("NETIMGUI_FONT_JAPANESE={0}", bFontJapanese_Enabled ? 1 : 0));
Expand All @@ -189,11 +227,19 @@ public NetImgui(TargetInfo Target)
// Misc
PrivateDefinitions.Add("NETIMGUI_WINSOCKET_ENABLED=0"); // Using Unreal sockets, no need for built-in sockets
PrivateDefinitions.Add("NETIMGUI_POSIX_SOCKETS_ENABLED=0"); // Using Unreal sockets, no need for built-in sockets
PrivateDefinitions.Add(string.Format("RUNTIME_LOADER_ENABLED={0}", bEnableRuntimeLoader ? 1 : 0));

if (Target.Platform.Equals(UnrealTargetPlatform.XSX))
{
PublicDefinitions.Add("IMGUI_DISABLE_WIN32_FUNCTIONS=1");
PublicDefinitions.Add("IMGUI_API=NETIMGUI_API");
PublicDefinitions.Add("IMPLOT_API=NETIMGUI_API");
PublicDefinitions.Add("IM_NODE_EDITOR_API=NETIMGUI_API");

if (bFreeType_Enabled){
PublicDefinitions.Add("IMGUI_ENABLE_FREETYPE");
}

if (bNetImgui_Enabled && bImPlot_Enabled) {
PublicDefinitions.Add("IMGUI_DEFINE_MATH_OPERATORS"); // Note: Needed by ImPlot
}

PrivateDefinitions.Add(string.Format("RUNTIME_LOADER_ENABLED={0}", bEnableRuntimeLoader ? 1 : 0));
}
}
Loading

0 comments on commit f102f79

Please sign in to comment.