Giter VIP home page Giter VIP logo

networksample's Introduction

Flax Engine

Flax Engine is a high quality modern 3D game engine written in C++ and C#. From stunning graphics to powerful scripts, it's designed for fast workflow with many ready-to-use features waiting for you right now. To learn more see the website (www.flaxengine.com).

This repository contains full source code of the Flax Engine (excluding NDA-protected platforms support). Anyone is welcome to contribute or use the modified source in Flax-based games.

Development

Screenshots

pbr-rendering rendering performance

Getting started

Follow the instructions below to compile and run the engine from source.

Windows

  • Install Visual Studio 2022 or newer
  • Install Windows 8.1 SDK or newer (via Visual Studio Installer)
  • Install Microsoft Visual C++ 2015 v140 toolset or newer (via Visual Studio Installer)
  • Install .NET 8 SDK for Windows x64 (via Visual Studio Installer or from web)
  • Install Git with LFS
  • Clone repo (with LFS)
  • Run GenerateProjectFiles.bat
  • Open Flax.sln and set solution configuration to Editor.Development and solution platform to Win64
  • Set Flax (C++) or FlaxEngine (C#) as startup project
  • Compile Flax project (hit F7 or CTRL+Shift+B)
  • Optionally set Debug Type to Managed Only (.NET Core) to debug C#-only, or Mixed (.NET Core) to debug both C++ and C#
  • Run Flax (hit F5 key)

Linux

  • Install Visual Studio Code
  • Install .NET 8 SDK (https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
    • Ubuntu: sudo apt install dotnet-sdk-8.0
  • Install Vulkan SDK (https://vulkan.lunarg.com/)
    • Ubuntu: sudo apt install vulkan-sdk
    • Arch: sudo pacman -S spirv-tools vulkan-headers vulkan-tools vulkan-validation-layers
  • Install Git with LFS
    • Ubuntu: sudo apt-get install git git-lfs
    • Arch: sudo pacman -S git git-lfs
    • git-lfs install
  • Install the required packages:
    • Ubuntu: sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev zlib1g-dev
    • Arch: sudo pacman -S base-devel libx11 libxcursor libxinerama zlib
  • Install Clang compiler (version 6 or later):
    • Ubuntu: sudo apt-get install clang lldb lld
    • Arch: sudo pacman -S clang lldb lld
  • Clone the repository (with LFS)
  • Run ./GenerateProjectFiles.sh
  • Open workspace with Visual Code
  • Build and run (configuration and task named Flax|Editor.Linux.Development|x64)

Mac

Troubleshooting

  • Could not execute because the specified command or file was not found.

Restart PC - ensure DotNet is added to PATH for command line tools execution.

  • Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 8.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 8.0

Use Visual Studio 2022, older versions are not supported by .NET SDK 8.

  • Building for Windows without Vulkan rendering backend (Vulkan SDK is missing)

Install the Vulkan SDK then set an environment variable to provide the path to the SDK prior to running GenerateProjectFiles.bat: set VULKAN_SDK=%sdk_path%.

  • The NuGetSdkResolver did not resolve this SDK

Install .NET SDK, NuGet package manager and NuGet targets and build tasks in Visual Studio components.

Workspace directory

  • Binaries/ - executable files
    • Editor/ - Flax Editor binaries
    • Tools/ - tools binaries
  • Cache/ - local data cache folder used by the engine and tools
    • Intermediate/ - intermediate files and cache for engine build
      • ProjectName/ - per-project build cache data
      • Deps/ - Flax.Build dependencies building cache
    • Projects/ - project files location
  • Content/ - assets and binary files used by the engine and editor
  • Development/ - engine development files
    • Scripts/ - utility scripts
  • Source/ - source code location
    • Editor/ - Flax Editor source code
    • Engine/ - Flax Engine source code
    • Platforms/ - per-platform sources and dependency files
      • DotNet/ - C# dependencies
      • Editor/ - Flax Editor binaries
      • PlatformName/ - per-platform files
        • Binaries/ - per-platform binaries
          • Game/ - Flax Game binaries
          • ThirdParty/ - prebuilt 3rd Party binaries
    • Shaders/ - shaders source code
    • ThirdParty/ - 3rd Party source code
    • Tools/ - development tools source code

Licensing and Contributions

Using Flax source code is strictly governed by the Flax Engine End User License Agreement. If you don't agree to those terms, as amended from time to time, you are not permitted to access or use Flax Engine.

We welcome any contributions to Flax Engine development through pull requests on GitHub. Most of our active development is in the master branch, so we prefer to take pull requests there (particularly for new features). We try to make sure that all new code adheres to the Flax coding standards. All contributions are governed by the terms of the EULA.

networksample's People

Contributors

jb-perrier avatar mafiesto4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

networksample's Issues

Is there a correct way to compile ENet in Linux with IPv6 disabled?

Since I have never delved into IPv6 I usually disable it (kernel command line ipv6.disable=1), apparently ENet is not happy with it.

I noticed that there is a define ENET_IPV6 to compile ENet without IPv6 but I'm not sure it's enough, in fact it seems to me that it creates problems with the memory management.

I can get the example to work (with two instances) with a couple of changes to enet.h (below) but when I exit the preview/game mode with the Esc key I get a SIGABRT signal, apparently due to an invalid free() (below).

I am trying to understand the problem, but if you have any suggestions they are more than welcome.

free(): invalid pointer

Thread 1 "FlaxEditor" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
49	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  0x00007ffff596b546 in __GI_abort () at abort.c:79
#2  0x00007ffff59c2eb8 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff5ae0a78 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007ffff59ca91a in malloc_printerr (str=str@entry=0x7ffff5ade74e "free(): invalid pointer") at malloc.c:5628
#4  0x00007ffff59cbcf4 in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:4398
#5  0x00007ffff59cf9b4 in __GI___libc_free (mem=<optimized out>) at malloc.c:3309
#6  0x00007ffff637337e in UnixPlatform::Free (ptr=0x3d5eb80) at Source/Engine/Platform/Unix/UnixPlatform.cpp:54
#7  0x00007ffff6332045 in CrtAllocator::Free (ptr=0x3d5eb80) at Source/Engine/Core/Memory/CrtAllocator.h:32
#8  0x00007ffff6a67ec1 in Delete<INetworkDriver, CrtAllocator> (ptr=0x3d5eb80) at Source/Engine/Core/Memory/Memory.h:313
#9  0x00007ffff6a6736e in NetworkPeer::Shutdown (this=0x3534370) at Source/Engine/Networking/NetworkPeer.cpp:77
#10 0x00007ffff6a67b31 in NetworkPeer::ShutdownPeer (peer=0x3534370) at Source/Engine/Networking/NetworkPeer.cpp:227
#11 0x00007ffff6a822e5 in NetworkPeerInternal::ShutdownPeer (peer=0x3534370) at Cache/Intermediate/FlaxEditor/Linux/x64/Debug/Networking/Networking.Bindings.Gen.cpp:1898
#12 0x000000004068dd92 in ?? ()
#13 0x0000000000000000 in ?? ()
 #ifndef ENET_IPV6
-#define ENET_IPV6           1
+#define ENET_IPV6           0
+in_addr in4addr_any = { 0 };
 #endif
     ENetSocket enet_socket_create(ENetSocketType type) {
-        return socket(PF_INET6, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
+        return socket(PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
   }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.