RPGBattle

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

RPGBattle

#1 Post by monele » Tue Jan 15, 2008 7:10 pm

Ren'Py Generic Battle (RPGB)

Uncompress this in a recent Ren'Py (6.5.0 to be sure, really). The project directory is "rpgbattle". It contains :
- game : the usual Ren'Py directory
- rpgb : the python package used by the game.

You can use the rpgb package in any Python project as it's independant from Ren'Py. Keep in mind that no interface or even game flow is provided with that package.
The Ren'Py project provides an interface and uses rpgb to computer numbers and stuff.

As of now, the rpgb package lacks features but what is there should work properly. The Ren'Py interface is very much Alpha though, with a capital A ^^;... Everything doesn't even work in the example because I added a lot of skills I planned to have but rpgb/the interface can't deal with them yet.

Ok, what *works* : you can launch the game, use "attack" for both characters. For Nicholas :
Times Blades, Blood of Time (though not as intended), Ram, Taurus, Lion, Virgo, Scorpion, Sagittarius, Aquarius.... okay, I listed everything XD... I guess it was not that bad ô_o.
Actually uh... all skills work except that Blood of Time should do something very complex but only does damage, sometimes, and not to all the intended targets... As for Scorpion, the interface doesn't deal with "death by poison", so the enemy will remain on screen but *is* dead and won't attack anymore.

The goblin goes with default stats (rather weak). The orc was made stronger and will do harsh damage. The fire elemental is also a threat but was mainly added to test fire resistance (try using Fireball, Lion or Sagittarius on it). Sadly, Fire Shield doesn't help any against it because it doesn't really attack with a fire based weapon, sorry ^^;...

Haven't tested rollback or saving that much. Rollback very certainly fails. Saves might work.


Okay!!... Now for people who want to play around with it a bit or even use the core system in their games :

"I don't care for this interface but am interested in the rpgb package"
Just look at script.rpy, line 10 to know how to import the package and be ready to use it. Yep, that's it, one line :). As for *how* to use it, refer to http://lemmasoft.renai.us/forums/viewto ... 976#p40976 for a commented example and to the rpgb/__init__.py file for a not commented but up-to-date one.
Sorry for the lack of comments in these, feel free to ask questions if you don't get it ^^;. The final product would definitely have a cool tutorial but there's no time for now.

"I don't know how to make interfaces, I want to use this Ren'Py one!"
You'll still need to look at the __init__.py examples to create your own characters, monsters, weapons, skills, etc...
To use them in the current wonky interface, look at script.rpy, line 62 to 75. That's where you should put your initialization code. Here's a quick example :

Code: Select all

	h_mary = rpgb.Hero("Mary", basestats = {
	'hp':50,
	'mp':30,
	'str':5,
	'dex':10,
	'agi':20,
	'int':40,
	'atk':0,
	'pdef':0,
	'mdef':0
	},
	picture = "cleric.png"
	)
	
	h_mary.skills = [rpgb.fb]  # this gives Mary the skill "Fireball" which is created in __init__.py
	# of the rpgb package
	# note that the AI won't use any special skill, only "attack"
	
	club = rpgb.EquipItem("Club", slotType="Weapon", modifiers={'atk': 5})
	
	h_mary.equip(club)
	
	heroes = rpgb.Team("Heroes")
	heroes.addCopy(h_mary)  # h_mary acts as a "base template" and can be reused
	
	e_mary = h_mary.copy()  # make a copy of mary to use as an enemy
	e_mary.targetType = rpgb.ENEMY  # since we created Mary as a hero, we need to change this for her enemy counterpart
	
	enemies = rpgb.Team("Enemies")
	enemies.addCopy(e_mary) # let's add a copy of the new e_mary template in the enemy team
	
	# ... as an enemy this time :)
Sorry if this is all confusing right now, I just want to put this out, even if in a half-done state. Again, feel free to ask stuff!
Attachments
rpgbattle.rar
(195.26 KiB) Downloaded 631 times

User avatar
Aashtarsrain
Regular
Posts: 188
Joined: Thu Oct 25, 2007 3:25 pm
Projects: Speed Dater Evolution, The Magistrate
Contact:

Re: RPGBattle

#2 Post by Aashtarsrain » Sat Jan 26, 2008 4:02 pm

:D :D :D
Just played it. Great example, man, thank you very much for the achievement and the script ! Quite promising.

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: RPGBattle

#3 Post by monele » Sat Jan 26, 2008 4:58 pm

