Skip to content

Commit c63aed8

Browse files
author
Codex Labs
committed
Release v1.0.1
1 parent b727682 commit c63aed8

9 files changed

Lines changed: 296 additions & 99 deletions

core/swarm.py

Lines changed: 235 additions & 97 deletions
Large diffs are not rendered by default.

examples/view_level.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# =============================================================================
2+
# Copyright 2022-2023. Codex Laboratories LLC. All Rights Reserved.
3+
#
4+
# Created By: Tyler Fedrizzi
5+
# Created On: 6 December 2022
6+
#
7+
# Description: Run a Simulation in View Only mode, allowing you to view
8+
# the level that is selected.
9+
# =============================================================================
10+
import argparse
11+
import os
12+
import sys
13+
14+
# Taken from https://docs.python-guide.org/writing/structure/
15+
# Add the root folder to our path to access SWARM
16+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
17+
18+
from core.swarm import SWARM
19+
20+
SIMULATION_NAME = "example"
21+
22+
argpaser = argparse.ArgumentParser("SWARM Simulation Platform",
23+
usage="Run a simulation using a specific map name.",
24+
description="This system represents the client in the SWARM simulation platform. This connects to the core SWARM platform and manages the processing of running a simulation.")
25+
argpaser.add_argument("--map-name", default="SWARMHome", help='The name of the environment to run. Use `list_envs.py` to see which environments are supported')
26+
argpaser.add_argument("--ip-address", default="127.0.0.1", help='The remote IP address of the SWARM Server provided by Codex Labs')
27+
28+
args = argpaser.parse_args()
29+
30+
sim_manager = SWARM(ip_address=args.ip_address)
31+
32+
sim_manager.setup_simulation(args.map_name)
33+
34+
new_simulation = sim_manager.build_simulation(SIMULATION_NAME)
35+
36+
# Please note that the level that will loaded is the one you select
37+
# in the Environment section of the settings file, with the name
38+
# "StartingLevelName"
39+
sim_manager.run_view_only_simulation(args.map_name, SIMULATION_NAME)
40+
41+
print("Finished!")

maps/SWARMHome_Home2.png

20.5 KB
Loading

maps/SWARMHome_Home3.png

20.6 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Origin": [0.0, 0.0, 0.0],
2+
"Origin": [0.0, -3.5, 0.0],
33
"CaptureSize": [30,30,30],
4-
"ImageSize": [350, 350],
4+
"ImageSize": [374, 374],
55
"CaptureIncrement": 0.1
66
}

maps/SWARMHome_metadata_Home1.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Origin": [34, 34, 0.0],
3+
"CaptureSize": [30, 30, 30],
4+
"ImageSize": [374, 374],
5+
"CaptureIncrement": 0.1
6+
}

maps/SWARMHome_metadata_Home2.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Origin": [36, -57, 0.0],
3+
"CaptureSize": [30, 30, 30],
4+
"ImageSize": [374, 374],
5+
"CaptureIncrement": 0.1
6+
}

maps/SWARMHome_metadata_Home3.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"Origin": [35, 70, 0.0],
3+
"CaptureSize": [30, 30, 30],
4+
"ImageSize": [374, 374],
5+
"CaptureIncrement": 0.1
6+
}

0 commit comments

Comments
 (0)