Tuesday, May 14, 2013

RPG Equipment Menu


I'm continuing writing my book "How to make an RPG" and I've been creating the equipment ingame menu.

I forgot how involved this menu is, I had to create player stats, weapon stats and write the comparison code. This screen still isn't finished, a little more layout needs to be done but functionally it's as far as I want to take it. The player can change 3 different item slots - weapon, armour and accessory and each item can alter the players stats. The other thing of note is the menus here are filtered by item type to.

The weapons only alter basic stats by integer amounts at the moment. It wouldn't be too hard to add "increases attack by 50%" but I'm not going to get into that. I'm already quite off track!



2 comments:

Unknown said...

First of all, bought your book C# game programming for serious game creation. Read it and loved it! Built the game engine (after a few minor bumps here and there :D but it works great now). Currently researching how to load my blender models into the game engine. OpenGL has a .obj loader, but it is written in C++ (openglsamples.sourceforge.net). I have been trying to get it to work using the game engine from your book, but it would seem that there is something I am not doing right in the translation. Do you have any suggestions?

balaam said...

I've written an obj (in C++) a long time ago.

But I'd start off with a cube or triangle in obj format. Something very simple. Then you can trace through the loading and see what's going wrong.

If you have the cube's origin at 0,0,0 and the cube 1 in size, or some other simple numbers then it should be easier to debug.

I'd also get this cube drawn manually first, in immediate mode. Then once I had that working I'd get it working with vertex/index buffers. It's all just case of narrowing down where the problem might lie!

There are many things that could go wrong :D Is the camera set up correctly? Is it pointing the right way? Are the vertex / index buffers all being given the correct values? Is lighting turned off?

I can't remember but the camera in the book is probably super close up, so the front of a model might be clipped and you wouldn't see the back it, due back faces not being rendered. But it's hard to say.