Game Development Community

Using TGB as interface on existing C++ simulation engine

by Dave Mark · in Torque Game Builder · 04/09/2009 (10:07 pm) · 6 replies

Hey folks,

I have a simulation engine for a game that is in pretty hefty C++. I originally wrote the display portion of the game in MFC just so I could get some stuff on the screen. However, it was always intended to be a throw-away interface. I am looking at redoing the interface in TGB. It is a business management simulation that will have some 2D graphics such as items on a 2D (non-iso) map but otherwise it will be a GUI-fest... lots of buttons, lists, dropdowns, etc.

I assume that I can use my existing C++ engine for the game and simply build the interface over the top of it using TGB. Is that correct? The implementation that I would need is to fill those lists and drop-down boxes with "stuff" from the engine (simple function calls that return STL lists of contents), locations of stuff on the map, and of-course, sending events to the game engine through things like button clicks and what-not.

A) Is this feasible?
B) Is TGB the right choice for this?
C) How much of a headache will it be to integrate the existing C++ code to the TGB gui stuff?

Thoughts?

Dave Mark
Intrinsic Algorithm LLC

About the author

Recent Threads


#1
04/10/2009 (1:44 am)
TGB is an engine, not an API. If you turn your engine into an API, it would be possible to merge more easily, and possibly even expose your functions and classes to the scripting language.

Perhaps you should look at a non-game framework, like wxWidgets? If you need fullscreen stuff, it might be easier to do the GUI with SFML or SDL.
#2
04/10/2009 (7:50 am)
Thank you for your answer. I suppose I didn't mention before that I am also looking at TGB to be a solution for other similar ventures such as AI demos and the like.

I feel that my engine is almost API-like in that there is an obvious division between the engine and the current GUI. For example, there is no display code in the numerous classes of the game entities. The GUI classes simply calls certain public functions to retrieve information and then handles all the display work inside the GUI classes and code. It is this portion that I want to strip away and replace with a more graphical engine -- not just for GUI elements but with support for 2D display stuff as well.

I guess what I am more concerned about is how feasible and/or practical it is for me to combine my game engine classes to the C++ display engine classes of TGB and build a single solution out of it.

Again, thanks for the replies...

Dave Mark
Intrinsic Algorithm LLC
#3
04/10/2009 (9:00 am)
GameSWF, an open-source flash library is also an option.

are you looking for something to render not only the GUI but the elements of the simulation as well ? if it's 2D, again i think gameSWF might be a reasonable choice.
#4
04/10/2009 (9:08 am)
SFML looks interesting. However, I am not making a flash game so GameSWF is probably out.
#5
04/10/2009 (9:55 am)
right but you can use GameSWF as just the GUI for the game, not the game itself. this has been done with a couple TGE titles. I believe venture africa is a good example of using GameSWF as a GUI, and they have a free demo so you could give it a spin.

from my perspective the big advantage to GameSWF is that [i think] you can then leverage the huge amount of flash components, tools, and skills out in the internet.

i used the word "leverage" !
#6
04/10/2009 (1:02 pm)
GameSWF means your GUI is a vector GUI, so it scales to any size you want. Yeah, sounds like a good idea.

Did you know God of War used Flash as a major component? The details are linked from here:
http://msinilo.pl/blog/?p=149