Compare commits

...

8 Commits

Author SHA1 Message Date
Kenney 8a00aa235f
Merge pull request #28 from Calinou/update-to-godot-4.4.1
Update to Godot 4.4.1, fix visuals in web export
2025-09-16 18:54:47 +07:00
Kenney 050df82317
Merge pull request #25 from Joseph-DiGiovanni/falling-platform-fix
Make falling platform frame rate independent
2025-09-16 18:54:14 +07:00
Kenney b965ff4346
Merge pull request #26 from Joseph-DiGiovanni/analog-animation-fix
Fix walking animation speed with analog movement
2025-09-16 18:53:53 +07:00
Hugo Locurcio 136af9113c
Update to Godot 4.4.1, fix visuals in web export
This performs various upgrades and fixes:

- Use lossless compression for all textures to improve quality and fix
  textures on the web export. Textures are very small in size, so they didn't
  use much memory in the first place anyway.
- Adjust the appearance when running under the Compatibility rendering method
  (including the web export), so that the scene brightness roughly matches
  Forward+.
- Enable physics interpolation for smoother visuals when the rendering
  FPS doesn't match the physics tick rate (60 in this project).
- Switch the physics engine to Jolt Physics for faster, more reliable physics.
- Use the `canvas_items` stretch mode to scale 2D elements automatically.
- Remove redundant CanvasLayer node for the HUD (not needed in 3D games).
- Tweak the HUD to constrain the coin display to a 16:9 aspect ratio, so that
  the coin display isn't too far away on ultrawide displays.
2025-07-29 02:39:08 +07:00
Joseph DiGiovanni ffa7ca6857 Use physics_process to move falling platform 2025-02-25 20:14:28 +07:00
Joseph DiGiovanni 767f0f052f Reorganize falling platform logic 2025-02-25 20:14:28 +07:00
Joseph DiGiovanni 1fe809c95d Fix walking animation speed with analog movement 2025-02-25 17:20:10 +07:00
Joseph DiGiovanni 3c0bc7b645 Make falling platform frame rate independent 2025-02-25 16:52:10 +07:00
34 changed files with 101 additions and 40 deletions

@ -23,6 +23,7 @@ allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]

@ -3,20 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://0odt7cvj574e"
path.bptc="res://.godot/imported/colormap.png-c1bc3c3aabeec406ff4b53328583776a.bptc.ctex"
path="res://.godot/imported/colormap.png-c1bc3c3aabeec406ff4b53328583776a.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
"vram_texture": false
}
[deps]
source_file="res://models/Textures/colormap.png"
dest_files=["res://.godot/imported/colormap.png-c1bc3c3aabeec406ff4b53328583776a.bptc.ctex"]
dest_files=["res://.godot/imported/colormap.png-c1bc3c3aabeec406ff4b53328583776a.ctex"]
[params]
compress/mode=2
compress/mode=0
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -18,6 +18,7 @@ nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true

