Skip to content

Commit

Permalink
Restructure map file layout, add map viewer UX
Browse files Browse the repository at this point in the history
  • Loading branch information
Shfty committed Jan 17, 2020
1 parent b427c8b commit 1652d2f
Show file tree
Hide file tree
Showing 9 changed files with 656 additions and 92 deletions.
134 changes: 134 additions & 0 deletions maps/abstract-test.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
// Game: Qodot
// Format: Hexen2
// entity 0
{
"classname" "worldspawn"
"wad" ""
// brush 0
{
( -64 64 16 ) ( -64 -64 -16 ) ( -64 64 -16 ) base/checkerboard 0 0 0 0.0625 0.0625 0
( 64 -64 16 ) ( -64 -64 -16 ) ( -64 -64 16 ) base/checkerboard 0 0 0 0.0625 0.0625 0
( -64 -64 -16 ) ( 64 64 -16 ) ( -64 64 -16 ) base/checkerboard 0 -0 0 0.0625 0.0625 0
( 64 64 16 ) ( -64 -64 16 ) ( -64 64 16 ) base/checkerboard 0 -0 0 0.0625 0.0625 0
( 64 64 -16 ) ( -64 64 16 ) ( -64 64 -16 ) base/checkerboard 0 0 0 0.0625 0.0625 0
( 64 64 -16 ) ( 64 -64 16 ) ( 64 64 16 ) base/checkerboard 0 0 0 0.0625 0.0625 0
}
// brush 1
{
( -48 48 112 ) ( -48 32 112 ) ( -48 32 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( -32 32 112 ) ( -32 32 16 ) ( -48 32 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( -48 32 16 ) ( -32 32 16 ) ( -32 48 16 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( -32 48 112 ) ( -32 32 112 ) ( -48 32 112 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( -32 48 16 ) ( -32 48 112 ) ( -48 48 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( -32 48 16 ) ( -32 32 16 ) ( -32 32 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
}
// brush 2
{
( 32 48 112 ) ( 32 32 16 ) ( 32 48 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( 48 32 112 ) ( 32 32 16 ) ( 32 32 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( 32 32 16 ) ( 48 48 16 ) ( 32 48 16 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( 48 48 112 ) ( 32 32 112 ) ( 32 48 112 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( 48 48 16 ) ( 32 48 112 ) ( 32 48 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( 48 48 16 ) ( 48 32 112 ) ( 48 48 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
}
// brush 3
{
( 32 -32 112 ) ( 32 -48 16 ) ( 32 -32 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( 48 -48 112 ) ( 32 -48 16 ) ( 32 -48 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( 32 -48 16 ) ( 48 -32 16 ) ( 32 -32 16 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( 48 -32 112 ) ( 32 -48 112 ) ( 32 -32 112 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( 48 -32 16 ) ( 32 -32 112 ) ( 32 -32 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( 48 -32 16 ) ( 48 -48 112 ) ( 48 -32 112 ) __TB_empty 0 0 -0 0.0625 0.0625 0
}
// brush 4
{
( -48 -32 112 ) ( -48 -48 16 ) ( -48 -32 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( -32 -48 112 ) ( -48 -48 16 ) ( -48 -48 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( -48 -48 16 ) ( -32 -32 16 ) ( -48 -32 16 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( -32 -32 112 ) ( -48 -48 112 ) ( -48 -32 112 ) __TB_empty -0 -0 0 0.0625 0.0625 0
( -32 -32 16 ) ( -48 -32 112 ) ( -48 -32 16 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
( -32 -32 16 ) ( -32 -48 112 ) ( -32 -32 112 ) __TB_empty -0 -0 -0 0.0625 0.0625 0
}
// brush 5
{
( -64 256 128 ) ( -96 192 128 ) ( -96 192 16 ) base/uv_test -0 0 -0 0.0625 0.0625 0
( -80 192 128 ) ( -80 192 16 ) ( -96 192 16 ) base/uv_test -0 0 -0 0.0625 0.0625 0
( -96 192 16 ) ( -80 192 16 ) ( -48 256 16 ) base/uv_test 0 0 0 0.0625 0.0625 0
( -48 256 128 ) ( -80 192 128 ) ( -96 192 128 ) base/uv_test 0 0 0 0.0625 0.0625 0
( -48 256 16 ) ( -48 256 128 ) ( -64 256 128 ) base/uv_test -0 0 -0 0.0625 0.0625 0
( -48 256 16 ) ( -80 192 16 ) ( -80 192 128 ) base/uv_test 0 0 -0 0.0625 0.0625 0
}
// brush 6
{
( -64 352 79 ) ( -64 256 79 ) ( -48 256 47 ) base/uv_test 0 0 0 0.0625 0.0625 0
( -48 256 95 ) ( -64 256 79 ) ( -64 352 79 ) base/uv_test 0 -0 0 0.0625 0.0625 0
( -48 256 47 ) ( -64 256 79 ) ( -48 256 95 ) base/uv_test -0 0 -0 0.0625 0.0625 0
( -48 352 95 ) ( -64 352 79 ) ( -48 352 47 ) base/uv_test -0 0 -0 0.0625 0.0625 0
( -48 352 47 ) ( -48 256 47 ) ( -48 256 95 ) base/uv_test 0 0 0 0.0625 0.0625 0
}
// brush 7
{
( -37 187 16 ) ( -27 210 16 ) ( -27 210 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -27 210 66 ) ( -27 210 16 ) ( -6 223 16 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -22 178 66 ) ( -37 187 16 ) ( -37 187 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -10 171 16 ) ( -37 187 16 ) ( -22 178 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -10 171 55 ) ( -10 171 16 ) ( -22 178 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( 11 169 42 ) ( 11 169 16 ) ( -10 171 16 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -10 171 16 ) ( 11 169 16 ) ( 21 182 16 ) base/checkerboard 0 0 0 0.015625 0.015625 0
( 23 214 66 ) ( -22 178 66 ) ( -37 187 66 ) base/checkerboard 0 0 0 0.015625 0.015625 0
( 27 213 16 ) ( 27 213 63 ) ( -6 223 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -6 223 66 ) ( 27 213 63 ) ( 23 214 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -22 178 66 ) ( 21 182 46 ) ( -10 171 55 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( 23 214 66 ) ( 21 182 46 ) ( -22 178 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( -10 171 55 ) ( 21 182 46 ) ( 11 169 42 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( 27 213 63 ) ( 21 182 46 ) ( 23 214 66 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( 21 182 16 ) ( 11 169 16 ) ( 11 169 42 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
( 21 182 16 ) ( 21 182 46 ) ( 27 213 63 ) base/checkerboard -0 -0 0 0.015625 0.015625 0
}
// brush 8
{
( -64 128 -16 ) ( -64 129 -16 ) ( -64 128 -15 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( -64 128 -16 ) ( -64 128 -15 ) ( -63 128 -16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( -64 128 -16 ) ( -63 128 -16 ) ( -64 129 -16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 256 16 ) ( 64 257 16 ) ( 65 256 16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 256 16 ) ( 65 256 16 ) ( 64 256 17 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 256 16 ) ( 64 256 17 ) ( 64 257 16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
}
// brush 9
{
( -16 -0 57 ) ( -16 23 80 ) ( -16 -0 103 ) base/uv_test_512 -0 0 -0 0.0625 0.0625 0
( -16 -23 80 ) ( 16 -23 80 ) ( 16 -0 57 ) base/uv_test_512 -0 -2.98065 -0 0.0625 0.0625 0
( 16 -0 103 ) ( 16 -23 80 ) ( -16 -23 80 ) base/uv_test_512 -0 -0 -0 0.0625 0.0625 0
( 16 -0 57 ) ( 16 23 80 ) ( -16 23 80 ) base/uv_test_512 -0 -0 -0 0.0625 0.0625 0
( 16 23 80 ) ( 16 -0 103 ) ( -16 -0 103 ) base/uv_test_512 -0 -0 -0 0.0625 0.0625 0
( 16 -0 57 ) ( 16 -23 80 ) ( 16 -0 103 ) base/uv_test_512 256 0 -0 0.0625 0.0625 0
}
// brush 10
{
( -64 128 -16 ) ( -64 128 16 ) ( -64 64 16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 64 -16 ) ( -64 64 -16 ) ( -64 64 16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 128 -16 ) ( -64 128 -16 ) ( -64 64 -16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( -64 64 16 ) ( -64 128 16 ) ( 64 128 16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 128 16 ) ( -64 128 16 ) ( -64 128 -16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
( 64 128 -16 ) ( 64 64 -16 ) ( 64 64 16 ) base/checkerboard -0 -0 -0 0.0625 0.0625 0
}
}
// entity 1
{
"classname" "trigger"
// brush 0
{
( -64 256 64 ) ( -64 176 64 ) ( -64 176 16 ) __TB_empty -0 -0 0 1 1 0
( 64 144 64 ) ( 64 144 16 ) ( 16 144 16 ) __TB_empty -0 -0 0 1 1 0
( 16 176 16 ) ( 64 176 16 ) ( 64 256 16 ) __TB_empty 0 0 0 1 1 0
( 64 256 80 ) ( 64 176 80 ) ( 16 176 80 ) __TB_empty 0 0 0 1 1 0
( 64 256 16 ) ( 64 256 64 ) ( 16 256 64 ) __TB_empty -0 -0 0 1 1 0
( 64 256 16 ) ( 64 176 16 ) ( 64 176 64 ) __TB_empty -0 -0 0 1 1 0
}
}
// entity 2
{
"classname" "example_player_start"
"origin" "-8 104 32"
"angle" "315"
}
13 changes: 13 additions & 0 deletions maps/abstract-test.map.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[remap]

importer="qodot.map"
type="Resource"
path="res://.import/abstract-test.map-cee423dd62b77763742031c76cfd959d.tres"

[deps]

source_file="res://maps/abstract-test.map"
dest_files=[ "res://.import/abstract-test.map-cee423dd62b77763742031c76cfd959d.tres" ]

[params]

File renamed without changes.
13 changes: 13 additions & 0 deletions maps/metal-arch.map.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[remap]

importer="qodot.map"
type="Resource"
path="res://.import/metal-arch.map-d9235a073bf8747a1072d3ab9be569bc.tres"

[deps]

source_file="res://maps/metal-arch.map"
dest_files=[ "res://.import/metal-arch.map-d9235a073bf8747a1072d3ab9be569bc.tres" ]

[params]

Binary file modified scenes/qodot_example/lightmaps/LightMap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions scenes/qodot_example/qodot_example.map.import

This file was deleted.

537 changes: 458 additions & 79 deletions scenes/qodot_example/qodot_example.tscn

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions scripts/OrbitArm.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
extends Spatial

var yaw = 0.0
var pitch = 0.0

func _ready() -> void:
yaw = transform.basis.get_euler().y
pitch = transform.basis.get_euler().x

func _process(delta):
rotation = Vector3.ZERO
rotate(Vector3.RIGHT, pitch)
rotate(Vector3.UP, yaw)

func _input(event) -> void:
if event is InputEventMouseButton:
if event.button_index == BUTTON_WHEEL_UP:
$Camera.translation.z -= 2.0
elif event.button_index == BUTTON_WHEEL_DOWN:
$Camera.translation.z += 2.0
elif event is InputEventMouseMotion:
if Input.is_mouse_button_pressed(BUTTON_MASK_LEFT):
translation += $Camera.global_transform.basis.x * event.relative.x * -0.05
translation += $Camera.global_transform.basis.y * event.relative.y * 0.05
elif Input.is_mouse_button_pressed(BUTTON_MASK_RIGHT):
yaw += event.relative.x * -0.002
pitch += event.relative.y * -0.002
11 changes: 11 additions & 0 deletions scripts/WadListVBox.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends VBoxContainer

func set_wad_list(wad_list: PoolStringArray) -> void:
for child in get_children():
remove_child(child)
child.queue_free()

for wad in wad_list:
var label = Label.new()
label.text = wad
add_child(label)

0 comments on commit 1652d2f

Please sign in to comment.