Creating an RPG using a forum as a base
Introduction
The description is a bit vague - this is not about creating "forum RPGs" (pen and paper on a screen), rather, this is about creating visual online games, "MMORPGs" due to their potential scale, using a PHPBB forum as a strong base.
The case study will be my own game, Afar, which has become one of the more active on this board and is created and maintained using a PHPBB forum as a base.
Why use a forum? Why not just plain and straight PHP?
I do not trust myself to know how to make a strong and sturdy authentication system, nor a good-to-use administration panel.
While most of the coding and such is custom, the absolute base of a forum provides:
- A professional, safe, sturdy authentication (login/logout) system tried and tested over years
- A forum! Built into the game. Which you don't have to register seperate for. Which is complete and working from the get-go.
Before we start: what you need
First of all, you need a PHP and MySQL web host. You will probably have to pay for this. I am using a VPS (Virtual Private Server) at $19.99 a month, with a domain name which costs £15 a year.
PHPMyAdmin is invaluable and should really be installed. It will make things a lot easier and I will be using it for this workshop.
The stats you need depends entirely on your game, but take note that running a game using PHPBB is going to take rather more processing and bandwidth than just a simple forum.
Once you have set up PHPBB (please see PHPBB.com) you are going to need the mod for "pages". I believe that is this one but obviously versions might have changed and such since I set up Afar.
If you've done it right, check your host for, in your phpbb folder (whatever you decided to call it):
- page.php
- includes/functions.php
These are your game, in essence.
Behind the scenes... creating your files
At the top of functions.php you need to include a new file:
include 'functions_game.php';
Now create the following files:
action.php
includes/functions_game.php
How the game will work
Pages will be created in the admin control panel, linking to other pages, creating maps which can be followed to create an explorable world.
action.php will hold "things we can do" - actions.
page.php handles how the pages are displayed on the screen.
functions_game.php will hold important functions that are not part of phpbb by default. They will enable editing of profile fields on the go, game variables and switches, and the concept of user stats and variables.
Important notes before we begin
The system behind Afar is tailored to it, and is different to what I am going to describe now. Afar was not built to be "the system behind many games", it is the system behind Afar.
What I am going to describe how to do is basically a shell system which can then be used for any game, in a similar, but altogether different, style.
Useful things to know before we begin
- HTML
- Basic PHP or knowledge of how programming languages work in general
- Basic SQL and knowing your way around phpmyadmin
Goals and aims
I would like to therefore list the goals and aims of this workshop, what will be achieved:
- A basic game created in PHPBB
- A series of graphical maps representing an explorable world
- The basics of creating a battle system and other useful "features"
Some ground rules
- The following coding and tutorial is offered as is with no warranty as to even it's usability or fit-for-purposeness.
- I and HBGames hold no responsibility for any losses or damage incurred by use, or misuse, of this tutorial in any way shape or form.
- No making a game better than Afar >