Fresh start: replace with naxIO/netfox-cs-sample foundation
Complete replacement of the tactical-shooter project with the netfox-cs-sample (MIT) — a CS 1.6 inspired multiplayer FPS built with Godot 4 and netfox. ## What's new - Full CS-style gameplay: teams (T/CT), rounds, economy, buy menu - 6 weapons: Knife, Glock, USP, AK-47, M4A1, AWP - Bomb plant/defuse with 2 bombsites - Flashbang & smoke grenades - Proper netfox rollback netcode at 64 tick - Network popup UI for host/join - HUD, crosshair, round timer, scoreboard - All netfox singletons registered as autoloads (works in exported builds) ## Architecture - Listen-server (host from client, no dedicated server binary) - Multiplayer-fps game lives at examples/multiplayer-fps/ - Netfox addons registered as autoloads for exported build compat - Godot 4.7 with Forward+ renderer ## Removed - Old headless-server architecture (client_main, server_main, player.gd, etc.) - Custom netfox bootstrap with ENet fallback - Old ChaffGames FPS template (2,420 lines, 844 KB) - SimulationServer GDExtension stub - Godot-jolt physics (netfox sample uses default Godot physics) - Duplicate weapon_data.gd, anti_cheat.gd, round_manager.gd, etc. - Server browser API Python venv (87 MB) - test_range map and modular assets ## Preserved - Git history - Server config at config/default_server_config.cfg - Windows export preset - Build directory (gitignored) Co-authored-by: naxIO <naxIO@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
@tool
|
||||
class_name Projection3D extends Node3D
|
||||
|
||||
## Whatever 2D nodes are added to Projection3D are projected onto a plane
|
||||
|
||||
## Width of the projection
|
||||
@export var projection_size: Vector2 = Vector2(1.0, 0.66)
|
||||
## Resolution of the projection
|
||||
@export var resolution_size: Vector2 = Vector2(640, 480)
|
||||
## Billboard mode (always face the player)
|
||||
@export var billboard: bool = true
|
||||
## Render in front of everything else
|
||||
@export var always_on_top: bool = false
|
||||
## No lighting or shading
|
||||
@export var disable_shading: bool = true
|
||||
|
||||
## Emitted when the Node is fully constructed
|
||||
signal on_constructed
|
||||
|
||||
var plane_mesh = PlaneMesh.new()
|
||||
var viewport = SubViewport.new()
|
||||
var original_children: Array[Node] = []
|
||||
|
||||
## Set the size of the projection and resolution
|
||||
func set_size(new_projection_size: Vector2, new_resolution_size: Vector2):
|
||||
plane_mesh.size = new_projection_size
|
||||
viewport.size = new_resolution_size
|
||||
|
||||
func _ready():
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
var children = get_children()
|
||||
original_children = children
|
||||
|
||||
var mesh = MeshInstance3D.new()
|
||||
plane_mesh.size = projection_size
|
||||
plane_mesh.orientation = PlaneMesh.FACE_Z
|
||||
mesh.gi_mode = GeometryInstance3D.GI_MODE_DISABLED
|
||||
mesh.cast_shadow = false
|
||||
mesh.mesh = plane_mesh
|
||||
add_child(mesh)
|
||||
|
||||
var viewport_container = SubViewportContainer.new()
|
||||
viewport_container.clip_children = CanvasItem.CLIP_CHILDREN_ONLY
|
||||
viewport_container.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
viewport.size = resolution_size
|
||||
# TODO: Figure out why the progressbar is slightly transparent.
|
||||
# It may not be a material issue but a rendering one (cleared one frame but drawn the next)
|
||||
viewport.transparent_bg = true
|
||||
viewport.disable_3d = true
|
||||
viewport.handle_input_locally = false
|
||||
viewport_container.add_child(viewport)
|
||||
add_child(viewport_container)
|
||||
|
||||
for child in children:
|
||||
child.reparent(viewport)
|
||||
|
||||
var material = StandardMaterial3D.new()
|
||||
material.albedo_texture = viewport.get_texture()
|
||||
material.transparency = BaseMaterial3D.TRANSPARENCY_MAX
|
||||
if billboard:
|
||||
material.billboard_mode = BaseMaterial3D.BILLBOARD_FIXED_Y
|
||||
material.billboard_keep_scale = true
|
||||
if disable_shading:
|
||||
material.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
|
||||
material.disable_ambient_light = true
|
||||
material.no_depth_test = always_on_top
|
||||
plane_mesh.material = material
|
||||
|
||||
on_constructed.emit()
|
||||
Reference in New Issue
Block a user