I'm glad you liked it ^^ I admit I was a bit desperate seeing the uh... absence of response so far ^^;. I haven't touched this for a while but don't hesitate if you have a question ^^

User avatar
herenvardo
Veteran
Posts: 359
Joined: Sat Feb 25, 2006 11:09 am
Location: Sant Cugat del Vallès (Barcelona, Spain)
Contact:

Re: RPGBattle

#4 Post by herenvardo » Sat Jan 26, 2008 7:09 pm

Nice. There are some minor bugs, but the system is quite simple, generic, and efficient.
If I had know about it before, I'd have considered using your engine on my current project, but currently my combat AI engine for monsters already relies on the system I've designed.

Note on the bugs: these are the ones I've noticed; I think they are part of the sample game rather than the engine, but I'm not sure so I prefer to post them so you can check it:
- When one of the "player" characters dies, you still have to chose actions for it each turn (the actions actually do nothing, but you have to chose them as if the character were still fighting).
- When both "player" characters die, the game doesn't seem to notice it, so the combat goes on; but since the death characters don't deal any damage to the monsters, the combat can never end... fighting for all eternity even after death? Wooooo... I think this idea is worth a place on later episodes of my Wars of Barhorkh series :D
- :shock: Non-green orcs and goblins??? WTF!!? Ok, that's more a "personal choice"; but due so many years playing Warhammer, this hurts my eyes. Maybe you should put some kind of disclaimer: "Warning: this game may hurt the sensibility of hardcore Warhammer players or anyone else uncapable of thinking of non-green greenskins." (Note that this whole point, while holding some truth, is mostly a joke :P )
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready :P

User avatar
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: RPGBattle

#5 Post by Jake » Sat Jan 26, 2008 8:24 pm

herenvardo wrote: - :shock: Non-green orcs and goblins??? WTF!!? Ok, that's more a "personal choice"; but due so many years playing Warhammer, this hurts my eyes. Maybe you should put some kind of disclaimer: "Warning: this game may hurt the sensibility of hardcore Warhammer players or anyone else uncapable of thinking of non-green greenskins." (Note that this whole point, while holding some truth, is mostly a joke :P )
Eh, the Lord of the Rings movies (and book) had brown orcs; I didn't see anyone raising a fuss.

Point of trivia: if you go back to mid-late eighties Games Workshop publications, they are painting at least some of their orcs brown there. It was only really the early nineties when they become a uniform green... ;-)
Server error: user 'Jake' not found

User avatar
herenvardo
Veteran
Posts: 359
Joined: Sat Feb 25, 2006 11:09 am
Location: Sant Cugat del Vallès (Barcelona, Spain)
Contact:

Re: RPGBattle

#6 Post by herenvardo » Sat Jan 26, 2008 9:02 pm

Brown orcs are ok (as well as gobs), since it's easy to think that behind the thick layer of dirt that covers them (shouldn't it grant them a 6+ Armour save roll? OMG! I can already imagine my night goblins standing against a unit of chaos warriors!! XDD ) they are actually green.
But the orc and the gobl in the demo.. they are actually dogs! Have you looked at them?

Note to monele: I'm only joking and I mean no offense against neither you nor your artwork. It's true that the graphics you used match my concept of lychantropes better than my concept of orkz and goblz, but the concepts I might have on my mind about arbitrary mythological creatures should mean absolutelly nothing for everybody else. The art is actually quite good.
Also, I should clarify:
Herenvardo wrote:Note that this whole point, while holding some truth, is mostly a joke
By "holding some truth" referring to my joke, I only mean that this representation of these creatures actually shocked me, but nothing beyond that.
Anyway, this discussion is so absurd I think it's worth the change I just made in my signature XD
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready :P

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: RPGBattle

#7 Post by Showsni » Sat Jan 26, 2008 10:08 pm

Tolkien style orcs and goblins (which are really two words for the same thing in Tolkien's works) are actually descended from elves, so it makes sense for them to have a similar skin colour...

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: RPGBattle

#8 Post by monele » Sun Jan 27, 2008 4:38 am

Believe it or not, I never had any hero die when testing XD... Thus, I never even realized I hadn't dealt with these cases ^^;... Thanks for spotting it :).

As for the graphics, they're not mine : it's placeholder taken from the RPG Maker series. And what I used for the monsters are actually Kobolds, so it does make sense in the end, eh? :)

