State Management, State Machines, and the State Design Pattern in Unreal Engine 4 Blueprint

Опубликовано: 03 Март 2020
на канале: Paul Gestwicki
8,192
219

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.


Смотрите видео State Management, State Machines, and the State Design Pattern in Unreal Engine 4 Blueprint онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Paul Gestwicki 03 Март 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 8,19 раз и оно понравилось 21 людям.