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,55 @@
|
||||
extends Node3D
|
||||
class_name Effect
|
||||
|
||||
@export var duration: float = 8.0
|
||||
@export var winddown_time: float = 2.0
|
||||
|
||||
@onready var animation_player: AnimationPlayer = $AnimationPlayer as AnimationPlayer
|
||||
|
||||
var _apply_tick: int = 0
|
||||
var _cease_tick: int = 0
|
||||
var _destroy_tick: int = 0
|
||||
|
||||
func _ready():
|
||||
if not get_parent() is BrawlerController:
|
||||
push_error("Powerup effect added to non-player!")
|
||||
queue_free()
|
||||
return
|
||||
|
||||
_apply_tick = NetworkTime.tick + 1
|
||||
_cease_tick = _apply_tick + NetworkTime.seconds_to_ticks(duration)
|
||||
_destroy_tick = max(
|
||||
_cease_tick + NetworkTime.seconds_to_ticks(winddown_time),
|
||||
_cease_tick + NetworkRollback.history_limit
|
||||
)
|
||||
|
||||
# Resim from apply tick on the next loop
|
||||
NetworkRollback.before_loop.connect(func(): NetworkRollback.notify_resimulation_start(_apply_tick), CONNECT_ONE_SHOT)
|
||||
|
||||
NetworkRollback.on_process_tick.connect(_rollback_tick)
|
||||
NetworkTime.on_tick.connect(_tick)
|
||||
|
||||
func _rollback_tick(tick):
|
||||
if tick == _apply_tick:
|
||||
_apply()
|
||||
if tick == _cease_tick:
|
||||
_cease()
|
||||
|
||||
func _tick(_delta, tick):
|
||||
if tick == _cease_tick:
|
||||
animation_player.play("death")
|
||||
if tick >= _destroy_tick:
|
||||
queue_free()
|
||||
|
||||
func _apply():
|
||||
pass
|
||||
|
||||
func _cease():
|
||||
pass
|
||||
|
||||
func get_target() -> BrawlerController:
|
||||
return get_parent_node_3d() as BrawlerController
|
||||
|
||||
func is_active() -> bool:
|
||||
var tick = NetworkRollback.tick if NetworkRollback.is_rollback() else NetworkTime.tick
|
||||
return tick >= _apply_tick and tick < _cease_tick
|
||||
@@ -0,0 +1 @@
|
||||
uid://rbj18ues4b75
|
||||
@@ -0,0 +1,11 @@
|
||||
extends Effect
|
||||
|
||||
@export var bonus_mass: float = 1.0
|
||||
|
||||
func _apply():
|
||||
get_target().mass += bonus_mass
|
||||
NetworkRollback.mutate(get_target())
|
||||
|
||||
func _cease():
|
||||
get_target().mass -= bonus_mass
|
||||
NetworkRollback.mutate(get_target())
|
||||
@@ -0,0 +1 @@
|
||||
uid://ku0h0bido33i
|
||||
@@ -0,0 +1,25 @@
|
||||
extends Effect
|
||||
|
||||
@export var area: Area3D
|
||||
@export var strength: float = 4.0
|
||||
|
||||
func _rollback_tick(tick):
|
||||
super._rollback_tick(tick)
|
||||
|
||||
if not is_active():
|
||||
return
|
||||
|
||||
for body in area.get_overlapping_bodies():
|
||||
if not body is BrawlerController or body == get_parent_node_3d():
|
||||
continue
|
||||
|
||||
var brawler := body as BrawlerController
|
||||
var diff: Vector3 = brawler.global_position - global_position
|
||||
var f = clampf(1.0 / (1.0 + diff.length_squared()), 0.0, 1.0)
|
||||
f = clampf(1. - diff.length_squared() / 16., 0., 1.)
|
||||
diff.y = max(0, diff.y)
|
||||
var motion = diff.normalized() * strength * f * NetworkTime.ticktime
|
||||
brawler.shove(motion)
|
||||
|
||||
brawler.register_hit(get_parent_node_3d())
|
||||
NetworkRollback.mutate(brawler)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bbyjqcch0uq2b
|
||||
@@ -0,0 +1,11 @@
|
||||
extends Effect
|
||||
|
||||
@export var bonus: float = 0.2
|
||||
|
||||
func _apply():
|
||||
get_target().speed *= 1 + bonus
|
||||
NetworkRollback.mutate(get_target())
|
||||
|
||||
func _cease():
|
||||
get_target().speed /= 1 + bonus
|
||||
NetworkRollback.mutate(get_target())
|
||||
@@ -0,0 +1 @@
|
||||
uid://byyjui57c0qjx
|
||||
Reference in New Issue
Block a user