Integration Phase 1b: Setting up the BaseSystem

The first thing to do in your code is to initialize the Gameware Navigation BaseSystem when you initialize your game, and to close it when you close your game.

The BaseSystem provides Gameware Navigation components with a set of basic services and information, such as memory management and logging.

At this time, the most important things to set up for your BaseSystem is your Gameware license key. This is required when using an evaluation copy of Gameware Navigation. Later on in your integration, you may want to set up your BaseSystem to use your own memory management, logging and performance profiling systems instead of the default systems.

For example: [code from Tutorial_FirstIntegration.cpp]

#include "gwnavruntime/basesystem/basesystem.h"
...

class MyGame
{
public:
    bool Initialize();
    ...
    void Destroy(); 
    ...
};
 
bool MyGame::Initialize()
{
    // Create a configuration object.
    Kaim::BaseSystem::Config config;

    // Copy the license key from the navigation.gamewarekey file.
    config.m_gamewareKeyConfig.m_gamewareKey = "1GAMEWARE1KEY1PROVIDED1BY1AUTODESK1";

    Kaim::BaseSystem::Init(config);

    if (Kaim::BaseSystem::IsInitialized() == false)
    {
        Kaim::BaseSystem::Destroy();
        return false;
    }
    ...
}
...
 
void MyGame::Destroy()
{
    ...
    Kaim::BaseSystem::Destroy();
}

Testing

Run your game. If your BaseSystem has been initialized successfully, you should see a message similar to the following in your debug output:

============== Gameware Key is valid until 2012.12.31 ==============

If you see the following message:

Error: Invalid gameware key (1GAMEWARE1KEY1PROVIDED1BY1AUTODESK1)- 
Navigation will not run correctly

check for typos in the license key, and check the expiration of the key listed for your project on the Gameware portal. See Licensing.