Difference between revisions of "User:Xudojnik"

From The Battle for Wesnoth Wiki
Line 109: Line 109:
 
In perfect way, I should create some sort of database (TD).
 
In perfect way, I should create some sort of database (TD).
  
1) It consist of tree parts. First parts should contain booleans to check "does item useful?". And second should contain one big macro, what will create variables for "useful items".
+
1) It consist of tree parts. First parts should contain booleans to check "does item useful?". And second should contain one big macro, what will create variables for "useful items". There will be as much of this DB's as slots for items.
 +
 
 
  void UpdateDatabase()
 
  void UpdateDatabase()
 
  {
 
  {
Line 136: Line 137:
 
   }
 
   }
 
   Player.damage = ( TD[Player.class].strength + TD[Player.inv.body.item_id].strength + TD[Player.inv.boots.item_id].strength + Player.buffed.strength ) * ( TD[Player.inv.melee.item_id].strength_multiplier + Player.buffed.strength_multiplier );
 
   Player.damage = ( TD[Player.class].strength + TD[Player.inv.body.item_id].strength + TD[Player.inv.boots.item_id].strength + Player.buffed.strength ) * ( TD[Player.inv.melee.item_id].strength_multiplier + Player.buffed.strength_multiplier );
 +
  //Each class of items have it's own list of possible values. Thats why I call to each item, which can have such stats.
 
  }
 
  }
  
Line 145: Line 147:
 
  }
 
  }
  
  void PickUpItem(itemid, itemtype, uint * Player)
+
  void PickUpItem(itemid, itemtype, unit * Player)
 
  {
 
  {
 
   CreateVariablesOfItem(new_item_id);
 
   CreateVariablesOfItem(new_item_id);
 
   Give Stats(new_item_id);
 
   Give Stats(new_item_id);
 
   usefulness[new_item_id]=1;
 
   usefulness[new_item_id]=1;
}
 
 
void CancelStats(itemid, itemtype, unit * Player)
 
{
 
Player.inv.$itemtype.
 
 
  }
 
  }

Revision as of 18:41, 2 September 2010

I know Wesnoth from version 1.1.2a. This is really perspective game not only as strategy, but as RPG too. Large world, filled by history, epic battles, heroes and factions, is perfect for creating RPG. It's not so hard because Wesnoth have simple language, what support wide variety of events, easy way to define dialogs, items, forum and Wiki, where always can be found answer for any question.

There are function, what are completed or close to it:

  1. Weapon vendor.
  2. Potion vendor.
  3. Home(place, where hero can change his weapons, take rest).
  4. Stable, where hero can buy horse.
  5. Mounting/dismounting on that horse. Two types of weapon: for mounted hero and foot.
  6. Talking to NPC's.
  7. NPC's shedule in one string.
  8. Spellcasting system (general-purpose examples of spells, what can be copied and changed later).
  9. Quest log now wait for content.
  10. Beneficial spell effects needs only more spells.
  11. Improved inventory, Spellbook.

There are in the future:

  1. Dog (taming, training, feeding).
  2. Levelling and customising character.



At the end of my work, I get unimaginable amount of lags, long and boring loading time and HUGE savegames. And I leave it. Now I wait for stable version of BfW 1.9. The only reason is implemented persistent variables. I will wrote here some basic terms of this project.

WesMMO

To play it (now only in theory):

  1. Design new character.
    • Download WesMMO era.
    • Download beginner's map, designed for WesMMO.
    • Create game in lobby.
    • Create an "account" and character on it.
    • Win beginner's scenario.
  2. Get fun.
    • Download some other playable map, designed for WesMMO.
    • Create game in lobby.
    • Map will automatically use your account. Now choose any existed character and play.
I planned to invent spell-system in this MMO, but not yet decide about mana and cooldowns.

Character is a "team" of three units. Each unit have own stats, small inventory and spellbook.

