top of page
Search
  • Brendan McIntyre

DevLog 1 - New Project

Over the last couple of months, I have been taking advantage of the current world situation to spend this time to properly learn c++ from the basics. This is something that I wanted to do to expand upon the currently limited languages that I know (especially after the disastrous attempt with my last uni project). For several weeks I followed tutorials that were released by the now abandoned “3D buzz” as well as some pointers from a youtuber called “The Cherno”. Since following these, I have managed to develop a solid understanding of c++ (something that I could not achieve with my final uni project). However, the visual studio console is not well designed for games that involve any visuals. So, I decided to take the (huge) step back into the unreal engine to learn how to use c++ within it. After following tutorials that made some simple games, I’ve decided to start work on a new game that I plan to potentially publish. I have also decided to get back into blog posting so that I can demonstrate the skills that I learn along the way in making this game.


The game (currently called “Contract Defender” (w.i,p title)) is a FPS defender game where the player takes on contracts to defend precious cargo against waves of enemies that spawn at certain locations at the edges of the map. In between each wave, players can place down walls, which can be used to direct enemies around the map. Enemies won’t attack these walls normally unless there is no path for them to take to reach the goods. Upon completing the contract, players will receive money in which they can spend on getting more powerful guns or upgrading their currently owned guns. The game ends when players have completed all the contracts.


The game will have a sci-fi feel to the game, with the weapons that the player uses and enemies the player faces reflecting that theme. The weapon models and sounds will come from weapon packs that are available on the unreal engine marketplace. The enemy models and animations will come from content available on mixamo. Once again, I do not plan to have a player model (although this can always change) as it makes it much easier for me to implement and is less important in a first-person game.

Initial Work – Setup & Player Movement

Already at the time of writing I have begun creating the game. The first part of this process was creating the first couple of classes that I needed. These being the player class (created from the unreal character class), the player controller class and the game mode class. The decision between using the character or pawn class for the player class was a difficult one for me. However, I decided to go with the character class for two reasons: firstly the character class has many built in features that make character movement a lot easier to setup and secondly it means that I have the option to include a skeletal mesh later on if I decide to. The creation of the custom player controller class means that I can use this class to handle inputs from the player and decide how the player pawn should move while leaving the rest of the player functionality on the player class. Finally the custom game mode was created to enable the option to have my player pawn and controller to be set up default.


After those classes were setup, I needed to then create blueprint objects that derived from these respective classes so that they can be used.


Once the project was setup, the next goal was to get the basic movement controls of the player setup. The first step in this was to setup the input axis in the project settings. For the movement I went with a standard setup of w/a/s/d to move forward/left/backward/right. I also setup the mouse x and y movements so that the player can look around. Currently I don’t have any game controller inputs setup, but this may change in the future.

With the axis inputs setup and named I could finally begin coding. The first step was to create the camera component that would sit on the player. This involved creating the component using code and storing it in a pointer variable so that it can be accessed later on. This variable has been set to visible but only blueprint readable so that any blueprint can have access to the camera component but can’t change which component it’s pointing to. Finally I set the camera to be attached to the root component (the collider on the player) so that it moves with the entire player object and I added some offset to it’s location position so that it would sit at the top of the collider.


With the camera done, I could move onto actually getting the player to move. To start with, I created to functions: MoveForward and MoveSideways. Both these functions are similar in how they work. They firstly get the player’s forward vector (so that all movement is based around where the player is looking rather than using world coordinates), then it moves the player along either the x or y axis based upon the input.


With the handling of the movement done, I then moved to the player controller to connect the input to these two functions. On the player controller I created two functions which would handle telling the pawn to move and a pointer to the player pawn. Within these function (if the pointer is not null) the controller calls the respective function that tell the pawn to move either forward/back or left/right. The final setup was to bind the axis mappings in the engine to these two functions.


Now the player can move around a map. The only problem is that the player can’t look around. This final part was pretty easy, as it involved only two things. The first part was the bind the axis mappings for the mouse x and y to functions in the pawn class that add yaw and pitch movement. Then I changed some variables on the character controller component and camera component to enable the player to look fully around on both x and y axis.


The end result is a pretty standard player movement for an FPS game that does the job nicely to begin with. As development continues I will probably end up changing various things and of course adding in extra features.




This is where I currently am up to on the project. The plans for the next bit of work is to setup a player weapon, attaching it to the player and having it fire. I also plan to have setup an enemy that can take damage from the player weapons. As for future blogs, I don’t plan on having a consistent schedule as to when I post them. It will just be a case of making these blogs whenever progression to talk about. So with that, see you in the next blog.

4 views0 comments

Recent Posts

See All
Post: Blog2_Post
bottom of page