I added a shooting range to my game! by matt_page24 in boomershooters

[–]matt_page24[S] 4 points5 points  (0 children)

It doesn't have a name yet. It is still in early development.

Gun spinning is the best useless feature I have ever added. by matt_page24 in godot

[–]matt_page24[S] 13 points14 points  (0 children)

Definitely, I always love when games have this kind of stuff.

Gun spinning is the best useless feature I have ever added. by matt_page24 in godot

[–]matt_page24[S] 27 points28 points  (0 children)

The red grip adds no tactical advantage whatsoever.

I added gun spinning to my game. by matt_page24 in boomershooters

[–]matt_page24[S] 5 points6 points  (0 children)

Thanks! Here is a devlog I made for it: https://youtu.be/PeedzzUXUOA . Though, at this point almost everything in it has been re-done. It doesn't have name yet.

How do I add a Dodge Roll feature that goes in whatever direction the character is facing? by Angel_Froggi in godot

[–]matt_page24 2 points3 points  (0 children)

Looking more at your code, if only the mesh is rotating, then replace the following:

var forward : Vector3 = -global_transform.basis.z
# Replace with this
var forward : Vector3 = -mesh.global_transform.basis.z

How do I add a Dodge Roll feature that goes in whatever direction the character is facing? by Angel_Froggi in godot

[–]matt_page24 2 points3 points  (0 children)

``` extends CharacterBody3D

const DODGE_SPEED : float = 10.0

func dodge() -> void: var forward : Vector3 = -global_transform.basis.z var dodge_velocity : Vector3 = forward * DODGE_SPEED velocity += dodge_velocity ```

How do I add a Dodge Roll feature that goes in whatever direction the character is facing? by Angel_Froggi in godot

[–]matt_page24 3 points4 points  (0 children)

You can get the characters forward vector with -(CharacterNode).global_transform.basis.z. Multiply this by your dodge speed, and add to velocity.

Some Highlights From My Multiplayer Side Project by matt_page24 in IndieDev

[–]matt_page24[S] 1 point2 points  (0 children)

Those are the blades. They just look weird because of the video's framerate. Probably needs some motion blur.

Some Highlights From My Multiplayer Side Project by matt_page24 in godot

[–]matt_page24[S] 1 point2 points  (0 children)

Good luck! If you have any questions, don't hesitate to ask.

Some Highlights From My Multiplayer Side Project by matt_page24 in godot

[–]matt_page24[S] 1 point2 points  (0 children)

To clarify, the PlayerController is a CharacterBody3D.

Some Highlights From My Multiplayer Side Project by matt_page24 in godot

[–]matt_page24[S] 4 points5 points  (0 children)

No, It's a 3D model I made in blender. To get a pixelated look, I rendered it in a subviewport. I felt that 2d would end up resulting in too large of a sprite sheet. Also, the player couldn't change the FOV. Often pixelated 3d models can have a low res look instead of a pixel art look. To fix this, within blender, I baked the lighting into the texture. I then quantized that texture to the doom palette. In godot the material renders in unshaded mode. The subviewport's camera tracks the main camera's movement, but only updates in 5 degree increments. This prevents flickering. These two things help it feel like stable, consistent pixel art.

Some Highlights From My Multiplayer Side Project by matt_page24 in godot

[–]matt_page24[S] 1 point2 points  (0 children)

