Tuesday, May 21, 2013

Brief Update

I'm back on to writing the book now after integrating some changes I made when developing the menu system. I'd like to be able to concentrate on writing the book full-time but I'm going to have some downtime both the end of this week and the whole of next week, frustrating but unavoidable!

Sunday, May 19, 2013

RPG Status Menu

The end of last week I was traveling but today I've progressed a little with the "How to Make an RPG book". I've finished all the menu modes, so tomorrow I'll return to writing text again which will be good!



Here's the status menu. The textbox for the commands isn't written in a nice way at the moment but it will be a long while before I actually reach this menu in the book and I'll rewrite it then.

(As well as the status menu, I also finished off the equip menu and rewrote a lot of the menu code to make it shorter and consistent.)

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!



Monday, May 13, 2013

RPG Magic Menu

Menu systems in JRPG games have to convey an awful lot of information in quite a limited space, so I definitely have respect for what the designers of classic JRPGs were able to do. (Though I also think there's plenty of room for improvement! And that they have gradually improved with more modern games)

Anyway today I did not get a lot done. I'm writing the code for the menu screens and making them almost fully functional. I finished off the item menu and did the magic menu too.

Creating these menu's forces you to make decisions about the game, so in some cases I've made things up to fill out the menus. Will examples in the book have a fire spell? Probably, but it may not be called "Fire" and will there be a branch of magic called "Sword Magic" ... probably not :)

The magic menu is just going to allow browsing the spells and branches of magic available to each character. Tomorrow, if all goes well, I'll finish off the equipment screen and the item screen.


Thursday, May 09, 2013

JRPG Inventory

JRPG style inventory and menus
Recently for the "How to Make an RPG" book I've been coding up the inventory menu. In order to do this I've added a scrollbar widget, it's pretty functional, in the above screen you can see the size of the caret represents the amount of inventory being displayed at once. I've also created a new selection menu which can handle columns, display a subset of items and simple scrolling. It's easy to configure it's appearance from the number of columns to the spacing between elements.

I'm going to make the menu near to 100% functional, then get back to the writing.

All the art is placeholder - but the inventory icons are especially placeholder as I drew them, which is why the bag icon looks more like a spade or stingray.

If this post has caught your interest and you'd like to know more about the book I'm writing please check out the promo site here.

Wednesday, May 08, 2013

How to make an RPG: Making Menu Layout code suck a little less

As I'm writing more and more of the ingame menu code for my book "How To Make An RPG" I'm reminded of the Carl Sagan quote.
If you want to make an apple pie from scratch, you must first create the universe.

The menus for an RPG are absolutely integral to the game and they make use of a lot of game data. Want to display the party? Well you need a list of party members, each member needs an avatar and they need stats and levels and experience. Every part of the menu relies on a big chunk of the game already existing! But that's not a problem, I only need a small subsection of the menu for this part of the book and I can lock off the rest until we're ready for it.

RPG menus are commonly made of backing panels. These panels are a pain to position. I had some helper code but it wasn't clear and easy enough. Therefore I decided to create a special piece of code, just for handling these panel layouts which makes it far easier to build up the menu screens.

Here's my current menu:


This is somewhat hardcoded. I create the top title panel first offset from the top of the screen. Then I created the menu panel the length of the screen, then reduced it by the height of the time/gold panel. Finally I work out the position of the party panel offseting it from the menu panel. It's kind of a pain in the ass and even with my offset helper functions, there's a lot of manual calculation.

After I finished the above screen, I started on the item screen and quickly realised I needed an easier way to construct these menu and so I created a class called PanelLayout which starts with a panel that fills the entire screen.



I don't want the menu to take up the full screen, I want some nice padding around it. Therefore I contract the screen panel by calling PanelLayout:Contract("screen", 80, 40) , 80 pixels of padding on the horizontal and 40 on the vertical.

Next I want to make the title bar at the top, so I cut this panel into two pieces using the command SplitHorz("screen", "top", "bottom", 0.13, 4) which means split the screen panel into two panels called top and bottom. Do the split 13% from the top and have 4 pixels of spacing between these two child panels.
Then I do a vertical split to separate out the menu and party panels. SplitVert("bottom", "left", "party", 0.76, 4)

One final split, pl:SplitHorz("left", "menu", "gold", 0.7, 4),  for the gold box and we've got the desired layout, in around 4 lines of code. Far better than my initial attempt! 
I'm going to continue and flesh out the menu with the appropriate layouts for each screen and then add a little functionality where necessary.

If this post has caught your interest and you'd like to know more about the book I'm writing please check out the promo site here.



Tuesday, May 07, 2013

In Game Menus for RPGs

I'm going to be running ahead with the code again, a little this week, getting some of the menu stuff written out. Then I'll go back through it making it as simple as possible. The book won't create a full gui system as it would take up too much room, instead a lot of the positions and layout will be hard-coded (which, perhaps counter-intuitively, is a good thing, the layout code won't obscured by some opaque scene-graph, applying transforms to every element in a hierarchy, swarming with subtle bugs)


The above image shows a menu made up of panes, with the character panes heavily inspired by Final Fantasy 7. The same character is just displayed 3 times with a increased Y position. The MP, MP & XP bar are all working, the progress bar element is also something that was created in the previous chapter. The area under the Next Level will probably be used for status effects, but  I don't have any the moment (when I do this could be a good place to get some placeholder art http://game-icons.net/)

I want to add a GOLD/TIME piece of hud into the screen shot above. Then I want to start fleshing out some of the submenus.  

The problem with UI stuff is whatever you do, there tends to be a lot of code / data! But I'm going to try and keep it to a minimum.

If this post has caught your interest and you'd like to know more about the book I'm writing please check out the promo site here.

Saturday, May 04, 2013

How To Build An RPG: A narrative diversion

I'm writing my next book "How to Make an RPG" and I'm slowly coming to the end of the first part.

Recently I've been adding in a little of the game framework using a 'state stack'. The architecture is quite simple but suprisngly powerful. I want to demonstrate how powerful it is, so there's a small section in the book that creates the scene shown below.

A basic "game start" type narrative. All graphics are placeholder.

The image above demonstrates the use of the textboxes on the statestack and a simple fade state. The rest of this chapter will be about creating the in-game menu.

As always I'll be keeping this blog up to date with my progress and if you want to be notified when the book is coming out please visit the promo site below:


Friday, May 03, 2013

RPG Stack of States

I'm continuing writing my "How To Make An RPG" book.

Recently I went back through the GUI textbox code and text and changed it because I decided I could make it simpler and more straightforward. It took a while but was worth doing. Then even more recently I've moved off the GUI chapter and into the next chapter that lays down a little of the game framework and basic in-game menu. Once I've done this chapter, I'll be making a small game to finish this part of the book. After that it's combat.

Demonstrate a state stack, the textbox state and map-exploration-state
I've finally got to the stage where I'm combing GUI elements and the map code from previous chapters, so that's awesome! Each example gets closer and closer to resembling a full a game.

If this post has caught your interest and you'd like to know more about the book I'm writing please check out the promo site here. Learn how to write a JRPG style game such as Final Fantasy 6.