What is the entry point?

The documentaion is trash. I can’t find anywhere what is an entry point for a program, like main.cs or something and where it is defined.

Hi there!

I would agree with you that documentation could use some upgrades and it is certainly not as beginner friendly as it should be.

As to the entry point it is a BeginPlay event inside your GameMode class. If you have not created your own, there is a default one the Unreal will use. To be able to write any logic you need to create your own and set it as default in Project Settings.

However if you are just starting out, I would suggest you use any of the templates that you like and start writing logic on the Pawn Actor object that is set as default for the template you have chosen. There you will also find BeginPlay and OnTick events where you can write your logic.

I mainly use blueprints and then rewrite logic in c++ for tick intensive operations but everything should be the same in regards to names of the classes and events/functions.

I would suggest you start experimenting with blueprints as well since you do not have to worry about declaring stuff properly with using things like UObject etc.

I wish you good luck!

1 Like

Actually GameMode comes much later. See this:

2 Likes

Unreal is not a “library,” it’s a “lifestyle.” You’re not going to be successful with Unreal unless you swallow the red pill and drink from the firehose.

The “entry point” for a project, is configured in Project Settings – the Maps and Modes setting:

The “Editor Startup Map” is the map that’s loaded when you first open the project in the editor. This will typically be whatever level you’re currently working on, or perhaps some kind of gameplay playground you use for testing.

The “Game Default Map” is the map that’s loaded when the engine starts up in a packaged game. This is typically your main menu level, or maybe some pre-main-menu sequence.

Each map has a Level Blueprint, which as an Event Begin Play event. That’s a great place to do things that you want to do “at startup.”

Once the player joins, the PlayerController also has an Event Begin Play event. That’s a great place to do things you want the player to have – for example, a main GUI that could be added to the player screen, and so on. (Note: “player” not necessarily “pawn”)

Finally, there’s the GameMode. This typically has a lot of properties for the specific game instance. One GameMode is instantiated per level, so you could have your “main menu” level have a game mode that doesn’t spawn a player pawn, and then have your real “game levels” have a GameMode that DOES spawn a Pawn. For example.

2 Likes

Correct, GameMode is not an initial entry point. I was under the assumption he just wants to start prototyping some functionality to figure out how to do any gameplay related functionality in engine. For that use case I believe starting with Pawn or Player Controller is most suitable.

I think there was 2 good answers. One with diagram of game initialization process, and the second about project settings.
Since I was asking where it can be redefined, I chose second.

As I understand, Unreal have built-in default/base implementations, some of them can be redefined via project menu, some via blueprint slots or class properties. And the closest to root class that can be redefined in game editor via project settings is the GameMode.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.