Browse Source
late Sunday update: netcode changes, bot improvements, bot development
master
pre_alpha_3
late Sunday update: netcode changes, bot improvements, bot development
master
pre_alpha_3
Lurkars
5 years ago
46 changed files with 3128 additions and 135396 deletions
-
BINassets/blender/loop.blend
-
BINassets/blender/loop.blend1
-
137356assets/road/roadLoop.obj
-
13ext/server.py
-
14project.godot
-
11resources/ui/i18n.csv
-
73scenes/menus/DirectHostMenu.tscn
-
2scenes/menus/DirectJoinMenu.tscn
-
44scenes/menus/LocalGameMenu.tscn
-
29scenes/menus/MainMenu.tscn
-
25scenes/menus/ServerCreateGameMenu.tscn
-
2scenes/menus/SettingsControlsMenu.tscn
-
53scenes/menus/SettingsGameMenu.tscn
-
44scenes/menus/SettingsGraphicsMenu.tscn
-
196scenes/menus/SettingsMenu.tscn
-
1scenes/menus/SettingsPlayerMenu.tscn
-
31scenes/menus/SettingsSystemMenu.tscn
-
7scenes/player/BotPlayer.tscn
-
62scenes/player/HumanPlayer.tscn
-
3scripts/game/config.gd
-
5scripts/game/config_apply.gd
-
16scripts/game/game.gd
-
13scripts/game/gamestate.gd
-
22scripts/game/route.gd
-
12scripts/menus/direct_host_menu.gd
-
6scripts/menus/ingame_menu.gd
-
2scripts/menus/lobby_menu.gd
-
10scripts/menus/local_game.gd
-
7scripts/menus/main_menu.gd
-
10scripts/menus/server_create_menu.gd
-
4scripts/menus/server_menu.gd
-
4scripts/menus/settings_controls_menu.gd
-
17scripts/menus/settings_game_menu.gd
-
24scripts/menus/settings_graphics_menu.gd
-
94scripts/menus/settings_menu.gd
-
55scripts/menus/settings_system_menu.gd
-
35scripts/networking/server.gd
-
42scripts/player/base_inventory.gd
-
50scripts/player/bot_controls.gd
-
3scripts/player/bot_inventory.gd
-
16scripts/player/human_controls.gd
-
6scripts/player/human_inventory.gd
-
4scripts/player/inventory_preview.gd
-
48scripts/player/player.gd
-
53scripts/screen_capture.gd
-
0scripts/util.gd
137356
assets/road/roadLoop.obj
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,53 @@ |
|||||
|
[gd_scene load_steps=3 format=2] |
||||
|
|
||||
|
[ext_resource path="res://scripts/menus/settings_game_menu.gd" type="Script" id=1] |
||||
|
[ext_resource path="res://scenes/menus/SettingsPlayerMenu.tscn" type="PackedScene" id=2] |
||||
|
|
||||
|
[node name="settings_game_menu" type="Tabs"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
focus_neighbour_right = NodePath("../controls") |
||||
|
focus_neighbour_bottom = NodePath("GridContainer/settings_player/VBoxContainer/name") |
||||
|
focus_mode = 2 |
||||
|
script = ExtResource( 1 ) |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="."] |
||||
|
margin_left = 9.0 |
||||
|
margin_top = 10.0 |
||||
|
margin_right = 416.0 |
||||
|
margin_bottom = 202.0 |
||||
|
|
||||
|
[node name="settings_player" parent="GridContainer" instance=ExtResource( 2 )] |
||||
|
margin_left = 0.0 |
||||
|
margin_top = 0.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 148.0 |
||||
|
|
||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="GridContainer"] |
||||
|
margin_top = 152.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 192.0 |
||||
|
|
||||
|
[node name="bots" type="CheckButton" parent="GridContainer/HBoxContainer"] |
||||
|
margin_right = 109.0 |
||||
|
margin_bottom = 40.0 |
||||
|
focus_neighbour_top = NodePath("../settings_player/VBoxContainer/color") |
||||
|
focus_neighbour_bottom = NodePath("../../../../HBoxContainer/apply") |
||||
|
size_flags_horizontal = 0 |
||||
|
size_flags_vertical = 0 |
||||
|
text = "Bots" |
||||
|
|
||||
|
[node name="bot_difficulty" type="HSlider" parent="GridContainer/HBoxContainer"] |
||||
|
margin_left = 113.0 |
||||
|
margin_right = 407.0 |
||||
|
margin_bottom = 40.0 |
||||
|
size_flags_horizontal = 3 |
||||
|
size_flags_vertical = 1 |
||||
|
max_value = 1.0 |
||||
|
step = 0.1 |
||||
|
tick_count = 11 |
||||
|
ticks_on_borders = true |
@ -0,0 +1,44 @@ |
|||||
|
[gd_scene load_steps=2 format=2] |
||||
|
|
||||
|
[ext_resource path="res://scripts/menus/settings_graphics_menu.gd" type="Script" id=1] |
||||
|
|
||||
|
[node name="settings_graphics_menu" type="Tabs"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
focus_neighbour_left = NodePath("../controls") |
||||
|
focus_neighbour_right = NodePath("../system") |
||||
|
focus_mode = 2 |
||||
|
script = ExtResource( 1 ) |
||||
|
|
||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="."] |
||||
|
margin_right = 40.0 |
||||
|
margin_bottom = 40.0 |
||||
|
|
||||
|
[node name="resolution" type="OptionButton" parent="VBoxContainer"] |
||||
|
margin_right = 192.0 |
||||
|
margin_bottom = 20.0 |
||||
|
|
||||
|
[node name="fullscreen" type="CheckButton" parent="VBoxContainer"] |
||||
|
margin_top = 24.0 |
||||
|
margin_right = 192.0 |
||||
|
margin_bottom = 64.0 |
||||
|
pressed = true |
||||
|
text = "FULLSCREEN" |
||||
|
|
||||
|
[node name="light" type="CheckButton" parent="VBoxContainer"] |
||||
|
margin_top = 68.0 |
||||
|
margin_right = 192.0 |
||||
|
margin_bottom = 108.0 |
||||
|
text = "LIGHT" |
||||
|
|
||||
|
[node name="shadows" type="CheckButton" parent="VBoxContainer"] |
||||
|
margin_top = 112.0 |
||||
|
margin_right = 192.0 |
||||
|
margin_bottom = 152.0 |
||||
|
disabled = true |
||||
|
text = "SHADOWS" |
||||
|
[connection signal="toggled" from="VBoxContainer/light" to="." method="_on_light_toggled"] |
@ -1,47 +1,62 @@ |
|||||
[gd_scene format=2] |
|
||||
|
[gd_scene load_steps=2 format=2] |
||||
|
|
||||
[node name="GridContainer" type="GridContainer"] |
|
||||
|
[ext_resource path="res://scripts/menus/settings_system_menu.gd" type="Script" id=1] |
||||
|
|
||||
|
[node name="system_settings_menu" type="Tabs"] |
||||
|
anchor_right = 1.0 |
||||
|
anchor_bottom = 1.0 |
||||
|
margin_left = 4.0 |
||||
|
margin_top = 45.0 |
||||
|
margin_right = -4.0 |
||||
|
margin_bottom = -4.0 |
||||
|
focus_neighbour_left = NodePath("../graphics") |
||||
|
focus_mode = 2 |
||||
|
script = ExtResource( 1 ) |
||||
|
|
||||
|
[node name="GridContainer" type="GridContainer" parent="."] |
||||
margin_left = 12.0 |
margin_left = 12.0 |
||||
margin_top = 8.0 |
margin_top = 8.0 |
||||
margin_right = 907.0 |
margin_right = 907.0 |
||||
margin_bottom = 124.0 |
margin_bottom = 124.0 |
||||
columns = 2 |
columns = 2 |
||||
|
|
||||
[node name="locale_label" type="Label" parent="."] |
|
||||
|
[node name="locale_label" type="Label" parent="GridContainer"] |
||||
margin_right = 88.0 |
margin_right = 88.0 |
||||
margin_bottom = 14.0 |
margin_bottom = 14.0 |
||||
text = "LOCALE" |
text = "LOCALE" |
||||
valign = 1 |
valign = 1 |
||||
|
|
||||
[node name="locales" type="ItemList" parent="."] |
|
||||
|
[node name="locales" type="ItemList" parent="GridContainer"] |
||||
margin_left = 92.0 |
margin_left = 92.0 |
||||
margin_right = 895.0 |
margin_right = 895.0 |
||||
margin_bottom = 14.0 |
margin_bottom = 14.0 |
||||
size_flags_horizontal = 3 |
size_flags_horizontal = 3 |
||||
auto_height = true |
auto_height = true |
||||
|
|
||||
[node name="server_addr_label" type="Label" parent="."] |
|
||||
|
[node name="server_addr_label" type="Label" parent="GridContainer"] |
||||
margin_top = 23.0 |
margin_top = 23.0 |
||||
margin_right = 88.0 |
margin_right = 88.0 |
||||
margin_bottom = 37.0 |
margin_bottom = 37.0 |
||||
text = "SERVER_ADDR" |
text = "SERVER_ADDR" |
||||
valign = 1 |
valign = 1 |
||||
|
|
||||
[node name="server_addr" type="LineEdit" parent="."] |
|
||||
|
[node name="server_addr" type="LineEdit" parent="GridContainer"] |
||||
margin_left = 92.0 |
margin_left = 92.0 |
||||
margin_top = 18.0 |
margin_top = 18.0 |
||||
margin_right = 895.0 |
margin_right = 895.0 |
||||
margin_bottom = 42.0 |
margin_bottom = 42.0 |
||||
|
|
||||
[node name="api_addr_label" type="Label" parent="."] |
|
||||
|
[node name="api_addr_label" type="Label" parent="GridContainer"] |
||||
margin_top = 51.0 |
margin_top = 51.0 |
||||
margin_right = 88.0 |
margin_right = 88.0 |
||||
margin_bottom = 65.0 |
margin_bottom = 65.0 |
||||
text = "API_ADDR" |
text = "API_ADDR" |
||||
valign = 1 |
valign = 1 |
||||
|
|
||||
[node name="api_addr" type="LineEdit" parent="."] |
|
||||
|
[node name="api_addr" type="LineEdit" parent="GridContainer"] |
||||
margin_left = 92.0 |
margin_left = 92.0 |
||||
margin_top = 46.0 |
margin_top = 46.0 |
||||
margin_right = 895.0 |
margin_right = 895.0 |
||||
margin_bottom = 70.0 |
margin_bottom = 70.0 |
||||
|
[connection signal="tree_exiting" from="." to="." method="_on_system_settings_menu_tree_exiting"] |
||||
|
[connection signal="item_selected" from="GridContainer/locales" to="." method="_on_locales_item_selected"] |
@ -0,0 +1,17 @@ |
|||||
|
extends Tabs |
||||
|
|
||||
|
onready var player_settings = find_node("settings_player") |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
# game |
||||
|
find_node("bots").set_pressed(config.get_value("game","bots", true)) |
||||
|
find_node("bot_difficulty").set_value(config.get_value("game","bot_difficulty", gamestate.DEFAULT_BOT_DIFFICULTY)) |
||||
|
find_node("bot_difficulty").set_tooltip(tr("BOT_DIFFICULTY")) |
||||
|
|
||||
|
|
||||
|
func apply(): |
||||
|
config.set_value("game","player_name",player_settings.get_name_node().get_text()) |
||||
|
config.set_value("game","player_color",player_settings.get_color_node().color) |
||||
|
config.set_value("game","bots",find_node("bots").is_pressed()) |
||||
|
config.set_value("game","bot_difficulty",find_node("bot_difficulty").get_value()) |
@ -0,0 +1,24 @@ |
|||||
|
extends Tabs |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
find_node("fullscreen").set_pressed(config.get_value("graphics","fullscreen", true)) |
||||
|
find_node("light").set_pressed(config.get_value("graphics","light", false)) |
||||
|
find_node("shadows").set_pressed(config.get_value("graphics","shadows", false)) |
||||
|
find_node("shadows").set_disabled(not find_node("light").is_pressed()) |
||||
|
|
||||
|
for resolution in config.RESOLUTIONS: |
||||
|
find_node("resolution").add_item(str(resolution.x) + " * " + str(resolution.y)) |
||||
|
|
||||
|
find_node("resolution").select(config.RESOLUTIONS.find(config.get_value("graphics","resolution", config.RESOLUTIONS[0]))) |
||||
|
|
||||
|
|
||||
|
func apply(): |
||||
|
config.set_value("graphics","resolution",config.RESOLUTIONS[find_node("resolution").get_selected()]) |
||||
|
config.set_value("graphics","fullscreen",find_node("fullscreen").is_pressed()) |
||||
|
config.set_value("graphics","light",find_node("light").is_pressed()) |
||||
|
config.set_value("graphics","shadows",find_node("shadows").is_pressed()) |
||||
|
|
||||
|
|
||||
|
func _on_light_toggled(button_pressed): |
||||
|
find_node("shadows").set_disabled(not button_pressed) |
@ -0,0 +1,55 @@ |
|||||
|
extends Tabs |
||||
|
|
||||
|
var locale |
||||
|
|
||||
|
signal locale_changed() |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
find_node("server_addr").set_text(game_server.get_server_addr()) |
||||
|
find_node("api_addr").set_text(game_server.get_api_addr()) |
||||
|
_init_locales() |
||||
|
|
||||
|
|
||||
|
func apply(): |
||||
|
config.set_value("system","locale",locale) |
||||
|
var server_addr = find_node("server_addr").get_text() |
||||
|
if server_addr.empty(): |
||||
|
server_addr = game_server.SERVER_ADDR |
||||
|
config.set_value("system","server_addr",server_addr) |
||||
|
|
||||
|
var api_addr = find_node("api_addr").get_text() |
||||
|
if api_addr.empty(): |
||||
|
api_addr = game_server.API_ADDR |
||||
|
config.set_value("system","api_addr",api_addr) |
||||
|
|
||||
|
|
||||
|
func _on_locales_item_selected(index): |
||||
|
match index: |
||||
|
0: |
||||
|
locale = "en" |
||||
|
1: |
||||
|
locale = "de" |
||||
|
_: |
||||
|
locale = "en" |
||||
|
TranslationServer.set_locale(locale) |
||||
|
emit_signal("locale_changed") |
||||
|
|
||||
|
|
||||
|
func _init_locales(): |
||||
|
var locales = find_node("locales") |
||||
|
locales.clear() |
||||
|
locales.add_item(tr("LOCALE_EN")) |
||||
|
locales.add_item(tr("LOCALE_DE")) |
||||
|
locale = config.get_value("system","locale","en") |
||||
|
match locale: |
||||
|
"en": |
||||
|
locales.select(0) |
||||
|
_on_locales_item_selected(0) |
||||
|
"de": |
||||
|
locales.select(1) |
||||
|
_on_locales_item_selected(1) |
||||
|
|
||||
|
|
||||
|
func _on_system_settings_menu_tree_exiting(): |
||||
|
config_apply.apply_locale() |
@ -0,0 +1,53 @@ |
|||||
|
extends Node |
||||
|
|
||||
|
export(float) var frames_per_second = 5.0 |
||||
|
|
||||
|
var is_active:bool = false |
||||
|
var is_saving:bool = false |
||||
|
|
||||
|
var _frametick = 1.0/frames_per_second |
||||
|
var _thread:Thread |
||||
|
|
||||
|
var images = [] |
||||
|
|
||||
|
|
||||
|
func _ready(): |
||||
|
_thread = Thread.new() |
||||
|
|
||||
|
|
||||
|
func _process(delta): |
||||
|
if Input.is_action_just_pressed("controls_capture") && not is_saving: |
||||
|
is_active = not is_active |
||||
|
find_node("recording").set_visible(is_active) |
||||
|
if not is_active: |
||||
|
is_saving = true |
||||
|
find_node("saving").set_visible(true) |
||||
|
_thread.start(self, "save_images") |
||||
|
if is_active: |
||||
|
_frametick += delta |
||||
|
if (_frametick > 1.0/frames_per_second): |
||||
|
get_viewport().set_clear_mode(Viewport.CLEAR_MODE_ONLY_NEXT_FRAME) |
||||
|
var img = get_viewport().get_texture().get_data() |
||||
|
img.flip_y() |
||||
|
images.append(img) |
||||
|
|
||||
|
|
||||
|
func save_images(userdata): |
||||
|
var dir = Directory.new() |
||||
|
var timestamp = OS.get_unix_time() |
||||
|
if dir.open("user://capture/") != OK: |
||||
|
dir.open("user://") |
||||
|
dir.make_dir("capture") |
||||
|
|
||||
|
dir.open("user://capture/") |
||||
|
dir.make_dir(str(timestamp)) |
||||
|
|
||||
|
for img in images: |
||||
|
img.save_png("user://capture/" + str(timestamp) + "/" + str(img) + ".png") |
||||
|
|
||||
|
images = [] |
||||
|
is_saving = false |
||||
|
find_node("saving").set_visible(false) |
||||
|
|
||||
|
if(_thread.is_active()): |
||||
|
_thread.wait_to_finish() |
Write
Preview
Loading…
Cancel
Save
Reference in new issue