Stats should be simple
Stamina - increases your hitpoints by 2 (3?) per point.
Strength - increases your melee damage.
Speed - increases your movement points.
Agility - increase your defense on each type of terrain by 1 per point and ranged damage.
Intellect of Spell Power (or both)- increase magical potence of unit
Inventory contains
Healing Potion - number of them.
Mana Potions - number of them.
Melee Weapon - affects melee combat: strength_multiplier and number_of_strikes and possibly defenses.
Ranged Weapon - affects ranged combat: damage_from_agility_multiplier and number_of_strikes.
Amulet - affects base stats, magical resistances and magical potency of unit
Body Armor - affects base stats, all resistances and defenses.
Boots - affects base stats and have movement_multipier.
Helm - affects melee resistances and magical potency of unit.

Each item has it own's id. Data about it will be stored inside WesMMO era. That allows me to implement 'inventory slots'. Players will carry unused items in them.

Spellbook will contains information about direct spells and units's auras.

How does this work

There should be macro to refresh visible stats of hero (hp, damage e.t.c.) It should be called when unit change it's base stats.

List of variables
stat.stamina.base + it will contain base stats, what will only depends from the class of unit
stat.stamina.buffed
stat.stamina.total_modifier need this to implement debuffs like -50% hp, default "1"
stat.strength.base +
stat.strength.buffed
stat.strength.total_modifier
stat.speed.base +
stat.speed.buffed
stat.speed.total_modifier
stat.agility.base +
stat.agility.buffed
stat.agility.total_modifier
stat.damage_multiplier
inv.healing +
inv.melee.item_id +
inv.melee.strength_multiplier +
inv.melee.agility_multiplier + possible implement this as "class bonus" or "weapon type"
inv.melee.speed + there are no proc system. thats why speed multiplier will be unused
inv.melee.defense
inv.ranged.agility_multiplier +
inv.ranged.strength_multiplier + who knows, who knows...
inv.ranged.speed +
inv.body.stamina +
inv.body.strength +
inv.body.agility +
inv.body.pierce +
inv.body.blade +
inv.body.blow +
inv.body.arcane +
inv.body.fire +
inv.body.cold +
inv.boots.speed_multiplier +
inv.boots.stamina +
inv.boots.strength +
inv.boots.agility +
inv.head.pierce +
inv.head.blade +
inv.head.blow +
spb.aura_id +
spb.aura_id +
spb.aura_id +
spb.direct_id +
spb.direct_id +
spb.direct_id +

In perfect way, I should create some sort of database (TD).

1) It consist of tree parts. First parts should contain booleans to check "does item useful?". And second should contain one big macro, what will create variables for "useful items". There will be as much of this DB's as slots for items.

void UpdateDatabase()
{
 for( int i = 0; i < NUMBER_OF_ITEMS; i ++ )
 {
  if( usefulness[i] )
   CreateVariablesOfItem( i );
  if( !usefulness[i] )
   ClearVariablesOfItem( i );
 }
}
unit Player;
StoreUnit( Player );
void UpdateStats( unit * Player )
{
 if( !usefulness[Player.inv.body.item_id] )
 {
  CreateVariablesOfItem( Player.inv.body.item_id );
  usefulness[Player.inv.body.item_id]=1;
 }
 if( !usefulness[Player.inv.boots.item_id] )
 {
  CreateVariablesOfItem( Player.inv.boots.item_id );
  usefulness[Player.inv.boots.item_id]=1;
 }
 Player.damage = ( TD[Player.class].strength + TD[Player.inv.body.item_id].strength + TD[Player.inv.boots.item_id].strength + Player.buffed.strength ) * ( TD[Player.inv.melee.item_id].strength_multiplier + Player.buffed.strength_multiplier );
 //Each class of items have it's own list of possible values. Thats why I call to each item, which can have such stats.
}
void TakeOffItem(itemid, itemtype, unit * Player)
{
 CancelStats(itemid, itemtype, Player);
 ClearVariablesOfItem(itemid);
 usefulness[itemid]=0;
}
void PickUpItem(itemid, itemtype, unit * Player)
{
 CreateVariablesOfItem(new_item_id);
 Give Stats(new_item_id);
 usefulness[new_item_id]=1;
}