top of page
Search
  • Brendan McIntyre

DevLog 03 - Gameplay is born

Hello Everyone. Since the last update I’ve managed to get the basis of gameplay completed. This means that there is now a basic map the player can move around. It also means that enemies that are spawned in will move towards a goal and the player is able to shoot and stop them. I’ve also added in some basic animations for the enemy and some basic ui.


Creating the map

To start off with, I created a much larger area to test with. The layout of this map is how maps will look in many of the easier contracts the player will take. This is because there is only one critical path that the enemies can take (meaning that they all must take a path through the same point eventually to reach the goods). For the player, this means that it takes less walls to block access to goods, giving them more time to kill enemies and to understand the mechanics of the game. More challenging levels will involve many more of these critical paths, meaning it takes more walls, planning and decision making to utilize the walls to the player’s advantage. Some maps may also have the goods location in the middle of the map (with enemies spawning all around the player), which challenges the player even more as there are many more directions that they must keep track off. Once the layout of the level was done, I added a navmesh bounds around the level so that unreal would generate a navigation mesh in the level, allowing enemies to move around it.



The next thing that I needed to do was to create the goods that the enemies would path to. This was a fairly simple class that only contained a couple of important variables (health, staticmesh and collider) and the take damage function that would be called when an enemy attacks it. The mesh was assigned to the generic cube provided by unreal. For the material on the mesh, I just created a simple material that consisted of a plain yellow colour (to make it stand out). Then I added it to the end of the level.




A.I. Navigation

Next I worked on having the enemy path towards the goods. This ended up taking longer than it should’ve as I spent way too much time trying to fix issues caused my simple oversights. The first part of this was that the enemy would not move when the move to function was called in the beginplay function. So, I had to call it constantly in the tick function before it would work. The next problem was that the enemy would sink into the floor or float when moving around rather than moving along the ground.


Eventually I realized that this was caused by the enemy’s skeletal mesh collision presets not being set to character.


That appeared to fix the problem, until the enemy got close to the goods, where it would raise above the ground. This problem was caused by the fact that the centre of the goods transform was located around the centre of the object itself, meaning that the enemy’s navigation was pathing it upwards. To fix this I created a default scene component in the goods class, then I moved both the collider and static mesh up so that the bottom of these two objects would line up where the scene object was located. This resulted in the centre of transform being located at the base of the object, stopping the enemy pathing itself into the sky.





One final note about this is that during this period of trying to fix these issues, I decided to make the entirety of the ai’s decision making in unreal behaviour tree system. While many of the variables and possibly even functions will be created inside of c++, the structure of an enemies decision making will be done in the behaviour tree. I may later on decide to implement all of it inside a c++ script in the future, but for now this is the much easier solution and keeps to learning curve for much less steep.

Animations

Once that was done I worked on adding some basic animations to the enemy. I downloaded a few animations (runnings, idle and attacking) from mixamo and imported them into the project. I noticed after importing them that the animations floated above the ground, so I had to re-import them and adjusted their import transform down a bit so that they were aligned with the ground once more (although after completing this I realise I may need to adjust these again).



With this done I could begin work on setting up the animation blueprint. The main part of the blueprint features two state machines, each controlling the animations of the upper body and lower body. The output animations of these two state machines is blended from the base of the spine. This allows the enemies to be doing actions such as swiping or shooting/carrying a gun while they are in different states of motion (ie walking/running, idle).



Both of the state machines used to control the upper and lower bones are fairly similar. Both have an idle and running state, with the same condition to transition between these states. The difference is the upper body sm has an extra state, which is an attacking state.



This state is triggered when the enemy gets close to the goods target. For now these state machines are fairly simple but will likely increase in complexity as more complex ai gets added in.


The final step of the animation process was to add in a blend space for the enemies. This blend space will allow animations to be blended to make for smoother looking transitions. For now, the this only blends between idle and running. However, it will likely be expanded to blend strafing animations if these types of ai are included.





Basic UI

The final addition was the creating of a basic ui. For now this ui only utilizes the standard visuals and some functionally in it cannot be done until further features are added (such as ui related to the waves). The layout of the ui is also subject to future change once playtesting gets underway.



However, there was still some basic thought into this layout. I decided to have the player and goods health separated from each other as these are two very distinct and important ui the player needs to keep track off. I decided that having two similar yet important ui close together might make it more difficult for players to see and differentiate between the two in their peripheral vision. The placement of the guns current and spare ammo was done as this is the traditional location for this type of ui information. The guns current ammo was made larger as this is the more important of the two and the larger size makes it easier to see in the player’s peripheral vision. The text denoting the amount of walls remaining will also not be visible the entire time, but will only appear between waves. So for now the only functioning ui is the weapon ammo and the health bars. However, functionality of the rest of the ui will be added as the appropriate features are added.




What's Coming Next?

On the topic of future updates, the next batch of content will work towards completing the mvp of the game. The first step will be setting up the goods to take damage from enemy attacks. Then I plan to work on getting a wave system setup. This will likely be similar to the ratio system that I used in my last unreal project, albeit with some tweaks due to the difference in the way enemies will be spawned. With that done I can setup the win and lose conditions and states of the game, accompanied by the appropriate win/lose menu as well as the main menu. However, progress on this will be slower as I have not been feeling the best in the recent past and need some time to relaxing and de-stressing myself. So until the next blog post,goodbye.

12 views0 comments

Recent Posts

See All
Post: Blog2_Post
bottom of page