Skip to content

Commit c353a57

Browse files
Construct Vehicle archetype from input file (#2)
* Delete level generation code * Add nlohmann json as a submodule * Create Vehicle archetypes from an input file Unlike madrona_escape_room which procedurally generates an environment, gpudrive generates an environment from an input map file. This updates level_gen.cpp to construct Vehicles based on a (currently hardcoded) input file. The Agent archetype is reused for Vechicles. * Fix up task graph Since buttons and doors are no longer being generated, this deletes the nodes associated with those concepts.
1 parent 3afec1a commit c353a57

File tree

8 files changed

+76
-759
lines changed

8 files changed

+76
-759
lines changed

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "external/madrona"]
22
path = external/madrona
33
url = https://github.com/shacklettbp/madrona.git
4+
[submodule "external/json"]
5+
path = external/json
6+
url = https://github.com/nlohmann/json.git

Diff for: external/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
add_subdirectory("${MADRONA_DIR}" madrona EXCLUDE_FROM_ALL)
2+
add_subdirectory(nlohmann_json)
3+
4+

Diff for: src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ target_link_libraries(mad_escape_cpu_impl
1313
PUBLIC
1414
madrona_mw_core
1515
PRIVATE
16+
nlohmann_json::nlohmann_json
1617
madrona_common
1718
madrona_mw_physics
1819
madrona_viz_system

Diff for: src/consts.hpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ namespace consts {
99
// must solve in order to maximize their reward.
1010
inline constexpr madrona::CountT numRooms = 3;
1111

12-
// Generated levels assume 2 agents
13-
inline constexpr madrona::CountT numAgents = 2;
12+
// TODO(samk): This number is specifically derived for
13+
// tfrecord-00004-of-00150_246.json. Once we move to multiple map files, it will
14+
// have to be updated.
15+
inline constexpr madrona::CountT numAgents = 42;
16+
inline constexpr madrona::CountT numRoadSegments = 4425;
1417

1518
// Maximum number of interactive objects per challenge room. This is needed
1619
// in order to setup the fixed-size learning tensors appropriately.
@@ -48,8 +51,10 @@ inline constexpr float deltaT = 0.04f;
4851
inline constexpr float doorSpeed = 30.f;
4952

5053
// Number of physics substeps
51-
inline constexpr madrona::CountT numPhysicsSubsteps = 4.f;
54+
inline constexpr madrona::CountT numPhysicsSubsteps = 0.f;
5255

56+
inline constexpr float zDimensionScale = 1;
57+
inline constexpr float xDimensionScaleRoadSegment = 1;
5358
}
5459

5560
}

0 commit comments

Comments
 (0)