Godot: The open source game engine

21 readers
1 users here now

A community for discussion and support in development with the Godot game engine.

founded 1 year ago
MODERATORS
651
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/LunalienRay on 2024-09-19 16:15:27+00:00.

652
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/FR3NKD on 2024-09-19 18:08:04+00:00.

653
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/MatMADNESSart on 2024-09-19 16:17:12+00:00.

654
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/JohnJamesGutib on 2024-09-19 16:03:28+00:00.

655
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Outrageous_Affect_69 on 2024-09-19 15:25:01+00:00.

656
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/ArchangelSoftworks on 2024-09-19 13:15:21+00:00.

657
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/sumguy67 on 2024-09-19 13:50:26+00:00.


Background: Some of you may know me as The Shaggy Dev. One of the more popular subjects I talk about on my channel is my coding adventures in the tactical strategy genre, of which there seems to be a lack of gamedev-oriented content compared to other genres, especially for Godot. A common viewer request is to see more code, which I find hard to make work with the YouTube algorithm, or even a sample project of some kind, which I hope to do one day but don't currently have time for. So, I did some digging around and grabbed an old commit (you are all using source control, right?) for my latest project, Unto Deepest Depths, and have now open sourced it!

REPO LINK

What it is: This is early prototype code of the core game loop for Unto Deepest Depths. You can fire up the game, move units around, attack one another, and step through the turn order. It is prototype code, so the usual warnings apply: may be some jank or things you and I both would do differently now, potentially some bugs (though I'm not aware of any), etc. The code is provided as-is, but I do believe this is repo isn't a complete mess and is in good enough shape to act as a learning example.

I hope you'll find it helpful!

658
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/flashag on 2024-09-19 12:22:53+00:00.

659
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Sexy_German_Accent on 2024-09-19 10:09:59+00:00.

660
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Turbulent-Fly-6339 on 2024-09-19 08:22:05+00:00.

661
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/realAzakaela on 2024-09-19 07:58:44+00:00.

662
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Windheart_dev on 2024-09-19 07:26:44+00:00.

663
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Fisher_P on 2024-09-19 01:42:04+00:00.

664
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Lambda-lighthouse on 2024-09-18 20:47:24+00:00.

665
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/VVeston on 2024-09-19 06:36:15+00:00.

666
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/RealDale on 2024-09-19 00:03:37+00:00.

667
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/dh-dev on 2024-09-19 00:01:21+00:00.

668
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Hokome on 2024-09-18 21:13:06+00:00.


The variable name

Name displayed in the inspector

This is the most pointlessly beautiful feature I have ever seen. Or maybe if it makes me so happy it's not useless after all. Whoever implemented this I will give you a hug.

669
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/kingoftheconnorsmcp on 2024-09-18 14:56:14+00:00.

670
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/QuirkyDutchmanGaming on 2024-09-18 20:38:01+00:00.

671
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/toxiccrack on 2024-09-18 12:12:16+00:00.

672
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/SluttyDev on 2024-09-18 18:05:58+00:00.


This is a "Dont feel dumb if you get stuck on something, it happens to everyone know matter how long you've been developing." post.

I was starting a new mobile project and ended up with a weird issue where I couldn't get the hardware to match what was being seen in the editor. The editor showed correct resizing behavior, the hardware did not. I messed with all the aspect ratio and stretch settings but nothing allowed me to fill the background on the mobile device without pinning it to the upper left, which wasn't acceptable.

My usual workaround for this kind of thing is moving the camera to the center of the playfield but didn't work for some reason, I asked all over the internet with no answer (expected, it's a pain to get games loaded onto mobile devices so most people don't look into it). After days of looking for a solution I eventually gave up, switched to Unity, and started building my game in Unity...

...until today when I decided to try once more. I tried parenting my camera to an empty Node2D and moving that around...weird, the camera isn't following the Node2D...why not? After tons of digging through the docs for some setting, and looking at a few YouTube videos I saw it...

...I saw a script attached to my camera...I don't remember why I had a script attached to my camera so I opened it to see what was in said script.

position = $"..".get_viewport().canvas_transform.get_origin()  

Oh...oh my...omfg.....WHY!? What the hell was I doing and why didn't I delete it!?

Needless to say removing that script and doing my center camera thing worked just like expected. I got it building to device with the expected stretching, and I'm moving back to Godot. (Nothing against Unity, Unity 6 is nice but it takes so long to iterate and develop in Unity compared to Godot and my time for gamedev is limited, and I still can't get touches working with Unity's new input system so...)

I've been programming since the 90s. My first games were written in C, C++, SDL, and OpenGL and I'm a professional software developer during the day.

TL;DR: It doesn't matter how much experience you have, sometimes the stupidest little thing will trip you up.

673
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/CroissantDev on 2024-09-18 16:09:17+00:00.

674
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/oWispYo on 2024-09-18 15:02:18+00:00.

675
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/helewrer3 on 2024-09-18 14:57:29+00:00.

view more: ‹ prev next ›