How to make a Doom clone in Godot in 13 minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

You just jump right in and do it. I love tutorials like this without the extra bullshit everywhere.

Thank you!

👍︎︎ 37 👤︎︎ u/crilen 📅︎︎ Nov 10 2018 🗫︎ replies

One thing I recommend. Please put the final product on https://godotengine.org/asset-library/asset That way people can just start with a doom template as well and go through your tutorial to get the bits they need when they want to modify it. Or someone like me who has a lot of UE4 experience would love something like this as a template over a tutorial to get started right away.

👍︎︎ 16 👤︎︎ u/MJBrune 📅︎︎ Nov 11 2018 🗫︎ replies

Nice!

I am impressed that you could stay that focused for 13 minutes. Some nice techniques in there.

How were you pasting different code chunks in there? Or was that video editing?

👍︎︎ 6 👤︎︎ u/NavinRJohnson 📅︎︎ Nov 11 2018 🗫︎ replies

This is awesome but I wish you would type the code out and explain the logic behind the code more thoroughly rather than copy and only summarize what it does.

That being said, I still think your tutorials are among the best for those of us who already have Godot experience since we can keep up with what's going on.

👍︎︎ 3 👤︎︎ u/Laudunix 📅︎︎ Nov 11 2018 🗫︎ replies

How can I like this twice?

👍︎︎ 3 👤︎︎ u/Nearly_Enjoyable 📅︎︎ Nov 11 2018 🗫︎ replies

did you report that dpi issue to https://github.com/godotengine/godot/issues ?

