Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - RPG Battle - Test of Mechanics.

Reply to topic
Author Message
  • Joined: 30 Mar 2009
  • Posts: 295
Reply with quote
RPG Battle - Test of Mechanics.
Post Posted: Fri Jun 22, 2018 5:38 pm
First of all, i hope this is the correct subforum, if it's not, please move it.

I'm working a RPG/Dungeon Crawling game, using twee2sam.
And i just finished the first version of the battle mechanics.
It's turn-based and with 3 possible options for the player in each turn:
- ATTACK
- DEFEND (to regain HP)
- ESCAPE / RUN.

I want to know if my current implementation works, so i build a quick test-rom. It's just a 2 room tech demo. There are 3 enemies coded.

The final game won't use any of these assets, these i just picked up from opengameart for the demo.


Some technical information, and where i might need some help:

*** Stats: ***
p_hp = Player Hit Points
p_atk = Player Attack Points
p_wep_min = Player Weapon Points (Min - Range)
p_wep_max = Player Weapon Points (Max - Range)
p_def = Player Defense Points
p_lck = Player Luck Points (perhaps it's accuracy, instead of luck?)
p_xp = Player Experience
p_reg = Player HP Regeneration Points if DEFEND is succesful.
p_hp_max = Player MAX HP at that level.

e_atk = Enemy Attack Points
e_wep_min = Enemy Weapon Points ? (Unnecessary? / good to randomize the damage keeping the same formula as players)
e_wep_max = Enemy Weapon Points
e_def = Enemy Defense Points
e_hp = Enemy Hit Points
e_hp_min = Enemy Type Min HP (range) (useful to add variety).
e_hp_max = Enemy Type Max HP (range).
e_xp = How much XP this enemy gives the player when defeated (range this too?).
e_run = How easy/difficult is to evade this battle.

*** Test for HIT / ATTACK : ***
-- invert for enemy attack, using e_lck, e_atk, e_wep_min/e_wep_max, etc --
miss = random(1,100)
if(p_lck > miss) { damage = (p_atk + random(p_wep_min, p_wep_max)) - e_def; }
if(p_lck < miss) { no hit. }
if(p_lck == miss { critical hit = p_atk + p_wep_max - e_def; (remove e_def? for maximum damage? create a different type of critical? ) }
p_lck = higher is better
p_lck = 101 = always hit
p_lck = 0 = never hit (need? maybe have a "bad ending" type of situation, where the player luck is down to zero, possible to branch story.).

*** Test for ESCAPE ***
miss = random(1,100);
if(e_run > miss) { // escape }
if(e_run < miss) { // dont escape - iniciate enemy turn / take damage }
e_run = higher is easier to escape from this particular enemy (range this?).
e_run = 101 = always run from enemy.
e_run = 0 = never run (like a boss enemy).


What is a good way to calculate random battle?
right now the chance is literally 1 in 4. (not really, but you understand).
init_battle = random(1,4).
if(init_battle == 1) { // battle // }
else { // no battle // }



Alternative DMG Formula: (better?)
damage = atk * atk / (atk + def) - damage is never more than att, damage is never negative. it scalate well bigger stats, it seems.


determine enemy type by player level or location? (high player level should still face weak enemies?) or use different level of enemies, according to player's level ? (bat lv.1 bat lv.2 etc?)


Weapons can determine Luck (accuracy?) and damage (this is where p_wep gets used), i can manipulate both how likely is a hit to land and damage according to the current weapon.

Items can determine Luck. So, you can have better aim/weapon mod.



Any help / opinions would be nice.
Attached ROM for test of the mechanics.
rpg_battle_test.rar (12.12 KB)

  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 874
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Fri Jun 22, 2018 11:13 pm
It's looking pretty nice, so far. ;)
  View user's profile Send private message Visit poster's website
  • Joined: 30 Mar 2009
  • Posts: 295
Reply with quote
Post Posted: Thu Jun 28, 2018 7:31 pm
I had an idea, but i don't know if it will work.
instead of a defense system, to regain hp.
do a equippable regen item, that can regain X hp per fight.
but for every level equipped of this item, the max hp stat drops.

so you will have to balance how would you want to play.


I never saw any game with this specific mechanic, might work?
  View user's profile Send private message Visit poster's website
  • Joined: 25 Feb 2006
  • Posts: 874
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Thu Jun 28, 2018 10:32 pm
It could work, but it would definitely require balancing.
  View user's profile Send private message Visit poster's website
  • Joined: 30 Mar 2009
  • Posts: 295
Reply with quote
Post Posted: Fri Jun 29, 2018 1:40 am
Yeah, that's what i thinking, how to balance this.
because if max hp regained per fight = same ammount reduced from max hp, it makes no sense.

I'll probably have to try these, and see how it could work.
  View user's profile Send private message Visit poster's website
  • Joined: 30 Mar 2009
  • Posts: 295
Reply with quote
Post Posted: Wed Aug 08, 2018 1:19 pm
Been working on this,
I did kept the battle as it was on the demo, just changed some initial values, and added a leveling up system (so far, level cap is Level 4, because, it's all that is needed).

Here are a couple of screenshots.
I have trouble drawing portraits for characters, so i decided to use the same sprites, it's not as visually impressed, but i really can't draw portraits.

I hope it doesn't look too bad.

Also, since twee2sam games can't save. I am aiming for the game to be finished in around 1hr. Is that a good length? That is usually the time i dedicate to gaming "sessions".. i figured it should be okay?
smsrpg.png (1.59 KB)
smsrpg.png
smsrpg2.png (2.18 KB)
smsrpg2.png
smsrpg3.png (1.08 KB)
smsrpg3.png

  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!