@ -0,0 +1 @@
uid://dlh7g3g207i7c

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://dy017k58p20sk"]
[ext_resource type="PackedScene" uid="uid://bsrmqj84lksd7" path="res://models/cloud.glb" id="1_pjiy0"]
[ext_resource type="Script" path="res://objects/cloud.gd" id="2_hugjq"]
[ext_resource type="Script" uid="uid://dlh7g3g207i7c" path="res://objects/cloud.gd" id="2_hugjq"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_m5bs8"]
transparency = 1

@ -0,0 +1 @@
uid://0gfgixhikw1y

File diff suppressed because one or more lines are too long

@ -1,19 +1,19 @@
extends Node3D
var falling := false
var gravity := 0.0
var fall_velocity := 0.0
func _process(delta):
func _physics_process(delta):
scale = scale.lerp(Vector3(1, 1, 1), delta * 10) # Animate scale
position.y -= gravity * delta
if falling:
fall_velocity += 15.0 * delta
position.y -= fall_velocity * delta
else:
fall_velocity = 0.0
if position.y < -10:
queue_free() # Remove platform if below threshold
if falling:
gravity += 0.25
func _on_body_entered(_body):
if !falling:

@ -0,0 +1 @@
uid://c1yo3ijh0gjjt

@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://c8up71en5djgm"]
[ext_resource type="PackedScene" uid="uid://biyd6x403gvny" path="res://models/platform-falling.glb" id="1_gkggt"]
[ext_resource type="Script" path="res://objects/platform_falling.gd" id="2_6ganw"]
[ext_resource type="Script" uid="uid://c1yo3ijh0gjjt" path="res://objects/platform_falling.gd" id="2_6ganw"]
[sub_resource type="BoxShape3D" id="BoxShape3D_t551e"]
size = Vector3(2, 0.1, 2)

@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://dl2ed4gkybggf"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_ffboj"]
[ext_resource type="Script" uid="uid://br1k30d32naot" path="res://scripts/player.gd" id="1_ffboj"]
[ext_resource type="PackedScene" uid="uid://c0e27836xgmhi" path="res://objects/character.tscn" id="2_nero3"]
[ext_resource type="Texture2D" uid="uid://8ggihh27mlrr" path="res://sprites/blob_shadow.png" id="3_0c7wt"]
[ext_resource type="ArrayMesh" uid="uid://deu06eho4c74" path="res://meshes/dust.res" id="4_mvhqy"]
@ -41,6 +41,7 @@ modulate = Color(1, 1, 1, 0.705882)
normal_fade = 0.5
[node name="ParticlesTrail" type="CPUParticles3D" parent="."]
physics_interpolation_mode = 2
material_override = SubResource("StandardMaterial3D_q7stj")
cast_shadow = 0
amount = 60

@ -13,7 +13,7 @@ config_version=5
config/name="Starter Kit 3D Platformer"
config/tags=PackedStringArray("starterkit")
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/features=PackedStringArray("4.4", "Forward Plus")
boot_splash/bg_color=Color(0.92549, 0.92549, 0.960784, 1)
boot_splash/image="res://splash-screen.png"
config/icon="res://icon.png"
@ -26,6 +26,8 @@ Audio="*res://scripts/audio.gd"
window/size/viewport_width=1280
window/size/viewport_height=720
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
[editor]
@ -104,6 +106,11 @@ zoom_out={
]
}
[physics]
3d/physics_engine="Jolt Physics"
common/physics_interpolation=true
[rendering]
anti_aliasing/quality/screen_space_aa=1

