Game Development Community

Two questions in need of some answering

by John Paul Koczan · in General Game Discussion · 07/05/2004 (10:53 pm) · 4 replies

Hi, I just got the Reactor Engine, and am decent at programming, however I am totally new to game programming and using an "engine" all-together. My questions are:

Does anyone could help me or at least know where I could find a tutorial to basically hold my hand to to just get started making a simple (very simple) program with this engine. I have read most of the documentation and looked at all of the examples, and it is very thorough, but (in my opinion) fails to explain exactly how to use the engine to create your very own game. I am using VS .Net 2003 if that helps. ANY information at all would be greatly appreciated. And that leads me to the next question:

I was trying to figure out how to make my own simple program (my own Solution/vcproj/etc files)using the engine, and am getting an error as such:

TestProgram error LNK2020: unresolved token (0A00000F) Device_Input
TestProgram error LNK2020: unresolved token (0A000022) Device_GFX
TestProgram error LNK2020: unresolved token (0A000032) Device_Ini
TestProgram error LNK2020: unresolved token (0A00003A) Device_Font
TestProgram error LNK2020: unresolved token (0A00003B) Device_OS

Again, any help would be...helpful. I hope I am not being a burden, I am just very excited to start programming and making my own games. Thanks again.

#1
07/06/2004 (12:17 am)
Hi,

First off, I use Visual C++ 6 so there may be some issues with .NET that I'm not aware of. With that said, lets see ...

As far as tutorials go, there is only really what comes with Reaction Engine as far as I know. If you're experienced at programming, it may help to forget the concept of "engine" and think of it as "library," which is what it is as far as the compiler is concerned. Reading through the documentation will get you the basics, reading through the examples will get you a bit more understanding of the basics. There is also a lot of documentation that only exists as comments in the source code to Reaction Engine itself, so I suggest reading through that in any areas where you're not sure on how things work.

As far as your errors goes, it sounds like you're not using the correct namespaces. RE uses namespaces extensively. To use a device, you can either specify it explicityly, for example RE_GFX::Device_GFX, or you can add a line at the top of the .cpp file after the includes something line "using namespace RE_GFX;"

The following should get you most, if not all, of what you're using:

using namespace RE_IO;
using namespace RE_GFX;
using namespace RE_TXT;
using namespace RE_RES;
using namespace RE_MATH;
using namespace RE_INPUT;
using namespace RE_SND;

I believe this may be covered further in one of the earlier docs, if not just snip it out of the examples or check the header files.

Hope that helps,

Tom.
#2
07/06/2004 (2:12 pm)
Thanks for the speedy reply. I have been reading the comments in the source code as I go along and it does seems to be helping.

All those "using namespace ..." were already in the code. Just to tinker around with the program, I tried to make a solution and program of my own, but just cut-and-pasted the code from "Getting_Started.cpp" into my program to see what I all needed to make a program run. I'm still running into the same errors.

One thing I forgot to ask was: DOES YOUR OWN PROGRAM NEED TO BE IN ANY SPECIFIC LOCATION (FOLDER) for things to work properly? Stupid question I'm sure, but I appreciate any information.

Thanks again for all your help.
#3
07/06/2004 (4:06 pm)
Hmm. It could be you're not linking to ReactionEngine.lib, check the linker settings for your solution and the sample's solution. Dont forget to do the same for both Release and Debug builds.

Your program doesnt need to be in any particular place, it just has to have its data accessible. The way I usually set things up (regardless of engine) is to have a Game directory outside of the Source directory, then I tell VC to put the executables in the Game directory. Basically, I get the Game directory as it would be when installed on the player's machine and make sure that all resources (e.g. art, models, etc) are referenced in the source using relative paths. That way they are loaded from whatever the current directory is (e.g. the same place as the .exe) This approach has it's pitfalls, but it's been working great for me for years.

Tom.

PS. If you understood all that, well done, I'm a bit tired and incoherent at the moment :)
#4
07/06/2004 (5:39 pm)
By the way, the latest release of RE does NOT build out of the box with VS.NET. I've sent the appropriate fix to Joe and Clark at bravetree.

RE_OBJ_Persistent.h:52 :: changed
int handle = -1
to
int handle
as the C++ spec no longer allows default args in typedefs

RE_Math.h:97 :: changed
{ return((int)(sqrt(SQ(x) + SQ(y)))); }
to
{ return((int)(sqrt(double(SQ(x) + SQ(y))))); }
to quell an 'ambiguous call to overloaded function' error.