fat4eyes-mwo / mwo-simulator

Mech and Weapon Simulator for Mechwarrior Online
3 stars 0 forks source link

mwo-simulator

Mech Loadout Simulator for Mechwarrior Online

Quick Start Guide

  1. Click 'Add Mech'.
  2. Paste Smurfy URL.
  3. Click 'Load'.
  4. Click OK once mech is loaded from smurfy.
  5. Add more mechs if you want. Click the 'Range' Button if you want to change the engagement range.
  6. Click 'Run'.
  7. Click 'Save' to save changes and share your simulation.
  8. Click 'Reset Simulation' to bring dead mechs back to life and start again.

Slightly Less Quick Start Guide

1-5. Same as above.

  1. Click 'Settings' to view and set various Team Settings.
  2. Click Speed setting (1x to 8x) to set simulation speed.
  3. Click 'Details' to see the mech's quirks and skills.
  4. Click 'Skills'->'Load Skills' to load skills from kitlaan.
  5. Click 'Run'.
  6. Click 'Save' to save changes and share your simulation.
  7. Click 'Reset Simulation' to bring dead mechs back to life and start again.

Guide for Reporting Bugs

  1. Press Ctrl-Shift-i (on Chrome or Firefox) to bring up the Developer Tools.
  2. Click the Console Tab.
  3. Right-click on the console window and click Save As...
  4. Go to the project issue tracker to report the issue. Make sure to include the console log and the URL where the simulator failed.
  5. If you are using Edge or Internet Explorer, contact your local exorcist and have these hellspawn banished back to the pit from which they came. (Edge and IE are not supported).

Current Features

Currently Unsimulated Mechanics

Code Guide

The project uses Typescript, and the project build configuration tsconfig.json is in the root project directory. The transpiled .js file is outputted in build/.

For those interested in looking at the code, the most interesting stuff can be found in scripts/model/simulator-logic.ts. It contains the simulation loop and most of the mechanics of the simulation. The main loop function is step().

The definition of the data structures used by the simulation are in scripts/model/simulator-model*.ts. The important bits are in class declarations, most of the other code there is just data conversion from smurfy format to the one used by the simulation.

The weapon fire patterns (which determine how mechs choose what weapons to fire) are in scripts/model/simulator-firepattern.ts. Target component patterns (which determine what components a mech targets) are in scripts/model/simulator-componenttarget.ts. Target mech patterns (which enemy mech to target) are in scripts/model/simulator-mechtarget.ts. And weapon accuracy patterns (which determine how a weapon or mech spreads damage) are in scripts/simulator-accuracypattern.ts. Read the comments in those files if you want to try adding your own patterns and have them appear in the UI.

The UI code can be found in the files scripts/view/simulator-view*.ts. At the moment I woudn't suggest looking at these as they're a bit of a mess, and a big refactoring is coming soon.

The main entry point of the program is in scripts/main/simulator.ts.

Update Info