Project Plan - Geneticus/SpaceEngineers GitHub Wiki
Welcome to the SpaceEngineers SerialComms wiki!
Step 1:
Basic Communication
- Add Controller mapping to Game Options screen.
- Header: "Detected USB controllers"
- Options screen will have 6 DropDown/DropDown/TextBox Pairs
- First DropDowns will pair detected devices filtered against a list of Device ID's stored in the UserProfile\SpaceEngineers XML "Microcontrollers.cfg" to prevent unwanted devices from appearing in the DDLs.
- Second Dropdown will have a value of "Input Device", "Output Device", or "Both"
- User will assign a Unique name for each device selected to be used (or a standard unique name will be auto created on DDL selection)
- The Name will be referenced by the API script to tell it where to send data to/get data from.
- For DS Compatibility, the Name can be hardcoded into a local script or/and set in script storage on DS.
Step 2:
Create Vrage .cs files
- SerialDataMapper.cs - Manages port detection/polling/mapping to the device in Options
- SerialDataIn.cs - Creates a buffer in game to store serial input until the API picks it up.
- SerialDataOut.cs - Accepts game data from the API script, encodes it to the proper serial byte format, transmits to the mapped COM port.
Step 3:
Examples and Tutorials
API
- Create Example API Script that gathers all useful game data for output and sends it to the Serializer.
- Create Example API Script that grabs data from the Receive Buffer and manipulates the game (Toggle group ON/OFF)
- Scripts will be stackable so that DS admins can include or exclude specific game changes. EX: a script for reporting Health can exist next to a script for reporting Coordinates. Both scripts can send data to the same Device concurrently.
Sketch
- Create example Sketch files for upload to Arduinos that process incoming Serial data and apply it to a readout.
- Create Example Sketch files for Sending button presses to the game for API Script processing.
- Create new or leverage existing library functions for encoding decoding of serial data on the Microcontroller
Hardware
- Prepare Demo of working device that reads a single game value and display it.
- Prepare Demo of working device that sends a control change to the Game for API Processing. (Toggle Emergency Reactor ON/OFF)
- Prepare Fully functional device using all available API data(Health, O2, Ship Power details, etc and toggles for various inputs)
- Prepare Component lists for projects
- Link to Demo/Tutorial videos
Step 4(Optional):
- Check feasibility for Adding other Serial capable Hardware to the mappable list.(Raspberry Pi, Intel Edison, etc)
- Check feasibility for grabbing a (secondary) camera feed, while piloting, from the game and sending it through the serializer for display on an external device. (Current gen Arduinos are incapable of running video in color at a useful resolution)