@ -1,15 +1,16 @@
[gd_scene load_steps=15 format=3 uid="uid://bqqgyqafm7xwp"]
[gd_scene load_steps=16 format=3 uid="uid://bqqgyqafm7xwp"]
[ext_resource type="Environment" uid="uid://bqnqgflivjvue" path="res://scenes/main-environment.tres" id="1_ahusb"]
[ext_resource type="Script" uid="uid://djpme521r3cxe" path="res://scripts/main.gd" id="1_jkv2x"]
[ext_resource type="PackedScene" uid="uid://dl2ed4gkybggf" path="res://objects/player.tscn" id="2_onms2"]
[ext_resource type="Script" path="res://scripts/view.gd" id="5_bg0fr"]
[ext_resource type="Script" uid="uid://bcg2kkbsnttec" path="res://scripts/view.gd" id="5_bg0fr"]
[ext_resource type="PackedScene" uid="uid://cnymdajj1vsqm" path="res://objects/platform.tscn" id="6_sdmev"]
[ext_resource type="PackedScene" uid="uid://rjh4ifidqrfp" path="res://objects/platform_medium.tscn" id="7_ixpj3"]
[ext_resource type="PackedScene" uid="uid://uqr4hswv6d2g" path="res://objects/platform_grass_large_round.tscn" id="8_4oh1e"]
[ext_resource type="PackedScene" uid="uid://c8up71en5djgm" path="res://objects/platform_falling.tscn" id="9_2fnpo"]
[ext_resource type="PackedScene" uid="uid://dtjvjdjl8cs6e" path="res://models/flag.glb" id="9_fw1f5"]
[ext_resource type="PackedScene" uid="uid://dfpisimsgf5ce" path="res://objects/coin.tscn" id="10_fwhys"]
[ext_resource type="Script" path="res://scripts/hud.gd" id="11_apvpm"]
[ext_resource type="Script" uid="uid://bap462su1xjtx" path="res://scripts/hud.gd" id="11_apvpm"]
[ext_resource type="PackedScene" uid="uid://dy017k58p20sk" path="res://objects/cloud.tscn" id="13_drtpy"]
[ext_resource type="Texture2D" uid="uid://cd7oyc56ehkx1" path="res://sprites/coin.png" id="13_jfda3"]
[ext_resource type="FontFile" uid="uid://d0cxd77jybrcn" path="res://fonts/lilita_one_regular.ttf" id="17_tk810"]
@ -21,6 +22,7 @@ shadow_color = Color(0, 0, 0, 0.376471)
shadow_offset = Vector2(2, 2)
[node name="Main" type="Node3D"]
script = ExtResource("1_jkv2x")
[node name="Environment" type="WorldEnvironment" parent="."]
environment = ExtResource("1_ahusb")
@ -135,10 +137,22 @@ transform = Transform3D(-0.422618, -0.694272, 0.582563, 0, 0.642788, 0.766044, -
shadow_enabled = true
shadow_opacity = 0.75
[node name="HUD" type="CanvasLayer" parent="."]
[node name="HUD" type="Control" parent="."]
layout_mode = 3
anchors_preset = 13
anchor_left = 0.5
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -640.0
offset_right = 640.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 8
size_flags_vertical = 8
script = ExtResource("11_apvpm")
[node name="Icon" type="TextureRect" parent="HUD"]
layout_mode = 0
offset_left = 57.0
offset_top = 67.0
offset_right = 313.0
@ -147,19 +161,23 @@ scale = Vector2(0.2, 0.2)
texture = ExtResource("13_jfda3")
[node name="x" type="Label" parent="HUD"]
layout_mode = 0
offset_left = 112.0
offset_top = 64.0
offset_right = 144.0
offset_bottom = 123.0
text = "×"
label_settings = SubResource("LabelSettings_38ys3")
metadata/_edit_use_anchors_ = true
[node name="Coins" type="Label" parent="HUD"]
layout_mode = 0
offset_left = 144.0
offset_top = 64.0
offset_right = 368.0
offset_bottom = 123.0
text = "0"
label_settings = SubResource("LabelSettings_38ys3")
metadata/_edit_use_anchors_ = true
[connection signal="coin_collected" from="Player" to="HUD" method="_on_coin_collected"]

@ -0,0 +1 @@
uid://71e1lia2abr7

@ -1,4 +1,4 @@
extends CanvasLayer
extends Control
func _on_coin_collected(coins):

@ -0,0 +1 @@
uid://bap462su1xjtx

@ -0,0 +1,11 @@
extends Node3D
func _ready() -> void:
if RenderingServer.get_current_rendering_method() == "gl_compatibility":
# Reduce background and sun brightness when using the Compatibility renderer;
# this tries to roughly match the appearance of Forward+.
# This compensates for the different color space and light rendering for lights with shadows enabled.
$Sun.light_energy = 0.24
$Sun.shadow_opacity = 0.85
$Environment.environment.background_energy_multiplier = 0.25

@ -0,0 +1 @@
uid://djpme521r3cxe

@ -93,6 +93,12 @@ func handle_effects(delta):
elif animation.current_animation != "idle":
animation.play("idle", 0.1)
if animation.current_animation == "walk":
animation.speed_scale = speed_factor
else:
animation.speed_scale = 1.0
elif animation.current_animation != "jump":
animation.play("jump", 0.1)

@ -0,0 +1 @@
uid://br1k30d32naot

@ -0,0 +1 @@
uid://bcg2kkbsnttec

@ -3,20 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cd7oyc56ehkx1"
path.s3tc="res://.godot/imported/coin.png-54d5e156d7891d9603a51f76f85b4fd9.s3tc.ctex"
path="res://.godot/imported/coin.png-54d5e156d7891d9603a51f76f85b4fd9.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
"vram_texture": false
}
[deps]
source_file="res://sprites/coin.png"
dest_files=["res://.godot/imported/coin.png-54d5e156d7891d9603a51f76f85b4fd9.s3tc.ctex"]
dest_files=["res://.godot/imported/coin.png-54d5e156d7891d9603a51f76f85b4fd9.ctex"]
[params]
compress/mode=2
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1

@ -3,20 +3,19 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bs6puxrivhkk2"
path.s3tc="res://.godot/imported/particle.png-9c8c1748211b697ea72e6a5d18d7f578.s3tc.ctex"
path="res://.godot/imported/particle.png-9c8c1748211b697ea72e6a5d18d7f578.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
"vram_texture": false
}
[deps]
source_file="res://sprites/particle.png"
dest_files=["res://.godot/imported/particle.png-9c8c1748211b697ea72e6a5d18d7f578.s3tc.ctex"]
dest_files=["res://.godot/imported/particle.png-9c8c1748211b697ea72e6a5d18d7f578.ctex"]
[params]
compress/mode=2
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1