Git Product home page Git Product logo

improved-initiative's Introduction

improved-initiative

Combat tracker for Dungeons and Dragons (D&D) 5th Edition

The official Improved Initiative app lives at https://improvedinitiative.app/

Local Development

Requirements

  • Node.js (see package.json for specific version)

Setup

  • Clone the repo to a folder on your computer
  • Open the cloned folder in a code editor such as Visual Studio Code
  • Open a terminal window (Powershell is the recommend terminal application for this project)
  • Run the following commands in the Terminal window to build the dev environment code:
npm install
npx grunt
  • To get the dev server running, you can either:
    • Press F5 in Visual Studio Code or
    • In a new terminal window run npm run start
  • Once the server is running, visit http://localhost in a web browser to view a development version of the UI that responds to your code changes.
  • Every time you make a change, wait for it to finish compiling then manually reload your browser.

Development of Improved Initiative is supported through Patreon.

To learn more about how to contribute code to Improved Initiative, refer to CONTRIBUTING.md.

Linting

Improved Initiative uses Eslint with prettier to lint the code files.

Linting happens automatically on commit, but you can also run it manually via: npm run lint.

App Settings

You can configure your instance of Improved Initiative with these settings. All are optional, basic functionality should work if you don't specify any.

  • PORT - Defaults to 80
  • NODE_ENV - Set to "production" to satisfy react, set to "development" to disable html view caching.
  • BASE_URL - Used in absolute URLs on client side. Falls back to relative urls if unavailable. This is the canonical URL for Patreon callback and browser localStorage.
  • SESSION_SECRET - Used to keep session continuity through app restarts or something. Handed to express-session.
  • DEFAULT_ACCOUNT_LEVEL - Set to "accountsync" or "epicinitiative" to grant rewards to all users. Useful if you have no DB.
  • DEFAULT_PATREON_ID - Set the dummy Patreon user id when running with DEFAULT_ACCOUNT_LEVEL set.
  • DB_CONNECTION_STRING - Provide a DB connection string for session and user account storage. In memory Mongo DB will be used otherwise, which is cleared on app restart.
  • METRICS_DB_CONNECTION_STRING - Provide a DB connection string to write metrics to.
  • PATREON_URL, PATREON_CLIENT_ID, PATREON_CLIENT_SECRET - Configuration for Patreon integration

Docker

Running Improved Initiative within Docker is possible, but completely optional and currently experimental. Proceed with caution and when in doubt, refer to the Docker documentation.

Building the Docker Image

To build the docker image with a development build, run:

docker build -t improved-initiative:latest .

To build the image with a production build, run:

docker build --build-arg NODE_ENV=production -t improved-initiative:prod .

Running the App in a Docker Container

To start the application within the container, run:

docker run -p80:80 --name improved-initiative improved-initiative:latest

Or, to run the production build:

docker run -p80:80 --name improved-initiative improved-initiative:prod

Stopping and Removing the Container

Assuming you started the container with the name improved-initiative as shown above, the following commands will stop the container and then remove it:

docker stop improved-initiative

docker rm improved-initiative

License

The Improved Initiative app is made available under the MIT license.

improved-initiative's People

Contributors

5emagic avatar actions-user avatar arcos avatar ascendedguard avatar austinburks avatar azzurite avatar blairstewart avatar chrisbloom7 avatar coreyjkelly avatar cynicaloptimist avatar danlite avatar dasug avatar dependabot[bot] avatar dlom avatar dprothero avatar evilblueshell avatar flooey avatar grinningrat avatar groke avatar jstevans avatar kmaris avatar komagr avatar lostminion avatar macdhollister avatar mphartman avatar omegajak avatar ryanmurray1 avatar ssunday avatar taylor1791 avatar thekrush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

improved-initiative's Issues

Track death rolls

It would be super useful if the app could track the failures and successes on death rolls

Columns do not scroll in firefox

Some columns do not scroll, notably the middle and right column.

I would be willing to work on this and provide a pull request sometime in the future.