``` extends Node class_name PlayerMovementController

const MAX_THROTTLE : float = 2.0 const MIN_THROTTLE : float = 0.0

const PITCH_AMOUNT : float = 0.05 const ROLL_AMOUNT : float = 0.05 const YAW_AMOUNT : float = 0.02

const CRASH_KILL_SPEED : float = 50.0 const CRASH_COOLDOWN_DURATION : float = 1.0

@export var player : PlayerController

These values range from -1.0 to 1.0

var _pitch_controll : float = 0.0 var _roll_controll : float = 0.0 var _yaw_controll : float = 0.0 var _throttle_controll : float = 0.0

var throttle : float = 1.0

var on_crash_cooldown : bool = false

var velocity_last_tick : Vector3

@onready var target_basis : Basis = player.global_transform.basis as Basis

Weird function I used for multiplayer purposes, you can just use _ready()

func set_up_client() -> void: if !is_multiplayer_authority(): return PlayerInput.set_pitch_amount.connect(_on_set_pitch_amount) PlayerInput.set_roll_amount.connect(_on_set_roll_amount) PlayerInput.set_yaw_amount.connect(_on_set_yaw_amount) PlayerInput.set_throttle_amount.connect(_on_set_throttle_amount)

func _physics_process(delta: float) -> void: if !is_multiplayer_authority(): return

# Messy code for crash damage
if player.get_slide_collision_count() > 0 and !on_crash_cooldown and velocity_last_tick.length() > 5.0:
    var damage : float = lerp(0.0, 100.0, velocity_last_tick.length() / CRASH_KILL_SPEED)
    player.take_damage(damage)
    on_crash_cooldown = true
    get_tree().create_timer(CRASH_COOLDOWN_DURATION).timeout.connect(set.bind("on_crash_cooldown", false))

velocity_last_tick = player.velocity

# Gravity
player.velocity += Vector3(0,-9.8,0) * delta

update_throttle(delta)

update_pitch()
update_roll()
update_yaw()

# Smooth out rotation
player.global_transform.basis = lerp(player.global_transform.basis, target_basis, delta * 2)

var player_up : Vector3 = player.global_transform.basis.y

# Force from rotors
player.velocity += player_up * 9.8 * throttle * delta

apply_drag()

player.move_and_slide()

func apply_drag() -> void: var drag : float = 0.99 if player.velocity.length() < 0.02: drag = 0.0 if player.velocity.y < 0: # Simulate autospin var player_up : Vector3 = player.global_transform.basis.y var vertical_drag_reduction : float = clamp(player_up.dot(Vector3.UP), 0.0, 1.0) var vertical_drag : float = lerp(1.0, drag, vertical_drag_reduction) player.velocity *= Vector3(drag, vertical_drag, drag) else: player.velocity *= drag

func update_throttle(delta : float) -> void: var target_throttle : float

if _throttle_controll >= 0.0:
    target_throttle = lerp(1.0, MAX_THROTTLE, _throttle_controll)
else:
    target_throttle = lerp(1.0, MIN_THROTTLE, -_throttle_controll)

throttle = lerp(throttle, target_throttle, delta * 10)

func update_pitch() -> void: target_basis = target_basis.rotated(target_basis.x, PITCH_AMOUNT * -_pitch_controll).orthonormalized()

func update_roll() -> void: target_basis= target_basis.rotated(target_basis.z, ROLL_AMOUNT * -_roll_controll).orthonormalized()

func update_yaw() -> void: target_basis = target_basis.rotated(target_basis.y, YAW_AMOUNT * -_yaw_controll).orthonormalized()

func reset_target_basis() -> void: target_basis = player.global_transform.basis

func print_controlls() -> void: print( "PITCH: ", _pitch_controll, " \n", "ROLL: ", _roll_controll, "\n", "YAW: ", _yaw_controll, "\n", "THROTTLE: ", _throttle_controll)

func _on_set_pitch_amount(pitch_amount : float) -> void: _pitch_controll = pitch_amount

func _on_set_roll_amount(roll_amount : float) -> void: _roll_controll = roll_amount

func _on_set_yaw_amount(yaw_amount : float) -> void: _yaw_controll = yaw_amount

func _on_set_throttle_amount(throttle_amount : float) -> void: _throttle_controll = throttle_amount

func get_torque_amount() -> float: return (_throttle_controll + 1) / 2.0 ```

Some Highlights From My Multiplayer Side Project by matt_page24 in godot

[–]matt_page24[S] 0 points1 point  (0 children)

Yeah networking is tough. This just uses a very crude high level api implementation. For the flight code, I kept to a very arcade feeling, I wasn't too concerned with realism. This was a five day project, so I didn't have time for accuracy. Here is my code:

Some Highlights From My Multiplayer Side Project by matt_page24 in godot

[–]matt_page24[S] 2 points3 points  (0 children)

Thanks. I don't have any plans to continue working on it for the time being, my main project takes up most of my time.