Announcement

Collapse
No announcement yet.

Main control loop

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Main control loop

    So most programs and game engines in the past have a main control loop that runs whatever logic is needed. In blue prints I can see a Tick event to trigger off of, but what would be the equivalent in the C++ code? Or more generally, where should we be putting the code that's supposed to manage the game. Looking at the documentation for GameState and GameMode doesn't show anything obvious and the example games I've looked at all seem purely dependent on being triggered by input of some kind, without any overarching logic.

    #2
    You can actually just overload the Tick() function in your GameMode class and put it there. It gets called every frame. It also really depends on what you are trying to manage. Local events you can add to the tick functions of your independent characters/pawns. Input you'd want in the PlayerController/Character, and global stuff is where you'd want your GameMode ticks.

    Comment


      #3
      Note to self: read the API documentation more carefully.....

      Thanks for your help.

      Comment


        #4
        No problem. Some of this stuff is actually a bit harder to find because of how encapsulated everything is.

        Comment

        Working...
        X