This video describes three ways to deal with state in game programming. An ad hoc approach can be used to get a system up and running, but it often results in code that is hard to read and maintain. Analysis of the problem reveals an underlying state machine, and so the second approach is to model the state machine explicitly using an enumerated type. This is a common approach in game development, and it has a lot of advantages over the ad hoc approach. However, this approach too can lead to clutter and distraction in files that leave them hard to maintain. The third approach is to use the State Design Pattern, in which each state is encapsulated in its own object. This simplifies the stateful actor as well as the implementation of the states themselves.
The example I use in the video is the movement pattern of an alien swarm in a game like Space Invaders. The problem is to have the whole swarm move left, then down, then right, then down, and so on. This is done by modeling the aliens as child actors of a Swarm class.
Here is an outline of the video:
1- Introduction: 0:00
2- Project Setup: 1:04
3- Ad Hoc State Management: 14:18
4- State Machines using an Enumerated Type: 25:10
5- The State Design Pattern: 36:38
This video also includes an example of using the Construction Script in Blueprint to enable editing-time modification of an actor--specifically, the number of rows and columns of enemies and the spacing between them.
This example uses an 8-bit-style alien graphic downloaded from https://www.classicgaming.cc/classics....
This video was developed with support from an Epic MegaGrant.
Watch video State Management, State Machines, and the State Design Pattern in Unreal Engine 4 Blueprint online without registration, duration hours minute second in high quality. This video was added by user Paul Gestwicki 03 March 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 8,19 once and liked it 21 people.