How to Build an RTS Inspired Base Building System in Godot!

preview_player
Показать описание
Subscribe and learn more from me about Game Development and Programming!

In this video, we build out our interaction system allowing us to pick up and throw objects. We also set up a way to open up doors and distract our enemies!

RESOURCES
File Assets

BE MY FRIEND:

TIMESTAMPS
00:00:00 – Start
00:01:05 – Getting Into Godot Setting the Scene
00:03:13 – Creating Our Camera System
00:06:32 – Setting Up Camera Mouse Edge Movement
00:18:55 – Insert Camera System Here
00:19:02 – Building Spawning System
00:22:50 – Setting Up Our Build Manager
00:24:29 – ADD Moment: How To Set Up the Assets
00:26:46 – Back to the Building System
00:47:52 – One Way To Fix Clicking Though the UI
00:56:29 – Fixing Our Spawning Issue
01:00:45 – Adding in the Ability To Spawn an Actor With Our Build System
01:03:26 – Creating Our Actor To Spawn
01:20:06 – Testing Our Spawning Actor System
01:26:33 – Making Our Actors Easier To Debug
01:29:20 – Rebaking Our NavMesh at Runtime
01:31:57 – Moving Our Spawn Point Forward
01:33:00 – Disabiling Collision for Our Mouse Object
01:35:36 – Keeping Track of Our Resources
01:40:23 – Abstracting Our Code To Make It Flexable
01:42:19 – Creating Our Resource Charging System
01:45:55 – Making Our Resource Gathering Generic
01:48:30 – Getting the Nearest Resource to Our Actor
01:50:47 – Back to Making Our Stuff Generic
01:53:47 – Setting Up Some Interface Elements
01:58:38 – Marker 26
02:00:49 – Fixing Our Stockpile Bug
02:03:17 – Showing Off Our Generic System
02:06:42 – Filling Our Our Generic System
02:14:00 – Adding in Population Cost
02:16:17 – Creating A Happiness System
02:29:07 – Fixing a small stockpile bug
02:30:14 – Creating our Happiness System
02:30:43 – Setting Up Our Population Spawing System
02:43:34 – Removing SubChildren Of Objects
02:54:24 – Fixing our Unselect system and Adding Deleting
02:57:10 – Lets Destory Some Buildings
03:06:58 – Fixing our current Spawnable when Destorying
03:08:06 – Building a happiness System
03:19:31 – Setting Up Food Production
03:22:20 – Getting Food Prouction working
03:32:35 – Testing and Fixing some index bugs
03:40:34 – Adding in the Ability to Rotate Objects (yes it took me this long to realize)
03:42:47 – Building our Economy Tab
03:47:21 – Creating a MarketPlace
04:01:35 – Outro Lessons Learned!

MUSIC
Music provided by TheRelaxedMovement.

HASHTAGS:
#godot #rts #framework #gamedev

ABOUT MY CHANNEL:
I've been a software developer for over 7 years. I've worked in the game industry for 3 of those years. This channel is used for news on the gaming\programming industry and for tutorials for game\programming development.

How to Build an RTS Inspired Base Building System in Godot!
Рекомендации по теме
Комментарии
Автор

this is one of the best tutorials I ever watched! To be honest, I never watched an entire 4h tutorial. I could do pretty much anything in godot 4, but the destroying system, and there is a bug that if the workers don't go directly to the stockpile's SpawnPoint they may get stuck, maybe it is easier with an area. Apart from that, I expect the continuation of this! Greetings from Argentina

francopiadora
Автор

It took me a couple of days but i finally completed the entire tutorial, and adjusted for Godot 4. The only thing i got stuck with was the destroy function, i got a few errors regarding *var result = space_state.intersect_ray(from, to [self])* but i just commented out the entire destroy function and i will fix it later. Thank you for this tutorial! I found the pace to be perfect, and i was able to follow along and pause when needed. Felt like a lecture in university (but more fun).
Now it's time to finally replace all my placeholder models with my own. I am a 3D artist so this programming stuff is alien language to me. For some reason it never really sticks. The amount of joy i get when i see it working is unexplainable!

