-
Notifications
You must be signed in to change notification settings - Fork 69
Compilation
First check the platform specific section for
And follow any instructions there.
NOTE:
You'll need a 64-bit PC. (possibly 32-bit Windows could work but some libraries are not available on 32-bit Linux.)
Linux will need SDL2 installed, though windows should work with the included SDL2 libs.
Install the .NET 7.0 SDK
-
Clone the Git Repo.
Emphasis on "Clone" just downloading the source wont work due to a bit of code which grabs the git commit version.
ie:git clone https://github.com/Pulsar4xDevs/Pulsar4x.git
from the commandline. -
Open the solution file "Pulsar4X\Pulsar4X.sln". in Monodevelop, Visual Studio, or Rider.
a. If you're running Windows: Should work.
b. If you're running Linux: Should work.
c. If you're running Mac: you'll need xamarin studio to compile it for Mac. Let me know, as of 2019.07, this is not yet tested.
-
Set Pulsar4X.Client project as the startup project.
-
Run/debug to compile and run the project.
Important: there are a number of NuGet packages that VS/Monodevelop/Rider should automatically get the first time you attempt to build. The IDE will have a number of errors but build the solution anyway, VS will get the packages for you.
To compile and debug Pulsar4x we recommend minimum Visual Studio 2019 Community Edition. We're starting to use a bit of C#6, so 2013 won't even load the newer csproj files. 2015 might work? Xamarin Studio does work under Windows, and the process is the same as for VS2015. Rider also works under windows.
When cloning the project in visual studios, download the .NET6 SDK (not just the runtime) and run the ImgGui project
For linux I'd recommend Rider over monodevelop due to MS appearing to be playing the Embrace Extend Extinguish game. (mostly due to just not caring enough about the Linux platform to put the effort into monodevelop debugging. Not sure if MD even supports .net6 MS seems to have done the Embrace Extend Extinguish thing with MD.
For the current UI to work, you'll need SDL version 2.0.5 or higher, if you're running Ubuntu < than 18, you'll likely need to compile and install SDL from source, if your update repositories are high enough you should be fine. This shouldn't be a problem on Windows since the dll is included for the Windows build. Note, you may have a permissions problem that I've been unable to fully figure out that's mentioned in this issue
from the folder with the pulsar4x.sln dotnet build
from the folder with the GameEngine.csproj dotnet watch
(will run with hotreloading, allowing you to edit the code, and it will update the game when saving)
Note, these instructions are old and haven't been updated since the switch over from .net 4.7 to dotnet core. I think this section should maybe be deleted now...
I (Houkime) wanted to try out Pulsar and have managed to run it from sources on a clean MXLinux machine. There is no requirement to have a specific IDE - there is a simpler IDE-agnostic purely terminal way to compile and run, and it can be used for automatic builds.
Testing OS was MXLinux 19 which is based on Debian 10. I (Houkime) used a clean virtual machine to keep my Arch install away from MS stuff. Order is important because of xbuild-msbuild conflict described below.
sudo apt install apt-transport-https dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/debian vs-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-vs.list
sudo apt update
sudo apt install msbuild
sudo apt install mono-complete libsdl2-dev
sudo apt install nuget
git clone https://github.com/Pulsar4xDevs/Pulsar4x
cd Pulsar4x/Pulsar4x
nuget restore
msbuild Pulsar4x.sln -t:Build
mono Pulsar4X.ImGuiNetUI/bin/Debug/net47/Pulsar4X.ImGuiNetUI.exe
- first few commands are from here: https://www.monodevelop.com/download/#fndtn-download-lin-debian
-
mono-xbuild
is currently being deprecated by Mono (unfortunately) in favor of Microsoftmsbuild
which is somewhat less readily compilable from sources (if avoiding preexisting dotnet binaries) and is not in official repos. - because of
xbuild
being deprecated, it doesn't support newer .csproj formats and never will. - New Pulsar4X build files are no longer compatible with
xbuild
and require a bulkiermsbuild
route. - Old Pulsar4X build files ARE compatible with
xbuild
but seems like they are no longer compatible with Pulsar sources. - It is important to install
msbuild
beforemono-complete
.mono-complete
includesmono-xbuild
and if installation process ofmsbuild
sees preexistingxbuild
it tries to do sth with it and it results in a file conflict. Conflict does not arise ifmsbuild
is installed first and only then comesmono-complete
withmono-xbuild
included. - MonoDevelop uses
msbuild
. Process here is identical to what you will have with an IDE but with less overhead and no clicks. - The above fact also means that when installing MonoDevelop you need to ensure that
msbuild
is installed beforemono-xbuild
(MonoDevelop has an indirect dependency onmono-xbuild
so you can't omit the latter). You might want to installmsbuild
separately first. - Build process rises around 100 warnings, but no errors.
There are some small weird details in how UI operates (may report as separate issues when have time) and i (Houkime) have nothing to compare it with, but overall seems to be working fine.
Maybe if I (Houkime) really like it I will fork it and port to syntactically-similar but infrastructurally different Vala to make it less cumbersome.
Right now i (Houkime) can't even post Pulsar4X to AUR (despite automated builds being possible as shown above) because of MS infrastructure it relies upon.
Although technically I (Houkime) can (there are packages for mono in official Arch repos, and also msbuild and nuget in AUR), i (Houkime) am sure not the one that wants to maintain and debug such an install.
If you are interested in having and maintaining an AUR package (for Arch Linux, Manjaro and other Arch-based distros), I (Houkime) can prepare an initial PKGBUILD for you to own and maintain.
Fenobus managed to compile and run on mac M1: STEPS used to compile on mac
- Download and install VS2022 for Mac https://www.visualstudio.com/vs/visual-studio-mac/
- Download and install dotnet 6.0.100 https://download.visualstudio.microsoft.com/download/pr/ed60d37e-7842-4fc2-8250-2bd66073d79e/725d486e04d27e45d2b41c687dc35f49/dotnet-sdk-6.0.100-osx-arm64.pkg
- Download the latest sdl here (tar.gz) https://github.com/libsdl-org/SDL/releases/tag/release-2.24.1
- On a terminal, cd to the folder and run the following commands: ./configure make make install
- Download imgui from here: https://github.com/mellinoe/ImGui.NET/blob/master/deps/cimgui/osx/cimgui.dylib
- Rename file to libcimgui (remove dylib extension), then copy and paste in Pulsar4X.ImGuiNetUI/bin/Debug/net6.0
- Open VScode sln file, Clean build folder, build and run
Another IDE... editor rather? option is Visual Studio Code, if you can stomach setting it up.
Documentation
-
Contribution
-
Design
-
Processes
-
Datatypes
-
Guides and Resources
-
Modding & Json files