Giter VIP home page Giter VIP logo

mimas's Introduction

mimas


Mimas is a fleet commander for the game SpaceTraders. SpaceTraders is played by interacting with an https API and therefore can be automated with code.

If you are interested in playing the game, then this repository is, for all intents and purposes, "spoilers" for the game. Part of the fun and interest for the game is working out your own solutions to the problems you face through coding!

File structure / current purposes

.
├── data
│   └── market_data.json
├── leaderboard.py
├── LICENSE
├── main.py
├── map.py
├── mimas
│   ├── find_market.py
│   ├── __init__.py
│   ├── pathfinding.py
│   ├── save_load.py
│   ├── ships.py
│   └── spacetraders.py
└── README.md

Directory top level

leaderboard.py is a small script to detail our current standing amongst all players in SpaceTraders. Specifically it will tell us our ranking in terms of credits and ship count.

main.py runs the main script that controls the ships and tells them what to do. Currently we are just interested in import/export trade routes as well as building our local jump gate

map.py displays a very simple map of the current system

Directory "data"

This is where we will generally store any cached data. Currently we only have one file which stores a bit of data about each market that we have visted. This is useful for deciding which import / export routes are going to generate us the most money.

Directory "mimas"

This directory contains general tools that are useful for interacting with the SpaceTraders API.

spacetraders.py is a thin wrapper around HTTP requests. This just prevents us from having to deal with creating requests all over the place and it also handles potential errors if we don't have an internet connection or something is not working correctly. This bit of code will handle all of this for us and return the formatted JSON of the response of the request

ships.py contains a class called "Ship". This is just our code representation of an individual ship within the game. We can use methods on this class to do basic things with the ship. Fly to a certain location, jettison cargo, buy and sell goods, etc. The ship is not responsible for doing anything "smart" like figure out what goods to move where. However, if we try to fly somewhere that is not possible to fly to directly, then we will utilize more complex route planning.

pathfinding.py contains code that performs route planning by first turning the system we are in to a weighted graph, and then computing BFS on that graph.

save_load.py is a thin wrapper for saving and loading JSON data to disk.

find_market.py contains some code for identifying markets / locations with fuel but this needs to be retooled eventually into something more broad.

mimas's People

Contributors

noahschiro avatar

Watchers

Kostas Georgiou avatar  avatar

mimas's Issues

Ships should handle buy / sell caps.

Some products have buy / sell caps at a market. I commonly see this as around 60 units of goods but the formula for what actually determines this cap is hidden.

We should update the buy / sell function in the ship so that if we want to trade more than 40 units, it will break it up into smaller transactions until we meet the amount that we wanted to trade originally.

I.e. sell 100 circuits: should make 3 transactions. 1. 40 circuits, 2. 40 circuits, 3. 20 circuits.

Web dashboard

Use flask as backend

  • map
  • system information
  • waypoint information. Including market data, shipyard data etc.
  • agent + ship information

Create a web dashboard to display information about a system

Use flask as the backend plus some basic html

Want to see:

  • map
  • list of waypoints. Should be searchable by trait, by type, whether or not it has a market, goods sold at market, etc.
  • ship list as well as info about ships. Also information about agent
  • jump gate and associated info

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.