Giter VIP home page Giter VIP logo

srb2-emscripten's Introduction

Sonic Robo Blast 2

Sonic Robo Blast 2 Trailer

(Watch YouTube)

Sonic Robo Blast 2 is a 3D Sonic the Hedgehog fangame inspired by the original Sonic games of the 1990s.

In over 20 years, SRB2 has enjoyed a thriving player and modding community along with healthy press attention and an accomplished development team.

For the main project's code, issues, and pull requests, see Sonic Team Junior's GitLab repository.

Web Version

For all code relating to SRB2-emscripten, see this repository.

For code and documentation on the Web version, see the /emscripten directory.

To build the Web version from scratch, see this /emscripten/build-sample.sh script.

You can also deploy a Web build using Travis-CI. See this /travis/emscripten_script.sh script for deployment details. You will want to set the following variables in Travis CI:

  • DPL_SURGE_DOMAIN -- surge.sh domain to deploy to
  • DPL_SURGE_LOGIN -- surge.sh login email
  • DPL_SURGE_TOKEN -- surge.sh login token; retrieve this by running surge token
  • DPL_GITHUB_TOKEN -- GitHub application token to upload ZIP releases
  • GTAG -- base64 encoded Google Analytics tag (optional)
  • MAINTAINER -- Your name, for linking the service maintainer (optional)
  • MAINTAINER_URL -- URL to your web site (optional)
  • PACKAGE_VERSION -- Name of SRB2 version to use as the label, e.g., 2.2.4. If this is not specified, the commit hash will be used as the label.

Co-development credits go to:

  • heyjoeway for producing a successful proof-of-concept to compile the code to WebAssembly
  • Jimita for producing the Android port which this Web version is based on.

License

Sonic Robo Blast 2 is licensed under the GNU General Public License, Version 2.

Sonic Team Junior is in no way affiliated with SEGA or Sonic Team. We do not claim ownership of any of SEGA's intellectual property used in SRB2.

Author's Notes

This document details my contributions to this project. I acted as a maintainer and developer between March 2018 and June 2020.

SRB2 for Web

SRB2 for Web demonstration video

(Watch YouTube, credit RetroToaster; See Twitter)

My crowning achievement is that I ported SRB2 to the web browser. My goal was to address the problem of distribution on mobile devices.

I designed a feasible web service for this game by leveraging my knowledge in native code, cross-platform compilers, and full-stack web development to optimize for network bandwidth, local storage, memory usage, and in-game performance.

SRB2 for Web - Responsive Video

SRB2 (Main Project)

On the main project, I served as release manager for minor releases v2.1.21 thru v2.1.23, wherein I experimented with new technologies (see "Cross-Platform Releases" below) and addressed issues in response to community feedback.

I authored 173 pull requests with a 90% approval rate wherein I proposed small fixes, refactored two subsystems (see "Fading Platforms" and "Music Features" below), and implemented specifications from staff designers.

Cross-Platform Releases via Continuous Integration

Illustration of cross-platform deployment

As release manager, I spearheaded native macOS and Linux releases by scripting Travis CI to upload installer builds to FTP and Linux repositories. By doing so, our project gained 19,000 downloads from macOS users and 4,000 downloads fom Linux users.

Previously, the game was released only for Windows, and installers were built by hand.

Benchmarked Compiler Optimizations

As release manager, I investigated the effectiveness of 64-bit and other CPU optimizations by running a test suite of demos and timing their average framerates.

I compiled these results into Excel and enabled filtering of the results to generate graphs. I found that the game's hardware renderer benefited significantly from floating point optimizations.

Professional Landing Screen

SRB2 Title Screen

(Watch YouTube)

I worked with industry animator Alice de Lemos to implement her hand-drawn title animation. This animation was acclaimed by fans for setting the tone for a revolutionary major release.

I referenced Alice's animation timings for the three characters, which required separate tracking for multiple layers such as arms, eyes, and tails.

I optimized each animation frame to crop non-significant pixels and compute adjusted screen positions. I also resized the graphics to display optimally on six screen resolutions. Overall, I kept track of over 150 frames of animation sized across six resolutions, totalling 900 graphics.

Interactive Tutorial

SRB2 Tutorial

(Watch YouTube)

I worked with the lead game designer to implement an interactive tutorial for new players. The game designer provided a specification for the tutorial dialogue script, as well as the intended sequence for players to complete the tutorial.

I implemented the text dialogue system seen above, as well as special behavior for the world to interact with the player.

Fading Platforms

Illustration of colormap fading

(Watch YouTube)

Illustration of platform fading

(Watch YouTube)

These features allow floating platforms to fade translucently and for colored lights to fade between different colors.

This work involved a team effort in significantly rewriting the legacy lighting code. An associate cleaned up the old code, while I re-architected his cleanup work to allocate color data dynamically. Previously, colormaps were assigned to a limited array.

Music Features

SRB2 uses the SDL Mixer library, which provides only basic playback features. To make the music more programmable, I implemented music fading and jingle switching by hand.

I implemented custom MIDI instruments by utilizing the SDL Mixer X library. I worked with SteelT to improve MOD playback by utilizing the libopenmpt library.

This work also involved a major rewrite of legacy code. I refactored the game's music code to eliminate an obsolete duality between MIDI and digital music playback. This resulted in a new, simpler API for music playback.

YouTube Level Tutorial

I directed and narrated a tutorial series on building NiGHTS levels, which are the most complicated type of level to create for the game.

srb2-emscripten's People

Contributors

mazmazz avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.