Git Product home page Git Product logo

nx_gamepad's Introduction

nx Gamepad

This repository aims to sum up the extent of the open-source project nx Gamepad which not only provides a Flutter plugin for utilizing platform-specific game controller inputs on an application. Inspired by the Wii U console, the library additionally aims to unlock the potential of using a smartphone in combination with a controller peripheral as a gamepad for your computer.

In order to showcase and explain this concept in more detail, the releases page lists all of the installable applications and mods of this project. The following sub respositories provide corresponding examples with comprehensive documentation on how to implement such functionality yourself:

Overview

The project's core is the Flutter plugin, with platform-specific implementations responsible for sending input events from a connected controller to a compatible game. It supports Android devices and has planned support for iPhones, the Steam Deck, and the Asus ROG Ally. New user interfaces and interactions are easily implemented for an application which serves as the gamepad, while games need to integrate to react and respond to the before mentioned events.

Integration Details

The following diagram illustrates important communication flows:

   App
+-------------------------------------------------------+
|                                                       |  - Android (working)
|   +- Flutter --------+         +- Platform -------+   |
|   |      Client      | ------- |      Client      |   |  - iOS     (planned)
|   +------------------+         +------------------+   |  - Linux   (planned)
|           |  ▲                         |              |  - Windows (planned)
+-----------|--|-------------------------|--------------+
            |  |                         |
            |  |                         |
   Mod      |  |                         |
+-----------|--|-----------+             |
|           ▼  |           |             |
|   +- Game -----------+   |             |
|   |      Server      | ◀---------------+
|   +------------------+   |
|                          |
+--------------------------+

Input events are sent via UDP over the local network from either the Flutter or Platform Client to a Game Server. Flutter is able to communicate with a dedicated Platform integration via method channels to also receive input events or confirm that a connection has been established, but is mainly focused on managing custom interactions with its user interface, which needs to be retrieved according to changes from the Game Server. This modular design ensures an easy addition of new platforms and allows to only need to integrate the client once.

For a detailed description of input events and the client-server communication please refer to the wiki page of this repository.

Plugin Features

  • User interface and interactions only need to be written once
  • Available connection setup and communication with game servers
  • Support for touch, gyro, button, dpad, joystick, and trigger input events
  • Event channels for input events between platforms and Flutter

Considerations & Limitations

While Flutter provides a powerful toolset for 2D UI development, it still has limitations when it comes to 3D models and rendering. Furthermore, the project only focuses on using Wi-Fi for gamepad connections, as it offers higher bandwidth for streaming compared to Bluetooth. Lastly, it is well tested with the Razer Kishi v1 controller for Android but other gamepad peripherals may require additional development.

Fortunately, all those points are able to be worked on and should therefore be crossed off over time. Even Flutter is receiving a new rendering engine called Impeller, which looks very promising to fill in the gap for the 3D related shortcomings.

Future Plans

Planned developments for the nx Gamepad project include:

  • Adding Linux and iOS platform support
  • Implementing gyro controls with Flick Stick
  • Support usage of multiple controllers
  • Integrate shared preferences for settings
  • Expanding gamepad peripheral compatibility
  • Develop compatible Unity plugin for games
  • Alternative connection options like Bluetooth
  • Improve security and encryption for connection
  • Additional mode to stream game contents

Community contributions are highly encouraged to make this project as accessible to game developers as possible.

How to Contribute

To contribute to any of the previously mentioned repositories, please follow these steps:

  1. Fork the repository of your choice
  2. Create a new branch for your changes
  3. Commit your changes to your branch
  4. Push your changes to your fork
  5. Open a pull request to that repository

I will review your pull request and provide feedback or merge your changes as quickly as possible. If you have questions or need assistance, please do not hesitate to reach out. For problems with specific libraries, use the issue tracker of the respective repository. Feature suggestions can be discussed on the issues page of this one. Your input and help in improving this project are invaluable!

nx_gamepad's People

Contributors

devenju avatar

Stargazers

ChengYang avatar Kevin Benjamin Beier avatar  avatar

Watchers

 avatar

nx_gamepad's Issues

Socket stream updates HomePage for all received messages

The stream on the HomePage needs to be listened to and split accordingly, instead of being mapped in order to avoid null values being returned. The actual state management with the StreamBuilder and the HomePageState is also difficult to test. Since the split of streams is necessary, it might also make sense to wrap them in an InheritedWidget to be able to pass their state down the widget tree.

Have a dynamically assigned socket on the client

In order to allow the client to run on the same system as the GameServer, the client's socket needs to have a dynamically assigned port. This could be especially handy, if you would only like to test touch inputs with a Windows, Linux or macOS build.

Add example for a GameServer application

Right now this project only shows what the client side is doing. In order to make it more accessible, there should be an easy-to-understand example plus explanation on how to read from the required socket on a server, which listens to the events and inputs from the client.

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.