This is an explaination of my project layout for Godot games and other projects. Each folder is visualised in a code block and explained below. Names written in cursive are arbitrary and can be changed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
import os | |
import subprocess | |
def replace_in_file(path, replacements): | |
with open(path, "r") as original: | |
content = original.read() | |
for to_replace in replacements: | |
content = content.replace(to_replace, replacements[to_replace]) | |
with open(path, "w") as modified: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Script to help create new modding projects. | |
Execute this inside the template folder and | |
fill in the form. | |
""" | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
# this script is attached to the main scene | |
var server_api := MultiplayerAPI.new() | |
var client_api := MultiplayerAPI.new() | |
# The actual main scene of the game. It is instanced in the script. | |
export var game_scene : PackedScene |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func _join_duplicates(mesh : Mesh) -> Dictionary: | |
var data_tool := MeshDataTool.new() | |
if not data_tool.create_from_surface(_deindex(mesh), 0) == OK: | |
return {} | |
var old_vertex_ids := {} | |
var ordered_vertices := [] | |
for vertex_id in data_tool.get_vertex_count(): | |
var vertex := data_tool.get_vertex(vertex_id) | |
old_vertex_ids[vertex] = vertex_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
# registered as an autload on both | |
# the dedicated server and on the player | |
var MY_IP | |
var MY_PORT | |
var is_player | |
const DEDICATED_SERVER_PORT = 1234 |