BattleCommence! - Planning phase

Rationale for the Project

Developing a RPG is a daunting task. First of all, the developer faces the problem of having to lay out the plot and the characters. Next to that, the UI must be developed in a way that the players enjoy a great time with it. Within the UI there's multiple fronts: The "World" map, the "town" map and their corresponding navigation methods. However, one thing all RPGs have in common (at least the japanesesque ones) is the battle routine where the party characters engage in battle with their enemies that try to stop the noble (and sometimes not so noble) quest of the hero. BattleCommence tries to close the gap on battle development with a tool that makes it easy to implement battle logic without the hassle of designing the whole system.

As a side note, the target syntax of BattleCommence is an OpenGL alike public API.

When i have some time, i will wrap up everything here in a more nice manner, for now it's just a plain hard-to-read html

Let's do it right - Requirements

  1. The system must permit the wholly description of the scenario being played
    1. The system must have a way to set the name of the scenario
    2. The system must have a way to set the effects that are being applied over the characters on a given scenario, due to scenario properties
    3. The system must have a way to set the number of sides on the scenario
    4. The system must have a way to indicate the characters in a given scenario

    Data structure proposal (Internal):

    typedef struct bcScenario{
     char *name;
     
    bcEffect *effects;
     int numsides;
     int sideTurn;
     bcCharacter *characters;
    };

    Functions proposal (Public):

    int bcCreateScenario(void): Creates a new Scenario

    void bcDeleteScenario(int scenario): Deletes a given Scenario. Does nothing if the Scenario has been already deleted.

    void bcBindScenario(int scenario): Binds a given Scenario as current. The default Scenario is BC_SCENARIO_0. Does nothing if the Scenario is invalid.

    void bcSetName(int target = BC_SCENARIO, char *name): Sets the name of the currently bound Scenario. If there's no currently bound Scenario, changes the name of the default Scenario.

    void bcAddEffect(int target = BC_SCENARIO, int effect): Adds an effect to the currently bound Scenario. Does nothing if the effect already exists in the Scenario.

    void bcRemoveEffect(int target = BC_SCENARIO, int effect): Removes an effect from the currently bound Scenario. Does nothing if the effect isn't in the Scenario.

    void bcSetInt(int target = BC_SCENARIO_SIDES, int num): Sets how many sides there are on the currently bound Scenario.

    void bcAddCharacter(int target = BC_SCENARIO, int character): Adds a character to the currently bound Scenario. Does nothing if the character already exists in the scenario.

    void bcRemoveCharacter(int target = BC_SCENARIO, int character): Removes a character from the currently bound Scenario. Does nothing if the character doesn't exists in the scenario.

    In more mundane words: The system must have a way to indicate name, effects (modifiers), sides and the characters involved in the battle

  2. The system must permit the wholly description of the characters available
    1. The system must have a way to set the name of the character
    2. The system must have a way to indicate the side of a character
    3. The system must have a way to access the statistics for a given character
      1. The system must permit reading a stat of a given character
      2. The system must permit writing a stat of a given character, assuring the correctnes of the new values
    4. The system must have a way to access the effects for a given character
      1. The system must permit reading a effect on a given character
      2. The system must permit adding a effect to a given character
      3. The system must permit removing a effect from a given character
    5. The system must have a way to access the items that has a given character
      1. The system must permit reading an item on a given character
      2. The system must permit adding an item to a given character
      3. The system must permit removing an item from a given character
      4. The system must have a way to indicate the number of items the character has
    6. The system must permit introducing new stats on the fly
      1. The system must have a way to group stats
      2. The system must have a way to specify formulae to combine stats when certain (pre and user defined) events occur

    Data structure proposal (Internal):

    typedef struct bcCharacter{
     char *name;
     int side;
     bcStat *stats;
     
    bcEffect *effects;
     bcItem *items;
    };

    Functions proposal (Public):

    int bcCreateCharacter(void): Creates a Character.

    void bcDeleteCharacter(int character): Deletes a given Character. Does nothing if the Character is invalid.

    void bcBindCharacter(int character): Binds a given Character as current. The default Character is BC_CHARACTER_0. Does nothing if the Character is invalid.

    void bcSetName(int target = BC_CHARACTER, char *name): Sets the name of the currently bound character.

    void bcAddEffect(int target = BC_CHARACTER, int effect): Adds an effect to the currently bound Character. Does nothing if the effect already exists in the Character.

    void bcRemoveEffect(int target = BC_CHARACTER, int effect): Removes an effect from the currently bound Character. Does nothing if the effect isn't in the Character.

    void bcSetInt(int target = BC_CHARACTER_SIDE, int num): Sets the side of the currently bound Character. Does nothing if the character isn't included on a scenario or if the side isn't valid.

    int bcAddStati(int min, int max): Adds an stat to the available stats to the characters. Defines an integer range for the stat, with minimum and maximum values. If the minimum is greater or equal to the maximum, the stat doesn't have limits.

    void bcSetStati(int stat, int value): Sets the value of an integer stat to the currently bound character. If the new value falls outside the valid range for the stat, does nothing.

    int bcReadStati(int stat): Returns the value of an integer stat from the currently bound character.

    int bcAddStatf(float min, float max): Adds an stat to the available stats to the characters. Defines a floating point range for the stat, with minimum and maximum values. If the minimum is greater or equal to the maximum, the stat doesn't have limits.

    void bcSetStatf(int stat, float value): Sets the value of a floating point stat to the currently bound character. If the new value falls outside the valid range for the stat, does nothing.

    float bcReadStatf(int stat): Returns the value of a floating point stat from the currently bound character.

    int bcAddStatb(char val): Adds an stat to the available stats to the characters. Defines a boolean range for the stat, with initial value "val". Valid values for "val" are numeral 0 or 1.

    void bcSetStatb(int stat, char value): Sets the value of a boolean stat to the currently bound character. If the new value falls outside the valid range for the stat, does nothing.

    char bcReadStatb(int stat): Returns the value of a boolean stat from the currently bound character.

    void bcAddItem(int target = BC_CHARACTER, int item): Adds an item to the currently bound character. Does nothing if the character already has the item.

    void bcRemoveItem(int target = BC_CHARACTER, int item): Removes an item from the currently bound character. Does nothing if the character doesn't have the item.

    void bcAssignEvent(int event, int formulae, int stat, void *val): Assigns a stat modifying formulae to an event for the currently bound character. The event parameter may be any of the BC_CHARACTER_EVENT_* constant. The formulae parameter may be any of the BC_FORMULAE_*. The parameter val points to the corresponding bcFormulae struct for the given formula. There may be only one event*stat combination for a given character.

    void bcUnassignEvent(int event, int stat): Unassigns an event for the currently bound character.

    In more mundane words: The system must have a way to indicate name, effects (modifiers), stats, side, items and new abilities for a character

  3. The system must have a way to wholly describe an item
    1. The system must have a way to set the name of the item
    2. The system must have a way to indicate the possible targets for an item.
      Possible targets are:
      1. Self: Uses one charge of the item to deploy it on the user.
      2. Ally: Uses one charge of the item to deploy it on one of the user's allies.
      3. Enemy: Uses one charge of the item to deploy it on one of the user's enemies.
      4. Allies: Uses one charge of the item to deploy it on the user's allies.
      5. Enemies: Uses one charge of the item to deploy it on the user's enemies.
      6. Everyone: Uses one charge of the item to deploy it on every character.
      7. Scenario: Uses one charge of the item to deploy it on the scenario.
      8. Bearer: Doesn't use charges, the effect of the item is applied on the bearer of the item.
    3. The system must have a way to specify the number of uses that an item has available
    4. The system must have a way to specify the effects of an item
    5. The system must have a way to indicate the possible targets for every effect of an item.
      Possible targets are:
      1. Self: Deploys the effect on the user.
      2. Target: Deploys the effect on the given target for the item.
      3. Allies: Deploys the effect on the user's allies.
      4. Enemies: Deploys the effect on the user's enemies.
      5. Everyone: Deploys the effect on everyone.
      6. Scenario: Deploys the effect on the scenario.

    Data structure proposal (Internal):

    typedef struct bcItem{
     char *name;
     unsigned char targets;
     int numUses;
     
    bcEffect *effects;
    };

    Functions proposal (Public):

    int bcCreateItem(void): Creates an Item.

    void bcDeleteItem(int item): Deletes a given Item. Does nothing if the Item is invalid.

    void bcBindItem(int item): Binds a given Item as current. The default Item is BC_ITEM_0. Does nothing if the Item is invalid.

    void bcSetName(int target = BC_ITEM, char *name): Sets the name of the currently bound Item.

    void bcAddEffect(int target = BC_ITEM, int effect): Adds an effect to the currently bound Item. Does nothing if the effect already exists in the Item.

    void bcRemoveEffect(int target = BC_ITEM, int effect): Removes an effect from the currently bound Item. Does nothing if the effect isn't in the Item.

    void bcSetInt(int target = BC_ITEM_USES, int num): Sets the number of uses the currently bound Item has.

    void bcSetInt(int target = BC_ITEM_TARGET, int num): Sets the possible targets for the Item. This must be a combination with ORs of the BC_TARGET_* constants or 0, if the item doesn't target anything, this would mean that the item is a key one and mustn't be used.

    In more mundane words: The system must have a way to indicate name, effects (modifiers), type of targets and number of uses for an item

  4. The system must have a way to wholly define an efect (modifier). An effect is whatever modifies some stat of a character. It ranges from physical damage to new-level stats.
    1. The system must have a way to define multiple chained effects
    2. The system must have possibilities to apply the same effect to multiple characters
    3. The system must have a way to define the time an effect lasts
    4. The system must have a way to specify the decaying rate of the effects
    5. The system must have a way to specify the time to wait before an effect is applied to the target
    6. The system must have a way to specify if the effect is permanent or not

    Data structure proposal (Internal):

    typedef struct bcEffectDescriptor{
     char *name;
     int stat;
     int applyFormulae;
     void *applyVal;
     int decayFormulae;
     void *decayVal;
     char permanent;
     int TimeToLive;
     int TimeToWait;
    };

    typedef struct bcEffect{
     
    bcEffectDescriptor *effect;
     bcEffect *next;
     int target;
    };

    In more mundane words: The system must have a way to specify effects that will modify the stats of one or more characters

Send all your mail to john.villar (at) florhard.com and i will read it :-)

SourceForge.net Logo