diff --git a/.gitignore b/.gitignore index 38098ad..e3a8483 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,16 @@ -# Created by https://www.toptal.com/developers/gitignore/api/godot,visualstudiocode,macos,linux,windows,zig -# Edit at https://www.toptal.com/developers/gitignore?templates=godot,visualstudiocode,macos,linux,windows,zig +# Created by https://www.toptal.com/developers/gitignore/api/blender,visualstudiocode,backup,visualbasic,godot,macos,linux,windows,zig +# Edit at https://www.toptal.com/developers/gitignore?templates=blender,visualstudiocode,backup,visualbasic,godot,macos,linux,windows,zig + +### Backup ### +*.bak +*.gho +*.ori +*.orig +*.tmp + +### Blender ### +# Ignore temporary Blender files. +*.blend[0-9]* ### Godot ### # Godot 4+ specific ignores @@ -66,6 +77,55 @@ Temporary Items # iCloud generated files *.icloud +### VisualBasic ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +*.vbw +*.csi +*.exp +*.lib +*.lvw +*.dca +*.scc +*.exe +*.bat +*.zip +*.old +*.enc +*.key +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + + +# Thumbnails + +# Files that might appear in the root of a volume + +# Directories potentially created on remote AFP share + ### VisualStudioCode ### .vscode/* !.vscode/settings.json @@ -87,9 +147,7 @@ Temporary Items ### Windows ### # Windows thumbnail cache files -Thumbs.db Thumbs.db:encryptable -ehthumbs.db ehthumbs_vista.db # Dump file @@ -99,17 +157,11 @@ ehthumbs_vista.db [Dd]esktop.ini # Recycle Bin used on file shares -$RECYCLE.BIN/ # Windows Installer files -*.cab -*.msi *.msix -*.msm -*.msp # Windows shortcuts -*.lnk ### zig ### # Zig programming language @@ -120,4 +172,4 @@ build/ build-*/ docgen_tmp/ -# End of https://www.toptal.com/developers/gitignore/api/godot,visualstudiocode,macos,linux,windows,zig \ No newline at end of file +# End of https://www.toptal.com/developers/gitignore/api/blender,visualstudiocode,backup,visualbasic,godot,macos,linux,windows,zig \ No newline at end of file diff --git a/client/.gdignore b/client/.gdignore new file mode 100644 index 0000000..d8d0fbb --- /dev/null +++ b/client/.gdignore @@ -0,0 +1 @@ +*.blend \ No newline at end of file diff --git a/client/assets/aidan.png b/client/assets/aidan.png new file mode 100644 index 0000000..f7f69a2 Binary files /dev/null and b/client/assets/aidan.png differ diff --git a/client/assets/aidan.png.import b/client/assets/aidan.png.import new file mode 100644 index 0000000..6c51eac --- /dev/null +++ b/client/assets/aidan.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bx4r78bteh5ir" +path="res://.godot/imported/aidan.png-1c40479ad7899f55d511eb33d01d6a0d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/aidan.png" +dest_files=["res://.godot/imported/aidan.png-1c40479ad7899f55d511eb33d01d6a0d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/client/assets/minecraft-base.blend b/client/assets/minecraft-base.blend new file mode 100644 index 0000000..205be9c Binary files /dev/null and b/client/assets/minecraft-base.blend differ diff --git a/client/assets/zack.mtl b/client/assets/zack.mtl new file mode 100644 index 0000000..a0dfc4f --- /dev/null +++ b/client/assets/zack.mtl @@ -0,0 +1,12 @@ +# Blender 4.3.2 MTL File: 'minecraft-base.blend' +# www.blender.org + +newmtl Material +Ns 250.000000 +Ka 1.000000 1.000000 1.000000 +Kd 0.800000 0.800000 0.800000 +Ks 0.500000 0.500000 0.500000 +Ke 0.000000 0.000000 0.000000 +Ni 1.000000 +d 1.000000 +illum 2 diff --git a/client/assets/zack.obj b/client/assets/zack.obj new file mode 100644 index 0000000..437d4a3 --- /dev/null +++ b/client/assets/zack.obj @@ -0,0 +1,231 @@ +# Blender 4.3.2 +# www.blender.org +mtllib zack.mtl +o MC_Base +v -1.978339 -0.016785 -0.859280 +v -1.978339 -0.017375 -0.459280 +v -2.378339 -0.017375 -0.459280 +v -2.378339 -0.016785 -0.859280 +v -1.978339 1.183215 -0.859280 +v -1.978339 1.182625 -0.459280 +v -2.378339 1.182625 -0.459280 +v -2.378339 1.183215 -0.859280 +v -1.578339 -0.017080 -0.859280 +v -1.578339 -0.017080 -0.459280 +v -1.978339 -0.017080 -0.459280 +v -1.978339 -0.017080 -0.859280 +v -1.578339 1.182920 -0.859280 +v -1.578339 1.182920 -0.459280 +v -1.978339 1.182920 -0.459280 +v -1.978339 1.182920 -0.859280 +v -1.178339 1.182920 -0.859280 +v -1.178339 1.182920 -0.459280 +v -1.578339 1.182920 -0.459280 +v -1.578339 1.182920 -0.859280 +v -1.178339 2.382920 -0.859280 +v -1.178339 2.382920 -0.459280 +v -1.578339 2.382920 -0.459280 +v -1.578339 2.382920 -0.859280 +v -2.378310 1.182920 -0.859280 +v -2.378310 1.182920 -0.459280 +v -2.778310 1.182920 -0.459281 +v -2.778310 1.182920 -0.859281 +v -2.378310 2.382920 -0.859280 +v -2.378310 2.382920 -0.459280 +v -2.778310 2.382920 -0.459281 +v -2.778310 2.382920 -0.859281 +v -1.578339 1.182920 -0.859280 +v -1.578339 1.182920 -0.459280 +v -2.378339 1.182920 -0.459280 +v -2.378339 1.182920 -0.859280 +v -1.578339 2.388221 -0.859280 +v -1.578339 2.388221 -0.459280 +v -2.378339 2.388221 -0.459280 +v -2.378339 2.388221 -0.859280 +v -1.578339 2.382920 -1.059280 +v -1.578339 2.382920 -0.259280 +v -2.378339 2.382920 -0.259280 +v -2.378339 2.382920 -1.059280 +v -1.578339 3.182920 -1.059280 +v -1.578339 3.182920 -0.261393 +v -2.378339 3.182920 -0.261393 +v -2.378339 3.182920 -1.059280 +vn -0.0000 -1.0000 -0.0015 +vn -0.0000 1.0000 0.0015 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 1.0000 +vn -1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 -1.0000 +vn -0.0000 -1.0000 -0.0000 +vn -0.0000 1.0000 -0.0000 +vn -0.0000 0.0026 1.0000 +vt 0.187512 0.500023 +vt 0.187512 0.374977 +vt 0.125012 0.374977 +vt 0.125012 0.500023 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 0.187746 0.000000 +vt 0.187746 0.375000 +vt 0.125246 0.375000 +vt 0.125246 0.000000 +vt 0.124561 -0.000549 +vt 0.124561 0.374451 +vt 0.062732 0.374451 +vt 0.062732 -0.000549 +vt 0.061874 0.004922 +vt 0.061874 0.376259 +vt -0.000626 0.376259 +vt -0.000626 0.004922 +vt 0.188651 0.383819 +vt 0.188651 0.000000 +vt 0.249601 0.000000 +vt 0.249601 0.383819 +vt 0.124655 0.499310 +vt 0.124655 0.375690 +vt 0.187155 0.375690 +vt 0.187155 0.499310 +vt 0.063050 -0.003168 +vt 0.063050 0.374515 +vt 0.000738 0.374515 +vt 0.000738 -0.003168 +vt 0.063295 -0.001283 +vt 0.063128 0.374048 +vt 0.125816 0.374048 +vt 0.125473 -0.001283 +vt 0.187865 0.000000 +vt 0.187865 0.375000 +vt 0.125000 0.375000 +vt 0.125000 0.000000 +vt 0.249510 0.383805 +vt 0.249510 -0.002461 +vt 0.186756 -0.002461 +vt 0.186756 0.383805 +vt 0.750355 0.499991 +vt 0.750355 0.381605 +vt 0.809614 0.381605 +vt 0.809614 0.499991 +vt 0.691701 0.500889 +vt 0.750960 0.500889 +vt 0.750960 0.375889 +vt 0.691701 0.375889 +vt 0.688916 0.000000 +vt 0.688458 0.375000 +vt 0.625958 0.375000 +vt 0.626416 0.000000 +vt 0.688231 -0.001461 +vt 0.688231 0.376461 +vt 0.750731 0.376461 +vt 0.750731 -0.001461 +vt 0.687744 0.000000 +vt 0.687744 0.375000 +vt 0.625000 0.375000 +vt 0.625000 0.000000 +vt 0.876375 0.375000 +vt 0.876375 -0.000000 +vt 0.813631 0.000000 +vt 0.813631 0.375000 +vt 0.809664 0.500038 +vt 0.809664 0.383122 +vt 0.749942 0.383122 +vt 0.749942 0.500038 +vt 0.749894 0.500211 +vt 0.691561 0.500211 +vt 0.691561 0.374789 +vt 0.749894 0.374789 +vt 0.688865 0.000000 +vt 0.688865 0.375000 +vt 0.750173 -0.001759 +vt 0.750173 0.375754 +vt 0.687426 0.375754 +vt 0.687426 -0.001759 +vt 0.688751 0.000061 +vt 0.688751 0.375061 +vt 0.626251 0.375061 +vt 0.626251 0.000061 +vt 0.812655 0.374136 +vt 0.812655 -0.000864 +vt 0.875155 -0.000864 +vt 0.875155 0.374136 +vt 0.309108 0.385289 +vt 0.439542 0.385289 +vt 0.439542 0.500000 +vt 0.309108 0.500000 +vt 0.505829 0.000000 +vt 0.505829 0.375000 +vt 0.438961 0.375000 +vt 0.438961 0.000000 +vt 0.437345 -0.000567 +vt 0.437558 0.386093 +vt 0.312472 0.386093 +vt 0.312259 -0.000567 +vt 0.313234 -0.001453 +vt 0.313234 0.382366 +vt 0.249273 0.382366 +vt 0.249273 -0.001453 +vt 0.500000 0.375000 +vt 0.500000 0.000000 +vt 0.625000 0.375000 +vt 0.250000 0.743519 +vt 0.379630 0.743519 +vt 0.379630 1.000000 +vt 0.250000 1.000000 +vt 0.249385 1.000000 +vt 0.130245 1.001230 +vt 0.130867 0.743077 +vt 0.250007 0.741847 +vt 0.250000 0.500000 +vt 0.250463 0.741149 +vt 0.380129 0.741149 +vt 0.379666 0.500000 +vt 0.250000 0.740667 +vt 0.129958 0.740667 +vt 0.129958 0.500000 +vt 0.129958 0.500000 +vt 0.125000 0.741916 +vt 0.000000 0.741916 +vt -0.000000 0.500000 +vt 0.379630 0.742593 +vt 0.379630 0.500000 +vt 0.500000 0.500000 +vt 0.500000 0.742593 +s 0 +usemtl Material +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 8/6/2 7/7/2 6/8/2 +f 1/9/3 5/10/3 6/11/3 2/12/3 +f 2/13/4 6/14/4 7/15/4 3/16/4 +f 3/17/5 7/18/5 8/19/5 4/20/5 +f 5/21/6 1/22/6 4/23/6 8/24/6 +f 9/25/7 10/26/7 11/27/7 12/28/7 +f 13/5/8 16/6/8 15/7/8 14/8/8 +f 9/29/3 13/30/3 14/31/3 10/32/3 +f 10/33/4 14/34/4 15/35/4 11/36/4 +f 11/37/5 15/38/5 16/39/5 12/40/5 +f 13/41/6 9/42/6 12/43/6 16/44/6 +f 17/45/7 18/46/7 19/47/7 20/48/7 +f 21/49/8 24/50/8 23/51/8 22/52/8 +f 17/53/3 21/54/3 22/55/3 18/56/3 +f 18/57/4 22/58/4 23/59/4 19/60/4 +f 19/61/5 23/62/5 24/63/5 20/64/5 +f 21/65/6 17/66/6 20/67/6 24/68/6 +f 25/69/7 26/70/7 27/71/7 28/72/7 +f 29/73/8 32/74/8 31/75/8 30/76/8 +f 25/77/3 29/78/3 30/63/3 26/64/3 +f 26/79/4 30/80/4 31/81/4 27/82/4 +f 27/83/5 31/84/5 32/85/5 28/86/5 +f 29/87/6 25/88/6 28/89/6 32/90/6 +f 33/5/7 34/6/7 35/7/7 36/8/7 +f 37/91/8 40/92/8 39/93/8 38/94/8 +f 33/95/3 37/96/3 38/97/3 34/98/3 +f 34/99/4 38/100/4 39/101/4 35/102/4 +f 35/103/5 39/104/5 40/105/5 36/106/5 +f 37/107/6 33/108/6 36/64/6 40/109/6 +f 41/110/7 42/111/7 43/112/7 44/113/7 +f 45/114/8 48/115/8 47/116/8 46/117/8 +f 41/118/3 45/119/3 46/120/3 42/121/3 +f 42/118/9 46/122/9 47/123/9 43/124/9 +f 43/125/5 47/126/5 48/127/5 44/128/5 +f 45/129/6 41/130/6 44/131/6 48/132/6 diff --git a/client/assets/zack.obj.import b/client/assets/zack.obj.import new file mode 100644 index 0000000..42abc4d --- /dev/null +++ b/client/assets/zack.obj.import @@ -0,0 +1,22 @@ +[remap] + +importer="wavefront_obj" +importer_version=1 +type="Mesh" +uid="uid://bjpoyqf436huc" +path="res://.godot/imported/zack.obj-e5cc42e06a40e9f17f429b94b6be7c0d.mesh" + +[deps] + +files=["res://.godot/imported/zack.obj-e5cc42e06a40e9f17f429b94b6be7c0d.mesh"] + +source_file="res://assets/zack.obj" +dest_files=["res://.godot/imported/zack.obj-e5cc42e06a40e9f17f429b94b6be7c0d.mesh", "res://.godot/imported/zack.obj-e5cc42e06a40e9f17f429b94b6be7c0d.mesh"] + +[params] + +generate_tangents=true +scale_mesh=Vector3(1, 1, 1) +offset_mesh=Vector3(0, 0, 0) +optimize_mesh=true +force_disable_mesh_compression=false diff --git a/client/assets/zack.png b/client/assets/zack.png new file mode 100644 index 0000000..3103719 Binary files /dev/null and b/client/assets/zack.png differ diff --git a/client/assets/zack.png.import b/client/assets/zack.png.import new file mode 100644 index 0000000..38ca3a6 --- /dev/null +++ b/client/assets/zack.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6ji7dkamlh7c" +path.s3tc="res://.godot/imported/zack.png-74318faf97fac49ca9782014f761fb29.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/zack.png" +dest_files=["res://.godot/imported/zack.png-74318faf97fac49ca9782014f761fb29.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +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=0 diff --git a/client/project.godot b/client/project.godot index f6343d6..b2e4078 100644 --- a/client/project.godot +++ b/client/project.godot @@ -10,7 +10,7 @@ config_version=5 [application] -config/name="Godot 4.3 Starter" +config/name="Legends Online" run/main_scene="res://scenes/TitleScn.tscn" config/features=PackedStringArray("4.3") @@ -22,6 +22,10 @@ GameKit="*res://source/GameKit.gd" window/size/resizable=false +[filesystem] + +import/blender/enabled=false + [input] ui_pause={ diff --git a/client/scenes/GameScn.tscn b/client/scenes/GameScn.tscn index 28e46de..0943465 100644 --- a/client/scenes/GameScn.tscn +++ b/client/scenes/GameScn.tscn @@ -1,20 +1,35 @@ -[gd_scene load_steps=4 format=3 uid="uid://b0fl2hf2lbd0s"] +[gd_scene load_steps=6 format=3 uid="uid://b0fl2hf2lbd0s"] [ext_resource type="Script" path="res://source/GameScn.gd" id="1"] -[ext_resource type="Texture2D" uid="uid://cltqljwt37ib5" path="res://icon.png" id="2_24hj0"] [ext_resource type="PackedScene" uid="uid://baomgr7v1oi8q" path="res://scenes/PauseScn.tscn" id="3_gdh7b"] +[ext_resource type="ArrayMesh" uid="uid://bjpoyqf436huc" path="res://assets/zack.obj" id="3_itwju"] +[ext_resource type="Texture2D" uid="uid://c6ji7dkamlh7c" path="res://assets/zack.png" id="4_o6j42"] -[node name="GameScn" type="Node"] +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_vqte0"] +albedo_texture = ExtResource("4_o6j42") + +[node name="GameScn" type="Node3D"] script = ExtResource("1") -[node name="Sprite2D" type="Sprite2D" parent="."] -position = Vector2(466, 192) -texture = ExtResource("2_24hj0") - [node name="PauseScn" parent="." instance=ExtResource("3_gdh7b")] [node name="Timer" type="Timer" parent="."] wait_time = 3.0 autostart = true +[node name="Skeleton3D" type="Skeleton3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.62414) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Skeleton3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.62414) +mesh = ExtResource("3_itwju") +skeleton = NodePath("../..") +surface_material_override/0 = SubResource("StandardMaterial3D_vqte0") + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 0.999964, 0.00853461, 0, -0.00853461, 0.999964, -2.05695, 2.32707, 2.94945) + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(0.998299, 0.0566293, 0.0138393, 0, 0.237398, -0.971413, -0.0582958, 0.969761, 0.236994, -27.2069, 8.89115, -21.9681) + [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/client/scenes/Player.tscn b/client/scenes/Player.tscn new file mode 100644 index 0000000..88b6979 --- /dev/null +++ b/client/scenes/Player.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://dlred617a071v"] + +[node name="Player" type="Node3D"] diff --git a/client/source/GameScn.gd b/client/source/GameScn.gd index bd80b3d..a4b69a4 100644 --- a/client/source/GameScn.gd +++ b/client/source/GameScn.gd @@ -1,4 +1,4 @@ -extends Node +extends Node3D var client: StreamPeerTCP diff --git a/server/src/main.zig b/server/src/main.zig index 8ff2ed4..5d610ef 100644 --- a/server/src/main.zig +++ b/server/src/main.zig @@ -5,9 +5,12 @@ pub fn main() !void { const address = net.Address.resolveIp("0.0.0.0", 1337) catch { @panic("Failed to bind to address."); }; + var server = address.listen(net.Address.ListenOptions{}) catch unreachable; + std.debug.print("Listening to clients.\n", .{}); defer server.deinit(); + while (true) { const conn = server.accept() catch { std.debug.print("Connection attempt failed.", .{});