Multiple run initiaive stack user input actions

If the button "Run Initiative" is pressed multiple times and the player initiative is not confirmed after the first time this will stack the "run initiative" procedure.
Example: "Run initiative" is pressed. Input for a player character appears. "Run initiative" is pressed one more time. Now you need confirm the player initiative 2 times to be able to continue.

Proposal:

  • block the "run initiative" command untill all user inputs are complete.

or

  • do not stack initiative and only handle single input for initiative per player

Stat block layout seems pretty cramped

I can not objectively quantify this, but the stat block seems cramped and kind of unorganized. For example, a name like "skills" is imediately followed by the accompanying text. Maybe something like aligning the text on the right or adding a little bit of margin or line breaks could make the stat block look more readable.

I would be willing to work on this and provide a pull request some time in the future.

Add SRD condition reference

Conditions, with optional durations (so like blinded, 2 rounds). It would be great if it had the list of conditions, but even the ability to just add a condition to a combatant that could track how much time is left on it would be awesome. I would see these as like attached to the combatant, but the duration may be tied to the initiative of the combatant who added the effect (like the wizard casts a spell that causes fear, so the duration is tracked on his initiative, but it's attached to the enemies who are feared.

Hide enemies option doesn't always work

If you use the hide enemies until combat starts option, it works the first time, but if you start a second encounter, they are immediatly visible. Given that starting an encounter resets the enemies, it should rest the hidden feature too.

The user poll queue is very small and easily overlooked

It happened multiple times for me that I clicked on something, the user poll queue at the bottom showed up and I didn't even notice it.

It should be made bigger and stand out a little more.

I would be willing to work on this and provide a pull request some time in the future.

Player screen needs to be resizable

As mentioned, my combats are larger then the player screen. Using chromecast I play it out on a monitor, and I tried to resize the screen so we could see more using zoom on chrome.

well, whatever technique is being used to size the player screen means that even though you can zoom in and out for all the elements surrounding the center of the screen, that stays the exact same size. Kinda frusterating

Ability to add spells and their duration

Spell durations (or just effect durations) So I can track how long say a web spell will be there, or how long a wall of fire will be around (or even durations of just environmental things. Same deal as above, it would be nice if there was a list of spells, but this can be solved by just letting me type in the effect and assign it to an initiative and a duration.

Player screen should auto scroll

My combats are larger then a single screen on the player screen. I project a player screen to a chromecast on a monitor at the table. I have to go manually scroll it as the initiative changes. It would be much better if the combat auto centered the current combatant.

allow AC reveal

on a practical basis, many GMs, myself included will eventually tell the players the AC of monsters as their attacks narrow it down. It would be useful if you could click on something to reveal the AC of monsters where they've narrowed it down so that they don't have to keep asking (telling one player doesn't necessarily mean they all hear it, and if it's on the board, I think they will quickly get used to looking there)

Add support for Source field

Source field tells the user where the creature came from in the case it's OGL content not from the 5th edition SRD

Note. Source is in the data for the PR I made of OGL data

Add Reaction section

The SRD contains sections titled "Reaction" as opposed to "Action".

Example: Shrieker

Exporting drops a player

When I add several players, then export them to a json, I see when I reload them (or look in the JSON file itself) that one player is missing. It doesn't seem to change depending on the number of characters you start with.

Let the gm track other per PC things in the app

It would be cool if there was an ability to just add boxes on a character, say like it's own field where you could track checkboxes that can be reset by a long or short rest.

This would imply that there would also be a "long rest" and "short rest" button that resets these checkboxes.

it would be kinda helpful to track hit dice used in a short rest this way too.

Counter support

the ability to have a counter that you can set to any initiative that will count down and disappear when it's done

Library does not appear in Safari and iPhone

from daren_sf
On my iPhone Chrome was a bit better in that it showed the icons on the left side tabs. Still no creatures listed, default party members, etc.
It seems to be a display / visual thing as when I delete it's asking me if I want to delete all creatures, even though none are visible.

A queue for "user polling" sometimes does not make sense from a UX standpoint

For example, you click two times (maybe by accident) on "set initiative" for a combatant. Or maybe you click on "set initiative", remember that you did not want that and click "rename combatant" instead.

In any case, you're left with dealing with the first dialog, even if you only wanted the last one.

I don't really think a queue makes sense for those kind of actions, when you click a button, as a user, you want to immediately perform the action that you clicked on, and not click on multiple actions to put them in a list and deal with them later.

The question is if there are valid usecases in the app for a user poll queue. Normally I would think of a UserPollQueue when the application is generating requests that have to be answered by the user. Is this the case for Improved Initiative?

I personally have not found any instances of this (which doesn't mean much). As I see it, every usage of the UserPollQueue seems to be a direct response to the user clicking something. If that is true, my suggestion would be to remove the UserPollQueue and replace it with something more direct and blocking, like a modal popup.

Comments welcome.

When switching encounters, don't wipe out the players

Having now used improved initiative in an actual game, I've got a couple items I think would be useful.

First off, when I finish a combat, and then move on to the next one, if I select an encounter, it wipes out all the PCs. I tried to use the app to keep track of PC damage, but because of this, the damage PCs had needed to be written down between encounters.

It would be better if when adding an encounter, it only cleared enemies.

Provide endpoint to launch an encounter based on POSTed payload

This endpoint will provide a means for tools like Kobold Fight Club to provide users with a one-click option to start encounters built in another tool. Where possible, it should attach stat blocks for OGL creatures, and make placeholders for player characters and non OGL creatures.

Rewind not rewinding timed notes

When rewinding a turn, the applied notes with an associated timer will not re-appear if the timer ended with the change of turn.
Example:
-Actors-
Player
Monster

Round 1
-Top of initiative -> Player Turn 1
Player1, poisons Monster until the end of their next turn. DM applies timed tag that will end after Monster Turn 1.
-Next turn -> Monster Turn 1
Monster is poisoned [and misses its attack due to disadvantage]
-Next turn -> Player Turn 2
DM realises that Monster has an ability to remove poison from self or friendly target.
-Previous turn -> Monster Turn 1
Monsters tag is not back.

Pathfinder support

So it may need to be a fork, or just a config variuable, but it would be nice if this could handle pathfinder too.

I happen to have all the monsters from the srd (bestiary 1-4 as the npc codex) already in a database/json format, so I could greatly help with the import of info.

Support advantage on initiative rolls

Various things can give players advantage on initiative rolls, e.g. UA Ranger's Natural Explorer, or Sentinel Shield magic item.

Be great if we would flag players as having such a condition, and it be included in the initiative rolling.

Happy to look at adding this myself, but want to check it was something that was wanted by others.

Thanks.

Add a log

It would be super awesome if there was a log of what took place. Recording damage, addition and removal of notes, etc.

It would help to locate mistakes that were made in game (a player disputes something), as well as for people who like to write up notes/blog posts about what happened in a game session.

Error if the Port 80 is already in use

If the localhost:80 already have some other web application attached to (for example a web service running on IIS) the "node server.js" command will not run the app and gives following error:

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES 0.0.0.0:80
    at Object.exports._errnoException (util.js:1012:11)
    at exports._exceptionWithHostPort (util.js:1035:20)
    at Server._listen2 (net.js:1239:19)
    at listen (net.js:1288:10)
    at Server.listen (net.js:1384:5)
    at Object.<anonymous> (C:\dev\GitHub\improved-initiative\server.js:111:19)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)

Quick fix for anyone confronting this problem:
find in the server.js file
var port = process.env.PORT || 80;
and change it for example to
var port = process.env.PORT || 88;
now you will find the improved-initiative on http://localhost:88/

KFC goblins have the wrong initiative

From email:

I've started an encounter with 4 Goblins and 4 PCs. When Initiative isrolled, the Goblins get +4, shouldn't they have +2 as their Dex is 14?

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.