Godot

5923 readers
217 users here now

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

[email protected]

Credits

founded 1 year ago
MODERATORS
351
230
Godot Experience Chart (programming.dev)
submitted 1 year ago by mac to c/godot
 
 

Not an oc meme but thought it was funny

Originally posted by Legitimate-Record951

352
353
 
 

Hello Everyone! I apologize if this post isn't as organized as it should be.

Every now and then I try my hand at making a 3D terrain system for my game. It's typically a gdscript that reads coordinates in a json, dict, array, etc and then instances each point as a terrain node/tile (so I can dynamically change each tile). The primary issue I run into is lag with reading this data over and over causing lag and the many instances of nodes themselves potentially causing lag.

I have successfully implemented a render distance before, which I believe fixed the instance count (IRC works good for max 5k objects). The issue that I believe stopped me was the lag from looping over an extremely long dictionary every second (or less). The looping was so when the player moved, it rendered a new group of tiles based on the player location.

It took a long time to ask someone else for help with this because I didn't keep track of my small terrain test projects. I do not have any examples of what I've done before at the moment, so take this as someone asking for help on finding and setting up an easily managable 3D terrain system for Godot 3.5.x.

354
47
submitted 1 year ago* (last edited 1 year ago) by mac to c/godot
 
 
  • Jailbreaker
  • Cruel
  • Fresco
  • Doomsday Paradise
  • Dancing Duelists

The video itself is called final episode but its the final episode of 2023 and not the final episode the creator is making

355
356
 
 

Hi everybody, and especially Godot and shader effects enthusiasts. After the last video, where we delved into the third dimension and created an animated shield around a 3D character, I would once again return to 2D and demonstrate how we can generate an electric discharge effect, which could serve as an obstacle in our space shooter, for example. Let's get started.

357
 
 

I finally found the time and the motivation to get back into game dev and making videos. I trying out a shorter format mostly to document the progression of the project.

Maybe someone find it interesting at least :)

358
 
 

When I start my project (in the editor) I now get a big block of errors, mostly complaining about me overwriting sime Base Godot Classes (which is false)... Has someone here had this issue before? Here are the errors I am getting: https://drive.google.com/file/d/1cb4q9-cVFV0puFPQYgghYpy1hOJys14g/view?usp=drive_link

359
 
 

I didn't like how simple Flow containers were, so I made my own. This one Tweens nodes into place rather than snap them. Video in the readme.

360
22
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/godot
 
 

My background is backend development with Java and Kotlin for the last decade. I have a little bit of HTML/JS experience but I'm not a pro. I would like to build a modern Sierra game, of sorts.

I have no problem investing the time, it just seems overwhelming to jump into and while I've looked at a couple of tutorials, I still seem a bit mystified by the process.

I'm interested in multiplayer design and function twofold, as I'm intrigued at both how to make it work efficiently and the reasons some game companies claim their game servers cost millions a month to run and have to shut them off (looking at you, Gun Media).

361
 
 
362
20
submitted 1 year ago by popcar2 to c/godot
363
10
Making a Clock (catlikecoding.com)
submitted 1 year ago by mac to c/godot
364
 
 

Original post by @[email protected]

https://mastodon.gamedev.place/@luiscarli/111421187557991862

Reposted gif in case its not animating for you

365
 
 

Hello to all fans of Godot Engine and shaders! It seems that I've grown quite fond of visual shaders because I've just recorded another video on this topic. Would you like to use such an animated shield or force field in your game? It's easier than it might seem. Keep watching, I'd be happy to demonstrate it to you.

366
367
 
 
368
26
submitted 1 year ago by Ategon to c/godot
 
 

This is a spot where you can ask anything that you feel doesn't deserve its own post, no matter how small or simple it is!

369
37
Creating GodotOS - Devlog 2 (popcar.bearblog.dev)
submitted 1 year ago by popcar2 to c/godot
 
 

Going into some more depth on making the new features and the troubles I faced along the way, while giving advice to future projects looking to try the same thing.

Also, I announced in the blog post that GodotOS will be open source when it releases! Look forward to it.

