How to make an RPG - Role-playing games - in them the emphasis is on personifying the main computer hero, on identifying him with the human player...

Heresy #02
   #::######                                                    
  ::##############                                              
 ::##        ###########       #:##      ###      #######       
:###      ####   ###############:::#    #############   ###     
##       ######       #######:::#     ####     :  ###     ##    
######################      :##      #    ####  ######    ###   
#########         ######   #        #        ################   
                 ############      #   #   #::#######           
    ###########################   #    :   # #::# #  ########   
##########:::::###################    :::     ::::  #  #:#::::##
:######:::::::::####################  ::## ##### #::  #   ##::::
##########::#:########################:#:######## #:       ##::#
:###########       :################ ##:##########  :: :  ##::# 
##:::   #####   ##:################################ #::  ##:## #
         ::  #::::############### ###### ###########    #### ###
        #:   :::########## ###### ####:# ##:  #: ###  ##  ###%##
       #::  ########### #  ######:###::# :#:: ##:####    ######%
      #:: # :##### :# ::#  ###::#::###:# :##:###::#::   ###%#%%%
      ### #  :###  ::# #:# ##::####  ##     ## #####:: ###%#%:%:
       #  ## #:##  #       #::                      :: ####%%:::
                            ::                      :: ###%:%:::
                            #:                      :  ###%%%:::
                             #                      #  #%##%:%::
                              #                 ##    ####%%%%::
                               #               ### # ####%#%:%::
                                             ##########%##%%%:::
                                            #########%#%%%%%::::
   :##                                    ##########%#%%:%::::::
    # #:#                                #######%#%#%%%:%:::::: 
  ::   #  :#                            #######%##%%%:%:::::::  
:  ::#### :#  :##                  #   #####%#%#%%%%%:::::::  ::
  : :::::#### :### :### #### ## :# #  #####%##%%%%%%::::::      
   ::::#::::####   ::#  ::#  :# #### #####%##%%:%%%::::::  :    
