commit c3178cc1e2218ac3d310071d80b44e25f76dd1c0 Author: Christian Lincoln Date: Sun Mar 15 15:51:10 2026 +0000 Initial; Added: notes, part.tscn, *.gd glue scripts diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8734e9d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "addons/lua-gdextension"] + path = addons/lua-gdextension + url = https://github.com/gilzoide/lua-gdextension diff --git a/addons/lua-gdextension b/addons/lua-gdextension new file mode 160000 index 0000000..1334422 --- /dev/null +++ b/addons/lua-gdextension @@ -0,0 +1 @@ +Subproject commit 1334422d98908f876f9f86cb70f980326cfef3e0 diff --git a/assembly.gd b/assembly.gd new file mode 100644 index 0000000..2e07382 --- /dev/null +++ b/assembly.gd @@ -0,0 +1,13 @@ +# A rigid body +class_name ConAssembly extends Node + +@export var root: Node3D + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/assembly.gd.uid b/assembly.gd.uid new file mode 100644 index 0000000..a851a6b --- /dev/null +++ b/assembly.gd.uid @@ -0,0 +1 @@ +uid://bk1256xuikpvw diff --git a/construct/Part.tscn b/construct/Part.tscn new file mode 100644 index 0000000..bd162b6 --- /dev/null +++ b/construct/Part.tscn @@ -0,0 +1,22 @@ +[gd_scene format=3 uid="uid://8hxdrpjep2v0"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_ic8ju"] +size = Vector3(0.4, 0.2, 0.8) + +[sub_resource type="BoxMesh" id="BoxMesh_1pepr"] +size = Vector3(0.4, 0.2, 0.8) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_imbph"] +albedo_color = Color(0.41981313, 0.41981313, 0.4198131, 1) +stencil_flags = 2 +stencil_outline_thickness = 0.005 + +[node name="Part" type="RigidBody3D" unique_id=1269041573] + +[node name="Collider" type="CollisionShape3D" parent="." unique_id=1104384078] +transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0) +shape = SubResource("BoxShape3D_ic8ju") + +[node name="Mesh" type="MeshInstance3D" parent="." unique_id=1713002208] +mesh = SubResource("BoxMesh_1pepr") +surface_material_override/0 = SubResource("StandardMaterial3D_imbph") diff --git a/construct/main.tscn b/construct/main.tscn new file mode 100644 index 0000000..28645ee --- /dev/null +++ b/construct/main.tscn @@ -0,0 +1,64 @@ +[gd_scene format=3 uid="uid://xn8b5tekt44y"] + +[ext_resource type="Script" uid="uid://bloy37vgtwo5p" path="res://construct/scripts/game.gd" id="1_wgmnp"] +[ext_resource type="Script" uid="uid://ltg0gj54grd0" path="res://construct/scripts/world.gd" id="2_piwts"] +[ext_resource type="Script" uid="uid://bdhw85x3sfbr8" path="res://construct/scripts/storage.gd" id="3_4rhie"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_d51dm"] +sky_top_color = Color(0.32156864, 0.45490196, 0.64705884, 1) +sky_horizon_color = Color(0.5617817, 0.6774191, 0.71705645, 1) +sky_curve = 0.10606603 +sky_energy_multiplier = 1.2 +ground_bottom_color = Color(0.2239944, 0.33232817, 0.4919958, 1) +ground_horizon_color = Color(0.56078434, 0.6784314, 0.7176471, 1) +ground_curve = 0.10928374 +ground_energy_multiplier = 1.2 +sun_angle_max = 43.07 +sun_curve = 0.19118495 + +[sub_resource type="Sky" id="Sky_vwgih"] +sky_material = SubResource("ProceduralSkyMaterial_d51dm") + +[sub_resource type="Environment" id="Environment_nnel6"] +background_mode = 2 +sky = SubResource("Sky_vwgih") +glow_enabled = true +fog_sun_scatter = 0.2 + +[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_koolx"] + +[sub_resource type="GDScript" id="GDScript_koolx"] +script/source = "extends Node +# Responsible for executing connected scripts in the game. +class_name ConExecutor + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +func register_script(script: ConScript) -> void: + pass +" + +[node name="Game" type="Node3D" unique_id=571143091] +script = ExtResource("1_wgmnp") + +[node name="Workspace" type="Node3D" parent="." unique_id=520106173] +script = ExtResource("2_piwts") + +[node name="Environment" type="WorldEnvironment" parent="Workspace" unique_id=1958594174] +environment = SubResource("Environment_nnel6") + +[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="Workspace" unique_id=1628909564] +replication_config = SubResource("SceneReplicationConfig_koolx") + +[node name="Storage" type="Node3D" parent="." unique_id=1587339715] +script = ExtResource("3_4rhie") + +[node name="Executor" type="Node" parent="." unique_id=202334534] +script = SubResource("GDScript_koolx") diff --git a/construct/scripts/executor.gd b/construct/scripts/executor.gd new file mode 100644 index 0000000..1d11c26 --- /dev/null +++ b/construct/scripts/executor.gd @@ -0,0 +1,54 @@ +# Responsible for executing connected scripts in the game. +class_name ConExecutor extends Node + +class Event: + # List of functions that are waiting on this event to be called + var listening: Array[LuaFunction] + # List of coroutines that are waiting on this event to be resumed + var waiting: Array[LuaCoroutine] + + func _init() -> void: + listening = [] + waiting = [] + + func unlisten(callback: LuaFunction) -> void: + listening.remove_at(listening.find(callback)) + + func listen(callback: LuaFunction) -> void: + + + func fire() -> void: + for i in range(listening.size()): + var item = listening[i] + for i in range(waiting.size()): + var item = waiting[i] + +var lua: LuaState + +func setup() -> void: + lua = LuaState.new() + # Open only the necessary set of libraries + lua.open_libraries( + LuaState.Library.LUA_BASE | + LuaState.Library.LUA_BIT32 | + LuaState.Library.LUA_COROUTINE | + LuaState.Library.LUA_MATH | + LuaState.Library.LUA_STRING | + LuaState.Library.LUA_UTF8 | + LuaState.Library.LUA_TABLE + ) + + lua.globals.add_user_signal() + +func register_script(script: ConScript) -> void: + lua.do_string(script.source) + +func callback_loop() -> void: + pass + + +func _ready() -> void: + setup() + +func _process(delta: float) -> void: + callback_loop() diff --git a/construct/scripts/executor.gd.uid b/construct/scripts/executor.gd.uid new file mode 100644 index 0000000..56339eb --- /dev/null +++ b/construct/scripts/executor.gd.uid @@ -0,0 +1 @@ +uid://bwoy08qh5q473 diff --git a/construct/scripts/game.gd b/construct/scripts/game.gd new file mode 100644 index 0000000..760777d --- /dev/null +++ b/construct/scripts/game.gd @@ -0,0 +1,10 @@ +extends Node3D + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/construct/scripts/game.gd.uid b/construct/scripts/game.gd.uid new file mode 100644 index 0000000..c7d0e02 --- /dev/null +++ b/construct/scripts/game.gd.uid @@ -0,0 +1 @@ +uid://bloy37vgtwo5p diff --git a/construct/scripts/instance.gd b/construct/scripts/instance.gd new file mode 100644 index 0000000..684494b --- /dev/null +++ b/construct/scripts/instance.gd @@ -0,0 +1,10 @@ +class_name ConInstance extends Node + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/construct/scripts/instance.gd.uid b/construct/scripts/instance.gd.uid new file mode 100644 index 0000000..c9b6dee --- /dev/null +++ b/construct/scripts/instance.gd.uid @@ -0,0 +1 @@ +uid://t4ye8ubxu17t diff --git a/construct/scripts/script.gd b/construct/scripts/script.gd new file mode 100644 index 0000000..f99eea2 --- /dev/null +++ b/construct/scripts/script.gd @@ -0,0 +1,7 @@ +class_name ConScript extends Node + +@export var executor: ConExecutor; +@export var source: String; + +func _ready() -> void: + executor.register_script(self) diff --git a/construct/scripts/script.gd.uid b/construct/scripts/script.gd.uid new file mode 100644 index 0000000..d05c561 --- /dev/null +++ b/construct/scripts/script.gd.uid @@ -0,0 +1 @@ +uid://cvap3dddmwr8q diff --git a/construct/scripts/storage.gd b/construct/scripts/storage.gd new file mode 100644 index 0000000..d4554c9 --- /dev/null +++ b/construct/scripts/storage.gd @@ -0,0 +1,11 @@ +extends Node3D + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/construct/scripts/storage.gd.uid b/construct/scripts/storage.gd.uid new file mode 100644 index 0000000..3f249a5 --- /dev/null +++ b/construct/scripts/storage.gd.uid @@ -0,0 +1 @@ +uid://bdhw85x3sfbr8 diff --git a/construct/scripts/world.gd b/construct/scripts/world.gd new file mode 100644 index 0000000..760777d --- /dev/null +++ b/construct/scripts/world.gd @@ -0,0 +1,10 @@ +extends Node3D + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass diff --git a/construct/scripts/world.gd.uid b/construct/scripts/world.gd.uid new file mode 100644 index 0000000..a69ddd9 --- /dev/null +++ b/construct/scripts/world.gd.uid @@ -0,0 +1 @@ +uid://ltg0gj54grd0 diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..c6bbb7d --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..e51d118 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b3xxykeq0m65c" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..7df00fa --- /dev/null +++ b/notes.txt @@ -0,0 +1,21 @@ +Thoughts on the API: +It needs to satisfy the following: + - Being mostly backwards compatible with the old roblox code, maybe using an _ to translate? Also very automatic in nature, networking should just work. + - Being 'forwards' compatible with a potential bevy implementation. so all 'objects' need to be fully abstracted. anyways. Being kind to a nellie style implementation. So lots of OOP and abstraction as above. + - Allowing access to a lot of weird stuff we didn't have before. (consider the mesh systems) which also means we will need access to some 'services' (that we can expose again through _G so it swings both ways...) + + Maybe it would make more sense to have a sort of ID or name for every single type of thing in the + api, or 'scene'. That is quite weird, though it would mean that vehicle objects and their + properties could also be encoded. Maybe if each vehicle object was a sort of 'package' idk. + Although the game code does trace through objects. + +Part(){ + +} + +Accessory Ideas!: +- Different body types: floating limbs +- Dunce hat +- Wizard outfit +- Long coat outfit +- Combinable faces diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..76b142d --- /dev/null +++ b/project.godot @@ -0,0 +1,29 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="construct" +config/features=PackedStringArray("4.6", "GL Compatibility") +config/icon="res://icon.svg" + +[editor_plugins] + +enabled=PackedStringArray("res://addons/lua-gdextension/plugin.cfg") + +[physics] + +3d/physics_engine="Jolt Physics" + +[rendering] + +rendering_device/driver.windows="d3d12" +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"