Animated RPG Battle Engine 1.2

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
Habitacle
Newbie
Posts: 6
Joined: Tue Aug 04, 2020 9:53 pm
Contact:

Animated RPG Battle Engine 1.2

#1 Post by Habitacle »

Image

Download and documentation in GitHub
https://github.com/Habitacle/battle-engine

Fully automated RPG battle framework with ATL, battle formulas and randomization.


Features
  • 3 player slots and 8 monster slots
  • Monsters split between two rows (you can't attack a monster in the back row if there's another one in front of it)
  • Active and passive skills
  • Player skills can target enemies (one, more or all), allies (one or more), k.o. allies (to revive them) and themselves
  • Monsters can use skills too (attack only)
  • "Attack", "Defend" and "Use Item" commands
  • Damage, accuracy, experience and leveling formulas
  • Randomized monster selection and slot position
  • In-battle inventory system
  • Player selection screen
  • Mouse-following Tooltips
  • Message box at the top of the screen
  • ATL for players, monsters and damage display
  • Animated hp and mp bars

Credits

Music
Lucy Villarreal @filmnoirtoday

Scripts
Inventory system by saguaro
TransitionConditionSwitch by Asceai
Mouse following Tooltip by Human Bolt Diary
Random statement by PyTom
Random Bag by PyTom
Shake function (animation.rpy) by nyaatrap
Inspired by Dragonaqua's RPG Battle System

Sprites
Character sprites from Persona Q2: New Cinema Labyrinth
Monsters sprites from Pokémon Black / White
Item sprites from Atelier Totori: The Adventurer of Arland
Backgrounds from Hyperdevotion Noire: Goddess Black Heart
Skill sprites from Castle Clash

Sound effects
Pokémon GO
Pokémon Sun / Moon
FATE Undiscovered Realms
Fire Emblem: Awakening
Last edited by Habitacle on Mon Feb 01, 2021 10:53 pm, edited 2 times in total.

User avatar
anh0814
Newbie
Posts: 21
Joined: Wed Jul 08, 2020 4:37 am
Tumblr: https://anh0814.tumblr.com/
Contact:

Re: Animated RPG Battle Engine 1.0

#2 Post by anh0814 »

This looks amazing! I'm going to try it when I got a hold of my laptop. Thank you sharing. ❤

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Animated RPG Battle Engine 1.0

#3 Post by RicharDann »

This looks very nice and helpful!

Thanks for sharing it!
The most important step is always the next one.

EightiesOne
Newbie
Posts: 12
Joined: Fri Sep 04, 2020 2:31 pm
Contact:

Re: Animated RPG Battle Engine 1.0

#4 Post by EightiesOne »

This was exactly what I was searching for.

Thank you for sharing with us.

User avatar
Mokus
Newbie
Posts: 11
Joined: Wed Sep 26, 2018 8:43 pm
Completed: 0
Projects: Charlesdof
Organization: Mokus
IRC Nick: Mokus
Tumblr: Charlesdof
Deviantart: Charlesdof
Github: Charlesdof
Skype: Mokus
Soundcloud: Mokus
itch: amehynda
Location: Paraguay
Discord: Mokus
Contact:

Re: Animated RPG Battle Engine 1.0

#5 Post by Mokus »

This is a really cool idea! I tried it out and found it to be really fun to customize. I've got a few ideas for future releases...

Feature Suggestions:

1. Have characters have a persistent set of skills
- As it is now, characters have a fixed set of skills that is re-defined every single time a battle starts.
- Trying to add a list of skills to a character definition (instead of using the addSkill() function) results in an error. Conversely, monsters don't have this problem, and you can add any number of skills you want inside the array of skills that it has.

2. Gaining new skills
- Characters should be able to have additional skills given to them upon leveling up or accessing an event (such as story progression).
- Should use the same addSkill() function that's used in skill_def.rpy, then add it to the persistent skill set (see suggestion #1 above)

3. Status effects
- Some of the code references this, but no actual status effects (poison, sleep, confusion, etc.) are defined anywhere.

Habitacle
Newbie
Posts: 6
Joined: Tue Aug 04, 2020 9:53 pm
Contact:

Re: Animated RPG Battle Engine 1.0

#6 Post by Habitacle »

Mokus wrote: Fri Oct 16, 2020 5:34 pm This is a really cool idea! I tried it out and found it to be really fun to customize. I've got a few ideas for future releases...

Feature Suggestions:

1. Have characters have a persistent set of skills
- As it is now, characters have a fixed set of skills that is re-defined every single time a battle starts.
- Trying to add a list of skills to a character definition (instead of using the addSkill() function) results in an error. Conversely, monsters don't have this problem, and you can add any number of skills you want inside the array of skills that it has.

2. Gaining new skills
- Characters should be able to have additional skills given to them upon leveling up or accessing an event (such as story progression).
- Should use the same addSkill() function that's used in skill_def.rpy, then add it to the persistent skill set (see suggestion #1 above)

