The first things done in the engine

Hi everyone !
I have a question about the engine source code.
I am looking for the first peace of code that is executed. I mean, the first function, or the first thing the engine do to initialize.
I would like to execute some particular code at this moment but I don’t manage to find what is the first function to initialize the engine.

It is really important for me to put my code at the true beginning of the engine, before initializing the game or anything else.

I hope someone will have the answer :slight_smile:

All the best and thank you for your time !

That would be main(), right? :thinking:

Sure, but there is thousand of files in the engine so no idea which file can contain the initialising functions or a main function

Have you seen this?

oh, this video seems to be really interesting !! And it seems to provide all the information that I need.
I haven’t watch all of it yet but I will. Thank you a lot for your help :grin:
I will mark the question as resolved as soon as I will have finished to watch the video :grin:

1 Like

So, I watch the video and it was really great ! Nice video, I appreciate it. :+1:

But unfortunately, it didn’t solved my problem. Now I understand thanks to the video that I am not trying to find the first thing done in the engine, but the things that is done BEFORE engine creation and even before anything else.

In fact, I am trying to find a place before the load of the pak files.
After some tests, it appears that the GuardedMain mentionned in the video is the start point of the engine creation, truth is that a lot of things are done before the engine creation (including the load of the pak files). :slight_smile:

1 Like

What is the actual problem that you’re trying to solve? It’s possible that the engine has some mechanism to do what you want, but you’ve already pigeonholed yourself to a specific solution that you’re focusing your questions around.

1 Like

I’m simply trying to launch a specific .exe file the earliest possible (before the pak file decryption).
As far as I know, that is before the LoadIndex function. I am looking for a good place to put my code but I am stuck for the moment.

OK, I completely remove the comment I wrote because at the end I thought that I add found a good place to put my code but that is not the case… I need to find a place that is not called several time like this :sweat_smile:
So I am still looking for it. If anyone have more info about that I will appreciate :slight_smile:
Otherwise, I will share a solution if I found one.

1 Like

So, I have found a better place now, and at the end it is thanks to the video :slight_smile:
I misunderstood something in the video about the launch of the engine loop but now everything is clear.

For anyone that try to find something similar, go in the LaunchEngineLoop.cpp and in the PreInitPreStartupScreen function.

1 Like

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