How I Remade MW2 with Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i really want to play call of duty modern warfare 2 but it currently costs over 40 whole dollars and until that nigerian prince sends my money back that's just too much so today i'm going to remake and remaster modern warfare 2 using the newly released unreal engine 5 but how do you remake modern warfare 2 well the first thing we'll need is a map but what map am i going to remake well obviously rust it's small it's easy to remake and come on it's rust now i managed to find the raw rust map files online and after a huge amount of effort i managed to import the original map into unreal engine but the only problem is the level looks exactly like it did in 2009 we need to remaster rust so how will we do this why it is simple i'll just turn rtx on that didn't do anything but i know what will work the good folks over at epic games released a tool called quixo bridge and it has really high quality textures so i downloaded some higher quality rusts and concretes and then applied them to the models it's already looking a little bit bitter but now we need a landscape where are we going to get one of those well this rural australia pack from the marketplace is not only free but it looks pretty damn good the only problem is it doesn't have any hills hang on a second i live in dunedin there are loads of hills here i actually know why those are real hills but what if i can make the real hills into game hills if i can get a height map of the city i can feed it into unreal engine and it will make a virtual dunedin for me as it turns out there are loads of websites that'll do this for you so i used one to generate a height map of dunedin and here's that height map now i just plug that into unreal engine and there we go and i'll add some water and check this out i've got a desert landscape that is actually pretty close to dunedin's real geography the scale is a bit off but i think the map feels nicer at this scale now the rust map that i found online isn't perfect and it's actually missing a few objects but again quixel bridge comes to the rescue with free photo scanned models available i'm going to use this deered tree these mine carts and a few barriers and now my map's looking pretty complete finally let's add these dust particles and audio and now we can actually take a walk around rust and check it out for the first time [Music] so now here i've written some basic code to add some arms and a gun to the character and they don't do anything yet but we do have a problem i need to animate the arms but i'm a coder not an artist but what if i can code the animations instead of having an artist make them this is known as procedural animation since the weapon is attached to my character's right hand all i really need to do to move the weapon around is move my character's hand around let's start by comparing the camera to where it was last frame and this will tell me how much my character turned if we hook this up to the hand rotation check out what it does now what about getting a weapon to bob up and down as we walk around well this is actually really easy too we just map our weapons position onto sine waves and when moving we will intensify the sine waves to make the weapon bob up and down more when you start walking here's another really cool one we can do something called the raycast to check how far away the nearest wall is from our player and as our weapon gets closer to the wall we can rotate the character's hand to stop our weapon poking through walls here's what that looks like before and then after but it doesn't end here because for aim down sights you can do this as well you simply just need to move the right hand such that the aim down sights location lines up with the camera notice how previous effects like sway and weapon bulb are applied on top of this and still work perfectly fine we can also add impulses to the gum which we set over time we'll use these for weapon recoil and also for when you jump and land on the ground so so far i've used almost no animations and we have a pretty decent looking animation setup i also forgot to mention this is a true first person setup which is harder to make but it does mean you can look down and see your character we couldn't fully avoid using pre-made animations though and the leagues use a basic run walk cycle which means we blend between idle walking and running depending on our speed and we also factor in the character's move direction to make the character run in the correct direction and also we have a basic turn and place animation for when the character turns for the weapons i decided to add the intervention the m4a1 and the g18 because these models were available on the marketplace and i wanted the intervention so badly that i paid an eye watering 118 dollars for just this model which seems a little stupid because i'm doing this because 40 dollars is too expensive at the start of the video just ignore that anyways i coded attachments for the weapons and you can add any attachment to any weapon if you want to put a scope on a glock sure if you want a holographic intervention i give a put it on there now the holographic sight has a cool trick that makes the red dot appear further back and this is created using a shader trick called bump offset which essentially adds fake depth into the site this microscope is literally just this scope mesh but with a camera that feeds into the other side of the scope mesh and by changing the camera's fov we can zoom the scope in and out so now we've got some pretty nice looking weapons but it's not really that useful if we can't shoot them so how do we add shooting to the weapons raycasts are a type of collision test that lets us see if a given line will hit something and we can use this for the weapons to see if we've hit a enemy and we can deal damage to him i've also added some blood and gunshot particles now let's add some more logic if i hit an enemy do another raycast but ignore the guy we just hit and see if it would have hit someone else behind him as well also known as a collateral now i'm massively oversimplifying the weapon fire code and in reality about 400 lines of code executed every single time you want to fire a shot most of this complexity is just because the game is networked and so we have to prevent cheating and also make sure that firing syncs up between all the players in the game ui time let's start with the mini map if you've ever wondered how a map works in a game we basically just take a huge image of the map and move it around and we'll also clip it so that it just takes up a square and that looks pretty good what about the cross here well your weapon spread is based on your movement speed whether you're jumping what weapon you have and all we do is just feed that value into the spread on those crosshair pieces what about the little compass down the bottom surely that's pretty tricky to make no we literally just grab your character's turn rotation and feed that into the compass rotation how about the ammo counter what magnificent engineering feat has been employed to achieve such a magnificent ammo counter i hear you ask well don't tell anyone but the ammo counter is literally just the letter i duplicated for each bullet you have the last piece of ui that i needed to make was the score ui but i had a massive roadblock in the way you see i needed to create something called the game framework what is the game framework it's basically code that handles letting players joy in the game putting players into teams awarding points keeping track of score and time remaining and so on i also coded the concept of teams into the game giving each player a team with its own name and its own icon this took hours to implement but finally i could create the final piece of the ui and check it out the ui is now done and we also can't forget the xp and hitmarker pop-ups with the game looking pretty decent i wanted to get to the point where i could send my friend a copy and we could 1v1 each other because what's the point of remaking modern warfare 2 if i can't even play with people but before we get to that point there are still some very big challenges ahead so by default unreal engine respawns you at a random spawn point which absolutely sucks because you just end up spawning in front of enemies and getting insta-killed so ideally you want to spawn far away from an enemy and ideally behind cover as well so my approach was to give each spawn point a score and then we can respawn you at the highest scored spawn spawns close to enemies will get low scores and spawn's enemies have a line of sight to will get even lower scores you can see here as the enemy gets closer to their spawns their scores go down and then dramatically drop when the enemy has a line of sight to them so now we're going to test this out by killing the enemy a few times and just seeing where they respawn [Music] and so the spawn system works pretty well as you can see enemies get spawned somewhere far away from us and also usually behind some cover as well and so this gets us much closer to our goal of having the game in a playable state okay so it's time to try and achieve a really big milestone in the game we're going to package the game and see if my laptop and my desktop can play a game together on the lan and this is a big deal because so far we've just been simulating a networked game on my desktop a cool benefit of remaking modern warfare 2 is i could technically package the game for android linux mac toaster any of unreal supported platforms so leave a comment if you want to follow up where i put the game on a mobile device anyways once packaged the first thing i do is boot the game up on my desktop and i open the rust map adding the listen argument this means my desktop will be hosting a server but also playing in the game and i'll set b as lan match to one to make it a lan game and now on my laptop i simply use the open command and give it my desktop computer's ip address and if this works the two computers should be able to see each other in the game and wow it works first time no i'm just kidding this took like hours to get working but it's youtube so wow it worked first time [Music] but if 12 year old me in 2009 had to type console commands in to play with his friends online well i wouldn't have been pleased with that so how do we automate this process we need a find game button that will find the server's ip automatically for us and connect us to the game and this is really platform dependent finding a game on xbox is completely different a pc where we might use like steam or something else but we're going to use something called online subsystem null because it pretty much does all you need it finds an ip it connects it does nothing more it's very bare bones and in reality matchmaking is super complicated but with this library creating a session is like five blueprint nodes joining a session is like three blueprint nodes you hook that up to the sexiest looking main menu you've ever laid eyes on and we've got a game ah the play test so the play tips went about as well as you'd expect from a game that has literally never been played tested before i got one of my friends to jump in and there were bugs most of them hilarious i also added a secret teleport to the top of the level by pressing x on your keyboard which is also a really great way to trick your friends into an easy kill uh press x on your keyboard so the main bugs that did come up i think were very easily fixed and with a couple more play tests the game could be in a much more polished state speaking of hilarious bugs i let something really dumb slip through the cracks the player can actually shoot after they've died and watch this clip of my friend finding this bug hang on a sec watch this no thanks for watching the video if you'd like to download the project it's available over on the patreon and please keep in mind i have removed all call of duty content and references and replace them with art that i actually own the rights to and of course if you want to learn how to make games like i do try my survival game course over on the patreon i show you over 40 lessons how to make your own open world survival game that you can play with friends over steam
Info
Channel: reubs
Views: 3,058,397
Rating: undefined out of 5
Keywords: Unreal, Engine, C++, Tutorial, Beginner, Game, Programming, MW2, remastered, ue5, unreal 5, next gen
Id: YYVEHk_KurY
Channel Id: undefined
Length: 12min 36sec (756 seconds)
Published: Fri Jul 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.