Hello,

I've been trying to deal with this problem for a while now, I'm currently working on a game engine I could use to help myself later on, the thing is made in .NET C++, and is similiar in design plan to RPG Maker, and GameMaker and the such in the way that it handles the creation and handling of maps and events in the UI from .NET.

After the project is done, it is exported to code files in the format of native C++ using SDL.

Now, my problem is this part, I have the code generator mostly ready, it creates all the neccassery files for compilement and works well, now my problem is with actually compiling it automatically from within the GUI in .NET, I was thinking of using the CMD and vcvarsall.bat, but that didn't work, and thought about using makefiles, but that doesn't work on Windows, and I don't want the program to depend on too much external software by using NMake or something.

So, I guess, what I've come here to ask would be what are common methods for this type of thing? How do the popular engines, like the aformentioned ones, or Unity, or UDK, or any of the handful out there, work? How do they compile the work on them into and executable?

UDK compiles scripts into its own type of bytecode, which is then parsed at runtime. I'm actually not 100% sure about Unity -- it requires you to choose a platform when you build, but I assume they're using some bytecode (proprietary, most likely) because they support the web player. In short, the process is JIT compilation, similar to approach taken by .NET.

There's a well-established language/VM designed for game scripting called Lua (I'm sure you've heard of it). It's also compiled into bytecode, which is them interpreted by its own VM at runtime. Can be hosted on various platforms. Check it out see if it suits what you're trying to do, if not maybe you can grab some ideas from their implementation.

Hope this helps a bit..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.