TheForceEngine icon indicating copy to clipboard operation
TheForceEngine copied to clipboard

Linux Support

Open luciusDXL opened this issue 4 years ago • 8 comments

The Force Engine should compile and run on common Linux Distros using the CMake build system.

luciusDXL avatar Jan 03 '21 20:01 luciusDXL

Not sure when this will be getting attention/be more relevant, but with some tweaking, I was able to produce a Linux build:

image

I'm still working on actually getting the game to load, and cut a few corners in the threading stuff up under the MIDI player for now, but things seem to mostly just work as far as initially launching and loading the menu.

One thing I did notice throughout many files is the use of strcpy and memcpy without any inclusion of the cstring header, so I had to add that in quite a few places before g++ would build it. Additionally, some files using INT_MAX among other symbols required climits. The pthread implementation of the threading object is incomplete, but will build in at least. Finally, I needed to provide POSIX equivalents of many of the fileutil methods. I'll respond here with more info as I come across it, and likely will be raising a pull request once I've got the changes tidied up and tested.

Note, I am not intending on doing any build-system stuff, at least not yet, but just intend to contribute modifications to the source code itself that allow the files to build happily using g++ on an X11 POSIX system.

gilmorem560 avatar Nov 28 '21 08:11 gilmorem560

And now I've actually got it launching the game:

image

No audio yet, but I can run around and shoot things. I haven't explored outside the first room yet, just getting a feel for how well things are working thus far. The mouse cursor does not appear to be captured in the SDL window, I don't know if this is the experience on other platforms, and I don't have access to a decent Windows box to see how that build behaves. Currently the mouse can and will interact with items besides just the SDL window, making actual gameplay outside of fullscreen mode incredibly difficult as clicking anywhere outside the immediate area of the window unfocuses...

gilmorem560 avatar Nov 28 '21 22:11 gilmorem560

On Windows, the mouse is locked to the window while in gameplay.

luciusDXL avatar Nov 29 '21 01:11 luciusDXL

Reporting back that I've done some further testing but been busy with other things. I am able to go from level to level it seems, so I think things are behaving themselves pretty well all things considered. This weekend I'm going to see about massaging the rest of the necessary bits into enough shape to submit a succinct PR. The Mac stuff ala #90 will probably be a bit more back burner, but as time allows I intend on continuing to futz with that as well. Still don't have audio on either, but haven't been focused on that.

Would it be helpful if I also send up the Makefile I'm using to test things? It's no CMake build, and I wouldn't expect anyone to maintain it, but it would at least serve as a jumping off point for anyone else that'd be interested in contributing specifically to the Linux support. If nothing else, I could just keep it in my fork, folks could direct over there in the meantime until a proper CMake is in place, I just make no guarantees that I'll be syncing that regularly at times that I'm not working on it.

Also, just gotta say, I'm glad cross-platform support has been one of your targets from the get-go, so often I see people tunnel-vision on Windows despite the wide array of abstractions available, especially for OpenGL-driven stuff, so the relative ease of this port is definitely a testament to that attention.

gilmorem560 avatar Dec 03 '21 23:12 gilmorem560

@luciusDXL @gilmorem560 thanks for your effort!

siredmar avatar Dec 04 '21 15:12 siredmar

@gilmorem560

Would it be helpful if I also send up the Makefile I'm using to test things?

Why not. You can always remove it from your target branch, when you do the PR. This way you would enable anyone testing this with linux.

siredmar avatar Dec 04 '21 20:12 siredmar

You can include the makefile for now. But I won't have time to give this proper attention until after version 1.0 is released. See the Roadmap for more information. The goal is to build and test the Linux and Mac versions myself since there will be a lot of work after version 1.0 and more big changes. The GPU renderer (not yet finished) will also need special attention on Mac to make sure it works well. If I leave it up to others, the Linux and Mac build will be breaking constantly. :)

Anyway, thanks @gilmorem560 for all of your efforts, it will certainly help when the time comes and save me a lot of work.

luciusDXL avatar Dec 04 '21 20:12 luciusDXL

Why not. You can always remove it from your target branch, when you do the PR. This way you would enable anyone testing this with linux.

Seconded, I'm on Linux and can help with testing if the project builds.

JPLeBreton avatar Dec 04 '21 22:12 JPLeBreton

Implemented in version 1.08.

luciusDXL avatar Feb 16 '23 05:02 luciusDXL