Optimizing my Game so it Runs on a Potato
Ойындар
In 6 months I've taken my Godot game, Bloodthief, from 9 fps to 60 fps on this potato of a computer. Here are all the things I did to make that happen!
➤ WISHLIST BLOODTHIEF ON STEAM: store.steampowered.com/app/25...
➤ JOIN THE DISCORD: / discord
This is a devlog for Bloodthief, the indie game I'm working on inspired by Quake, Hotline Miami, Ghostrunner, and ULTRAKILL. In this devlog I talk about Optimization!
Leave a comment below if you have any feedback on the game or questions about my process!
--------------------------------------------
Chapters
0:00 Intro
1:20 Occlusion Culling
3:03 Baked Lighting
4:27 Optimizing Enemies
7:17 Shader Compilation
13:40 Graphics APIs
17:22 Rapid Fire Optimization Tips
18:14 Ending & Results
#devlog #gamedev #godot #indiegame #indiedev
Пікірлер: 1 000
PLEASE add an Easter egg so that we can enable to the audio or visuals for the shader comp loading screen, that’s hilarious😂😂
@Splarkszter
Ай бұрын
100%
@dan_loeb
Ай бұрын
yes, please!
@ZaidaZadkiel
Ай бұрын
signed
@rose_allen
Ай бұрын
was about to comment this. I think that a 10x speed preview of the level is kind of a cool feature as well.
@ZaidaZadkiel
Ай бұрын
ah i know! record the entire audio of the gameplay and then edit it and shift its speed 10x so it sounds like chipmunks all the whole loadingbar
12:36 PLEASE MAKE AN EASTER EGG TO ENABLE THE SOUND AGAIN "It sounds like the game is frantically cleaning a room" Is waaay too hilarious
@Fireway12
2 күн бұрын
Up, this gives life to the loading screen
Shader loading sounds are fucking hilarious
@Lachrymogenic
Ай бұрын
game be like "son, our neighbour is coming round to visit" game: "OH SH- FCK FCK CLEAN UP PUT EVERYTHING AWAY, KILL ALL THE DEMONS RQ"
@theridonculesknights
Ай бұрын
@@Lachrymogenic just Gmod glitching out sounds as the game scrambles to make itself presentable
This is the best kind of devlog, gets you excited about the game and also teaches you something about game dev!
@Blargis3d
Ай бұрын
thank you, glad you enjoyed it!
@calebgilbertyt
Ай бұрын
So true, I think most of the gamedev audience is a little brained out for something "entertaining", and just want something interesting and inspiring, amazing video blargis!
@cinderblocktreehouse
6 күн бұрын
@@Blargis3d hey so uh do you know what the price is going to be?
Omg thank you. I was little bit disappointed when I first launched your game because it run at 25-30 fps on my uhd 620 thinkpad. Now I'll be able to play it at 60fps wohooo Edit: for compiling shaders you can set camera fov to 180, detach it from the player spawn on different parts of the map and rotate it 360 degrees. I saw this method used by antii for his game Road to Vostok. You can check it out on youtube
@Nate-bd8fg
Ай бұрын
Rotate 180° lol
@realskyquest
22 күн бұрын
Nice more fps, road to vostok its pretty good, but pretty buggy now after moving to godot(*rip the guy with godot 3d optimizations*) Godot is really neat for 2d, but 3d hurts. As a web developer I'm afraid of react and testing(*its a pain, but i still do it*)
@steluste
22 күн бұрын
@@realskyquest I agree. Having good looks doesn't mean it's good at 3d.
@sdsdfdu4437
10 күн бұрын
Which video did the road to vostok Dev talk about that?
Why so many OccluderInstance3D nodes? A single one should be able to bake occlusions for an entire level.
@Blargis3d
Ай бұрын
OMG I'VE BEEN DOING IT WRONG THIS WHOLE TIME Just tried it like you just mentioned any yeah, the way you say works. I guess the way I describe is still useful for the anyone who wants to only have certain objects be occluders - but yeah for the general case I'm doing it the dumb way, lol, sucks that I can't go back and change the video now. Thanks for the tip though!
@GoodmansGhost
Ай бұрын
@@Blargis3d How many frames gained?
@slavsit7600
Ай бұрын
@@Blargis3d ye
@DrunkenLeaf
Ай бұрын
@@Blargis3d Man ain't this just the bitch about game development lol.
@abdelhakim1291
Ай бұрын
@@Blargis3dhow many frame Gains u got?
"Light baking can sometimes take a long time, think on the order of minutes." Literally the best advertisement I've heard for Godot as someone whose main engines up to this point have been Source and Unity.
@STNGR4Y
Күн бұрын
How long does unity take usually for light baking?
@MarcusBuer
Күн бұрын
@@STNGR4Y yes
@sujimayne
Күн бұрын
@@STNGR4Yyes
I live for developers talking about all the ways they optimize their code. Also you should keep the sound on for compiling shaders. It is really really funny
@xdanic3
Ай бұрын
Agreed, it made me laugh so much when I heard it
@ryan_1314
18 күн бұрын
It should be added as a secret option in settings that's just labeled something like "toggle loading screen tomfoolery"
Constantly finding barriers in your game's development that are tied to years old issues and pull requests on the github that are supposed to be fixed and merged in just the next update, that is just the Godot experience. Lord help us. But also thank you very much for making this video, best insight I've ever gotten on how I can apply optimizations as a fellow Godot developer.
@Saas_1
Ай бұрын
May I ask why you are using an engine that has the problem you just described?
@BluesM18A1
Ай бұрын
@@Saas_1 quite simply, because I am not smart enough to make my own engine yet. Even if I was, Godot would probably save me so much time that instead of sitting and waiting for bugfixes I'd be fixing them myself and sending pull requests.
@bitnewt
29 күн бұрын
@@Saas_1 Other engines also have bugs, but the reports and discussion aren't as easy to find when they aren't open source.
@RADkate
25 күн бұрын
@@Saas_1 the thing is with godot it will eventually get fixed but from i know of unity it just gets replaced by an equally broken system
@alexisjsosa
23 күн бұрын
Unreal doesn't have *ANY* of the issues listed in the video, using Godot is literally just shooting yourself in the foot.
Having the game do a pre-recorded run for shader compilation is a really clever idea, even if a broader solution is coming for the next versions. For the AI/pathfinding optimization I had a similar issue, and what I found is to have a singleton responsible for all enemies, and have enemies queue into it to have their next update calculated (can be for path update, sensor check, whatever could cause an issue in large numbers). That way you can control how many calculations you want to per tick (could even adjust it dynamically based on performance), and guaranteed to not have any accidental overlaps.
@sourestcake
5 күн бұрын
In my experience centralized data structures are the way to go for most things. It allows you to limit and batch work like that. But i do everything in C, so that probably has an impact.
@acenio654
9 минут бұрын
Well I'll be damned. I just commented something really similar addressing the same point and just saw this. Hats off to you sir
Hello, speedrunner here. I haven't watched the whole video yet and I'm in a rush but during the AI section you mention adding a random number to the AI's pathing tick cycle. Please seed this random number generator to the same seed everytime or the tiiiinnnnyyy amount of randomness this will cause will certainly screw TASes (and maybe super high level speedruns) forever. Thanks :P
@Blargis3d
Ай бұрын
Ooooh that's a really good point. Noted! Shouldn't be too hard to seed this
@Joshimuz
Ай бұрын
@@Blargis3dNice, sorry to probably add another global variable to the pile :P
@trentbillington1093
Ай бұрын
@@Blargis3d It also has the potential to break your shader compilation replay!
@rankail
Ай бұрын
@@Blargis3dit would be even better if you just count up the frame offset % 20. That would almost guarantee a rather even distribution of the calculation.
@thepro4805
Ай бұрын
i was thinking about how it would totally ruin TASes as well! lol
bro get your wife a new computer PLEASE
@sean7221
22 күн бұрын
It's her punishment.
@Elias01056
21 күн бұрын
@@sean7221for what
@sadstrawberry8834
20 күн бұрын
What did she do
@toucan6109
20 күн бұрын
Bro people have other things in life than video games
@maxwell_edison
19 күн бұрын
@@toucan6109 doesn't mean she doesn't deserve a better computer? weird take is weird
I ran into the same problems with OpenGL and Vulkan when I launched my game on steam. I ended up just adapting all of my visual effects to look mostly the same between OpenGL and Vulkan and then exported both versions and set them as different launch options on steam. Imagine my panic when I launch the game on Steam and I immediately get bug reports on how the game just doesn't lauch 😭
@Blargis3d
Ай бұрын
Oooof this terrifies me lol. Might end up having to do this. Was your game Godot as well?
@Xeloph986
Ай бұрын
@@Blargis3d yeah it was. It ultimately came down to the fact that it's a retro pixel game. And like you said in the video, people expect to be able to run retro looking games on potatoes :D So yeah, setting up a Compatibility launch option or a beta option on Steam might be necessary to make sure everyone can play.
@sulfur2964
Ай бұрын
I'm following ultra engine development and they completely switched to opengl from Vulcan, while gaining performance on amd GPUs. They have a great vide explaining why Vulcan is terrible for development and how almost no games use it, lol
@SilverDragonsmx
25 күн бұрын
@@sulfur2964 OpenGL is functionally a dead end. Development has ceased entirely on it, and it will not see any improvements nor new features. As far as I can tell by the presentation (that also uses AI generated images, which as far as I am concerned is already a red mark against something, I also have no interest in watching a nearly 2 hour video that's functionally just someone going over a slideshow, so maybe something was covered there but not in the slideshow), with all the main arguments essentially boiling down to pointing at numbers entirely out of context, and pretending like a point has been made. (ex, Vulkan games in 2023 vs GlideFX games in 1999, which ignores that game development as a whole has changed since 1999) Also minimum system requirements for an API doesn't exactly mean anything - sure you can now "support" games on something as old as a geforce 420, but no one is going to be practically targeting hardware that old, meaning it's equally as valid to say "The GeForce GT 630 is the minimum support for Vulkan". Also OpenGL driver support is known to be sketchy at best. This has been well documented. Also the wording of "API drivers buggy" isn't a search term normal people will use. instead, "API driver issue" is FAR more likely to be searched, which shows 15.6m results for DirectX, 10.8m results for OpenGL, and 3.4m for Vulkan. (also the original search query gives completely different numbers, with exclusively DirectX being the only one even remotely close). As with any sudden and significant performance boost, I would sooner suspect a poorly implemented Vulkan pipeline over any actual benefit to switching to OpenGL.
@froge4300
7 күн бұрын
@@sulfur2964 vulkan is so much fun to use tho, also most new games use it
Re: compiling shaders. That's what me and my colleagues in the industry like to call a "spicy" hack. 👌
I think an alternative way to mitigate shader stutters could be to have a main menu background, where a camera flies through a sort of demo/secret level. This would look kinda old school and in line with your game art style.
@FrozenDozer
Ай бұрын
And then your main menu stutters and freezes like crazy. Not exactly ideal, lol
@Aeduo
Ай бұрын
@@FrozenDozer I wonder if shader compilation blocks the whole process or if the like, menu and player controls and stuff are on a separate thread from the main game, if the menu would stay interactable even if the scene in the background is choppy. It'd be noticeable but certainly not as big of a problem as ingame stutters.
@L1vv4n
Ай бұрын
@@Aeduo i don't know for sure, but if during stutter a GPU waits for shaider to process current frame it might be that decoupling menu rendering from the background render is too complex task. Like you will need two renders a separate frames, and than ask gpu to combine current state of both into one frame.
@Aeduo
Ай бұрын
@@L1vv4n I think this is kinda the point of something like vulkan though, where you can have some task going on while other stuff is happening and you synchronize tasks and allow stuff to continue or wait based on what tasks have completed or not.
@leihau
28 күн бұрын
@@Aeduo asynchronous shader compilation exists, it waits for the shaders to be compiled before rendering, which solves the freezes at the cose that it may make assets invisible for a moment. I'm unsure that exists for Godot though
As someone who has been forced to play some games at 20 fps for years, thank you so much for adding some of these optimizations. Specifically i want to point out the resolution scale options. Its relativly simple to implement but, from a players perspective, can make or break how fun a game is.
If you can get an id for each enemy, instead of generating a random number for each, you can instead use mod(id, 20) so the 1st, 21st, 41th, 61th, etc enemies will update on the 1st tick, then the 2nd, 22nd, 42nd, etc on the 2nd perfectly dividing the enemies up into 20ths for AI updates every tick
@Blargis3d
Ай бұрын
Whoah! I'm gonna use this. Also deterministic which is great for speedrunning and stuff
@TavishMcEwen
21 күн бұрын
@Blargis3d idk what the mod function in gdscript/c# is but it just gives a remainder, just in case that wasn't clear
@alphamineron
Күн бұрын
@@TavishMcEwen I think everyone understands mod() unless you’re a high school kid. It’s basic maths and so common in programming
@TavishMcEwen
6 сағат бұрын
@@alphamineron you know what they say about assumptions
Chapters 0:00 Intro 1:20 Occlusion Culling 3:03 Baked Lighting 4:27 Optimizing Enemies 7:17 Shader Compilation 13:40 Graphics APIs 17:22 Rapid Fire Optimization Tips 18:14 Ending & Results
@J0rdan069
Ай бұрын
What is th point of this?
@SapkaliAkif
Ай бұрын
@@J0rdan069 Maybe the commenter will go back to the video for spesific purposes.
@J0rdan069
28 күн бұрын
@@SapkaliAkif Yeah, but these chapters are already in the video.
@ultimaxkom8728
28 күн бұрын
Hmmm... culling, pruning, distributing, simplifying, and memoization.
@SapkaliAkif
27 күн бұрын
@@J0rdan069 Ah, then maybe the comment was copied to the description afterwards.
Hey so with your Pathfinding optimization, it might be helpful to add your Knight agents to a queue and have a manager cycle the queue, invoking their pathfind() function on whatever interval you’d like. You’re probably already aware of this solution but I just thought I’d share since it helped one of my projects. Great video!
This was probably the most interesting gamedev video I've seen yet, it's production grade information for polish, which is rare imo.
As someone who is doing a retro-style fps on godot using Qodot and who has the same performance issues, I can't thank you enough for the techniques displayed here
Ohhh, I was just thinking today, "when are you going to release the video? " and then it comes out right in front of my eyes, enjoy watching it all
I am so so happy that the KZread algorithm brought me to this place, I watched all the devlogs and really really loved your videos but more the actual game. I got excited to know that I can play it for free right now and just played the demo and OMG those few minutes made my day. Most fun I have ever had playing a single player game in a while! Thank you and I wishlisted it ❤
Man I genuinely cannot thank you enough for these videos. Your 90s level design video introduced me to the trenchbroom + qodot pipeline a few months ago and I have never looked back. Bloodthief is coming along very well, best of luck
that's the greatest devlog! i learned a lot about optimization in godot, thank you!
Dude this content is golden. Also I love the contribution from other godot devs in ur comment section. Keep it going!
A game inspired by Quake, Hotline Miami, Ultrakill, and Ghostrunner? Literally some of my favorite games. I cant wait to try this game out
you are true engineer. i think its the first in a long time i saw someone talking abt optimisation.
Awesome! I'm glad people are actually making use of the occlusion option :D
your shader compiler is super smart! props also the shader loading sounds are AMAZING i need that
That's a nice jade roller you got there bro, so envious
Shader pre-compilation is an essential feature for every modern PC game. Glad to see it being implemented, even if it's done in a "unusual way" :D For your game, consider adding a integer scaling for resolution scaling, while also giving an option to disable the filtering. So players can play at 1/2 Res, 1/3 Res, 1/4 Res, etc... Prodeus added this option and I personally love it, even though my computer can easily handle the 1440p Native res, I prefer to play older games at 1/3 Resolution to get the those chunky pixels.
very good work! Impressive how much content you explained so easily and detailed at same time.
Great video, lots of insightful things and exciting to see progress, GGs ^-^
Funny how for 50 bucks more you can get a Steam Deck.
As someone with a potato I see this as a absolute W. Edit. I have a Vulcan specific potato so still a W.
Not sure when you made most of these changes, but since I started playing a few weeks ago, it has run beautifully on my 1070. I love to get insights into your process, and I'm glad that you have a decently sized community of playtesters to help you. You really deserve every ounce of support you've gotten so far, and beyond!
your work is not only informative but also incredibly inspiring!
0:59 the t-posing knights sliding towards you is terrifying
@slavsit7600
Ай бұрын
they doing the a-pose
@iamlosingmysanityrapidly
Ай бұрын
its an A-pose not a T-pose
I love this GAME!
I was also working on a low-poly godot game, even with the compatibility renderer on my shitty laptops, I barely cracked 50-60 fps on basic maps and minimal game logic. I was pissed because I wanted to have LAN parties with CRT's with really low end hardware. I bit the bullet and am rewriting in c++ no engine and just pick and choosing my libraries, now I'm cooking at like 250hz + on these shitter laptops it's great (opengl renderer)
thanks for making this video, as someone else making a godot game this was really informative. wish you luck on your game
Your videos are cracking the matrix, keep it up with the good stuff
Developers like you keep my faith in game developers
@krolmuch
23 күн бұрын
the biggest optimisation would not be using a python level scripting language for making a game though
@rinkachi-rinkitata
23 күн бұрын
@@krolmuch assembly or c++ would give even more performance
@sheepcommander_
22 күн бұрын
@@krolmuch "python level" bro does not know what he's talking about
@krolmuch
21 күн бұрын
@@sheepcommander_ he uses GDScript inside the game engine. tell me how is it not python level language?
@sheepcommander_
21 күн бұрын
@@krolmuch "Python level" is not a phrase that means anything, although it just occurred to me this might not be ur first language GDScript is a completely original language created to be closely integrated to the engine and it is also much much faster and just better than Python lol GDScript and C# have pretty much same performance if you use Static Typing on all your variables and methods
13:50 Technically all 3 are closed source, as it is up to the GPU manufacturer to implement the APIs. OpenGL and Vulkan are open STANDARD, not source
@mothcatcher893
Ай бұрын
It also does not necessarily have to be the GPU manufacturer to implement the APIs. You have Mesa as an open-source OpenGPL and Vulkan implementation.
@benedani9580
9 күн бұрын
kid called mesa:
I love the technical stuff. It's really interesting. Game Dev for me is that technical aspect as well and I wouldn't want just level designe or system crafting. Hope u show more in the future
I actually really like the sounds your cache solution produced. it's silly, but symbolic of your passion
You know that this video it basically just showing the core problems of Godot: Bad (rendering) engine code, age old and not fixed (critical) issues and the "we'll just have to wait a bit more for the engine to become amazing" mentality.
12:25 I actually really liked it when you could see the pre-recorded gameplay during the “Compiling Shaders” screen, lol. In fact, I’d argue that it’s a good way to make the loading screen less boring to look at since looking at a blank screen is incredibly boring.
@glorytotheaprdeathtotheufl7917
Ай бұрын
Would spoil the level tough (altough I agree it looks cool)
@DynoStorm
Ай бұрын
Should keep the audio, it's just funny :D
Hey thanks for this. I'm pretty new to 3d game dev and your solutions to these problems will definitely influence how I approach my own projects
Love the progress on this game. The amazing fact that this game have only two levels, yet people so invested in it
I have never tried the game but I've been following these videos pretty religiously. They're very interesting and your video making is top quality!
raytracing support pls
did you spend 6 months to only optimize this game by 50 fps???
@fykkus
18 күн бұрын
That is what optimization is, doing a lot of stuff for not so big of an improvement. It is a painful and very long process, but it has to be done.
Please make a part 2 with all the advice from this video! Would love to see how far you can push the optimizations!
These videos are so entertaining and informative. Love them.
incredible and beautiful work :) you are truly a visionary
This was a very well put together video - a lot of this stuff is not mentioned very often and takes a while to figure out!
@Blargis3d
Ай бұрын
I'm glad you found it helpful!
This is literally one of the best and funniest dev videos I've seen. The shaders part was the cherry on top
loving how the game is turning out, ur a huge inspiration for me :D
The moment you explain about shader compilation problems, i was thinking "Hmm, what if the game plays itself in background while the loading screen takes place". Glad that you actually found the exact same solution and it works
Thank you so much for sharing your experience i was able to improve the optimization of my own game
Thats an incredibly smart way to set an optimization goal! Great job.
THANK YOU THANK YOU THANK YOU!!!!! As someone who has a potato computer similar to the one in the video (gen4 processor, 8gig ram, no GPU I think) I'm glad you had a computer that bad in mind when optimizing. I'm no programmer by any means, but there's so many games I play that could easily have performance fixed with simple optimizations, such as enabling culling for more objects, staggering calculation times, reducing keyframes, not processing animations for objects out of view, or being able to toggle off shaders so potato PCs like mine don't have to process every object's ray tracing and motion blur. Literally just watching you optimize your game has convinced me to add it to my wishlist :)
your game looks really smooth like it, good luck
man, i feel like I've learned stuff that takes decades to learn just by watching this video, and the guy seems very supportive of his community which ik doesn't sound like a big deal, but it's actually pretty rare
your game looks freakin epic!! love it :3
I plan on switching to Godot sometime in the next few years and videos like this are very informative. Great work.
I loved the video, definitely going to subscribe!
A fantastic video!!! Keep it up!!! You have earned a subscriber 👍
I laughed so hard at the game rendering everything at once. Very informative, learned a lot
This is my new fav game dev youtuber by far lmao
I love the way you went into getting shader issues fixed
Lightbaking in minutes, hah! Lucky you went with the PS1 look. When I was working in gamedev one of our map took 8+ hours. With a 32 core CPU and 6 other 8core PCs helping. We had 10+ maps. You could imagine the frustration when something needed a change or we had to fix something on the map for production. But that was in Unreal engine! Well at least we never had a problem with shader compilations :) Exept ofc when master shaders changed and had to recompile hundreds of thousands of shaders. Fun times. Great video btw! You did a great job!
huuuuuuge props dude! honestly this made the best case for me switching to godot from Unity 😅😅
this is exactly what I need for my own game Thank You VERY MUCH
you no what The loading screen noise makes it sound like your doing stuff (I like it)
Great vid. Thanks for sharing.
Can't wait to play your game when its out. It looks really fun. Thanks for looking out for potato users.
Real good video and interesting stuff! Small thing I wanted to mention about making videos actually, not game dev, consider whether a cut is taking us from a dark scene to a pure white one x) I got flash-banged a good few times! Keep up the good work though this looks great!!!
"Frantically cleaning its room" spot on lol Really insightful video
As someone who reported stutters on the playtest I'm very happy to see you taking performance concerns seriously!
wow man, such a heavy atmosphere, i will buy your game for sure
Lots of useful info, thank you!
Spectacular work.
great work, high FPS for a movement shooter is key. Great to see old systems still being considered for optimisation. Look as how the optimization problem was solved back in the day for Quake as this may be relevant.
such a cool project!
These devlogs are great! Are you planning to make a tutorial on your character controller / state machine? I think it would be really helpful for a lot of people. Keep up the good work!
Game concept looks cool. the movement looks fun.
cool project man
This is really cool and helpful :)
thanks for the honesty with the godot engine, been having my own rough patches with it too that I was really wondering "I CANT be the only one experiencing this right?"
Very interesting and a great learning resource. Thanks for sharing and creating this video. While I am currently working on a 2D game I believe it will make the most sense to keep a potato option for CPU rendering at lower resolutions, hoping that this will mitigate all potential issues with OpenGL.
I enjoy this little developing insides so much! I always wanted to create my own optimized game that will support some kind of physics engine. And each day I am getting closer to my goal by studying low level programming in my university and hearing about software issues on youtube.
Youve been talking about all these advanced optimization techniques that ive realized now is literally every single thing I have to do while making maps for source in the hammer editor... entity culling, baked lighting, nav mesh optimization, etc
I'm glad you're adding multi-resolution support! I think it would be cool if players could choose between bilinear or whatever and point filtering for the retro feel.
Bro that solution to the shaders was wild, and I loved it
Hey man, really cool video, nice to see something different to the "and then I copied this code online!!!" stuff that most gamedev videos are. One thing with the enemy navmesh optimization, you could recalculate the path everytime the player moves a certain distance. If the player isn't moving too much then you're making unnecesary calculations. You can then add a random delay for the calculation. Still really cool video!
i like the volume on the loading screen, it gives that type of old game with some oversight which is cool. plus makes the loading screen something less boring, and if I want I can turn it off myself. Maybe not 10x the audio idk I LIKE IT
I hope you have something really cool in store for all your beta/play testers. They seem like such an important part of the development process. You should reward them.