👍︎︎ 2 👤︎︎ u/SaltTM 📅︎︎ Nov 11 2018 🗫︎ replies
Captions
start with an empty project here I'll add in a kinematic body and then collusion shape as a child will set a capsule shape to it and then we're going to rotate it because they have a horizontal by default rotated by 90 on the x-axis and then let's see we need to add in a ray cast add in a animation player add in a canvas layer and then there's a child to that I'm in a control and also texture rect and then to the child to the control add a spray just a regular spray now for the raycast enable it set the cast to two zero zero negative 2000 leave negative on the z-axis is considered forward and Godot and then for the control here set the anchor to be 0.5 on the left and one on the top and then I'll set the other ones correctly and then set all the margins to zero and that will Center it and move it to the bottom of the screen and then for the texture act I'm going to Center it for all of them we are at the margin and let's see drag in the image assets here so for any texture act I'm when you put in the crosshair image and then it's not centered yet what I need to do is on margin the left negative 16 which is half the size of the texture and top negative 16 so now it's centered so if I go to the sprite here I'm going to add the FPS shooter the gun sprites here now here's something cool I found with animation you can see vertical frames has one horizontal it has force and I can just do that and cycle between frames with this here it's pretty cool so now I need to move this so it's at the bottom the screen so half of this I believe is 256 let me see move it up 256 so I'm going to negative 256 so it's sprayed aligned with the bottom of the screen and then I'm going to move it to the right a little ways that seems good about 200 there so you can just move mode drag things hold shift to drag along one axis control Z to undo that so now animation I'm going to create a shoot animation here I'm gonna set the steps to 0.15 and the link will be point six now if I go down to the sprite here I can set the animation itself so it's at the first frame I wanted to zoom in here scroll with hold control the scroll wheel so I want the first frame to be one so just create a keyframe there and then once I do that it should automatically move me forward four and then the last one I want it to be zero so it starts over again oh and you have to close a key so now if I click start I don't want to loop this on I want to stop at the end so you'll see that it plays through the shoot animation and then stops so I can use that to track whether or not we can shoot and let's see go back to the player here and oh I need to add a camera of course so add this as a node and set current on it I'm gonna rename this player and save this scene and let's add our script so for our constants I remove speed remove it four units per second a unit in 3d is about a meter you can think of the math sensitivity that controls just how much your mouth affects things animation player reference and friends the rate caster then in ready I'm going to set the mouse mode to captured so it's invisible and stuck on the center of the screen which is kind of what you want for an FPS and then wait one frame and then call it set player on all the enemies so this is just code for my top-down shooter from before input get if we move the mouse get how much we moved it on the horizontal multiply that times the mouse sensitivity and then subtract that from the y axis of rotation we're using degrees instead of radians because you can get a little more control that way and in process since we're locking the mouse center of the screen I want an easy way to exit the games I just I have an exit button that quits and a restart button that a brief starts the scene also it's a next full input we're gonna have move 3d move vector if we move forward we're gonna subtract from z backwards see and left and right so next let's add in these buttons real quick but input map here move forwards and backwards right shoot exit and restart and w-4 forwards s4 backwards pay for left d4 right and mouse button left button for escape for exit and r4 restart and now let's do our actual movement toad here so normalize the move vectors so we don't move faster diagonally and then rotate it along the y axis by our current rotation and then move at move speed per second and then we checked if we press to shoot and the animation player isn't playing anything then called plays shoot animation and then see if there's a Collider that the cast is hitting and if it has the kill method won't kill and then finally come down and here and have our own kill method that just restarts the scene that's what restart uses to save and let's make a new scene so for this one do kinematic body collision shape and recast and animation player and we're gonna add in a sprite 3d so the collision shape will do another capsule and rotate that again 90 on the x-axis set the raycast to enable don't worry about casts - and then spray 3d drag on the monster straits here animations - vertical frames 5 on the horizontal and then animation player let's create a block animation and set the steps there Emily it's going to be 0.6 and then let's go just right here at the first frame create that so you go back to zero so your septum zero it's kind of weird on the first bum so at the preview for the first one now it moves properly three and four so I able looping there hit play you can see it does the run animation there and now I want to create a die animation here same amount of steps and then the length is point seventy five and I don't want to loop this let's go I believe it's five is the first one yeah five is the first so read that track and then move along here there we go so if I click to start the beginning you can see a place of die animation pretty good now we need to in sprite 3d go down to geometry here add a new spatial material let's go to that gonna go to Flags transparent and unshaded set those to true and then we need to go to see figure out what this one is parameters and billboard mode set it to why build Lord so now the sprite will face the camera at all times and now we'll go let's name this zombie also and add a script to it and we'll move at three units per second so a little slower than the player I've references to a ray cast animation player have variables for the player and another one checking if it's dead or not then the star ready we'll play a walk animation and then add it to the group zombies so over here you see you're waiting to all the zombies get out into the group before you call a set player method and just add a set player method we'll quit at the end so and then we go into physics process so just check if we're dead don't do anything if the player isn't set don't do anything now we're gonna get any vector pointing to the player so in 3d use translation instead of position so just get the vector binding to the player here and then normalize that and then set our ray cast cast to to be that vector a little bit longer so it's always pointing right at the player and then we just move along that vector and our moves feet per second and then we just check if that ray cast is colliding get the collider for the raycast and just see if it's not null and if it's the player and called a kill method if it's the player then our own kill method set dead to true disable the collision and play the animation and die so save this scene zombie create one more scene spatial node here and then just put an instance of the player here and then instance zombie and then I can zoom out a little here so if I grab this little green box here I can move it horizontally which is what I want and I can also if you go up here it shows you I can go to top view or I can just hit seven on my keypad and then just move this around duplicate with control D so they are implicated a bunch of them the players there I should you can put like something as a placeholder your 3d object or something in the player so you can see it better and just save this scene let's click play select our main scene to be world and then press our to restart if they touch me the game restarts and I could escape the game closes now some something sure I've been noticing this I have a high DPI monitor and that setting northa sirens outside if you have a high DPI monitor and you're setting your input a mouse mode to captured its gonna it's not gonna play nice with a mouse with mouse movement like I have to use my touchpad right now to get this movement if i reset editor settings it works but right now it's kind of weird I have to use the touchpad so what you can do for that is if you go in the editor editor settings if you have the same issue that I do go in dpi mode I prefer to use min dpi but what I do is I'll set it to low dpi then I'll close the editor reload it and set it back to minute dpi close it reload it and then it works so if you run into - that issue that's what you can do to fix it
Info
Channel: Miziziziz
Views: 139,534
Rating: undefined out of 5
Keywords: godot, doom, gamedev, game, development, how, to, tutorial, fps, first, person, shooter, clone, godot 3d tutorial, godot 3d game, godot fps tutorial, godot tutorial fps, godot shooter, godot shooter tutorial, godot doom
Id: LbyyjmOji0M
Channel Id: undefined
Length: 13min 36sec (816 seconds)
Published: Sat Nov 10 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.