Page 1 of 2
ALBS - RPG Battle/Inventory System
Posted: Wed Dec 27, 2006 12:06 am
by Counter Arts
Currently I am programming an RPG battle system for ren'py. However, I over-engineered it a bit and made it so open ended. For my game it's a bit too much, however, other people may want to use it.
Mind you this is the engine, not the interface. And you program the turn-order and stuff like that yourself. I'll be making a basic one though.
Anyone interested in using it?
Posted: Wed Dec 27, 2006 8:48 am
by DaFool
I'm definitely interested.
And if I can implement something like the Grandia battle system on it, I will worship you forever.
Posted: Wed Dec 27, 2006 9:19 am
by Counter Arts
Actually I didn't know about the Grandia (III) battle system till I wikipedia'ed it. The system I had in mind is kinda like that only not so 3-D-ish. (Darn, I didn't know someone else thought of that system a long time ago.)
My idea includes that and inserting renpy scenes in the middle of battle. Also, I'm also trying to give options to do stuff like, think and talk. However, it would be far easier to just choose attack and just go crazy in fighting. You do get about 3 actions per turn though.
But if you're going to implement something like a Grandia battle system, you're doing the interface, battle mechanics and game balancing yourself. That's still a lot of work on your part.
Still, I'd be willing to share my system once I can water it down a bit.
Posted: Mon Jan 01, 2007 12:54 pm
by jjsonick
I'd be really interested in this too. Having a battle system framework (even a very simple one) would likely guarantee I actually make a complete Ren'Py game.

Posted: Mon Jan 01, 2007 8:03 pm
by Counter Arts
Yeah, it started out as good programming but now as I started to over engineer it, I'll need to do water it down a bit.
I'll need to make it so that people who aren't programmers can use it. Of course, customization requires programming.
But I'll be crying when I see my beloved menu animation being overused. Oh well.
Posted: Tue Jan 02, 2007 1:19 am
by jjsonick
Well, I don't mind getting my hands somewhat dirty with programming -- I don't think at this point I'd be good building from scratch, but I think I could do some tweaking of code to suit my needs. It'd be worth it to have those systems.

Posted: Tue Jan 02, 2007 8:53 am
by bardsmanship
I'd like to have a look at this, too. I might just find some use for it.
Posted: Wed Jan 03, 2007 4:51 am
by chisa-chan
Wow

I bet this will be interesting.
I'll wait for this one.
Posted: Wed Jan 03, 2007 5:07 am
by Counter Arts
Well if you know the concept of passing a function as variable then you can tweak this code well enough I think. Though it is largely untested.
But this is really largely implemented in python.
I'll be making a very basic turn based system for you guys to expand upon to show you how to take advantage of the features of my system (and mostly interface). You'll even get to know how to use ren'py's interface system with style if you figure out my code!
- you go first
- enemies go second
- physical damage = attackPower - defensePower
- similar with magical damage
- you get one spell called heal
This will be in my sample code.
Posted: Fri Jan 05, 2007 8:24 am
by Counter Arts
Alright! The battle portion of my code is finished. No documentation though.
I also made an interesting menu interface.
I'll give you my first uncut code for you to read and test. If you have ANY questions,
please ask!
This python code has the flavour of a C++ programmer in it. A lot of habits that I gained from programming OS features in a university course are still within me. (Implementing memory paging, file systems as well as concurency is very painful)
Here is some sample code to run my ALBS (AL's Battle System).
Note: The pc and npc varibles are already initialized before this.
Code: Select all
label battle_begin:
$ battle_result = 0 # 0=in progress 1 = userWon 2 = userLost
"The battle has begun!"
"Are you ready?"
while battle_result == 0:
call battle_Start_Turn
$ temp1 = pc.stats.hp
$ temp2 = pc.stats.maxHP
$ temp3 = pc.stats.mp
$ temp4 = pc.stats.maxMP
"HP: %(temp1)s /%(temp2)s MP: %(temp3)s / %(temp4)s"
$ menu1Text = "Attack with Bat"
$ menu1Clicked = ui.returns("Attack")
$ menu2Text = "Heal"
$ menu2Clicked = ui.returns("Heal")
$ menu3Text = "Magical Attack"
$ menu3Clicked = ui.returns("Magic")
show menu1 at menuIn1 with Pause(0.1)
show menu2 at menuIn2 with Pause(0.1)
show menu3 at menuIn3 with Pause(0.2)
$ action = ui.interact()
hide menu1
hide menu2
hide menu3
if action == "Attack":
$ temp = pc.rightEquip.use([npc, pc])
$ print temp
elif action == "Heal":
$ pc.stats.hp += 10
elif action == "Magic":
$ temp = pc.ability.use([npc, pc])
call checkFinished
if battle_result != 0:
jump battleFinished
# Now the Enemy Attacks
$ temp = npc.attacks(pc)
$ temp2 = npc.name
$ temp3 = pc.name
"The %(temp2)s attacks %(temp3)s for %(temp)s damage"
$ print temp
call checkFinished
label battleFinished:
if battle_result == 1:
"You win!"
else:
"You lose!"
return
Posted: Tue Jan 09, 2007 3:48 pm
by DaFool
Although the moving buttons are cool, I'm thinking of just using a standard menu interface for consistency when integrating into my game (It's supposed to look primarily like a visual novel after all, not an RPG)
Also, I think I might want to add scenes in order to prolong the battle sequence, instead of just
""The Monster attacks You for X damage"
Posted: Tue Jan 09, 2007 10:34 pm
by Counter Arts
Yep, that's the idea behind this. You add your stuff like scenes.
I have a cleaner version of the code now. I'll upload it in a bit.
Posted: Sun Jan 21, 2007 1:11 pm
by DaFool
Successfully integrated the engine into the game (success = no crashes and still proceeds to play the rest of my game). I took out the blue textbox, but other then that, it inherited the style options I set for the rest of my game. I think the whizzing buttons are neat, on second thought, so I decided to let them be.
I'd like to add scenes, but I don't know how to navigate around the ui statements. Anyone familiar with python, I'd appreciate some help. I hope that this won't affect rollback should it get messy.
Note I tried changing batswinging to shotgun firing in defining the statements, but messed it up, so I just changed what it says while keeping the definition terms as bat swinging, its essentially the same thing. The magical attack is defined in similar fashion, so I just need to know how to insert scenes or at least image sequences here.
Code: Select all
init:
python:
def batSwing(args):
tempUser = args[ALBS_User]
tempTarget = args[ALBS_Target]
temp = tempTarget.recieveAttack(tempUser.stats.atk + 4)
#ui.window()
ui.text("You fire the shotgun!")
ui.saybehavior(afm="You fire the shotgun!")
ui.interact()
#narrator "You fire the shotgun!"
#ui.window()
#I'd like to place a CG event here, but how?
tempText = "You deal %d damage!" % (temp)
ui.text(tempText)
ui.saybehavior(afm="You deal " + tempText + "damage!")
#I'd like to place a second CG event here, but how?
ui.interact()
return temp
So how do I insert 2 CG events inside, what kind of show statements are needed?
Many thanks.
Posted: Sun Jan 21, 2007 7:20 pm
by Counter Arts
Posted: Tue Apr 24, 2007 1:13 pm
by Lee_Hitsugaya
I am new to Ren'Py but I'd love to use this form my Avatar RPG! Also it may be good for Star Trek: Valiant but I'll see once i get a look at it. So whenever you get it "watered down" as you say I'd love to see it. and i am no programmer so i will probably use the following smilie....alot...(

) lol. THANKS IN ADVANCE!