Becoming a Thrive developer

Hi! My name is Artem. I want to get involved in development process as a contributor at first.

I’ve read on your wiki it’s better to ask you where I should start. I’m actually working as a developer but I’m not a game developer so the field is completely new for me.

I’ve watched some videos on YouTube about what developers can do in the game industry. I’ve found gameplay programming interesting the most for me so far. Something like implementing game mechanics and systems, player input handling, NPC behavior, collision detection and physics simulation. Of course, it’s a lot but I’m not interested in graphics, audio or UI programming just now.

Can you direct me where to start and what additional Thrive’s code should I learn as well to help me with better understanding of the specific area suggested by you?

3 Likes

Welcome. I assume you saw this wiki page already: Getting Started - Thrive Developer Wiki

So I’ll specifically point out that you should first get Thrive compiled on your computer (and installing a C# IDE) following the setup instructions:

We have some code documentation which you can read:

but mostly just reading the XML comments on the code is the way to find out how stuff works.

To find stuff to work on you can check the good first issues: Issues · Revolutionary-Games/Thrive · GitHub or easy issues if there isn’t enough interesting good issues to start off with. If you find something interesting but don’t know how to get started you can comment on the github issue and I’ll probably have some ideas as to how the issue could be solved.

2 Likes

I’m actually working on Thrive compilation.

What I’ve done:

  1. Installed Godot mono version
  2. Installed .NET SDK and runtime
  3. Installed Git and Git LFS
  4. Compiled Thrive successfully before opening it in Godot
  5. Compiled it successfully in Godot as well

I skipped the part with IDE because in the setup instructions the part with VS Code is not up to date if I correctly understand. I’m using Ubuntu. Jetbrains Rider is not free. I don’t know whether I need to install VS Build tools 2022 because .NET SDK already has it. So talking about IDE I have VS Code and .NET SDK with runtime. What else do I have to do from this part about using VS Code to be able to work?

Ok. The building was successful so I decided to ask you about development environment and try to play the game. The next step is to install native libraries.

I’ve used the first command: dotnet run --project Scripts – native Fetch
and get the following:
ERROR(S):
Verb ‘–native’ is not recognized.

–help Display this help screen.

–version Display version information.

Then I decided to compile myself using the tools described in the instruction and after using the command:
dotnet run --project Scripts – native Build
I got the same error.

1 Like

VS Build tools is a WIndows only thing. Even if you wanted to you couldn’t install it on Linux.

You can get by with just the dotnet command line tool for building.

I don’t use it so I don’t know. The setup instructions, even if partially outdated is the best I can point you to related to that.

You have one too few - characters or a missing space, I think (you didn’t use ` to denote code blocks so the forums might be reformatting what you typed) but you need to confirm that you entered the command exactly correctly. That error message is from dotnet command itself and not Thrive scripts.

Confirm that you copy-paste exactly the right command to your terminal: dotnet run --project Scripts -- native Fetch The part -- tells dotnet that the next part is the arguments for the Thrive scripts so that it doesn’t look at them and try to understand what they are.

1 Like

Do I need to install 4.7.2 .NET developer pack or is it also for Windows users?

Your suggestion has helped. I’ve installed native libraries. But the game doesn’t want to work. After running the game and after the building progress bar the window appears with the logo for some seconds and then it disappears.

The reason why that was suggested before was that Godot 3.x versions used the old net47 runtime, meaning that now if such packages exist like “.NET 6 developer pack” or “.NET 8 developer pack” those would make sense to install based on the same reasoning.

Run Thrive from the terminal and check what it says, for example running godot in the Thrive folder should attempt to run the game with godot (assuming you setup your path etc. for godot to be called just by name like that).

Net 8 is now used due to move to Godot 4.x. Not any versions on that Godot version are yet publically released but repository on GitHub is already converted.

After running Thrive in terminal I have this:

Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org
Vulkan API 1.3.238 - Forward+ - Using Vulkan Device #0: Intel - Intel(R) UHD Graphics (JSL)

This is Thrive version: 0.6.6.0-alpha+381c8d8c6f5aa10a5e87ce0124583e5ef968e2eb (see below for more build info)
TODO: reimplement unhandled exception logger
Startup C# locale is: en-US Godot locale is: en_US
user:// directory is: /home/artem/.local/share/Thrive
Game logs are written to: /home/artem/.local/share/Thrive/logs latest log is ‘log.txt’
Cannot use full-speed Thrive native library due to: CPU is missing AVX 1 extension instruction support
CPU is missing AVX 2 extension instruction support
Using slower Thrive native library that doesn’t rely on as new CPU instructions
Checked that required CPU features are present
Library not found yet at expected paths, trying a distributable version

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.2.2.stable.mono.official (15073afe3856abd2aa1622492fe50026c7d63dc1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5dd2e1) [0x7cc277ddd2e1] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7cc2c0842520] (??:0)
[3] /home/artem/Desktop/Thrive/native_libs/distributable/linux/ThriveNative/12/release/lib/libthrive_native_without_avx.so(+0xad7bf) [0x7cc260aad7bf] (??:0)
[4] /lib64/ld-linux-x86-64.so.2(+0x647e) [0x7cc2c0d1247e] (??:0)
[5] /lib64/ld-linux-x86-64.so.2(+0x6568) [0x7cc2c0d12568] (??:0)
[6] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0xe5) [0x7cc2c0974af5] (??:0)
[7] /lib64/ld-linux-x86-64.so.2(+0xdff6) [0x7cc2c0d19ff6] (??:0)
[8] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x7cc2c0974a98] (??:0)
[9] /lib64/ld-linux-x86-64.so.2(+0xe34e) [0x7cc2c0d1a34e] (??:0)
[10] /lib/x86_64-linux-gnu/libc.so.6(+0x9063c) [0x7cc2c089063c] (??:0)
[11] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x7cc2c0974a98] (??:0)
[12] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x33) [0x7cc2c0974b63] (??:0)
[13] /lib/x86_64-linux-gnu/libc.so.6(+0x9012e) [0x7cc2c089012e] (??:0)
[14] /lib/x86_64-linux-gnu/libc.so.6(dlopen+0x48) [0x7cc2c08906c8] (??:0)
[15] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5e5ddb) [0x7cc277de5ddb] (??:0)
[16] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x367736) [0x7cc277b67736] (??:0)
[17] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x367589) [0x7cc277b67589] (??:0)
[18] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x3692e4) [0x7cc277b692e4] (??:0)
[19] [0x7cc1f8a98782] (??:0)
– END OF BACKTRACE –

Aborted (core dumped)

Signal 4 is illegal instruction signal. And with:

[1] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5dd2e1) [0x7cc277ddd2e1] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7cc2c0842520] (??:0)
[3] /home/artem/Desktop/Thrive/native_libs/distributable/linux/ThriveNative/12/release/lib/libthrive_native_without_avx.so(+0xad7bf) [0x7cc260aad7bf] (??:0)

I’m thinking that the Thrive native library variant that tries to not use AVX still does use it somehow.

Checking things out it might be the case that your CPU doesn’t have: FMA instruction set - Wikipedia or maybe F16C - Wikipedia Could you tell me which CPU do you have?

Could you try adding the following code into the src/native/interop/NativeInterop.cs file around line 262 (method CheckCPUFeaturesCompatibility):

        if (!Lzcnt.IsSupported)
            GD.PrintErr("Missing LZCNT");

        // For TZCNT
        if (!Bmi1.IsSupported)
            GD.PrintErr("Missing TZCNT");

        if (!Fma.IsSupported)
            GD.PrintErr("Missing FMA");

And then run Thrive again. This time hopefully one of those error prints trigger and it would give me some more info what flags I should set for the physics engine build. I didn’t find out how to check for F16C from C# so hopefully it is not that.

My CPU is:

Vendor ID: GenuineIntel
Model name: Intel(R) Pentium(R) Silver N6000 @ 1.10GHz
CPU family: 6
Model: 156

Looking at the feature sheet: https://www.cpu-world.com/CPUs/Pentium/Intel-Mobile%20Pentium%20N6000.html

It does look like your CPU is missing basically everything except SSE 4.2. So based on that I think the without AVX variant of the thrive native library should not use any of the other advanced instructions either (for now it just skipped AVX). I’ll make a new Thrive native library version later today that should work. If I needed you to update one number in NativeConstants.cs could you do that and test? Or do I need to fully make this change and commit the code?

    private static CPUCheckResult CheckCPUFeaturesCompatibility()
    {
        var result = CPUCheckResult.CPUCheckSuccess;

	if (!Lzcnt.IsSupported)
            GD.PrintErr("Missing LZCNT");

        // For TZCNT
        if (!Bmi1.IsSupported)
            GD.PrintErr("Missing TZCNT");

        if (!Fma.IsSupported)
            GD.PrintErr("Missing FMA");

        if (!Sse42.IsSupported)
            result |= CPUCheckResult.CPUCheckMissingSse42;

        if (!Sse41.IsSupported)
            result |= CPUCheckResult.CPUCheckMissingSse41;

        return result;
    }

Result:

handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.2.2.stable.mono.official (15073afe3856abd2aa1622492fe50026c7d63dc1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5dd2e1) [0x7fe522ddd2e1] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7fe567442520] (??:0)
[3] /home/artem/Desktop/Thrive/native_libs/distributable/linux/ThriveNative/12/release/lib/libthrive_native_without_avx.so(+0xad7bf) [0x7fe4a06ad7bf] (??:0)
[4] /lib64/ld-linux-x86-64.so.2(+0x647e) [0x7fe5678fa47e] (??:0)
[5] /lib64/ld-linux-x86-64.so.2(+0x6568) [0x7fe5678fa568] (??:0)
[6] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0xe5) [0x7fe567574af5] (??:0)
[7] /lib64/ld-linux-x86-64.so.2(+0xdff6) [0x7fe567901ff6] (??:0)
[8] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x7fe567574a98] (??:0)
[9] /lib64/ld-linux-x86-64.so.2(+0xe34e) [0x7fe56790234e] (??:0)
[10] /lib/x86_64-linux-gnu/libc.so.6(+0x9063c) [0x7fe56749063c] (??:0)
[11] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x7fe567574a98] (??:0)
[12] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x33) [0x7fe567574b63] (??:0)
[13] /lib/x86_64-linux-gnu/libc.so.6(+0x9012e) [0x7fe56749012e] (??:0)
[14] /lib/x86_64-linux-gnu/libc.so.6(dlopen+0x48) [0x7fe5674906c8] (??:0)
[15] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5e5ddb) [0x7fe522de5ddb] (??:0)
[16] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x367736) [0x7fe522b67736] (??:0)
[17] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x367589) [0x7fe522b67589] (??:0)
[18] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x3692e4) [0x7fe522b692e4] (??:0)
[19] [0x7fe4a3ac8782] (??:0)
-- END OF BACKTRACE --

As I can understand all if statements added have been skipped.

Yes, why not.

Some characters to message acceptance.

Alright, I’ve made a precompiled version of the library that turns off a bunch more CPU features (just for Linux as that seems to be what you are using).

Could you edit src/native/NativeConstants.cs to refer to native library version 14? The line near the top that specifies the version should be edited to look like this:

    public const int Version = 14;

Then re-run the native fetch script and try to run the game again. This time it should still pick the non-AVX variant of the Thrive native library but now that library should use even fewer advanced instructions.

Re-running the script

Performing operation Fetch
Checking if the precompiled object ThriveNative:14:Linux:None is available
Downloading ThriveNative for Linux version: 14
Successfully downloaded and decompressed the file (size: 2.02 MiB)
Checking if the precompiled object ThriveNative:14:Linux:WithoutAvx is available
Downloading ThriveNative for Linux version: 14
Successfully downloaded and decompressed the file (size: 2.02 MiB)
Checking if the precompiled object ThriveNative:14:Windows:None is available
Library is not available for download, or a server error occurred, response: {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.5","title":"Not Found","status":404,"traceId":"00-aee2d731530aceb80e39079a2c80b8a7-a44d9d42a93202a9-00"}
Operation failed on library: ThriveNative for platform: Windows
Operation failed for ThriveNative

Running game

Godot Engine v4.2.2.stable.mono.official.15073afe3 - https://godotengine.org
Vulkan API 1.3.238 - Forward+ - Using Vulkan Device #0: Intel - Intel(R) UHD Graphics (JSL)
 
This is Thrive version: 0.6.6.0-alpha+381c8d8c6f5aa10a5e87ce0124583e5ef968e2eb (see below for more build info)
TODO: reimplement unhandled exception logger
Startup C# locale is: en-US Godot locale is: en_US
user:// directory is: /home/artem/.local/share/Thrive
Game logs are written to: /home/artem/.local/share/Thrive/logs latest log is 'log.txt'
Cannot use full-speed Thrive native library due to: CPU is missing AVX 1 extension instruction support
CPU is missing AVX 2 extension instruction support
Using slower Thrive native library that doesn't rely on as new CPU instructions
Checked that required CPU features are present
Library not found yet at expected paths, trying a distributable version

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.2.2.stable.mono.official (15073afe3856abd2aa1622492fe50026c7d63dc1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5dd2e1) [0x77f419ddd2e1] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x77f44aa42520] (??:0)
[3] /home/artem/Desktop/Thrive/native_libs/distributable/linux/ThriveNative/12/release/lib/libthrive_native_without_avx.so(+0xad7bf) [0x77b2eeaad7bf] (??:0)
[4] /lib64/ld-linux-x86-64.so.2(+0x647e) [0x77f44ad7c47e] (??:0)
[5] /lib64/ld-linux-x86-64.so.2(+0x6568) [0x77f44ad7c568] (??:0)
[6] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0xe5) [0x77f44ab74af5] (??:0)
[7] /lib64/ld-linux-x86-64.so.2(+0xdff6) [0x77f44ad83ff6] (??:0)
[8] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x77f44ab74a98] (??:0)
[9] /lib64/ld-linux-x86-64.so.2(+0xe34e) [0x77f44ad8434e] (??:0)
[10] /lib/x86_64-linux-gnu/libc.so.6(+0x9063c) [0x77f44aa9063c] (??:0)
[11] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_exception+0x88) [0x77f44ab74a98] (??:0)
[12] /lib/x86_64-linux-gnu/libc.so.6(_dl_catch_error+0x33) [0x77f44ab74b63] (??:0)
[13] /lib/x86_64-linux-gnu/libc.so.6(+0x9012e) [0x77f44aa9012e] (??:0)
[14] /lib/x86_64-linux-gnu/libc.so.6(dlopen+0x48) [0x77f44aa906c8] (??:0)
[15] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x5e5ddb) [0x77f419de5ddb] (??:0)
[16] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x367736) [0x77f419b67736] (??:0)
[17] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x367589) [0x77f419b67589] (??:0)
[18] /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.3/libcoreclr.so(+0x3692e4) [0x77f419b692e4] (??:0)
[19] [0x77f39aaa8782] (??:0)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)

Very unfortunate. I saw your CPU didn’t have SSE 4.2a, so I tried making one more build that also turns off SSE entirely: https://dev.revolutionarygamesstudio.com/api/v1/download/44846

Though it doesn’t seem like the hash of the file changed so it might not work either…

I see 2 possibilities:

  • There is a bug in Jolt where the disabling of the specific instructions flag doesn’t work correctly
  • Or we are using something else in the library build that causes those instructions to be used

To figure that out I think you’ll need to compile the native library in debug mode and run the game with gdb to get an accurate stack trace of the crash.

To do so install the native code build dependencies from the setup instructions and then run:

dotnet run --project Scripts -- native Build -d
gdb godot
r

That last r should start running in gdb, which should then break at the signal, then you should be able to type bt and press enter to get a stacktrace.

I’ve installed cmake, clang and binutils-gold.

After running the command

dotnet run --project Scripts -- native Build -d

I got this:

Using debug versions of libraries (these are not always available for download)
Performing operation Build
Building ThriveNative for local use (Linux) with CMake (hopefully all native dependencies are installed)
-- The CXX compiler identification is Clang 14.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "/usr/bin/clang++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/artem/Desktop/Thrive/build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_e5f4b/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_e5f4b.dir/build.make CMakeFiles/cmTC_e5f4b.dir/build
    gmake[1]: Entering directory '/home/artem/Desktop/Thrive/build-debug/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_e5f4b.dir/testCXXCompiler.cxx.o
    /usr/bin/clang++    -MD -MT CMakeFiles/cmTC_e5f4b.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_e5f4b.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_e5f4b.dir/testCXXCompiler.cxx.o -c /home/artem/Desktop/Thrive/build-debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_e5f4b
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e5f4b.dir/link.txt --verbose=1
    /usr/bin/clang++ CMakeFiles/cmTC_e5f4b.dir/testCXXCompiler.cxx.o -o cmTC_e5f4b 
    /usr/bin/ld: cannot find -lstdc++: No such file or directory
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    gmake[1]: *** [CMakeFiles/cmTC_e5f4b.dir/build.make:100: cmTC_e5f4b] Error 1
    gmake[1]: Leaving directory '/home/artem/Desktop/Thrive/build-debug/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_e5f4b/fast] Error 2
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!
See also "/home/artem/Desktop/Thrive/build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/artem/Desktop/Thrive/build-debug/CMakeFiles/CMakeError.log".
CMake configuration failed (exit: 1). Do you have the required build tools installed?
Operation failed on library: ThriveNative for platform: Linux
Operation failed for ThriveNative

Is there something else I should have done?

I’ve double checked the existence of clang and binutils-gold.
I have libstdc++(lstdc++) installed as well.
The file clang++ exists in the usr/bin directory.

You didn’t install the C++ standard library so no C++ programs can be compiled. Usually that is automatically included when you install a C++ compiler, for example on Fedora installing gcc-c++ should work.

You maybe have just the runtime, but not the development version of the library? At least on Fedora there’s separate packages for running programs and for developing them, which include the needed stuff to link against the library.


Also I checked the non-AVX library version on a really bad Windows 7 laptop (it gets barely playable FPS in Thrive with massive lag spikes), and on there it works on a AMD A8-4500M CPU, which granted has many more extensions than your CPU, but it is a low power CPU for a Laptop from 2012.

I don’t know if it matters, but do you run the command with git bash/some regular command prompt or your IDE’s built in one? I remember having this problem and it installed properly when I used Visual Studio command prompt (thanks hh for tip back then).

It shouldn’t matter unless there’s some containerization or isolation going on (for example from Flatpak, immutable distro, distrobox etc. tools).

1 Like