Code Monkey home page Code Monkey logo

lets-play's Introduction

Let's Play

As of May 1st, 2021 this is being rewritten, see the v2.0 branch

Discord

A web-based collaborative RetroArch frontend

Screenshot

What is a "web-based collaborative RetroArch frontend"?

Why thanks for asking, a A web-based collaborative RetroArch frontend is just a fancy phrase for a video game you can play online, collaboratively, with friends by taking turns at the controller (so to speak). Users connect using the web portion which connects to this, the backend, and are then able to interact with an emulator that (usually) runs a retro video game system of some sort.

Requirements

  • Compiler with support for C++14
  • CMake version >= 3.2
  • CPU with support for SSE2 and SSSE3 (most CPUs do)

Building

To build, simply type cmake . in the top level directory, then type make. To do parallel builds (recommended), type make -j# where # is the number of cores you have on your machine. After the build, the binary will be in ./bin/ as letsplay.

Where do I put the extra files (bios, etc) that would normally go in the frontend's system directory?

The RetroArch cores will be instructed to look in the system folder inside of the data directory. The location of the data directory varies based on what is specified in the configuration. If dataDirectory is equal to System Default, Let's Play will first go to XDG_DATA_HOME/letsplay as the data dir, and if XDG envs are undefined, ~/.local/share/letsplay.

Note

The default admin password is LetsPlay. This should be changed for your own security. Change the password by directly modifying the config. The values that should be modified are config["serverConfig"]["salt"] and config["serverConfig"]["adminHash"]. The hash should be generated by taking your password, appending the salt value, and md5 hashing it.

lets-play's People

Contributors

ctrlaltf2 avatar modeco80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

modeco80

lets-play's Issues

Clean up emulator cores on shutdown

As a workaround for an issue with colliding address spaces, libretro shared objects are copied to their own file and then read from. However, the server doesn't clean this up.

Full support for multiple emulators

Server must list and send all available emulators. Information must include emulator system, game title, a preview of the emulator.
The join view must be implemented to display all available emulators and a preview.

Multicontroller Support

Have support for users choosing which 'player' they choose to be (think, which port is the controller plugged into?). Have this be a toggleable option to allow for something like a weekly smash bros tournament. Would require an overhaul of the current turn system to allow for four different turn queues going at once.

Create the join view

On page load, pull a list of emulators from the server with a preview and allow the user to select which emulator they want to connect to.

Make RetroCore cross platform

As of now, the RetroCore class relies on the Linux dl library. This obviously restricts its use to Linux-based platforms. Add support for Windows and optionally Mac.

Backport to C++14

Lots of problems relating to building on different platforms that derive from needing C++17 support. Backporting the code to C++14 will help this a lot.

Analog button support

As of now buttons are either on or off. Add support in both the client and server for analog values.

Logging

Add logging of IP Addresses and User Agents of those who connect. Retain chat logs, renames, joins, leaves as well as their timestamps.

Add audio streaming

Stream audio from the server. Add a mute command that stops/starts the server sending audio.

Use Hunter package manager

This would improve builds and reduce errors across platforms. While it would tank the (initial) build time, it would still be worth using.

Actual Unicode Support

We already send previews and screen updates as binary data, so why not do the same for chat messages. Messages could be sent as UTF8 data which can be then decoded clientside.

Core Downloader

Server could use some kind of system to automatically list and fetch compiled RetroArch cores from the libretro buildbot. Should use latest and nightly (?). Detect platform when accessing the buildbot.

Implementations for this already exist for the RetroArch Android app and possibly the desktop app. See their implementations to know how they access buildbot programmatically, or even if they use buildbot to begin with.

Add section to admin panel once it's completed to select the core from a given list. Server will automatically download it and extract it and use it for the emulator being configured.

Admin Panel

Create a web application for updating, managing, creating emulators. Requires #10 to be finished first.

Use processes instead of threads for EmulatorControllers

Currently, every EmulatorController is supposed to exist in its own thread because of some limitations of the libretro API. This isn't a very elegant design, and doesn't scale well. A better solution would be to break out EmulatorControllers into their own processes, and use some form of IPC to communicate/share memory with the LetsPlayServer instance that spawned it. Currently looking into TIPC as the IPC mechanism, because that could be easily extended to allow for emulators run on other devices in a distributed setup which could pave the way for user-hosted emulators (a far-off feature).

Change EmulatorController::GetFrame to use custom simd instructions

GetFrame appears to be one of the biggest places the Let's Play spends its resources. It looks like the old method I was looking into, turning the pixel formats into RGB888 could be made a lot better and clearer by using XRGB8888 which turns out to be directly supported by libturbo-jpeg. This could allow for cores that use XRGB8888 by default to straight up bypass this step for a massive (relative) speed boost.

Improve Build Times

Build times are horrendous, especially for LetsPlayServer.cpp. Reduce build times by either precompiling imported boost headers or splitting up LetsPlayServer.cpp (Put the queue thread function in its own translation unit?).

Fix reddish tint introduced on move to SIMD instructions

Possibly a side effect of turbojpeg moving to XRGB data rather than RGB. A possible clientside fix is to slightly increase hue, brightness, and contrast, on the canvas output which would color correct it to be pretty close to the real deal. However, fixing it server-side would be the optimal solution.

Merge server and client

Serve the client directly from the server. Serve HTTP and WebSocket on the same port if possible.

Fully implement turns

Server must block inputs from those who do not have a turn. Server must also send off turn lists when it updates.
Client must not capture keys if there's no turn. The user list has to also display the turn queue. Announce when turns are given.

Replace JSON & HTTP parts

Pretty sure nlohmann::json is one of the culprits (other than boost of course) for the terrible build times. That, and this is faster by a long shot.
The HTTP server is currently pretty tied to websocketpp. Because not all transport methods also implement an HTTP server, its probably best we roll our own HTTP server instead of what's tacked onto websocketpp or similar. (#44).
This library looks very promising. Probably should use this for the JSON & HTTP. Also has SQL database support (#40).

Other things:
https://github.com/h2o/h2o (HTTP)
RapidJSON

XSS Proof Client

Client can currently be XSSed. Do server-side HTML escaping of < and > sent from the client for usernames and chats. On client, ensure the HTML escaped characters display correctly.

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.