3. Status effects
- Some of the code references this, but no actual status effects (poison, sleep, confusion, etc.) are defined anywhere.
Thanks for the suggestions, I'll add them eventually. Right now you can't add a list of skills directly to the character definitions because the skills aren't defined before the characters. You can fix it by defining the skills like this:

Code: Select all

default arrowhail = ActiveSkill("Arrow Hail", 10, 40, "bow", "all", img="arrowhail", back_row=True)
Another workaround would be to leave the skill definitions as they are and replacing all the addSkill() functions for each character with something like:

Code: Select all

$ a.skills=[arrowhail, mindfreeze, thunderbolt]

chellophane
Newbie
Posts: 15
Joined: Fri Dec 06, 2019 11:24 pm
Contact:

Re: Animated RPG Battle Engine 1.0

#7 Post by chellophane »

awesome!!! can't believe i'm seeing this only now, this is amazing

thank you for your work :) i definitely want to use this in one of my projects
i was redredswap!!!!!!

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Animated RPG Battle Engine 1.0

#8 Post by _ticlock_ »

Hi, Habitacle,

That looks really handy. Thank you!

PS: I like the credit section. It makes good sense for educational purposes.

elshowdedarko
Newbie
Posts: 4
Joined: Sat Jun 13, 2020 4:41 pm
itch: onelevelmore
Contact:

Re: Animated RPG Battle Engine 1.0

#9 Post by elshowdedarko »

Hello! I would like to use this code in a prototype that I am making for a narrative game. I don't know how to code. But I have a problem...

I wish I could make enemies can be preset rather than random. How can I define what enemy will be in a specific battle ... if at all?

Habitacle
Newbie
Posts: 6
Joined: Tue Aug 04, 2020 9:53 pm
Contact:

Re: Animated RPG Battle Engine 1.0

#10 Post by Habitacle »

elshowdedarko wrote: Sat Dec 19, 2020 8:53 pm Hello! I would like to use this code in a prototype that I am making for a narrative game. I don't know how to code. But I have a problem...

I wish I could make enemies can be preset rather than random. How can I define what enemy will be in a specific battle ... if at all?
Hi, that is not possible yet, but I'll add it when I update it. Thanks for the suggestion.

For now, in setup.rpy all monsters are added to the "wild_monsters" variable as a list. You can edit this list so it will choose randomly between another set of monsters.

Habitacle
Newbie
Posts: 6
Joined: Tue Aug 04, 2020 9:53 pm
Contact:

Re: Animated RPG Battle Engine 1.1

#11 Post by Habitacle »

Version 1.1 update
  • Added a way to use fixed sets of monsters instead of picking monsters at random
  • Moved the skill definitions to battle_def, so now you can add a default set of skills for each character in char_def
  • Changed the color of the monsters when they're dying
  • Changed the duration of some pauses between attacks and actions
  • Added "()" (empty parameter list) to all screen statements to make them load faster (https://www.renpy.org/doc/html/screen_optimization.html)
  • Edited some of the sound files to make them shorter and less annoying
  • Removed all "renpy.sound.stop()" statements (they weren't doing anything)
Last edited by Habitacle on Mon Feb 01, 2021 10:57 pm, edited 1 time in total.

Habitacle
Newbie
Posts: 6
Joined: Tue Aug 04, 2020 9:53 pm
Contact:

Re: Animated RPG Battle Engine 1.2

#12 Post by Habitacle »

Version 1.2 update
  • Fixed a bug where a character would not die instantly when killed in the last monster's turn.
  • Fixed a bug where cancelling the "Use Item" action would end the players turn after choosing another action.
  • Added a "blank" transparent image for characters when they die, so the images will dissolve instead of disappearing instantly.
  • Added monsters' HP in numbers under their health bar.
  • Added a custom cursor.
  • Replaced CharStats class with a generic character class to add more flexibility.
  • Replaced the old function to randomize audios with PyTom's "Random Bag" function (https://patreon.renpy.org/python-tricks-2.html).
  • Passive skills are now in a different attribute list: "p_skills".
  • Changed the graphics and layout of the skill screen.
  • Right-clicking works as a "Cancel" button on some screens now.

User avatar
Bryy
Veteran
Posts: 407
Joined: Thu Dec 20, 2012 10:12 pm
Completed: 30+ games so far
Projects: Furry Shakespeare
Organization: Stegalosaurus Game Development
Location: Portage, MI
Contact:

Re: Animated RPG Battle Engine 1.2

#13 Post by Bryy »

This looks really cool.

User avatar
KebecMaslow
Regular
Posts: 39
Joined: Mon Feb 28, 2011 12:28 pm
Projects: Here's Evil
Organization: Grupo Tricksters
Location: At my pc
Contact:

Re: Animated RPG Battle Engine 1.2

#14 Post by KebecMaslow »

This is an amazing engine, but maybe you should do some tutorials for beginners like me T.T
"The men grew fond of themselves, forgetting all the fears and hardships of the past... until the darkness came back for them."

Post Reply

Who is online

Users browsing this forum: No registered users