From 3e09d6846e3200881c0dbc60f9dd805ec2050c30 Mon Sep 17 00:00:00 2001 From: dusoleil Date: Thu, 15 Sep 2022 20:51:50 -0400 Subject: Lower World Generation radius for performance --- FPS.gd | 4 ++++ Main.tscn | 10 ++++++++-- World.gd | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 FPS.gd diff --git a/FPS.gd b/FPS.gd new file mode 100644 index 0000000..b3ae31a --- /dev/null +++ b/FPS.gd @@ -0,0 +1,4 @@ +extends Label + +func _process(_delta): + self.set_text("FPS: %.1f" % Engine.get_frames_per_second()) diff --git a/Main.tscn b/Main.tscn index 9ba9b60..495c034 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=18 format=2] [ext_resource path="res://character/fps_controller/fps_controller.tscn" type="PackedScene" id=1] [ext_resource path="res://ship/ship/ship.tscn" type="PackedScene" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://ship/ship/crate.tscn" type="PackedScene" id=5] [ext_resource path="res://World.gd" type="Script" id=6] [ext_resource path="res://Ship.gd" type="Script" id=7] +[ext_resource path="res://FPS.gd" type="Script" id=8] [sub_resource type="BoxShape" id=19] extents = Vector3( 1000, 0.1, 1000 ) @@ -33,7 +34,7 @@ transform_array = PoolVector3Array( 0.35759, 0, -0.933879, 0, 1, 0, 0.933879, 0, [sub_resource type="BoxShape" id=23] [sub_resource type="BoxShape" id=24] -extents = Vector3( 500, 1000, 500 ) +extents = Vector3( 300, 1000, 300 ) [sub_resource type="CapsuleShape" id=22] radius = 11.4853 @@ -1891,4 +1892,9 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.9944, 5.67224, 2.09212 ) [node name="crate400" parent="crates" instance=ExtResource( 5 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.04795, 5.67224, 2.09212 ) +[node name="FPS" type="Label" parent="."] +margin_right = 163.0 +margin_bottom = 68.0 +script = ExtResource( 8 ) + [connection signal="body_exited" from="WorldGenCull" to="World" method="_on_WorldGenCull_body_exited"] diff --git a/World.gd b/World.gd index 6ea8452..15e283f 100644 --- a/World.gd +++ b/World.gd @@ -1,7 +1,7 @@ extends RigidBody export var acceleration = 10.0 -export var generation_distance = 500.0 +export var generation_distance = 300.0 export var generation_subdivision = 5.0 var gen_coords = Vector2.ZERO -- cgit v1.2.3