Eventually I hope to be able to start from scratch and write my own game engine in C++, in the mean time I am taking a few short cuts and have started programming a game using a program from The Game Creators called DarkBasic Professional. This program uses a very simple BASIC type language but uses all of the features of DX9 which means I should be able to build something pretty good. I will document my progess here, and include lots of code snippets so if you are interested in using DarkBasic Pro you may find some useful information. If someone has any suggestions or requests, please don't hesitate to contact me through the Contact page.
I started using DarkBasic Professional quite a long time ago and have made lots of different programs testing all sorts of different ideas all aiming towards my goal of have a good Virtual Reality program. This has ended up with lots of programs, each with only a small amount of usable code. To avoid all of this segmented code I have started writing the final game software in a modular form so that I can work on different sections at any time and still be able to include it in the end product. The aim of the software is to give the user many options of what VR hardware they wish to use and what sort of virtual world they wish to enter. The first thing to develop will be a main menu system to allow the user to set all of the input and hardware options, to choose what 3D character they wish to use, what virtual world they wish to enter and what type of game they wish to play.
To begin making the main game menu I used a DarkBasic Pro add-on called BlueGUI. BlueGUI provides DarkBASIC Professional with stacks of new commands for creating a standard Windows based GUI in your programs. BlueGui allows the use of Windows, buttons, gadgets, dialogs, Internet controls etc in a DarkBasic Pro program. The only other option was to design my own GUI but it would take much longer to do that so I will use BlueGUI for now. The menu I have decided on includes these selections:-
- Game Type
- Enter VR
The Profile section is where a player can select which 3D character they wish to play as, as well as what name they wish to use. I have based this section on the way most other games work by allowing any number of different profiles to be saved. The details from each profile are all saved in separate files. These files are opened and the data is loaded whenever the game is run. To simplify the way the program lists the different character models to choose from I have written code that checks the names of every folder inside the "Characters" folder. Whatever the name of the folder is, will be the characters name. This makes it simple to add in new characters without having to change the code of the program.
Inside each character folder will be the image used to show the character in the menu, as well as the model itself, any textures required, and 2 other files containing information about the structure and animations of the model. To be able to manipulate the model in conjunction with the hardware trackers the bone numbers will need to be known and not all models will have the same bone numbers, so a settings file will contain bone numbers that will be read automatically. The animation frame numbers will also need to be known and may be different from one model to another so this information will also be contained in a settings file to be read automatically. By doing it this way new characters just need to be named with the same name as the folder that contains them, and have the relevant information in the settings files, and the game will be able to load the character and animate it without any other hard coding.