StreamSDK Powered SNES w/Online Multiplayer Tutorial

April 10, 2020
protect

Introduction

Marketing a new product can be difficult. It’s doubly difficult when it’s in a new space, like real-time streaming … if that’s even the right way to classify StreamSDK. Pursuant to this challenge, one way to reach people is to present novel new demos that showcase the power of the platform and play off of something previously known to people.

Cue the StreamSDK SNES Teenage Mutant Ninja w/ Online Multiplayer Demo. 

<iframe title="StreamSDK Powered SNES w/Online Multiplayer Teenage Mutant Ninja Turtles IV: Turtles in Time" src="//www.youtube.com/embed/So0WUgZl19s?enablejsapi=1&amp;origin=https%3A%2F%2Fwww.gamedeveloper.com" height="360px" width="100%" data-testid="iframe" loading="lazy" scrolling="auto" class="optanon-category-C0004 ot-vscat-C0004 " data-gtm-yt-inspected-91172384_163="true" id="906551753" data-gtm-yt-inspected-91172384_165="true" data-gtm-yt-inspected-113="true"></iframe>

With this little piece, a nearly 30 year old game that was made for a console with no online capabilities can now be run on any platform and its two-player mode can be enjoyed between any two platforms from around the world.

In a nutshell, it’s a game people know, it’s a novel and powerful demonstration, and it highlights StreamSDK’s ability to empower things that just weren’t possible before.

Approach

Last weekend, the idea of converting older games to online multiplayer popped into mind. To be certain, this wasn’t the first time StreamSDK was used to convert a local multiplayer game into online multiplayer. During the first month of StreamSDK 3.0.0’s release, the Tanks demo from the Unity Asset Store as well as Swap Fire (Nintendo Wii U) both received the same treatment.

Of course, the Unity Tanks demo and Swap Fire are both pretty obscure. In short, they don’t fit the criteria of being previously known to people. Furthermore, it would be unsurprising for either of those Unity native games to re-emerge with online multiplayer capabilities.

So, the idea of instantly converting entire libraries of games, that were previously unplayable with online multiplayer, into online multiplayer was very intriguing. It also seemed like an impossibility at first. A short search quickly brought hope though. Sure enough, there was a MAME emulator written in C#. Wow! Maybe that could work with Unity?

No alt text provided for this image

More searching resulted in better prospects. It really seemed like there was a solution out there. Then, finally … a Game Boy emulator written directly in Unity appeared. The result was that an idea conceived at noon was actually functional by midnight (and there was a load of family time in between since it was a Sunday ;)

Acceleration

The StreamSDK Game Boy was neat, but to really achieve the original idea, the Super Nintendo would be golden. The idea of using the code structure from the Game Boy emulator to create a virtual SNES was an option but thankfully, more searching turned up Libretro and several Libretro powered Unity projects. Most didn’t work… and they were usually VR demos. Then finally, a bare bones example emerged called RetroUnity. It didn’t work out of the box, but by mixing and matching some elements from the other projects, it became functional. Making it work with StreamSDK after that was cake.

Technical (updated to represent StreamSDK3.1.0)

Now for the cream filling; just how does StreamSDK interface with a 30 year old game and make it online multiplayer?

  • Download RetroUnity project from GitHub

  • Import StreamSDK assets per docs at www.StreamSDK.com

  • Project View, Create Folder “StreamSDK/Experimental”

  • Project View, Drag “Plugins/RetroUnity into StreamSDK/Experimental”

  • Hierarchy, Create Empty

  • Rename, “RetroUnityContent”

  • Hierarchy, Drag all other game objects onto “RetroUnityContent”

  • Hierarchy, Make Prefab, Drag “RetroUnityContent” to Project View “StreamSDK/Experimental/RetroUnity”

  • Project View, Open “StreamSDK/Demo/Car3D/CarCloudcast.unity”

  • Hierarchy, Expand “Content”

  • Hierarchy, Delete children of “Content” (DO NOT DELETE StreamDisplayCanvas)

  • Project View, Drag “StreamSDK/Experimental/RetroUnity/RetroUnityContent.prefab” onto existing “Content” game object in the Hierarchy

  • Right Click, Unpack Prefab

  • Inspector, Set StreamSDK

  • Inspector, Set StreamSDK

  • Axes Size = 10

  • Element 0 = A

  • Element 1 = B

  • Element 2 = X

  • Element 3 = Y

  • Element 4 = DpadX

  • Element 5 = DpadY

  • Element 6 = START

  • Element 7 = SELECT

  • Element 8 = L

JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.

Read More>>