Adding This One Thing Made my Game Look 327% Better

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
when you think of beautiful 3D games you think breath of the wild Elden ring Horizon the fortnite maybe but there's one thing that they all have in common they're covered in grass grass is one of the most important things you can add to a video game world to make it look more alive but unfortunately most people won't even notice it unless it's not there back in the early days of 3D grass was optional but nowadays with improved Hardware every game needs to have grass or else it just won't look good just look at what happens to pubg when you turn the graphics down it goes from a passable game to a game that belongs on the PS2 it's out here looking like my game oh okay it's still a little bit better but we're here to fix that and what better place to start than by adding my own grass little did I know this would drive me insane I knew stepping into this project that I would run into a few brick walls here and there but I did not think this would be one now you might be thinking is this video 80 about something as simple as grass yes but who said Game Dev was easy but if you haven't clicked off already I'm sure I could teach you a few things plus you'll get to see the other improvements I made at the end of the video so let's mow over what I've been doing the last three weeks I'm already spawning in trees so grass can't be that hard right well that's where you'd be wrong if I spawn in Grass the same way I spawn in the trees there would be way too many game objects in the scene causing it to run extremely slow it's actually unplayable now if you're familiar with unity you know that there's a built-in feature where you can just paint grass on a Terrain and man do I wish I could use that since I am generating the terrain on runtime there's nothing to paint it on until it's too late and this was really stumping me when doing research I stumbled across an asset that I think would solve all my problems but then I looked at the price and it was seventy dollars and I would rather struggle for weeks than spend that much on something I think I'd be better off learning anyways I ended up getting some help from my Discord server shout out to here's Johnny for really helping me get started he recommended ace rolla's video series where he explains how to add grass officially into your game this is how I learned about GPU and thing basically The quick summary is that normally every game object in your scene is stored on the CPU and then is sent to the GPU every frame to be displayed this works great until you have too many game objects in your scene say for example you need a ton of grass in this case the funnel from the CPU to GPU gets extremely clogged leading to horrendous lag this can be fixed by having the GPU store all the grass objects in memory this way it does not have to be sent every frame and just if you were curious I can't do this for every game object because things on the GPU technically don't exist and therefore can't be interacted with if you want to see the code behind this I found an extremely helpful video by flareoon that goes in depth on it so after following along with the video I made a low polygrass model to populate the world because when you're using an object as much as I'm about to you need to have a very low poly count and now when I use the GPU instancing I can spawn a hundred thousand grass objects into the scene and while it does slow it down I'm actually able to move around still The Next Step was to get the grass to spawn across the terrain instead of just in a box my first attempt was not so great it slowed down the game and the grass looked really bad still so instead I tried to focus on populating a small area until I got it looking the way I wanted to and might I say the grass looks significantly better when densely populated but there are still some issues the grass looks really flat and only renders on one side so once you pass it it looks like it completely disappears there is a simple solution to this you just have to check the box to render both sides but I decided the other grass model just looked overall better so I switched back to it now that I have something I like it's time for some optimizations not every grass object needs to be displayed at all times if you're on the left side of the map the right side does not need grass to accomplish this I looped through the list of grass locations and make a new list that only includes the one within a certain range from the player I then send that list to the GPU to be displayed this does take some processing power to do but it saves more than it is using the only problem is once the entire map is covered with grass it still lags and that's just because it has to keep track of so many objects so to fix this we had to optimize some more and the best thing I could think of was to start chunking if you've ever played Minecraft before you'd be familiar with chunks basically I have multiple sections of grass that Now cover a certain area of the map and they'll only be activated if the player gets close enough to them I lowered the distance here so you can easily see it happening this greatly improves the frame rate and after tweaking the grass spawners little to use less grass yes I can get a stable 45 frames per second okay it's not perfect yet but I know there's more I can do I'm just burnt out for now I would love to hear if you guys have any suggestions they would really help me in the meantime there are some other graphical problems that come with adding grass items on the ground are now very hard to see to fix this I thought it'd be a good idea to give them an outline I found an asset that was exactly what I needed well almost it could still use some tweaking as of now you can see the outline from anywhere which is really dumb if you can see an item through Hills across the map so I'll need to make my own Shader in the future another Improvement I've been wanting to make has to do with punching the trees I noticed while hitting trees that my current method of making the tree Shake doesn't look very good so I spent some time reworking the shaking script to instead shake the camera instead of the tree and I think that looks much better the screen Shake can also be used for enemy encounters but I haven't decided exactly how I want that to work since I don't want hitting the enemy and getting hit by the enemy to have the same feel but I am going to focus on that more in the next video this video is still about graphical improvements and the next thing I wanted to do was improve the Sky Box this might be the most bang for your buck Improvement you can make I just downloaded a Skybox and put it in and I think it dramatically improves the look of the game it is not the perfect Skybox but it's definitely good enough for now another side effect to adding the Skybox was it also lit up the world more I would love your feedback on how this looks too it kinda looks a little off to me but I'm not sure if that's just because I've been looking at the darker version for so long now and finally the last Improvement I wanted to make was updating the terrain now that there's grass everywhere the mountains really stand out and just look off so I decided to flatten the terrain a bit and adjust where all the different colors start I think this flatter style really fits my game but let me know what you guys think your guys opinions mean a lot to me so any feedback you can give on any of these improvements would be greatly appreciated art is definitely not my strongest skill so hopefully I did okay and that's all I got for this update see you guys in a few weeks once I get the base defense up and running
Info
Channel: OverPhil Dev
Views: 81,639
Rating: undefined out of 5
Keywords: #untiy, #gamedev, #indiedev, #devlog, #dreamgame, #overphil, #unity3d, #indie, #indieGame
Id: 1Awse6C5I1s
Channel Id: undefined
Length: 6min 11sec (371 seconds)
Published: Sun Nov 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.