SpaceMango
Автор

you are a beacon in the Godot community thank you so much for your contributions

qjotx
Автор

Always in-depth and technical tutorials, Thank you!

childlearningclub
Автор

Looked for one of these for ages, you are the Godot king 👑

paulasiimwe
Автор

Hey. I just wanted to say thanks for this. It is really awesome that you made this tutorial, provided all of the files and took the time to timestamp each step. I am super appreciative.

OhBoy_IWasUsingMyRealName
Автор

This tutorial is simply great!! Many thanks :)

marcozanella
Автор

I've always wanted to make a command and conquer type game. This will get me started. Thank you for this tutorial. I love this channel!!

semtx
Автор

I'm working on a 3d game that's isometric with the locked camera angle, so this will undoubtedly be insanely helpful. Thanks a ton!

AatamiKankurin
Автор

This is amazing. Especially for a noob like me 🙏 thanks so much for the time and effort you put in.

TheEshanDas
Автор

Help for Godot 4 users

instance() is now instantiate, using GEN_EDIT_STATE_DISABLED, as its the only functioning option for out of editor builds.
Spatial is now Node3D, but you don't need this as he is doing a Plane intersection, the plane is made using a normal vector pointing up, which defines a plane like your playing area, the second parameter is just the "height" of the plane, setting it to 0 makes the plane exist in y position 0, set it 5 its in height 5, so you don't need a random y value of transform, just set it the float you want.
Translation ref has been removed, just use position or global_position.

adding more as I watch the whole thing.

MySuperSecretName-lhmh
Автор

18:50 For Godot 4, seems to be a lot simpler with the "position" option instead of confusing translations. I got a similar result using this for 4 with constants for camera speed and zoom speed, Camera3D being the child node in CameraRig, and this as CameraRig's script. All movement done to Camera3D, not the Rig, except for rotation:
extends Node3D
const CAMSPEED = 0.5
const ZOOMSPEED = 1
func _process(_delta):
var viewportSize = get_viewport().size
var mousePos =
if mousePos.x < 10:
$Camera3D.position.x -= CAMSPEED
elif mousePos.x > viewportSize.x - 10:
$Camera3D.position.x += CAMSPEED
if mousePos.y < 10:
$Camera3D.position.z -= CAMSPEED
elif mousePos.y > viewportSize.y - 10:
$Camera3D.position.z += CAMSPEED
if
rotation_degrees += Vector3(0, 90, 0)
if
if > 10:
$Camera3D.position.y -= ZOOMSPEED
if
if < 50:
$Camera3D.position.y += ZOOMSPEED


Rotating the full RIG with its attached Camera3D child node keeps the x and z movement correct when a rotation is done.

BurnLikeAFlame
Автор

I started prototyping an RTS about a week ago, and here you are with a video FOR ME. I appreciate you.

joshuamorris
Автор

This is going to be so great! Thank you.
Congrats, you are the only tuber that is making anything close to this tutorial. I'll be using Godot 4 so I'll try and leave comments if i see any changes for others. (Subscribed)

GaryParkin
Автор

Excellent video. Not just about designing building system, but also the godot game creation pattern in general.

alzzaMain
Автор

Really need a 4.0 version of this tutorial. So far as I can see, you're the top1 Godot tutorial maker, so much details you have provided, very very helpful.

WeirdGoat
Автор

I was building an very similar system today. Gonna “borrow” some ideas. 😂

rluders
Автор

Really awesome, I see a lot of things with tmp/temp in it. Is that because you haven't thought of a better name or because there is for sure a better way to do/implement what is named tmp/temp.

nicholasmaniccia
Автор

Thanks for your tutoriel.
He inspinring me a lot for my "tycoon" game.
Wouldn't it be better to put object spawn processing and moves in _physics_process?
I had a lot of trouble solving a bug on my game where when I tried to spawn many objects quickly some would appear in the Area of the other.
While searching, I read that _physics_process was strongly linked to all things collision and setting the spawn of my objects and movements solved the problem.

maxouloik
Автор

Can you please update the project to 4.x, the project gives several errors when trying to load it on new godot version.

prashannathapamagar