- C++ 97.7%
- CMake 1.2%
- Python 0.9%
- PLpgSQL 0.2%
| .forgejo | ||
| assets | ||
| cmake | ||
| docs | ||
| FLUF | ||
| module_tools | ||
| modules | ||
| profiles | ||
| scripts | ||
| vendor | ||
| .clang-format | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| cli.py | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| conan-linux.lock | ||
| conan-windows.lock | ||
| conanfile.py | ||
| LICENSE.md | ||
| metadata.rc.in | ||
| PCH.cpp | ||
| PCH.hpp | ||
| README.md | ||
| requirements.txt | ||
N.B. This project is still in a pre-release state and likely contains bugs or issues that cause instability.
What is FLUF
FLUF is a client/server framework for the video game Freelancer (2003). It is designed to make the game easier to write C++ code edits for and provide a set of common utils and APIs. New code units are called 'modules' (to be distinct from FLHook plugins) and a collection of core modules are available within this repo, as well as some example ones provided.
Running
In the release packages there are a number of files. For basic (non-developer) usage, extract FLUF.dll and the crt files into your EXE folder of Freelancer and add FLUF.dll to dacom.ini after all the vanilla dlls (by default flmaterials.dll is the last in the list).
After running the game once, if loading was successful, there should be a yml file in your EXE folder created (assuming non-read only) which can be used to configure FLUF. At this point you can setup which modules FLUF loads and use, and you can extract the modules folder to the EXE folder from the release package, as well as the DATA files to your Freelancer DATA folder.
In the case of using FLUF.UI, the vanilla renderer or FLAR (OpenGL based renderer) is supported: Freelancer Advanced Renderer.
Documentation
Refer to docs: https://the-starport.com/forums/docs/fluf
Runtime Requirements
For general usage, it is assumed that the VS2022 Redists are installed on the system.
Building
Requirements
This project can be build on both Linux and Windows. Both assume that Python 3.11+ is installed.
For Windows you should have Visual Studio 2022 installed with all the latest libs. This project builds with the v143 toolchain and C++20.
You will need the 7z tool which can be installed via the installers
on 7-zip.org.
On Windows systems at least, you will need to add the location of the 7z binary to your PATH, e.g.
C:\Program Files\7-Zip\.
This must be done before running the cli.py dependencies step below.
Linux requires compilation to be done through MSVC Wine. Follow the instructions there for setting it up. Once setup in your directories of choice, add these to your .bashrc* (or convert to your shell of choice):
# MSVC
MSVC="PATH_TO_MSVC"
# e.g. MSVC="$HOME/msvc"
export MSVC
source $MSVC/bin/x86/msvcenv.sh
# User specific environment
if ! [[ "$PATH" =~ "$MSVC/bin/x86" ]]; then
PATH="$MSVC/bin/x86:$PATH"
PATH="$MSVC/bin:$PATH"
PATH="$MSVC/kits/10/Lib/10.0.22621.0/um:$PATH"
PATH="$MSVC/VC/Tools/msvc/14.41.34120/lib:$PATH"
fi
export PATH
For both Windows and Linux, once all the prerequisite steps are completed the build steps are the same and the following commands can be run:
pip install -r requirements.txt
python cli.py dependencies
python cli.py configure
python cli.py build
--help can be appended to configure and build to see additional options.
Once these commands have been run you can open the folder with an IDE of your choice,
like Visual Studio Code or CLion.
Post Build
On successful build, a python script
will run that copies all of the build artefacts into the dist folder.
If you set BINARY_COPY_DESTINATION in build.conf, it will also copy the entire contents of that folder to
the specified destination directory. It must be an absolute directory, and any backslashes must be escaped.
GOTCHYAs & Troubleshooting
- This project uses CMake presets, ensure that your IDE supports them and has any needed extensions. VSCode for instance, requires a CMake plugin in order to function.
- When using CLion on Windows, the default toolchain is often not correct and overrides some of the conan build settings. Ensure that the active toolchain looks like this.
- On Linux, if you get an error saying 'CMAKE_CXX_COMPILER not found' or similar, it is possible that your CLion is not
reading from your
.bashrcfile and environment variables should be added to.profileinstead. - In case of CMake errors, try updating to the latest version. At the time of writing, CMake version 4.2.3 works just fine.
Credits
FLUF would not be possible without all the work done by the Freelancer community over the last 2 decades. Changes from Adoxa's plugins, FLHook, FLHDE, and more have been incorporated into this codebase, and we couldn't have gotten this far without standing on the shoulders of giants.
- Lazrius - Project Creator
- Aingar - Co-Creator, significant help with reverse engineering and hook creation
- JosByte - Helped with bug reports and porting over a number of old features
- BeagleRush - Commissioned the RaidUI module
- Nekomaru - Artist who created the icon
- IrateRedKite - Testing
