Game Menu/GUI

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Elmo115
Posts: 18
Joined: Wed Feb 06, 2008 11:35 pm

Game Menu/GUI

Post by Elmo115 »

I am trying to make a game menu for a game I am working on. It is to have simple features like Quit, Save, Load, and Settings. Is it better to type it in code or to use an editor like Irrlicht's GUIEditor? I've tried the editor and I cant seem to go anywhere with it.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Re: Game Menu/GUI

Post by Halifax »

Elmo115 wrote:I am trying to make a game menu for a game I am working on. It is to have simple features like Quit, Save, Load, and Settings. Is it better to type it in code or to use an editor like Irrlicht's GUIEditor? I've tried the editor and I cant seem to go anywhere with it.
Well it all depends on what you need to do. If you need a really complicated GUI, then I would recommend that you learn the GUIEditor. If you only need a simple one, then I recommend that you just write it by hand.
TheQuestion = 2B || !2B
Elmo115
Posts: 18
Joined: Wed Feb 06, 2008 11:35 pm

Post by Elmo115 »

OK I will just wirte it by hand then. Though I have been looking and cant find the funtion for saving the game. Any ideas?
Danny Gilbert
Posts: 54
Joined: Thu Oct 25, 2007 1:38 pm
Location: Montreal, Canada

Post by Danny Gilbert »

Irrlicht is not a game engine, it is for 3D. Saving game is Saving information, it is saving data. We talk about programming.

You need to have a class (or structure) that handle the GAME information and you need to serialize it in a file (save). Loading game is creating an instance of that class by setting all it's member (info) equals to the deserialized data from a file (the reverse process). Check on GOOGLE C++ Serialization.

You can also save info as a XML file or in registry, etc.
First of all, you need to DEFINE which information you want to keep and after that create method like SaveGame() and LoadGame() which call Serialize() and Deserialize().
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

See how Irrlicht saves the scene graph (saveScene()) it might help - it did helped me a lot..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Elmo115
Posts: 18
Joined: Wed Feb 06, 2008 11:35 pm

Post by Elmo115 »

I have been looking into both serialization and the savescene command. By just saving the scene, will that save everything like the location of the player, the progress of the game, the items picked up, etc. ? That is what I need to be done.
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

Elmo115 wrote:I have been looking into both serialization and the savescene command. By just saving the scene, will that save everything like the location of the player, the progress of the game, the items picked up, etc. ? That is what I need to be done.
No it wiil not.

Although the scene node has several properties that can be use for your game managment (in case you choose to use it), you will have a lot of extra info about your game, in particular , the progrress of the game, items picked, etc.

You must create a data structure, (struct, class etc) that handles with all this properties and the function that allows to uses them.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Elmo115 wrote:I have been looking into both serialization and the savescene command. By just saving the scene, will that save everything like the location of the player, the progress of the game, the items picked up, etc. ? That is what I need to be done.
No - See next quotes:
Danny Gilbert wrote:Irrlicht is not a game engine, it is for 3D. Saving game is Saving information, it is saving data. We talk about programming.

You need to have a class (or structure) that handle the GAME information and you need to serialize it in a file (save). Loading game is creating an instance of that class by setting all it's member (info) equals to the deserialized data from a file (the reverse process). Check on GOOGLE C++ Serialization.

You can also save info as a XML file or in registry, etc.
First of all, you need to DEFINE which information you want to keep and after that create method like SaveGame() and LoadGame() which call Serialize() and Deserialize().
Vsk wrote:You must create a data structure, (struct, class etc) that handles with all this properties and the function that allows to uses them.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Post Reply