-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document setting up a gps constellation #1070
Changes from 8 commits
8716eb0
85c8324
7dcf258
a600f80
3eb3ee1
ab7a316
c04f382
6a12337
b216a93
9998865
83cb0ea
12e896d
516070d
9027b21
ab6e508
b09dae9
81d6ae0
0807b92
d9375c7
4983b36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
module: [kind=guide] gps_setup | ||
--- | ||
|
||
# Setting up GPS | ||
The @{gps} API allows computers and turtles to find their current position using wireless modems. | ||
|
||
In order to use GPS, you'll need to set up multiple GPS hosts. These are computers running the special gps host program, which tell other computers the host's position. Several hosts running together are known as a GPS constellation. | ||
|
||
Before GPS can be used in a dimension (e.g. the Nether) a GPS host constellation needs to be set up. Traditionally this is done near the max build height for maximum range, but ender modems easily beats a normal modem's max range at any height. | ||
|
||
In order to give the best results, a GPS constellation needs at least four computers. More than four GPS hosts per constellation is redundant, but it does not harm. | ||
|
||
## Building a GPS constellation | ||
![An example GPS constellation.](/images/gps-constellation-example.png){.big-image} | ||
|
||
Assuming that you are using four computers per constellation, you will want each computer that makes up the constellation to be out of plane with at least one other computer in the constellation. To put this another way, if you can make a straight wall or floor (diagonal also counts as straight, having a corner or curve doesn't) that touches all four computers then you need to move one of the computers so that it's no longer in contact with the wall/floor. | ||
|
||
Having the GPS constellation computers within a few blocks of each other is what people commonly do but is not required. So long as at least four GPS hosts can respond to the requester the request will be fulfilled. | ||
|
||
GPS only works with wireless modems, ender modems count as wireless. It doesn't matter what side you attach them to, just that each computer in the constellation has one. | ||
|
||
:::note Ender modems | ||
You might be aware that ender modems have a very large range, this makes them very useful for setting up GPS hosts. If you do this then you will likely only need one GPS constellation for the whole dimension (in vanilla this will mean that you'd need three constellations, one for the Overworld, one for the Nether, and one for the End). | ||
|
||
Also, don't worry about an ender modem's ability to work across dimensions, the GPS API is smart enough to ignore constellations that are not in its dimension. | ||
Lupus590 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
::: | ||
|
||
## Configureing the constellation | ||
Lupus590 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
To provide computers (or more commonly, turtles) their location, every GPS host needs to know its own location. GPS host can get this from other constellations, but we are going to input it manually, which means that we are going to make a startup file. | ||
|
||
It doesn't matter what kind of startup file you use, so long as it's a valid one; the contents of the file is going to be the same. | ||
Lupus590 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Here's a template for the startup file's contents: | ||
```lua | ||
shell.run("gps", "host", x, y, z) | ||
``` | ||
Where `x`, `y`, and `z` are the respective coordinates of the CC computer. The easiest way to get the computer's coordinates is to look at it and press `F3`, its coordinates can then be found on the right side of the screen as `Targeted Block`. | ||
|
||
:::note Why use MC's coordinates? | ||
Lupus590 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CC doesn't care if you use Minecraft's coordinate system, so long as all of the GPS hosts with overlapping ranges use the same reference point (requesting computers will get confused if hosts have different reference points). However, using MC's coordinate system does provide a nice standard to adopt server-wide. It also is consistaint with how command computers get their location, they use MC's command system to get their block which returns that in MC's coordinate system. | ||
::: | ||
|
||
:::note Modem messages come from the computer's position, not the modem's | ||
Wireless modems transmit from the block that they are attached to *not* the block space that they occupy, the coordinates that you input into your GPS host should be the position of the computer and not the position of the modem. | ||
::: | ||
|
||
## A brief look at how the GPS API works in CC | ||
Except for command computers and user code overrides, ComputerCraft mimics real-life GPS; computers trilaterate themselves using signals with known sender positions (which is why we have to tell the GPS hosts where they are). This means that the average CC computer will need a wireless modem and be in range of a GPS constellation. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by "the average CC computer"? I assume you're referring to non-command ones here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, non-command computers is what I'm trying to say. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'd just leave that off then. I'm not really sure about this section in its current state. Right now it really boils down to "it's Trilateration!". I don't know if we want a couple of sentences explanation, or just drop it entirely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first bit of this kinda duplicates the previous paragraph now.
I think I'd probably drop this paragraph (and the one below) and then mention these considerations in the "Building a GPS constellation" section.