Trade Profit Calculator


https://ironikart.github.io/sc-trade-profit-client/

With 3.0 on the horizon we're finally going to get the first iteration of trade gameplay, which I'm totally pumped for. Some juicy teasers in this weeks Around the Verse. My Freelancer is fuelled and ready to haul. I've spent a little time and dusted off my JS skills to build a trade profit calculator with the hope of eventually min/maxing the trade gameplay Star Citizen will have to offer.

Here is the preview: https://ironikart.github.io/sc-trade-profit-client/

Right now, it's entirely client based which means it's entirely run in your web browser not storing or retrieving any data from a server. Eventually I would like to pair this with a server but that will depend on what CIG will offer in terms of trade data APIs (if anything). Since the data sets for commodities across the 100 or so eventual systems could be quite large I'm not holding my breath, but I'll quietly hope.

Disclaimer: I'm not a designer, hence the generic placeholder styles. I can design, i just prefer spending my efforts elsewhere.

What it does
* Allows manifest input (ship details, location details, cargo items). Everything here is quite manual - you will need to know the numbers to input.
* Allows custom expression sets (I've put 2 default sets in for now)
* Can save settings (per browser using the localStorage API - this is limited in size and is similar to cookies)
* Can import/export expression sets as text you can pass around. This should help if people smarter than me make more meaningful calculations.

What it doesn't do
* No dynamic data input (No server APIs yet). This would make it much more user-friendly in the long term.

What it could do (with a bit more work)
* Dynamic jump point calculations (to factor in fuel costs). The galactic map looks fairly straight forward to bring in and calculate jump point relationships. It may be feasible to calculate both the safest and shortest trips to maximise profits.
* Intra-system calculations (to factor in fuel costs, e.g. Quantum Fuel).
* Allow documented expressions. They can get complex and not obvious what those calculations mean in the interface.
* Finish off some work I started on conditional expressions. Not a priority, but the basics are in place (needs interfaces).

Contribution
If you want to contribute to this project, all are welcome. I'd prefer pull requests initially, I don't want to mess around adding/removing contributors and having to monitor every commit. If you want to take the code and do your own thing with it, you are also welcome (project is open source, you just need to keep proper attribution as per the MIT license).

Code is available on github:
https://github.com/ironikart/sc-trade-profit-client

Issues, Feature requests or Suggestions?
Log em here:
https://github.com/ironikart/sc-trade-profit-client/issues

Roadmap
The profit expressions will also run server side (Node.js) so there is a lot of potential here IF CIG allow access to trade data coming from the PU (node locations, type, buy/sell prices). What I would like to do is harvest that information and feed it into these expressions and build predictions on profitable trade routes. That's a fair way off, if it ever comes at all.

And finally...

If you want to point out the lack of commenting and missing code optimisation I won't take offence, just remember this represents a day or so of effort.

This is just a prototype. I will tweak it once we actually get trading in game.


Thank you
Ironik