Let's talk about battlescripting.

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Let's talk about battlescripting.

Post by ArtimusBena »

An RPG battle system is really, super important. Why is that? Because in most RPGs you're spending half your time talking to NPCs and exploring, and the other half the time you're fighting monsters. So when it comes to half the OHR experience... all games are practically identical!

If there's been a longer running theme I don't know of it: What can and can't be done in the OHR battle system. It seems almost daily I see you guys ask questions about whether this or that can be done. The answer is practically a coin toss. 50% yes, 50% no. And I think I'm just being overly fair with those percentages. More often than not, the answer is 'no', or 'we've been meaning to implement that for 9 years'. To which the questioner asks, 'aw, okay. can you implement this very specific thing that would make my particular game better?'

So, what's the answer? For me, the logical answer is a customizable battle system. And the case I've brought to the OHR devs is that their time and effort would be better spent, yes, creating a new system that is customizable and friendly with scripting. AND/OR a menu system (a la visual programming) to accomplish the same things. Otherwise... they may as well be on ALL your development staffs. Perpetually.

If you guys agree with me then, by the end of this thread we should have some better idea about what a customizable system might look like, or at least what the most essential elements would have to be.

Now, I'm not suggesting that I know what this system should look like. That's the purpose of this thread. I do have a couple of thoughts to stir the juices on this. And I think if we broaden this discussion beyond the ohrdev discord channel they might get some good ideas or at least some useful inspiration.

So, to me, this is where it would start:

A) if specified by some setting, the default battle system should be turned on or off. The battle engine has been, this entire time, practically a different game engine. It's an uneasy marriage between walking around and being in battle. And this adds even more weight on the engine devs who struggle - not only to respond to your specific feature requests, but - to update this system to work with advancements in slice features (for an instance).

B) a slew of commands that access all conceivable game data relating to battles. Things that you can currently set in the editor that plostscripting can access. This would encompass hero stats, more item commands, specific statuses like 'hero is attacking (who, who)', 'hero heals (who, who)'. These commands would encompass performing actions or retrieving the status of some element. Honestly, this seems like a lot less effort with better returns for the future.

Why would this be amazing? Well, let's say you want to create a turn based battle on the very map you encountered the battle. Think back to Chrono Trigger as an example, or any rpg tactics game. Break open the system: now that it's open, you don't go into some different mode or anything... Absolutely every. single. plotscript command. is at your disposal. Any menus you create, any graphical effects, any physics, any music or sound effects, timers, npc behavior, textboxes, backdrops, keypress scripts, flags, on-step triggers, map elements like zones or hurt tiles, HUD displays, every damn thing. Or, if you just want something that looks traditional but has all these advantages? Good news! You can make any walkabout any size (as we speak), and all you have to do is throw up a backdrop!

So again, the point I'm trying to make is that the engine devs are spending an awful lot of time scratching their heads and trying to make a very specific battle system work for everybody. I think with the same time and effort they could simply draft it up again. But I also think they need an idea of what that would look like.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Re: Let's talk about battlescripting.

Post by SwordPlay »

ArtimusBena wrote:Let's talk about battlescripting.
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

I agree that all battles look the same.
How about some options to customise the layout of the battle-scene, and battle-menu?
That'll probably do... right?
ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Post by ArtimusBena »

I'd consider that a facelift. We get new people in all the time asking questions like 'can it do this thing that my previous engine can do?'

I think you can either program in every conceivable feature, or give others the power to do so, to their own exact specifications.
Last edited by ArtimusBena on Sun May 17, 2020 9:38 am, edited 1 time in total.
lennyhome
Slime Knight
Posts: 115
Joined: Fri Feb 14, 2020 6:07 am

Post by lennyhome »

Well, let's say you want to create a turn based battle on the very map you encountered the battle.
Crypt of Baconthulhu (which may be the best game ever made) has the basics of a custom battle system. If you spend some time reading the scripts you'll see there's a lot of room for improvement, including (as it has been demonstrated) the possibility of moving without a grid.

