hi, I am working on a game engine project but I have a problem. In my game engine, there will 2 modes. Editor mode and play in editor mode(Like in unity). But In unity and other engines, you can build your project and get an only play mode executable. Let's say my engine directory is Engine_dir what I want to do is, engine creates an executable in Engine_dir\builds. How can I do that?
Note: I tried creating a bool releasemode but then players can change the bool with cheat engine and get the editor mode. and file size will be so big with engine integrated to the game.
I think you should research this on your own because this is a very basic concept.
You haven't even told us what IDE/makefile system you use, which is how you set these things, it really can't be that hard to google what are macros and how to put in a define them for 2 separate targets, and how to set the executable path in your IDE.
Switching back and forth between different executable files might not be what you want. You could still have editor mode and normal mode in the same executable if you want, but when you are done with it and want to create the final product, you could just rebuild everything with the macro to disables the editor mode, or you might want to do the opposite, having a macro that enables the editor mode and not defining the macro disables it. It's up to you.
Last game engine I wrote for the fun of it, the game engine did not contain the game. The game engine consumed files that told it what to do and what images to load and so on. The editor was a separate program that generated those files.
Yeah, usually if you have a game engine it either loads DLLs (might be renamed to a different extension), has a virtual machine that executes code, or isn't a separate program at all. If you're looking to "make a game and levels then release only the final executable" then you'll do defines. If you're trying to make your own version of unity, you'll probably load DLLs, or if you want to make it cross platform, you'll probably make a virtual machine so that games don't have to constantly be cross compiled, but only your engine itself.