370
14
Godot Weekly #15 (godot-weekly.curated.co)
submitted 1 year ago by mac to c/godot
371
 
 

Solution: I removed the else statement from the integrated_forces process and left the two lines from the condition within the process and it fixed it :) Before:

func _integrate_forces(state):
	if Input.is_action_pressed("move_up"):
		state.apply_force(thrust.rotated(rotation))
	if Input.is_action_pressed("strafe_left"):
		state.apply_force(thrust.rotated(rotation + 4.712))
	if Input.is_action_pressed("strafe_right"):
		state.apply_force(thrust.rotated(rotation + 1.5708))
	if Input.is_action_pressed("move_down"):
		state.apply_force((thrust.rotated(rotation) * -1))
	else:
		state.apply_force(Vector2())
		Globals.player_rotation = rotation

After:

func _integrate_forces(state):
	if Input.is_action_pressed("move_up"):
		state.apply_force(thrust.rotated(rotation))
	if Input.is_action_pressed("strafe_left"):
		state.apply_force(thrust.rotated(rotation + 4.712))
	if Input.is_action_pressed("strafe_right"):
		state.apply_force(thrust.rotated(rotation + 1.5708))
	if Input.is_action_pressed("move_down"):
		state.apply_force((thrust.rotated(rotation) * -1))
	state.apply_force(Vector2())
	Globals.player_rotation = rotation

Hey guys, making some progress on this game but having a weird issue and I can't figure out what's happening. I'm instancing a ship scene into the level scene based on player selection. Weapon projectile instancing happens in the level scene. Fixed weapons shoot straight forward and this works fine as I'm moving and rotating until I hold the key to move backward, then all of the shots continue firing in the same direction I was facing when I started holding the key. Video example. This was all working fine prior to instancing the player into the scene. Here's the code I'm working with (please disregard the messy code lol).

level.gd:

extends Node2D
class_name LevelParent

var selected_ship = Globals.player_selected_ship
var format_ship_resource_path = "res://scenes/ships/ship_%s.tscn"
var ship_resource_path = format_ship_resource_path % selected_ship

var laser_scene: PackedScene = preload("res://scenes/weapons/laser.tscn")

func _ready():
	var ship_scene = load(ship_resource_path)
	var ship = ship_scene.instantiate()
	$Player.add_child(ship)
	ship.connect("shoot_fixed_weapon", _shoot_fixed_weapon)
	ship.connect("shoot_gimbal_weapon", _shoot_gimbal_weapon)
	
func _shoot_gimbal_weapon(pos,direction):
	var laser = laser_scene.instantiate() as Area2D
	laser.position = pos
	laser.rotation_degrees = rad_to_deg(direction.angle()) + 90
	laser.direction = direction
	$Projectiles.add_child(laser)
	
func _shoot_fixed_weapon(pos, direction):
	var laser = laser_scene.instantiate() as Area2D
	laser.position = pos
	laser.rotation_degrees = rad_to_deg(Globals.player_rotation)
	Globals.fixed_hardpoint_direction = Vector2(cos(Globals.player_rotation),sin(Globals.player_rotation))
	laser.direction = Globals.fixed_hardpoint_direction.rotated(-1.5708)
	$Projectiles.add_child(laser)

ship_crescent.gd:

extends ShipTemplate


var can_boost: bool = true

#Weapons variables
var can_shoot: bool = true
#hardpoint type should use 0=fixed, 1=gimbal, 2=turret
#later add ability to have mixed hardpoints
var hardpoint_type: int = 0

#Signals
signal shoot_gimbal_weapon(pos,direction)
signal shoot_fixed_weapon(pos,direction)

func _ready():
	Globals.boost_max = boost_max

