Observe the world
curl --request POST \
--url http://localhost:3917/observeimport requests
url = "http://localhost:3917/observe"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('http://localhost:3917/observe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3917",
CURLOPT_URL => "http://localhost:3917/observe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3917/observe"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3917/observe")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3917/observe")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"entities": [
{
"generation": 1,
"health": [
60,
60
],
"id": 1,
"team": 2,
"transform": {
"position": [
5,
1,
0
],
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
}
},
{
"generation": 1,
"health": [
100,
100
],
"id": 2,
"physics_body": "Kinematic",
"team": 1,
"transform": {
"position": [
0.0833,
1,
0
],
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
},
"velocity": {
"angular": [
0,
0,
0
],
"linear": [
1,
0,
0
]
}
}
],
"entity_count": 2,
"tick": 65
}World
Observe the world
Returns the full, typed world state as a flat table of entities and their components. Optionally filtered to what a given viewer entity can see.
POST
/
observe
Observe the world
curl --request POST \
--url http://localhost:3917/observeimport requests
url = "http://localhost:3917/observe"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('http://localhost:3917/observe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3917",
CURLOPT_URL => "http://localhost:3917/observe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3917/observe"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3917/observe")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3917/observe")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"entities": [
{
"generation": 1,
"health": [
60,
60
],
"id": 1,
"team": 2,
"transform": {
"position": [
5,
1,
0
],
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
}
},
{
"generation": 1,
"health": [
100,
100
],
"id": 2,
"physics_body": "Kinematic",
"team": 1,
"transform": {
"position": [
0.0833,
1,
0
],
"rotation": [
0,
0,
0,
1
],
"scale": [
1,
1,
1
]
},
"velocity": {
"angular": [
0,
0,
0
],
"linear": [
1,
0,
0
]
}
}
],
"entity_count": 2,
"tick": 65
}Query Parameters
If set, only return entities visible to this observer entity id.
Required range:
x >= 0⌘I