With that said, recently I was watching this tutorial for the Godot engine. It explains how to make a Zelda-like game from scratch.

Is it good? Yes. But notice how different the approach and the focus is. In my opinion the strenght of this engine is not the fact that it's particularly powerful or customizable (altough in many respects it is), rather that it's friendly and pleasant to non-technical people.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Hate to say it, but that's something we've been meaning to implement for <s>9</s> 19 years.

There is another thread around here that made the same proposal in detail. From seven years ago:
TMC wrote:We can never build enough options into the engine to make possible everything that anyone is likely to request; we should not even try. Greater scriptability is a must. The plan in the medium-term is to add battlescripting and to allow replacing different parts of the built in battle system with scripts. For example, scripts to calculate the damage that an attack does, whether an attack misses, preferred targets, enemy AI, and determining enemy and hero counter attacks. As well as scripts being triggered by attacks and things. I think we would likely also expose the internal functions for doing some of these things to battlescripting so that they could be wrapped, or rewrite them as scripts so that you can copy and customise them.

Converting the whole battle system does have those nice advantages like allowing compatibility breaking changes, but it would also be a huge amount of work. I have no idea how many other internal functions the battle system code depends upon which would also have to be converted to scripts or exposed to scripting. Also you would probably find that a lot of it is dense code which is difficult to modify.

Someone can always come up with a scripted implementation of a simplified version of the battle system; it could even grow in time to emulate the whole thing if someone wants it.
Lately I've been planning out changes to the script interpreter to allow running scripts in parallel instead of blocking each other (aka "script multitasking"), running in builtin menus and battles, and using them to compute attack damage and so on. I'm aiming for the release after next (I***). One implication of the plan is that a single script could run outside of battle and continue running as a battle starts or as you enter a menu. A "battlescript" would just be a script that stops running automatically when battle ends. I agree that giving you the full set of commands everywhere is a lot more powerful than keeping battlescripting apart.

Commands to get item, attack, etc data is fine. However, adding a set of commands to let you access and modify the state of the battlesystem is a bit problematic, because the internals like the attack queue are often convoluted and already hard enough to clean up. If scripts start depending on them working a certain way, things would be even more locked in, so I'll be very cautious in adding commands of that sort. However, we can add lots of script triggers for computing damage, valid/preferred targets, fail, animations, transmog, etc. I expect you'll be able to do a lot of stuff even with no commands to e.g pause in the middle of an attack and show a textbox.
Last edited by TMC on Sun May 17, 2020 9:55 am, edited 1 time in total.
User avatar
Bird
Slime Knight
Posts: 227
Joined: Thu Jan 26, 2012 2:19 pm
Location: Germany

Post by Bird »

There were a few games with a custom battle system already. It should even be possible with very little plotscripting. Look at this example of a game called "Wally's Castle" from 2001. However it's just only this scene in the game, where four boxes appear around the player and they are triggered by looking at them.
A more complex example would be "Do you want to be a Hero?" from 2009, which has moving graphics for evasion for example. It is a turn-based battle system.
"Silhouette" from 2012 had the battles being fought out on the map directly. Here we have moving time bars to imitate the original OHR battle system.
Then I remember a game called "Tworound" by ChalkFlower, which has been taken down from the internet. The battles were Rock-Paper-Scissors fights. Of course it's a question how many variables are needed, to have good battles.
A current one, which expanded it's own battle system, is "Hati's Bizarre Adventure". Even dices roll there to calculate the damage.

Just a few examples of custom battle systems with the OHRRPGCE.
Attachments
Hati's Bizarre Adventure
Hati's Bizarre Adventure
Hati.png (10.82 KiB) Viewed 3310 times
Do you want to be a Hero?
Do you want to be a Hero?
Hero.PNG (2.69 KiB) Viewed 3310 times
Silhouette
Silhouette
Silhouette.PNG (6.93 KiB) Viewed 3310 times
Wally's Castle
Wally's Castle
Wcastl.png (2.11 KiB) Viewed 3310 times
User avatar
Rue
Slime Knight
Posts: 135
Joined: Sun Dec 09, 2007 4:01 am
Location: Bellevue, WA
Contact:

Post by Rue »

In all honesty, I'd just be happy if we had more control with strings.

If we could store strings in variables like normal programming languages without having to do a bunch of extra work and concatenate things together with a bunch of wonky commands, I don't think putting together any kind of battle engine using slices or existing would really be all that painful. Right now it's more just of constant battle with the eccentricities of the OHR that make it challenging (or, to be honest, annoying at best, you just end up spending several hours fighting bugs that you create that you wouldn't have otherwise have created).

Whiny python boi here.

What I mean is, instead of:

$1="You did %d damage to "
$2=get_enemy_name(blah)
sprintf(1,1,dmgvar)
string_concatenate(1,2)

You really should have been able to do:
dmgtext = "You did "+str(dmg)+" damage to "+get_enemy_name(blah)

or, if we were in a civilized, fstring world,
dmgtext = f"You did {dmg} damage to {get_enemy_name(blah)}"
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6461
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

We need battlescripting!!
:gonk: :v: :gonk: :v: :v:
User avatar
charbile
Metal Slime
Posts: 601
Joined: Tue Jun 21, 2011 6:18 am

Post by charbile »

Spoonweaver wrote:We need battlescripting!!
Bird wrote:There were a few games with a custom battle system already.
ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Post by ArtimusBena »

Char, (and Bird):

Of course those who work really hard to understand and use HS can do whatever they like, but what I'm suggesting is something that accommodate those people, and also the people who just want to put something together (most of the community). So I hope we can put that argument to rest.
User avatar
charbile
Metal Slime
Posts: 601
Joined: Tue Jun 21, 2011 6:18 am

Post by charbile »

Those are the same people though, who want to put something together.

To expand on the topic (or add what was said in chat), consider what you're actually asking for. What specifically does a custom battle engine look like in the engine? It's already custom to a degree; you can make your own attacks, pick from active time to turn based, etc.

If you want to have hooks for script insertion, then how is that functionally different than those who use HS to do whatever they like?
Attachments
2009
2009
sleepover0000.gif (278.06 KiB) Viewed 3079 times
ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Post by ArtimusBena »

What I am pushing for -- and what many, many before me have been saying -- is more customization, even on a basic level.

It's the reason you had to add the phrase "to a degree." There is a degree of customization when it comes to variables, but not at all in the way battles actually work.

Now, if we want to be competing with more than each other (as you alluded to in chat), then the basic functionality of OHR should allow for entry level hobbyists to do what they have in their heads without constantly being told the engine can't do that normal thing that anybody would expect it to be able to do.

As I said in the original post, the battle system is so specific and so proprietary unto itself that not only is it impractical for a newcomer to use, it doesn't even mesh with the rest of the engine.

The developers' efforts are best directed by the core mission statement of the engine, which is to provide something that anyone can pick up. My only addendum being that effort be placed on looking at the existing system and creating as many commands as possible that can access existing engine features and data set in the editor that as yet cannot be accessed by script.
ArtimusBena
Slime Knight
Posts: 251
Joined: Thu Nov 16, 2017 5:22 am

Post by ArtimusBena »

If you want to know what that would actually look like, I might work on a visual presentation. But for the moment, why don't we humor the possibility that what we have on our hands is a 20+ year old system, and that this is the perfect time to structure a plan for extending its capabilities (and put that extension in the hands of the creators)
Last edited by ArtimusBena on Sat Jul 04, 2020 3:20 am, edited 1 time in total.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

You can alter the source code to have your battle system displayed however you want, practically. So when it comes to changing the superficial layout, that's already in your hands.

Just say what kind of stuff you want, and someone *might* do it for you or tell you how to do it.
If it's a really good idea, you can proposition it to the devs as an official option.

Heck, if you just want to shuffle screen elements around or change the size of bars, almost anyone could do that, really!
"Imagination. Life is your creation."
Post Reply