User avatar
herenvardo
Veteran
Posts: 359
Joined: Sat Feb 25, 2006 11:09 am
Location: Sant Cugat del Vallès (Barcelona, Spain)
Contact:

Re: RPGBattle

#9 Post by herenvardo » Sun Jan 27, 2008 12:43 pm

monele wrote:Believe it or not, I never had any hero die when testing XD... Thus, I never even realized I hadn't dealt with these cases ^^;... Thanks for spotting it :).
Actually, I noticed that it was really hard getting killed in that combat example. I had to keep attacking the fire elemental with the cleric and fireballing him (which restores its life) with the other hero in order to lose the combat.
monele wrote:As for the graphics, they're not mine : it's placeholder taken from the RPG Maker series. And what I used for the monsters are actually Kobolds, so it does make sense in the end, eh? :)
Actually, I already thought they were from some kind of repository, since they look quite generic; but I wanted to clarify that I meant no kind of offense with my jokes about greenskins.
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready :P

User avatar
Serkai
Regular
Posts: 58
Joined: Fri Jan 18, 2008 9:35 am
Projects: Teo the Deciever, Shades of Grey and Junk Story(SoG and JS are fanworks)
Contact:

Re: RPGBattle

#10 Post by Serkai » Tue Jan 29, 2008 4:05 am

I'm considering integrating this system for the few battles I plan on putting in my game. Problem is that after having checked the scripting in these files, I understand almost nothing at all. Let's say I wish to the place the characters (Glenn and Nicholas) with my own (I basically want to do that for all the images, background, enemies and player characters). How would I go about doing that?

I also want to change the available skills for the players. Where do I change those?

I'm sorry if I'm asking odd question, but since I've just arrived here, and don't quite know where to learn stuff like these, I figure it's better to ask and seem ignorant, than to stay quiet and remain ignorant.

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: RPGBattle

#11 Post by monele » Tue Jan 29, 2008 7:37 am

Could you give me an example of your characters and one of the skills? Just describe them, give numbers if you already have them, and I'll :
1) see if it's possible with the current engine/interface
2) post the code needed for these, from which you should be able to create more

User avatar
Serkai
Regular
Posts: 58
Joined: Fri Jan 18, 2008 9:35 am
Projects: Teo the Deciever, Shades of Grey and Junk Story(SoG and JS are fanworks)
Contact:

Re: RPGBattle

#12 Post by Serkai » Tue Jan 29, 2008 9:36 am

Ok. I'll post the main character then. (At start of game, of course he's supposed to grow stronger throughout the game).
Maximum value in any stat is supposed to be 100, except in HP / MP where it's supposed to be 500. Not sure if that has anything to do with anything, though ^^ Just thought I'd add it ^^

Name: Teo
-Stats-
Health: 25
Mana: 45
Strength: 10 (Preferably used in some formula to determine damage of regular attack)
Defense: 12 (Preferably used in some formula to determine reduction from enemy damage)
Dexterity: 18 (Preferably used in some formula to determine hit-rate)
Agility: 16 (Preferably used to determine evade-rate from enemy attacks)
Intelligence: 16 (Preferably used in some formula to determine damage of -special- attacks)
Willpower: 13 (Preferably used in some formula to determine reduction from -special attack- damage)

-Special Attacks-
Shibari Ken: Supposed to deal half of regular attack in damage, and have an int vs will based chance to stun opponent for 2 rounds, preventing all action. Costs 2 HP to use

Renzoku Ken: Supposed to make two regular attacks in one go, but half the hit-rate on the second blow. Costs 3 HP to use

-True Speech-
Stay: Prevents one foe from acting for 2 turns, cannot be avoided. Costs 5 MP
Pain: Deals 100 HP to one foe. (More detailed explanation: Kills all foes under 100 Hp, no effect on those with more than 100 hp). Always costs all MP, no matter now much player has.
Heal: Heals 15-25 hp, generated randomly. Costs 5 MP.

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: RPGBattle

#13 Post by monele » Tue Jan 29, 2008 4:28 pm

Creating your character will be possible. Using formulas for all these stats should be possible too (any idea about these particular formulas already?).

