Game and Editor ??

Member
Posts: 157
Joined: 2002.12
Post: #1
Hello forum

I'm coding a arcade type shooter on 3D using C++, so far everything's going smooth.

The way I'm doing the code is with two builds one which is the editor, and the other is the actual game.

The code is exactly the same for the game except that there are no GUI controls for the game objects.

e.g

#ifdef EDITOR
InitGUIControls()
EditorLoop()
#else
InitGame()
GameLoop()
#endif

Is this an OK approach or is there an easier way to handle both editor and game projects.

Thanks
Quote this message in a reply
henryj
Unregistered
 
Post: #2
There's no problem doing it this way, though I would soon get sick of having to compile everything twice.

How about putting a flag in a config file or maybe a key combination to switch to the editor?
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2010.11
Post: #3
I ame doing that to but I am makeing a RPG. An integrated level editor would be cool but it's to much work in Metal.
Quote this message in a reply
Darkgold
Unregistered
 
Post: #4
I'm doing an RPG in Metal that does have a level editor. However I'm releasing them as two separate programs. Joseph, why can't you add an editor to yours?
Quote this message in a reply
Zachary
Unregistered
 
Post: #5
is everybody who uses metal making an rpg?


P.S: Yay, new smilies! *| :eh?: Wink
Quote this message in a reply
Darkgold
Unregistered
 
Post: #6
Nope, just us three.
Quote this message in a reply
Quicksilver
Unregistered
 
Post: #7
QS isn't.Grin
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #8
The reason I'm doing this project is to get familiar with real game development challenges, so I decided to go with c++.
Is hard, but rewarding when I get something working Rolleyes
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #9
If you are careful you could probably link shared files in each of your projects simply using the same file for both. You would just have to make sure that you take into account that what you do to the code in a file in respect to one project will also affect the other project.

It's still a double compile, but I bet a little tweaking could save compiling time by only recompiling code that is unique to each project. That is, if you make changes in both projects and then compile them, the first one will compile all altered files in the project, then the second will simply compile the files the first compile did not. Linking should be correct either way.
Quote this message in a reply
Post Reply