Giter Site home page Giter Site logo

nineworlds / xstreamer Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 3.0 158.67 MB

XStreamer X-Wing Squad and Imperial Assault Army Helper for Twitch and YouTube Streamers

License: MIT License

Java 79.92% Shell 1.92% Batchfile 1.39% FreeMarker 14.66% HTML 1.56% Python 0.55%
squad-builder html-squad-files xwing-squads obs-studio xsplit imperial-assault

xstreamer's Introduction

X-Streamer

XStreamer X-Wing Squad and Imperial Assault Helper for Twitch and YouTube Streamers. It isn't designed to be the prettiest thing, but it is designed take out some of the manual work and consolidate it into one location.

The purpose of this is to provide a convenient way to manage some basic information for your Twitch or YouTube streams using OBS or XSplit. All files are written as either straight text files, or html files. The application does provide the ability to import XWS json files, this means you can export squads from Yet Another Squad Builder or XWing Squad Builder, and import them directly into the application. Features of the application.

  1. A count down timer written every second to a file named timer.txt.
  2. Import of XWing Squads and Imperial Assault armies for player 1 and player 2.
  3. Ability to edit and update the stats of player squads/armies.
  4. Export the updated information to HTML squad files, for use as overlays with OBS and Xsplit.

Requirements

  1. Java 8 installed.
  2. Exported Squad lists for the players in XWS format.
  3. OBS Classic, OBS Studio, XSPlit, or some other software that can read and use either txt or html files.
  4. OBS Browser plugin is recommended for using the HTML files produced by XStreamer.

The application is written in Java so that it can run across all platforms. So it should work on any system that has Java 8 installed.

What is working?

  1. Timer
  2. Basic Importing of XWS/IASpec (in progress) for player 1 and player 2
  3. Generating of the Squad/Army Lists to HTML overlays
  4. Customizable Squad/Army list templates.
  5. Configurable locations where output and input files reside.
  6. Output files for player names.

The program is written in java, and does require Java 8. It should work across multiple platforms. Currently the best way to run this is via the -Prun profile, see below for how to execute.

Building

The program is an eclipse rcp application and uses maven tycho to build the project.

Install the target platform

In order to build the project you need to install the target platform definition file.

  cd releng
  cd us.nineworlds.xstreamer.target
  ./mvnw clean install

This will build and install the target platform definition file which has all the necessary repositories defined.

Building the project

From the projects root directory after the target definition file is installed.

  ./mvnw clean install

This will resolve all the dependencies and build the individual plugins for the application.

Installing

Individual project ZIP and TAR.GZ files are created as part of the builds. The artifacts for these can be found in the releng/us.nineworlds.xstreamer.product/target/product folders.

Binaries are available for Linux, Mac OS X, and Windows. All require a 64 bit machine operating system to run, and the latest Java 8 JDK.

Eclipse

  1. Open Eclipse.
  2. File -> Import -> Maven -> Existing Maven Project
  3. Browse to where you have the project cloned.
  4. Select the pom file, and then Import.

The program is now written using the Eclipse Rich Client Platform so requires Eclipse for development.

Running the Program.

Download and install one of the platform specific binaries, and execute the xstreamer executable.

If you are a developer, within eclipse, select Run As -> Eclipse Application.

Usage

You will need a couple of files.

  1. player1.json - A XWS json file, exported from Yet Another Squad Builder or X-Wing Squad Builder that has the squadlist for player 1.
  2. player2.json - A XWS json file that represents the second players list.
  3. timer.txt - A file where the timer output can be written that can then be used by Open Broadcast Software to show an on line timer.

Note Imperial assault is still in development but will suppor the IASpec supported by Tabletop Admiral and others.

Configuration

Once the program is started, select Edit->Preferences. The main pieces are under the Timer and Squad preference sections. Fill in the input and output directories, as well as various filenames that are needed to generate the application.

Customize the Squad HTML files

