Congratulations on your purchase of a brand new Walrus Class interplanetary hauler!

If you work hard, one day you'll be able to pay off the massive loan you had to take out in order to finance this beautiful behemoth.

Get out there and start making some $$$

  1. Accept a contract
  2. Travel to the origin space port to pick up your cargo
  3. Travel to the destination space port and unload
  4. Profit
  5. ???? (hold on a minute... isn't this meme out of order?)

Docs Contents

Basic Commands

Send get and post requests to these API endpoints:

Ship Commands

Command info example
accept_contract args: contract_id {
command: "accept_contract",
args: "42"
}
abort_contract args: contract_id {
command: "abort_contract",
args: "42"
}
plot_course args: array of vectors
[x,y, thrust (-1, 0, 1)]
{
command: "plot_course",
args: [
  [10, 10, 1]
  [20, 20, -1]
]
}
launch

Sends your ship on the course you plotted!

{
command: "launch"
}
dock

Docks your ship at the nearest spaceport (if there is one).

{
command: "dock"
}
load_cargo

Must be docked. Will load cargo from your current port to match your accepted contracts.

{
command: "load_cargo"
}
unload_cargo

Must be docked. Will unload cargo at your current port to match your accepted contracts. Gives you money if the contract is complete.

{
command: "unload_cargo"
}
refuel

Fills your tank to the max. Costs $$$. Much cheaper if you are docked... it costs a lot to haul fuel out to you in the middle of space.

{
command: "refuel"
}
stop

Stops your ship at full opposite thrust.

{
command: "stop"
}
emergency_stop

Stops your ship immediately in place. This dumps a lot of heat into your engine and you'll have to wait a bit before doing anything else.

{
command: "emergency_stop"
}
self_destruct

Blows up your ship and starts you with a new one in a random port. Removes all your current contracts and cargo.

{
command: "self_destruct"
}
jettison

Cargo weighing you down? Pitch it into space.

{
command: "jettison"
}

Upgrading Feedback Loop

Your ship isn't super smart. When sending it commands, you will receive some very basic (and not super useful) feedback.

If you are looking for more helpful feedback, tune in to Space Control RadioTM (over websockets)! This will give you realtime feedback on the status of commands sent to your ship... and more! (Brought to you by today's sponsor: SpudCo).

Start by sending a POST to:

https://space-rust.herokuapp.com/register

with the parameters:

{user_id: <your_user_id*>}

That will tell you which specific websocket address to listen on for all the juicy gossip your ship wasn't willing to share.

Contracts

Completing contracts is how you make your money. A few things to know about them:

Keep an eye on the Scoreboard to see how you're stacking up.

Starter Clients

Basic code examples to get you started.

Ruby Python JavaScript Elixir Rust

Hazards

There are things hanging out in space, looking to make your life a little more exciting.