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
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
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
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
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 :-)