: : :::%#%::::##### #:   ## ####### ####%##%%%:::::::::: :     :
   :::%#%::::::################### ######%%%%:::::::: : :       
 ::::%%:::::######################  ##%#%%%:::::::::::  :    :  
  #%#%:%::::#:#############:#######  ####%:%::::::: : :         
     ####::#:############ ::########  #%%%%%::::: :   ::  :     
 -I(E-   #:############# #::########  #%:%:::::::   :           
           ############  ##::######  #%%%::::::: :: : :         
               ######         ###  ##%%::::::: :  :   :         

                  ###### ######   #####                        %# # %# # % #                         
                   :# % :# % :: ###                         
                   :#### :#### # #                         
                   :# # :# :: ##                         
                   %# # %# %:::%#                         
                  ### # ### a$h %:%##                         
                   # % # ### #                         

 (C) Sergey Bobrovsky                                       

     Role-playing games - where the emphasis is on personalization
the main computer character, identifying him with
human player and for “education”, improvement of a number of qualities
hero, such as strength, experience, level, ym, agility, various
magical qualities, etc. These games go back to the tabletop RPG
"Dungeons & Dragons" with a complex scoring system and
development of qualities, conducting fights and exploring space.
This system was subsequently improved into "Advanced"
Dungeons & Dragons, the rights to which are owned by TSR, and
therefore, all game creators using the AD&D rules system
must obtain a license to do so from TSR.                         


     The game scheme itself is in many ways similar to the Adventure genre, only
In RPGs, progress is not made by making decisions.puzzles
and searching for key clue items, and mostly in the process
moving through many locations and in battles with enemies. When
When the hero reaches a certain level, emys become available
new opportunities that open up new aspects of the game, etc.
Let's try to describe the general algorithm of RPG games.                       

     The game map (each level) is presented as usual
in the form of an array of NxM cells, each of which stores
information about the possibility of passing through it, be it a wall, a hatch or
swamp, and the sprite number to display.                        

     Each character is characterized by such parameters as his
race (dwarfs, elves, people, ...), class (cleric, fighter, mage,
...), as well as a set of personal qualities: strength, intelligence, wisdom,
agility, health,... . Each of these parameters is contained in
a separate variable or in an array element.                    

 All game relationships are stored in special
prepared arrays that allow you to quickly obtain values
impact power depending on the race and class of the character, as well as
a number of other characteristics.  These arrays are represented in the form
multidimensional tables, one of the dimensions of which corresponds to
index of the hero's class, and others - the boundaries of the corresponding
values.  For example, addictionHP (Hit Points, hit size)
depending on the character's level and experience can be represented in
array HPLE[ 1..MAX_NUMBER_CLASSES, 1..MAX_LEVEL,
1..MAX_NUMBER OF EXPERIENCE, 1..2 ] like this: according to the first dimension - index
class (1-warrior, 2-mage, 3-cleric, 4-ranger...), for the second -
level, and the third - ranges of experience points, while in
HPLE elements [class-number, level-number, 1..MAX_EXPERIENCE_NUMBER,
1 ] the value of the next level of points will be stored in order
increasing, a in elements HPLE[ class-number, level-number,
1..MAX_NUMBER OF EXPERIENCE, 2 ] - corresponding HP values.
The return value must contain information about the range
points, for example +3+12. This can be presented in different ways.
In one of them, each of the boundaries is allocated two decimal places
digit, then our range will appear as 312. Translate it
does not represent in the corresponding algorithmic representation
no work.                                                 

         As an example, consider the procedure for obtaining HP:  

  Function GetHP( Class, Level, Exp: integer ): integer;        
  var i: integer;                                               
  begin                                                         
  { In case of error, return the minimum value: }            
  GetHP := HPLE[ Class, Level, 1, 2 ];for i := 1 to MAX_EXPERIENCE_NUMBER do                             
      if HPLE[ Class, Level, i, 1 ] >= Exp then                 
         begin                                                  
         GetHP := HPLE[ Class, Level, i, 2 ];                   
 exit                                                   
         end                                                    
  end;                                                          

     For a ranger character whose level is 5 and whose experience is
- 5500 points, the challenge will be carried out in the form                         

  HitPoints := GetHP( 4, 5, 5500 );                             


             0. Determining the goal of the game and its parameters.          

     Because the AD&D system is very flexible, it provides
Dungeon Master-y wide possibilities for choosing a topic
specific game.  For example, in ~Eye of the Beholder~ it is put
such a task: the mayor of Waterdeep, Mr. Kielben, hires a group
brave fighters led by you, as the toughest warrior, for
destruction of the evil Kcahatapa.  You'll have to go down to
sewers, get through the settlements of dwarves and elves,
break into the inner chambers of Kcahatapa's possessions and finish there
with him.  To do this you must create your own group. Your choice
will offera number of characters, each of whom has a creheput program
randomly his personal qualities.                          

             1. Advancement on the map.                           

     The process of passing each level is in many ways similar to
passing Adventure games.   It is necessary to find a number of key
objects such as levers that open secret doors,
spells, different types of weapons or jewelry, grapple
with squads of monsters and emerge victorious, while improving your
indicators, which is actually the main task.
The improvement of various qualities occurs in accordance with
AD&D rules included in the program, taking into account race and class
each of the group members.                                       

             2. End the game.                                

     When the goal is achieved, the game creators usually resort to
the following technique: all the parameters of the hero and sometimes his members
groups are saved in a special file, e if you buy
continuation of this game, usually a trilogy, then you can download
your hero's parameters from this file, instead of
start from scratch. Firstly, the hero’s individuality is preserved,
and secondly, its level will be higher than the initial one, which is important
to successfully complete a new game.Many firms have gone beyond the usual AD&D rules by attempting to either
significantly expand them, or significantly change them by applying to,
for example, the space genre, but these attempts have not yet yielded
quite successful results.  The AD&D system was developed
many years, and it is so precisely balanced that any
attempts to make changes to it usually lead to a decrease
playability.  That's why some companies just cheat on
standard rules, interesting plot, cool graphics,
musical accompaniment.  The difficulty of programming these games
difficult to assess unambiguously, on the one hand, the AD&D rules are very
detailed and published in detail almost algorithmically
level, almost every step is regulated in them, so cam
game mechanism consisting of many tables and their relationships,
easy to program, but this mechanism must be attached
Adventure-shell and a fairly original plot that
is quite labor-intensive and requires, first of all, no effort
programmers, designers and game designers.             

Share your thoughts about the article