func _process(delta):
	Globals.player_pos = global_position
	#Build out section to target planetary bodies/NPCs/etc for auto routing
	if Input.is_action_just_pressed("get_cords"):
		print(str(Globals.player_pos))
	#weapon aiming toggle, remove later after hardpoints developed
	if Input.is_action_just_pressed("gimbal_toggle"):
		if hardpoint_type == 0:
			hardpoint_type += 1
		else:
			hardpoint_type -= 1
		
	if can_boost == false:
		_boost_recharge(boost_regen*delta)
		print("boost max: " + str(boost_max))
		print("boost regen: " + str(boost_regen))
		print("global boost level: " + str(Globals.boost_level))
		if Globals.boost_level == boost_max:
			can_boost = true
			print("can boost: Boost recharged!")
	### WEAPONS ###
	#Remove LaserTimer when weapon modules are set up
	
	#Fixed weapon code
	var player_direction = (Globals.player_pos - $FixedHardpointDirection.position).normalized()
	if Input.is_action_just_pressed("fire_primary") and can_shoot and Globals.laser_ammo > 0 and hardpoint_type == 0:
		Globals.laser_ammo -= 1
		var hardpoint_positions = $HardpointPositions.get_children()
		can_shoot = false
		$Timers/LaserTimer.start()
		for i in hardpoint_positions:
			print("ship shot fired")
			shoot_fixed_weapon.emit(i.global_position, player_direction)
	#Gimbal weapon code
	var gimbal_direction = (get_global_mouse_position() - position).normalized()
	if Input.is_action_just_pressed("fire_primary") and can_shoot and Globals.laser_ammo > 0 and hardpoint_type == 1:
		Globals.laser_ammo -= 1
		var hardpoint_positions = $HardpointPositions.get_children()
		can_shoot = false
		$Timers/LaserTimer.start()
		for i in hardpoint_positions:
			shoot_gimbal_weapon.emit(i.global_position, gimbal_direction)
	#Add turret (auto aim system) later

#Spaceflight physics based controls
func _integrate_forces(state):
	if Input.is_action_pressed("move_up"):
		state.apply_force(thrust.rotated(rotation))
	if Input.is_action_pressed("strafe_left"):
		state.apply_force(thrust.rotated(rotation + 4.712))
	if Input.is_action_pressed("strafe_right"):
		state.apply_force(thrust.rotated(rotation + 1.5708))
	if Input.is_action_pressed("move_down"):
		state.apply_force((thrust.rotated(rotation) * -1))
	else:
		state.apply_force(Vector2())
		Globals.player_rotation = rotation
	#REWORK boost mechanic. button hold (gradual) vs press (instant), increase cooldown, adjust boost length, add fuel/special requirements for use
	if Input.is_action_just_pressed("boost") and can_boost:
		can_boost = false
		Globals.boost_level = 0
		#$Timers/BoostRecharge.start()
		state.apply_impulse((thrust.rotated(rotation) * 2))
	var rotation_direction = 0
	if Input.is_action_pressed("turn_right"):
		rotation_direction += 1
	if Input.is_action_pressed("turn_left"):
		rotation_direction -= 1
	state.apply_torque(rotation_direction * torque)

#modify later to remove globals. Base boost data on ship equipment
func _boost_recharge(recharge_rate):
	Globals.boost_level = clamp(Globals.boost_level + recharge_rate, 0, boost_max)
	print(Globals.boost_level)

#Timer timeout functions
func _on_boost_timer_timeout():
	print("boost depleted")

func _on_boost_recharge_timeout():
	print("boost timer recharged!")
	can_boost = true

func _on_laser_timer_timeout():
	can_shoot = true
372
15
submitted 1 year ago by mac to c/godot
373
 
 

Hey everybody, what’s up? In this video, I will demonstrate how to harness the high performance of a GPU for generating fractal patterns and transforming them in real-time, which can be used for creating original effects in your game with minimal effort.

Many people, when they hear the term "fractal", automatically envision the Mandelbrot set. It's not surprising because it is one of the most famous fractal shapes and has gradually become practically synonymous with chaos theory. But what is it exactly, and how do we generate it?

374
 
 

Jam link: https://itch.io/jam/godot-wild-jam-63

Theme is Cats!

375
31
submitted 1 year ago* (last edited 1 year ago) by mac to c/godot
 
 

The original video creator has been running something where people vote on their favorite of the 5 in the comments. Figure it would be fun to run something similar here within programming.dev

I put the 5 games below along with some information on each if you dont want to watch the video right now

view more: ‹ prev next ›