alpinestudios / oogabooga

ooga booga
Other
223 stars 247 forks source link

Compile the engine without windowing and graphics? #3

Closed cozis closed 4 months ago

cozis commented 4 months ago

Hello! I'm trying to make a multiplayer game with this engine and I'm looking for the best way to get a headless build of the game to run on servers. The idea is that regular builds of the game would only run on windows, while headless builds (no windowing, no graphics) should run on both windows and linux.

The two solutions I can think of are:

  1. Only use the engine for builds with graphics
  2. Exclude graphics and windowing from headless builds of the engine and port the rest to linux

At the moment I went with (1), but the ideal solution for me would be something similar to (2).

I wanted to get your thoughts before doing any significant changes to the engine

asbott commented 4 months ago

Interesting, I haven't considered this scenario.

What parts of the engine do you need for the server?

cozis commented 4 months ago

I'm guessing everything except windows, rendering and audio. You could think of the server as a CLI app

asbott commented 4 months ago

We could do something like a #define OOGABOOGA_HEADLESS 1 which #if removes the gfx_init call and most of os_init (Windowing & Audio stuff)

asbott commented 4 months ago

Although since we don't have linux implementations, maybe you're thinking about just stripping the whole os thing and programming directly in unix ? #define OOGABOOGA_NO_OS_IMPLEMENTATION 1 ?

cozis commented 4 months ago

Something like OOGABOOGA_NO_OS_IMPLEMENTATION works. Since I'd be porting code anyways I wouldn't mind contributing code back to the engine if that's of interest

asbott commented 4 months ago

Something like OOGABOOGA_NO_OS_IMPLEMENTATION works. Since I'd be porting code anyways I wouldn't mind contributing code back to the engine if that's of interest

Yeah go for it, let me know if something is confusing in there

cozis commented 4 months ago

I'll start by adding the OOGABOOGA_HEADLESS option then

cozis commented 4 months ago

One last thing. Any preferences/conventions for commits and PRs?

asbott commented 4 months ago

Not really, do as you like.