Squad HTML files are generated from a Freemarker templates (http://freemarker.org/docs/index.html). This provides a flexible way to allow customization of a squad list. A sample is included in the 'templates' directory.

The freemarker main variable is 'xwsspec'. This closely follows the naming convention and structure of the XWS Specification (https://github.com/elistevens/xws-spec) with a couple of enhancements.

Each pilot variable now includes the following:

  1. shields - contains shield value for the ship
  2. hull - contains hull value for the ship.

Initial shield and hull values are populated using the xwing-data (https://github.com/guidokessels/xwing-data) projects ship data files. Through the Player 1 and Player 2 tabs you will be able to update these values manually to take into account items like shield upgrades, hull upgrades, and regeneration. As damage is taken, you can update the shield and hull values to reflect the damage a ship has taken. File stats will be updated as changes are made for each ship, and the overlay html files for each player will be generated.

Contributing

If you want some new feature, or have a better way to do SWING programming, I'm looking for contributions. Instructions below.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

The MIT License (MIT) Copyright (c) 2016,2017 David Carver

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

xstreamer's People

Contributors

kingargyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

xstreamer's Issues

No way to contact you other than this! :)

Hi. I think I contacted you in a different project thread. I am working on a similar project and was wondering if you wanted to compare notes. My version is a c++ program using the gd library to render images. The images are then placed in your OBS scene and OBS refreshes them whenever they change. As for a UI for it... well, I'm not that far yet!
I didn't know about the x-wing data project(s) on here so I rolled my own called libxwing. It has a sqlite DB at its core.
I don't have my project posted anywhere yet but I intend to put it on github when it is a little further along (under a BSD-type license).

Expose Ship Data to templates

There is additional information that may be of use to template designers in regards to individual ships. Need to expose the data via a variable called allships.

Twitch Integration

Basic information for the streamer so that he knows current view count, and other stats.

Add Export button to Image Viewer

Pressing the export button will export the image and then an Image Viewer source in OBS can be used to display it.

This should export out as PNG

In Valid File Error on MacOSX

Getting not a Valid file, on Mac OSX when selecting from the grid template.

/Users/dionmorales/Desktop/New X streamer/squads/html/epic_squads.ftl

Squad Points

Display initial pilot squad points in the app. Currently only the pilot squad points are displayed, not the total squad points. Just need to update the label.

Add X-Wing Card Images and Pilots

X-Wing Data project maintains the card and pilots images as well as upgrade cards. Ideally we would retrieve these from a web site instead of bundling these in, but since there may not be an active internet connection the cards probably should be included.

This should work the way the Imperial Assault selection works, selecting a particular item in the list load the card image in the viewer.

Use X-Wing Miniatures TTF

Make use of the X-Wing Miniatures true type fonts from the XHud project. Create a XHUD/Team Covenant style template that uses these fonts.

Migrate to a Feature based build

This will allow for better control of what plugins get included as part of the build.

Also, will allow for the creation of update sites, to be used to allow upgrades to occur more seamlessly.

Add Web Server to XStreamer app

Due to the fact that the Web Browser support in OBS doesn't support, reloading HTML files if they change (the Linux browser plugin does support it). There needs to be a way to serve up these files.

So one option is to have files loaded locally and server up via url from XStreamer itself.

Another option, may be to document how to Setup Apache or IIS so that they can serve the files locally and have OBS Studio load them. Note that this will require refreshing the files periodically through a meta data refresh page and not caching the results.

Player Names

Allow for outputing player names or assigning them in the app

Abiltity to mark upgrades used

This is a two part request from Gold Squadron.

  1. Ability to mark an upgrade used in X-Streamer. Would need a boolean field for each of the upgrades.
  2. If the upgrade is marked as used, it should use the Strikethru font to make it out, or just don't display it.

Add Import Squad Section to Players tab

Yet Another Squad Builder outputs it's data into a text box on the screen instead of downloading a file. To help enable easier input into the tool. Each player tab should have an optional Multiline text input field that the data can be pasted into.

There should be an import button, and the squad data should be updated and as if the Import Wizard had been used.

Add Simple Web Browser

Add a simple web browser that leverages the platforms native browser. This will be used to allow accessing of web resources such as Chats, Online Squad builders, and other resources the streamer may need access to.

OBS Browser doesn't auto reload updated templates

If you are on Mac or Windows the OBS Browser source doesn't automatically reload the files when they are updated. In order to address this, some javascript is needed to force the page to reload at a specific interval.

Create Template for Generating Stele TV style Squad Lists

Stele TV creates squad lists as basic text files. A sample of the output:

(skill) Ship Name - Points
Upgrades
Upgrades
Shields (*) Hull (H)

The template should generate out a text file that displays this information. There should be one for both Left aligned and right aligned versions. It also needs an option Unique Pilot Identifier to track particular ships that are the same skill and ship type.

Refactor templates to use Include and Import

To make having to make changes to both the obsbrowser specific templates and non-obsbrowser templates less painful, should refactor to import common functions and include common HTML markup.

Fix issue with expanding of TreeView width

When clicking a entry in the TreeView for Pilots, the width will change. There is probably an API setting I'm missing telling it not to expand beyond the current width.

Crash when Player 1 and Player 2 JSON is missing

The program expects that player 1 and player 2 json files are available. If not, then the program hangs and the user can't star the program.

Allow the program to continue loading and not crash. Include sample player1.json and player2.json files to help prevent this in the future.

Create Epic Squad Template

For OutRyder Cup and the Epic Round it will display a two column listing.

This should be able to be done by a Wrapper element like the following:

<div class='wrap'>
    <div class = "blocks">div 1</div>
    <div class = "blocks">div 2</div>
    <div class = "blocks">div 3</div>
    <div class = "blocks">div 4</div>
</div>

The CSS for this would look similar to the following to force a 2 column by 2 row listing at 900 pixels wide.

.blocks {
    display: inline-block;
    border: solid 1px red;
    width: 400px;
}

.wrap{
    width:900px;
}

This should give enough space to display most Epic lists.

Usage can be to display this in a separate scene or as an optional overlay on the existing screen while dials are being set.

Critical Damage

This feature is to track the needs of tracking critical damage.

  • Display Damage Cards and Critical Damage.
  • Track critical damage on a ship?

Splash Screen

There is a little bit of a pause while everything loads up, add a simple splash screen so that people know that the application is in the process of loading.

Create new Template Preference Pages

Because of the templates can come in multiple files it is difficult to know which template file is to be used.

Eclipse provides a framework that can be leveraged, the TemplatesPreferencePage.

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Ftext%2Ftemplates%2Fpersistence%2FTemplateStore.html

The simple description for this template can be described in a xml file:

  <templates>
      <template name="%Templates.xmldeclaration.name"
                    description="%Templates.xmldeclaration.desc"
		 id="org.eclipse.wst.xml.ui.internal.templates.xmldeclaration"
		 filename="template.ftl"
		 format="text|html"
		 type="squad|dice"
		 path="template/squad/html/blah"
		 enabled="true"/>
 </templates>

Store this in the templates plugin and the perferences should be read from here.

There will need to be a way for the user to select this template either via a Dialog that or a drop down list box. Templates will need to be loaded when the app starts up.

Users should be able to add their own templates to the list either through the UI or via editing the template.xml file directly.

Set destroyed flag for Pilots

When a ship gets down to 0 shields and 0 hull... the destroyed flag should be set and available in the model for the templates to use.

Add in News ticker

Add in a text field where some multiline text can be entered to display a News ticker style moving text view.

Finish migration to Eclipse RCP framework

To help my own sanity in working with Java UI frameworks, I'm experimenting with having the app be built using the Eclipse RCP application framework.

Benefits are:

  • More Native Look and Feel
  • Easier addition of menus, wizards, and other items.
  • Ability to include other file editors like Freemarker IDE for helping with editing squad templates.
  • Abilities to provide Preference pages for use with setting the location of configuration files, and providing a UI around managing these.

Disadvanateges:

  • Will make a build harder as OSGi knowledge is required.

Alternatives:

  • Netbeans Workbench provides similar functionality for Swing applications.

Challonge Integration

Integrate with Challonge API. Need to research what we can do here. Maybe import and display brackets?

Add Ability to Display Dice Results

Need the ability to display an overlay that has the dice results rolled on attack and defense.
First row should display the hits, crits, focus, and misses.
Second row should display evad, focus, and blanks.

Templates should produce the results in html using the vasal image files.

Output filename: diceresults.html
Template filename: diceResults.ftl

Offline Squad Entry

There are times when an active Internet connection may not exist. There needs to be a simple way to enter in a squad. Most of the information that is needed is in the Ships, Pilots, and Upgrades json files.

X-Hud style template.

Let's push the design of HTML a bit more.

See latest Team Covenant videos for the image information included for squads.

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.