Shibari Ken : damage calculation = OK. Stun status based on formula = should be OK (I first went "eek!" but then realized it could be dealt with as a status (a "Stun" status, with a ToHit formula based on Int and Will). The fact it costs HP instead of MP = OK.
Stun status preventing action = totally linked to the interface, not yet implemented.

Renzoku Ken : two successive attacks/to hit calculations = internally possible (probably by using a "Renzoku Ken part 1" skill first, and then a "part 2"). Not yet implemented in the interface and honestly so specific that I'm thinking of dealing with it in a very game-specific way.

Stay : Stay status = preventing action not implemented. No avoidance = OK. Cost = OK.
Pain : Targets all enemies = OK. Specific way of dealing damage = not implemented, game-specific. Cost all MP = not implemented (a skill *can* cost 100% MP but you need to have all your MPs available to use it)
Heal : OK (phew, an easy one ^^)


You certainly don't have easy ones XD... and I'm surprised some of them actually fit the current system ^^;. About my comments : when I say "game-specific", it means it's something that's so specific, either to your game or even to a single skill, that it should be implemented through a custom function. Custom functions for skills are not yet implemented, though (it's one of the big hurdles). Basically, the idea is that instead of giving the skill rules and stats, following the current system, you'll just point to your own functions where you can do anything you want... even, for example, deal damage depending on the player's system time (midnight? full damage!) :)... In other words : anything that goes in Ren'Py/Python would then be possible.... but you'd have to do it yourself (or have someone code it).

For the double attack, the problem comes from the fact that I made the current system with a 1 skill = 1 hit concept in mind. All the RPGs I played at the time were like this. I'm playing Atelier Iris nowadays, though, so I see how multiple hits could be interesting at times. It's still a rather specific system and I'm not sure how to (IF it's possible) implement a generic version of it. That's for the internals. The interface itself links one button to one skill... Since skills are one-hit only, we also have a problem.
BUT, a possible solution here, as I wrote above, is to call two successive skills (the first one costing HP, the second one not), each one with its own ToHit formula and damage formula.


About the interface : did you have something specific in mind compared to the current one or does it fit your needs already? Also, how often will there be fights in your game, and how complex will they be? How many heroes vs how many foes?
I'm asking because I'm not terribly happy with the current interface and since you'll obviously need some specifics for your game, it *could* be quicker to make a different interface that deals specifically with what your game needs. Note : by interface I mean the buttons, pictures, animations, etc... By internals, I mean stats, formulas and computing.

User avatar
Vatina
Miko-Class Veteran
Posts: 862
Joined: Mon May 08, 2006 2:49 am
Completed: Blue Rose, AO: Broken Memories, My Eternal Rival, Dust
Projects: AO: Fallen Star
Organization: White Cat
IRC Nick: Vatina
Tumblr: vatinyan
Deviantart: Vatina
itch: whitecat
Contact:

Re: RPGBattle

#14 Post by Vatina » Tue Jan 29, 2008 4:58 pm

Serkai wrote:Renzoku Ken: Supposed to make two regular attacks in one go, but half the hit-rate on the second blow. Costs 3 HP to use.
For the double attack, the problem comes from the fact that I made the current system with a 1 skill = 1 hit concept in mind.
Now, I have no clue about the programming, and have hardly tested this engine yet, but couldn't this be done by making a skill with a total damage equal to those two attacks, and then make an attack graphic that makes it *look* like he attacks twice....?

/end lame proposal


Edit: I finally upgraded my renpy and made the engine work, and now I see that there are no battle animations -_-;; So I guess I have to change it to "if there is a battle animation, then make it look like...." :P
Last edited by Vatina on Wed Jan 30, 2008 11:11 am, edited 1 time in total.

User avatar
herenvardo
Veteran
Posts: 359
Joined: Sat Feb 25, 2006 11:09 am
Location: Sant Cugat del Vallès (Barcelona, Spain)
Contact:

Re: RPGBattle

#15 Post by herenvardo » Tue Jan 29, 2008 7:14 pm

monele wrote:In other words : anything that goes in Ren'Py/Python would then be possible.... but you'd have to do it yourself (or have someone code it).
Vatina wrote:Now, I have no clue about the programmind
"Programmer with 14 years of experience" looks around and puts himself at the disposal of any nanoreno/intrenaimo participant (just to encourage participation), subject to availability, for any punctual task in Ren'py, Python, C#, C++, VB (.NET 3.5), Java, PHP (I don't think somebody needs something done on PHP for nano, but who knows?), or javascript (sorry, I've only some notions on that one :(). Please notify in advance (for the "subject to availability" thing, you know). :roll:
I have failed to meet my deadlines so many times I'm not announcing my projects anymore. Whatever I'm working on, it'll be released when it is ready :P

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot, Sergei Falcon