Skip to content

RoboMiner Mechanics

In this section the mechanics of the RoboMiner Robots are explained.

Ore Container

The Ore Container is the part of the Robot that stores the ore mined. The size of the container limits the maximum amount of ore stored, but is also a big influence to the weight and size of the Robot.

Every ore container is aware of the different types of ore stored inside it. Also, it is able to dump the ore it contains, either one specific type of ore or all of it.

The ore() command can be used to measure the amount of ore it contains, per type if needed. The dump() command can be used to dump the ore it contains, also per type if requested to do so.

Mining Unit

The Mining Unit is the part of the Robot that is put to work when executing the mine() command. Unlike the Ore Container it is not aware of the different types of ore.

Mostly, one cycle of mining won't be enough to mine all the ore from one square. The amount of ore mined in one cycle is limited by two factors:

  • The Mining Units Mining capacity. In one cycle, the mining unit can never mine more ore then its Mining Capacity.
  • The amount of ore at the current location. In one cycle, the mining unit can never mine more then half the ore available at the current location, rounded up.

Besides the Mining Capacity there also is a large variation in power consumption and weight between the different mining units.

Battery

The Battery is what powers the Robot during the mining session. Besides that, the Battery is also the part responsible for the recharge periods between mining sessions.

Every part on the Robot, except the Battery itself, consumes power during a mining session. The power consumption is constant, parts that aren't active at the moment consume the same amount of power as active ones.

Add the power consumption of every part attached to the robot and divide the Battery Capacity by the result to calculate the maximum number of mining cycles the Robot can be active. This result is also visible on the Robots page.

The recharge time is even simpler, it is shown directly in the Shop. Recharge times can vary widely between different batteries, especially for the more advanced once.

Memory Module

The Memory Module stores the Robot program currently active for the Robot. The Memory size determines the maximum number of low-level instructions it can contain.

To calculate the number of low-level instructions of a program simply save it on the Edit code page. Assuming your code is compilable, it will show you the Compiled size on the bottom of the page. This Compiled size is the amount of low-level instructions.

There are two ways to upload new code to the Memory Module.

First, on the Robots page you can attach a Source code to the Robot. When you click on the Apply button on the bottom of the page, the code is uploaded to the Memory Module. If the Robot is mining at that point of time, this upload will be delayed until the end of the current mining session.

Secondly, when you're on the Edit code page and click on the Save button, the program will be uploaded to the Memory Module when the following conditions are met:

  • The program is compilable.
  • The Source code is linked to the Robot.
  • The Compiled size is equal to or smaller then the Memory Modules capacity.
  • The Robot is not mining at the time the Save button is pressed.

When one or more of these conditions are not met, use the first method to upload the code, if desired.

The Power consumption slightly increases with the Memory size of the Memory Module. So it is advisable to use the smallest Memory Module that can contain your compiled code.

CPU

The CPU is probably the most complicated part of the Robot. Besides a slight variation in Power consumption, it has one important property: The CPU speed.

In order to understand this property, it is important to know the difference between CPU actions and Physical actions of your Robot.

Physical actions are the actions that move your Robot or the ore in some kind of way. So move() is a physical action, as is rotate(), mine() and dump().

CPU actions are all other code actions, like flow control, calculations and variable assignment. The ore(), time(), and scan() instructions also are CPU actions as they don't take any physical action.

The Physical actions are also called Cycles. When a mining area has a maximum number of mining cycles of 150, there are at most 150 physical actions possible in one mining session in that area.

A portion of the timeline of a mining session with a 4 i/c can be represented as followed:

CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU
Physical Physical Physical

There are two important rules concerning this timeline:

  1. When the CPU starts a Physical action, no more CPU actions are processed during that cycle.
  2. When the CPU doesn't start a Physical action itself before the end of the cycle, the default Physical action 'Wait' is started.

When the CPU starts a mine() operation as the second CPU action, the timeline will look like this:

CPU mine X X CPU CPU CPU CPU CPU CPU CPU CPU
Physical mine() Physical

And when the CPU is busy with non-physical actions until the 7th CPU action, the timeline will look like this:

CPU CPU CPU CPU CPU CPU mine X CPU CPU CPU CPU
Physical Wait mine()

In order to mine efficiently, it is important that the Robot program and CPU match each others capabilities. It is useless to have a 72 i/c CPU for the default 'move(1); mine();' program. And a highly advanced but complex program requiring on average 120 CPU actions between Physical actions won't get a Robot very far with a 4 i/c CPU on a 150 Mining cycles mining area.

To check your CPU performance, you can see the Mining results page. When you click on the '+' of a mining session, you'll see a list of Actions. These are the Physical actions performed by your Robot during that session.

If the Wait actions are above 20%, you might consider buying a better CPU or creating a more efficient program.

Engine

The Engine is responsible for moving the Robot around. Stronger Engines can move and rotate faster. The Strength of the engine is split into three parts: Forward power, backward power and rotate power.

The other important factor for speed is weight. Every Robot part has a weight value. When you add up the weight values of all the Robot parts, you end up with the total weight of the Robot.

The Robots page will tell you the current maximum speeds of the Robot, again split into the three parts. The speed is the maximum distance the Robot can travel or rotate in one cycle.

When a move() or rotate() command is given which exceeds the speed of the Robot, the action is divided into two or more parts. The first cycle(s), the Robot will move at the maximum speed for the full duration of those cycles. In the last cycle, the Robot will still move at its maximum speed but only during the first part of the cycle.

Assume the Robot has a forward speed of 1.2 and a move(1.8) is executed. With a 4 i/c CPU, the timeline will look like this:

CPU CPU move(1.8) X X X X X CPU CPU CPU CPU
... move(1.2) move(0.6) idle

A collision cancels the move or rotate from the moment the collision occurs. So, when a collision occurs at one half of the move(1.2) cycle, the Robot has moved a distance of 0.6 and the second move(0.6) will not be executed.

CPU CPU move(1.8) X CPU CPU CPU CPU CPU CPU CPU CPU
... move(0.6) collision ...