Visual Basic RPG Tutorial

Written by darrin koltow
  • Share
  • Tweet
  • Share
  • Pin
  • Email
Visual Basic RPG Tutorial
The VB editor's "Step into" command help you locate game bugs. (Kutay Tanir/Photodisc/Getty Images)

Visual Basic (VB) is a programming language developed by Microsoft to create programs rapidly. Role playing games (RPGs), where players strive to increase the wealth and status of their characters, are one of many types of games you can create with VB. Developing these games involves writing source code simulating the opponents, obstacles and other elements of an RPG. You write this code in an integrated development environment (IDE), such as the one that ships with VB. Writing a VB RPG game is essentially creating a dynamic, interactive virtual world whose rules you define.

Skill level:


  1. 1

    Download, install and play an RPG whose code is open source, or available for free. Such games include Dark Crow and Simbion.

  2. 2

    Write, as you play, the answers to questions such as "What are this game's most interesting elements? What changes would make this game as fun to play as possible?"

  3. 3

    Download the game's source code files, then read the documentation that comes with the source code. In particular, note what programming language the game was written in.

  4. 4

    Download and install a software development kit (SDK) for the programming language from Step 3. If the game's source code is in Java, download the Java development kit (JDK) from Oracle's JDK download page. If the source is in C++ or C, download an SDK from the GNU Compiler Collection page.

  5. 5

    Compile the game's executable program (i.e. its .EXE file) by following the instructions included in the SDK's documentation. Play the game to ensure the compilation was successful.

  6. 6

    Print out the source files you downloaded in Step 3, then create a new set of source files by typing them manually. Typing the source code will begin to teach you the game's language and algorithms.

  7. 7

    Delete, then retype from memory, each of the game's source files. Refer to the printouts only as necessary. Repeat this step until you can recite the complete program by memory. This step will give you a complete understanding of the game's workings.

  8. 8

    Read each of the topics on the MSDN "Visual Basic Language Walkthroughs" page. For each topic you read, paste its sample program into the VB IDE, then run the program by pressing "F5.'

  9. 9

    Retype the sample program from memory, as you did the game's original source code. Retyping each of the small programs from the VB Walkthroughs page will yield sufficient skill in VB to allow you to convert the game's original source code to VB.

  10. 10

    Write, in the VB IDE, the VB equivalent of each function from the game's original source code. For example, your game's source may show this Java code for determining if the game is over:

    private boolean blnGameOver(goal Points, playerCurrentPoints) {

    if (playerCurrentPoints >= goal Points) return true;

    else return false;


    You might rewrite that code in VB as follows:

    Function blnGameOver(goal Points, playerCurrentPoints) as Boolean

    If (playerCurrentPoints >= goal Points) then

    blnGameOver = true


    blnGameOver = false

    end if

    End Function

  11. 11

    Press "F5" in the IDE to run the game, then debug any errors using the IDE's debugger. Refer to the debugging topics in the IDE for detailed instructions on debugging.

  12. 12

    Rewrite the list from Step 2 to place the easiest changes first, then write the VB source code for the list's top item. For example, if the item reads "The hero would look better in a black shirt," you might write "Character1.clothes.shirt = BLACK".

  13. 13

    Write the VB code from the remaining items in the list to fully customise the game based on your design ideas. Recompile, debug, and play the completed VB RPG game.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.