Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernizing the game libraries and build (PR discussion) #7

Closed
vblanco20-1 opened this issue Feb 18, 2021 · 1 comment · Fixed by #8
Closed

Modernizing the game libraries and build (PR discussion) #7

vblanco20-1 opened this issue Feb 18, 2021 · 1 comment · Fixed by #8

Comments

@vblanco20-1
Copy link

vblanco20-1 commented Feb 18, 2021

As part of a port to nintendo switch of the game, i have modernized the game so that it works well in there. There is a series of improvements ive done that i can PR back to the project, but i want to discuss them a bit before, to see what would fit.

  • CMake or Premake build: Original makefiles are tricky to get working on windows, and very tricky to get working for cross compilation. For the port i made the game work fine on Premake, and i also could PR it as CMake given there isnt much difference, i only use premake because it works better for cross compilation.
  • Upgrading SDL to SDL2: Original SDL 1 is not supported on Switch, so i upgraded it to SDL2. As the project only uses SDL for input, audio, and windowing, its a small change.
  • SDL Gamepad api: With the change to SDL 2, i also changed the input to support the Gamepad api instead of the Joystick api. This gives native support for Xbox gamepads.
  • Embedding BulletML inside the project itself. Makes it much easier to build from scratch.
  • Removal of Boost: No longer needed as shared_ptr is a cpp11 thing.
  • Removal of auto_ptr: Like above, i changed it to use cpp11 shared_ptr instead.
  • std::filesystem (cpp17) instead of dirint to load the bullet description files. This makes the code more portable, but cpp17 is a bit too new.
  • Replacing SDL_Mixer by using SDL audio directly and loading the ogg files with stb_vorbis.
  • Changed opengl to use Glad (dynamic function loading).
  • Opengl Optimization: The fixed pipeline opengl of the project can perform slow on modern machines. Ive optimized the bullet related graphics to perform sorting and batch-rendering, this improves the render speed of bullets by multiple times, making the game never slowdown unless its drawing 600+ bullets. Im still working on this, there is a slight difference in graphics due to the different render orders of the bullets. My goal is to have the game without any slowdown on nintendo switch.
    This also is a big difference to gameplay, as there is now no slowdown to help you navigate when the screen is full of bullets.

With the set of fixes, building the project would be a single click process using cmake, Only having to point Cmake to your SDL2 folder. On windows it runs fully native without having to use MinGW

The code is on my personal fork, but that version is experimental and its missing necesary files due to nintendo switch SDK being NDA'd. The code that would be on a PR would be a cleaned version of that.

@abagames
Copy link
Owner

PR for cleaned version is welcome. I have no problem with the new source code as long as it can be built and run on Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants