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.
-
Habitacle
- Newbie
- Posts: 6
- Joined: Tue Aug 04, 2020 9:53 pm
-
Contact:
#1
Post
by Habitacle » Wed Aug 05, 2020 2:24 pm
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.
-
RicharDann
- Veteran
- Posts: 284
- Joined: Thu Aug 31, 2017 11:47 am
-
Contact:
#3
Post
by RicharDann » Fri Aug 07, 2020 8:16 am
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:
#4
Post
by EightiesOne » Mon Sep 07, 2020 1:27 pm
This was exactly what I was searching for.
Thank you for sharing with us.
-
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:
#5
Post
by Mokus » 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.
-
Habitacle
- Newbie
- Posts: 6
- Joined: Tue Aug 04, 2020 9:53 pm
-
Contact:
#6
Post
by Habitacle » Thu Dec 10, 2020 7:15 pm
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:
#7
Post
by chellophane » Sat Dec 12, 2020 7:25 pm
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!!!!!!
-
_ticlock_
- Veteran
- Posts: 391
- Joined: Mon Oct 26, 2020 5:41 pm
-
Contact:
#8
Post
by _ticlock_ » Mon Dec 14, 2020 4:40 pm
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:
#9
Post
by elshowdedarko » 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?
-
Habitacle
- Newbie
- Posts: 6
- Joined: Tue Aug 04, 2020 9:53 pm
-
Contact:
#10
Post
by Habitacle » Tue Dec 22, 2020 6:51 pm
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:
#11
Post
by Habitacle » Sat Dec 26, 2020 9:29 am
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:
#12
Post
by Habitacle » Mon Feb 01, 2021 10:57 pm
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.
-
Bryy
- Veteran
- Posts: 404
- Joined: Thu Dec 20, 2012 10:12 pm
- Completed: 30+ games so far
- Projects: Furry Shakespeare
- Organization: Stegalosaurus Game Development
- Location: Portage, MI
-
Contact:
#13
Post
by Bryy » Fri Feb 19, 2021 10:51 pm
This looks really cool.
-
KebecMaslow
- Regular
- Posts: 39
- Joined: Mon Feb 28, 2011 12:28 pm
- Projects: Here's Evil
- Organization: Grupo Tricksters
- Location: At my pc
-
Contact:
#14
Post
by KebecMaslow » Mon Sep 13, 2021 10:14 pm
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."
Users browsing this forum: No registered users