Spherical forums

User-Made => Projects => Topic started by: Fat Cerberus on April 10, 2013, 02:52:25 am

Title: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 10, 2013, 02:52:25 am
The latest release was on April 29, 2014.
Screenshots are attached; see below.

Bruce's Story is the first installment of the three-part Spectacles Saga, a series of role-playing games following the exploits of Scott Starcross as he attempts to find and defeat the Primus, an exceedingly powerful magic user who threatens both worlds. According to a prophecy made years before the saga begins, Scott, the eleventh Littermate, is the only person capable of stopping the Primus with the aid of the Spectacles, a legendary pair of eyeglasses granting their wearer magical protection--ostensibly making Scott the chosen one. But all may not be as it seems...

So the plot for this is essentially finished, along with about 50% of the dialogue.  Programming-wise, however, it's still just a battle engine, which is quite far along.

Spectacles: Bruce's Story on GitHub:
https://github.com/powercommand/spectacles-i

Current Release - 2014-04-29 - "Hollow Mind" Battle and AI demo:
https://drive.google.com/file/d/0BxPKLRqQOUSNbXBfbFprMVVOMm8/edit?usp=sharing
(after opening the above link, click File->Download to get the archive.)

Technical Details:


Characters:
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 10, 2013, 02:15:07 pm
I'm going to try to post up some character descriptions later this evening so you guys can get a better idea of the game's story than my crappy plot summary above. Stay tuned!

Oh, and I added some info to the OP, so you might want to check it out again if you've already read it. :)
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 10, 2013, 02:42:33 pm
A map tile size of 64 would be hard to pull off. One it's hard to find resources for that size, two it's harder to draw (well by pixel art). But if you are going for a more HD style, then you just need someone who knows photoshop well enough.

I've never played FFX, so I'm curious to see how your game will play. :)

Looking good, I'm also curious to see Scenario in action. I've been using my own version of it for Blockman, and I think it's a great tool for game construction, right up there with 'persist.js'.
Title: Re: Spectacles: Bruce's Story
Post by: N E O on April 10, 2013, 03:18:53 pm
@Radnen re FFX CTB - it's basically your FF-standard ATB, but it pre-calculates upcoming turns, actually shows the queue to you on the HUD, AND updates on the fly when an action is taken (eg, casting Haste will move the hastened character ahead in the queue and possibly add more turns). I consider it FF ATB v3.0 and my old battle system tutorial (the 10xLois vs. Stewie one) attempted to show the basic theory behind it. :D
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 10, 2013, 06:58:44 pm
@NEO:
While CTB is technically just a glorified ATB system under the hood, I do feel it changes the overall gameplay experience dramatically.  It's my personal favorite of the FF battle systems, and I was quite disappointed when future games went back to the more active setup.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 10, 2013, 08:13:43 pm
I just added some character descriptions to the OP.  I hate bumping threads like this, so for my future reference: Is merely editing a post enough to push the thread to the top, or is a manual bump required?
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 10, 2013, 09:48:59 pm

I just added some character descriptions to the OP.  I hate bumping threads like this, so for my future reference: Is merely editing a post enough to push the thread to the top, or is a manual bump required?


No, it won't bump the post. I just tested this. :)
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 11, 2013, 12:50:07 am

A map tile size of 64 would be hard to pull off. One it's hard to find resources for that size, two it's harder to draw (well by pixel art). But if you are going for a more HD style, then you just need someone who knows photoshop well enough.


Hm, I guess you're right.  I suppose I got a little ambitious there shooting for 720p for a 2D RPG.  I mean, it would definitely look awesome, but the high-resolution graphics might seem out of place considering I'm shooting for an overall retro feel for the game itself (think SNES-era RPGs).  And Sphere renders in software I believe; 1280x720 would likely cause lag on anything slower than an i3 anyway.   So yeah, this would probably work better if I use the standard 320x240 resolution (fullscreen would be an issue though since no graphics hardware supports that res anymore and Sphere itself is too outdated to know how to accommodate).  Heck, I could even go really old-school and do 320x200 (mode 13!)

I don't know, any suggestions?
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 11, 2013, 01:09:47 am

So yeah, this would probably work better if I use the standard 320x240 resolution (fullscreen would be an issue though since no graphics hardware supports that res anymore


Well, that's why the 2x scaling modes were invented. ;) I make games in 320*240 all the time. And if you want some extra space, 400*300 is not too bad either (2x it's 800*600, a standard res).
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 17, 2013, 11:18:30 am
I made a repo for Spectacles on GitHub if anyone wants to check it out:
https://github.com/powercommand/spectacles-i

You can run it, but right now it's little more than a tech demo for the textbox system and Scenario, and it doesn't even really leverage the full power of the latter yet.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 21, 2013, 11:57:24 am
So I've been working on this at a pretty steady pace. If you look at my commit history a lot of it is just big fixes and tweaks, but I've also perfected the textbox system, and implemented menu strips, which will be used all over the place in the game. I plan to release a proper tech demo at some point, but that requires implementing the battle system, something I've been putting off for far too long.

Speaking of the menu strips, anyone want to check the code out of the spectacles-i repo and let me know what you think of those (and the textboxes as well, while you're at it)?  I'm rather proud of my minimalist UI design, but I was curious what everyone else thought.
Title: Re: Spectacles: Bruce's Story
Post by: N E O on April 22, 2013, 03:37:33 pm
I'll look at it myself soon. One thing that always hung me up about using Scenario in NShoot was I couldn't get proper sync between a cutscene and a running map engine where control is still attached. I keep thinking I screwed something up in the reimplementation.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 23, 2013, 12:43:35 am
If I'm being honest, I originally designed Scenario under the assumption that the player will never have control of the map engine during a cutscene, but in practice I don't see why it shouldn't work.  The only thing I can think of is some sort of weird race condition with map updates.  I don't know exactly what you did when you incorporated Scenario into NShoot, but I do know the official version runs its own update loop, including calls to RenderMap() and UpdateMapEngine().  Depending on what your setup is, it's possible the map engine is getting updated twice in a frame, which would of course knock Scenario out of sync since scenelets still only get one update per frame.
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 23, 2013, 01:14:36 am
but I do know the official version runs its own update loop, including calls to RenderMap() and UpdateMapEngine().


Ahh, that's why I re-implemented your Scenario cutscene engine, I  wanted to directly use the update and render scripts via SetUpdate/RenderScript() with Scenario. I did not like the idea of forcefully calling those methods, and I wanted to say, overlay it on top of other systems that already make use of the map engine. The rationale was that it was supposed to be a cutscene manager, rather than a map engine wrapper, and I think that's what you really wanted with your Scenario - a map engine wrapper.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 23, 2013, 01:32:21 am

The rationale was that it was supposed to be a cutscene manager, rather than a map engine wrapper, and I think that's what you really wanted with your Scenario - a map engine wrapper.

I'm not sure I follow you here. Scenario as written right now is basically useless outside of cutscenes, it hardly qualifies as a map engine wrapper.  "Wrapper" to me implies a library whose sole reason for existing is to repackage existing functionality with a different interface--which isn't what Scenario is meant to be at all.  It can be used that way, sure, but that isn't what it's designed for (I wouldn't have gone to all the trouble to implement fork & synchronize if that were the case!).  The only reason Scenario takes over the map engine update/render calls is because... hm, now I don't remember why I did it that way, actually!  My first instinct is it had something to with allowing it to just be dropped into any existing project and used right away regardless of that project's existing custom update/render scripts, but I feel like there must have been a more concrete reason than that...
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 23, 2013, 02:37:37 am
Lord English, yeah I know you weren't really trying to wrap the map editor, but to me it seems like you were. Removing the hooks to Update/RenderScript and instead calling them within your own game loop kinda implies that. Which is not bad, but I'm uncertain as to what functionality you gain/lose by doing that. For one, SetMapEngineFrameRate() may not work as intended (or at all).
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 23, 2013, 03:36:28 pm
I think I remember now.  The reason I had Scenario hijack the map engine instead of using user-accessible update/render hooks was because I didn't want Scenario.run() to return until the scene was over.  This makes it much easier to add teardown code (setting event flags, etc.) after the scene.  I suppose I could refactor everything to make this requirement unnecessary, but that would be Scenario 4.0, which I don't expect to be able to do for a while, as I have a few other time-consuming changes planned for 4.0.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 26, 2013, 02:00:41 pm
Getting back on topic: Much of the Specs battle engine is programmed.  I had been putting this off for a long time due to the sheer complexity of the design, but thanks to a drop-dead simple Console class I programmed in an hour last night, I've been making a lot of progress.  I suppose not having to waste time finding (or making) placeholder sprites to see what's going on in the battle helps. :)

Stuff that's implemented:
-- Turn resolver (resolves turn order based on battler stats/move used)
-- Action queue - for multi-turn moves
-- Enemy AI framework
-- Status effect framework (WIP)
-- Weapon switching framework (WIP)

Quite an impressive list I think, considering the battle engine didn't do a thing a few days ago--although to be fair several pieces of the framework were already in place as of my initial git commit, albeit not operational.

Anyway, that's my status update for today. I'm getting closer to releasing the Tech Demo, but that will require an actual battle screen layout first, so it's still a ways off. Sit tight, I promise it'll be worth the wait!
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 18, 2013, 04:40:18 pm
Finally just released the first Spectacles tech demo, showing off its CTB battle system! :)  Here's the Google Drive link to get it:
https://docs.google.com/file/d/0BxPKLRqQOUSNQTB3dFBtc0F4bUk/edit?usp=sharing

For convenience, the archive contains a copy of the Sphere 1.5 engine.

Let me know what you guys think!
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on June 18, 2013, 06:39:31 pm
I can't seem to download files off of Google Drive. It just goes to a page with infinite redirects, or says the app is "unreachable". Is this the same stuff in the github repo? Because I can check that out instead.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 18, 2013, 06:50:56 pm
Yes, my latest git commit is identical to what I released here :D
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 22, 2013, 11:51:11 am
So has anyone tried the demo yet, out of curiosity?

Also @Radnen:
I've made a bunch of new commits since releasing the demo. If you haven't played it yet, just be aware that if you check out the latest commit now, you might get a misbehaved demo since I'm currently in the process of implementing various statuses--which often involves doing strange things to stress test them! :P
Title: Re: Spectacles: Bruce's Story
Post by: DaVince on June 22, 2013, 12:04:53 pm
Downloaded it just now (from the Drive link above). The opening screen looks promising, but once I get to the main menu (with the option Start Demo), I can't seem to find the button to confirm that yes, I want to start the demo... Only the left/right keys do anything. I should tell you that I'm running Sphere through Wine, but so far, no game has failed because of that particular fact.

Nice music, though.

EDIT: hm. It didn't work because I used my own version of Sphere. It works with the one you provide.
Title: Re: Spectacles: Bruce's Story
Post by: ninjasword on June 22, 2013, 12:15:01 pm

So has anyone tried the demo yet, out of curiosity?


wow!

i like it, the ui is really clean, the pop ups, the fades, the typing, all of it looks really pro, i like the handling of the turns on the top, and the cooldowns of the abilities.

so... are u going for a super simplistic look? i sword slashed someone and i didnt see a sword or a slash. #sadface. and i was a little confused at first as to what button(s) to press,, maybe some text on the landing menu. also, when u zip things, put them in a folder and zip the folder, its a little cleaner that way for the user that wants to quickly extract without having to create a folder themselves.

good job man keep up the good work (or come to work for me on my game and clean up my ui!!)
Title: Re: Spectacles: Bruce's Story
Post by: DaVince on June 22, 2013, 12:24:11 pm
Okay, this is freakin' polished and I can easily see it turn into something great. Robert was impossible to beat, though. :P
Mind if I put it on Spherical's downloads repository?

ninjasword: have you seen any in-battle graphics at all? I'm sure by far most of it is placeholder, which explains the lack of any animation (other than the slick interface animation). :)
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on June 22, 2013, 03:01:44 pm
It was really very nice! This is one of the better battle engines I've seen, right up there with trial and error's.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 22, 2013, 03:41:43 pm
Glad everybody likes it!  The story for all three installments is actually finished, at least in concept.  Not all of the script has been written, but we're (me and my cousin) working on it.

But yeah, most of it is placeholder graphics for now. Battle animations and such will come in time, I just want to get all the technical things out of the way first.  It is possible to win against Robert, though--you just have to manage the turns right. What you're seeing is a sneak peek at the final battle of Spectacles I, it's not meant to be easy!  The anti-AI-cheating I implemented may halt the game early if he runs out of MP though... :P

@DaVince
Sure, feel free. :)
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 23, 2013, 11:48:37 am
So nobody's figured out the cheat to beat Robert in only two turns yet, huh?  That won't work in the final game, but I don't have the architecture in place at the moment to prevent it. :P

hint: it involves Alcohol
Title: Re: Spectacles: Bruce's Story
Post by: ninjasword on June 23, 2013, 02:41:48 pm
ok so i played ur demo again to try and beat robert and... well, is there no way to speed/skip the drawing of text? its really annoying after i die and play again to have to watch the words crawl across the screen when i already know wat they say
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 23, 2013, 03:07:58 pm

ok so i played ur demo again to try and beat robert and... well, is there no way to speed/skip the drawing of text? its really annoying after i die and play again to have to watch the words crawl across the screen when i already know wat they say


Not currently (it's just a tech demo), but you can edit main.js and change DBG_DISABLE_TEXTBOXES to true.
Title: Re: Spectacles: Bruce's Story
Post by: N E O on June 24, 2013, 04:41:13 pm
Finally tried out the demo; the battle engine feels very polished! I wish the HUD was simpler to decipher at a glance, especially a stat as important as HP, but I do like that you chose to list an extended turn queue at the top AND that it recalculates when your cursor is on an action. It's little things like that that made the FFX battle system the best TBS in the entire FF series.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 24, 2013, 06:27:38 pm
Haha, yes, FFX's battle system is still my favorite in the whole series. I was never a huge fan of ATB (except Chrono Trigger, that was IMO the only game that did ATB right), and the newer FFs seem to be going more towards CPU-controlled allies, which takes all the life out of the experience.  FFXIII is by far the worst, it's just an exercise in button mashing (and even KH did that better!). I couldn't finish it, got past the first few bosses before it became too dull; not even the summon they eventually gave me was enough to save it.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 25, 2013, 11:55:25 am
Another neat thing in my engine, and I don't know whether FFX had this or not (looking at bosses' attack patterns though, I don't think so)--CPU battlers can also see the turn queue.  I have a function in my AI class that allows the enemy AI to request a turn order prediction if that unit were to use a specified skill.  I use this in the Robert battle: If he can squeeze additional turns in by using a Rank-1 move, he'll throw in a couple uses of Quickstrike for extra damage before using his usual Rank-2 attack.  Makes the battles much more dynamic than simple RNG-based attack patterns.
Title: Re: Spectacles: Bruce's Story
Post by: N E O on June 25, 2013, 06:08:47 pm
That's kinda fcking genius, dude! I've been looking for more AI patterns to study that aren't the usual suspects and that one's a great idea I will certainly add to the eventual "CPU Logic" section of my battle system tutorial (which is also going to discuss Pac-Man ghost logic and the FFXII Gambit System) :)
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 26, 2013, 12:22:22 am
Yeah, NEO, if you want a bit of insight into how my engine works without having to sift through too much code, just turn the console on: Open main.js and change:

Code: (javascript) [Select]
var DBG_SHOW_CONSOLE = false;


...to true.  That'll let you see what the battle engine and AI is doing behind the scenes.  I actually built the vast majority of the battle engine with just the console output alone, I only started on the UI once most of the framework was already in place.  Even with full UI the console is still invaluable for me; it comes in real handy when trying to diagnose weird bugs! :P  At some point I should probably implement logging though, if I keep going at the pace I've been I'm going to have so much console output that I won't be able to see it all at once!
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 28, 2013, 02:40:20 am
So now that my battle system is basically complete, I figured I should explain my leveling system as its unlikely to change much from here on out...

Each character has a series of stats ranging from 1-100.  VIT, STR, FOC, etc.  Each stat maintains its own experience counter and level, and the stat obviously goes up as its level increases.  A character's overall level is the average of the levels of all his stats; this "battle level" is used for several calculations, most notably as a component of the damage formula.

When an enemy is slain, the character responsible for the kill gets experience for each of his stats equal to the product of the enemy's battle level and its corresponding base stat.  Base stats are used here to prevent the player cheating by buffing the enemy prior to the kill for more EXP. Note that if the enemy is killed by residual damage (poison, frostbite, zombie+regen...) no stat experience will be given, since the battle engine doesn't keep track of who inflicted a status.

Skills also level up independently, to discourage the player from over-reliance on one or two moves.  When a skill is first learned, it starts af level 1.  The level means different things for each skill, but higher levels are always better. Each time a skill is used, it gains EXP equal to the product of the enemy's battle level and overall base stat average. Again, base stats are used to prevent artificial EXP inflation.
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on June 28, 2013, 03:06:46 am

no stat experience will be given, since the battle engine doesn't keep track of who inflicted a status.


Aww, no achievements. :P

Neat stuff!
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on June 28, 2013, 06:41:53 pm
Oh, one thing I forgot to mention: Killing a boss gives the same amount of experience to all party members (including benched), regardless of how it's killed.  I didn't think it would be fair for a boss to only give EXP to the character who felled it since unlike with field enemies, defeating a boss will almost always require a team effort.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on July 04, 2013, 10:36:55 am
So I don't know if anyone looked close enough at the code to notice it, but those UI animations that you guys all seemed to love? Those are driven by Scenario! :D
Title: Re: Spectacles: Bruce's Story
Post by: N E O on July 04, 2013, 05:06:38 pm
I didn't look at the code, but I'll be sure to look now ;)
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on July 12, 2013, 11:45:11 am
Just attached some screenshots to the OP, so people who haven't played the demo can see what it looks like.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on February 21, 2014, 01:30:49 am
So I've been pretty quiet lately, everyone probably thinks this project fell off the edge of the earth.  But it didn't, just laziness on my part.  But I finally got back into the spirit of coding again, thanks in large part to Radnen's Link library which really makes so many things much easier that I had to do manually before.  So anyway, my latest addition to the battle engine is what I call the Stance system, a more advanced, more flexible iteration of the Defend feature seen in so many RPGs.

A little background before I explain the new system: One of my main goals with Spectacles has always been boss-player equality.  For example, I try to keep status immunities to a minimum (only those that make logical sense given the nature of the boss): the final boss of Bruce's Story is proof of this, not having a single immunity!  This certainly makes the AI routines much more complicated to program, but it's a small price to pay for the added strategic depth.  (This depth is also the reason I allow enemy AIs access to the turn predictor.)

But even worse than excessive status immunities, too many RPGs give their bosses, particularly mid- to late-game storyline bosses, advanced techniques that player-controlled characters simply don't have access to.  Final Fantasy is a prime offender here: Many, MANY bosses have a point in the fight where, if you attack them, they will counterattack, often with something EXTREMELY painful.  The player could never hope to duplicate such a strategy, and this is something I've always considered unfair.  Sure, it makes the fight more challenging, but for all the wrong reasons.

Another gripe of mine is that the Defend command in most battle systems is practically worthless.  Typically it halves damage, but using it in the heat of battle is, in practice, usually tantamount to suicide.  There's almost never a situation where it's better to take a defensive stance over just dishing out a ton of damage in a reckless last stand, and if you really need the damage reduction, you're almost always better served exploiting openings in the enemy's attack pattern to buff the party and then carry on attacking.  In fact, the ONLY good use I've ever found for defending in lieu of damage output is during--you guessed it, a boss's counterattacking phase!  This all almost has me convinced that the usual counterattack implementation for bosses is inherently broken and the Defend command is pretty much only provided to mitigate it.

The Stance system in Spectacles fixes all that.  At present there are three stances: Attack, Defend, and Counter, and both player- and AI-controlled battlers alike can use them.  How it works is this: All units enter the fight in the Attack stance.  This is the standard mode of operation, where units get to choose a move each turn and their next turn is determined by a combination of their immediate AGI stat and the rank of the move used (the higher the rank, the more the next turn is delayed).

The remaining two stances, Defend and Counter, are a bit different.  When a battler's turn comes up, that unit has the option to either choose a move as usual, or change their stance.  The catch is that changing stance represents a commitment: A unit changing stance won't receive another turn until the conditions of the stance are met.  Units in the Defend stance are stuck that way until they take damage (which is then reduced), and Counter-stance units are likewise stuck until their counterattack is activated.

Of course, the Counter stance has an additional level of commitment: When switching stance to Counter, the move to counter with has to be chosen in advance, which requires some strategy.  The upshot, however, is that a move used in a counterattack will be greatly more effective than that same move used from the Attack stance: Damaging moves deal more damage, attack accuracy is set at 100%, and intrinsically inaccurate moves like Munch are more likely to succeed.  This boost in efficacy elevates the Counter stance from useless fluff to a genuinely useful battle tactic: if you have a boss that likes to target one battler and whale on him, just have that unit counterattack with something powerful.  And just as it should be, if you try to abuse the mechanic, you'll get killed in short order.

As for that Defend stance, it may at first seem just as useless as any other Defend command, but it's not: Because of the way the Stance system works, the subtle difference in timing makes all the difference in the world.  In a Final Fantasy battle, for example, it's entirely possible to Defend and then not get hit at all before your next turn (this is less likely to happen in FFX as you can see the turn order ahead of time, but you don't have that luxury with ATB).  Which means, hey, you just wasted a turn defending that you could otherwise have used to damage the enemy or benefit the party.  Nice going, genius!  The Defend stance, however, doesn't end until the character is hit at least once, making it much more valuable strategically.  In addition, Defend in Spectacles also guards against instant-kill moves, halving their damage as with any other damaging attack and thus rendering them survivable.
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on February 21, 2014, 06:49:08 am
Love it. I do find late stage bosses to have that unfair moment. While I do think it was an okay way to up the difficulty or throw a curve-ball, I seriously thought each time they could have come up with something smarter.

Here's hoping to that something smarter. As always, I'll let physical gameplay be the deciding factor in whether or not the system really work in practice as it sounds on paper. But I have faith in this.

And nice Link shoutout. :) This is it's primary use case for games.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on March 25, 2014, 01:39:05 am
So I mentioned earlier how, as part of my Boss-Player Equality initiative, full status immunities are rare for Spectacles bosses.  I'm going to assume you're wondering how I intend to pull this off without making the whole thing broken in favor of the player.  The answer?  Simply put, status afflictions in many games are simply too broad in scope.  Kingdom Hearts 3D, for example, has the status effects Bind, Slow, and Stop.  As you can imagine, almost every single boss is immune to all three because if they weren't, the battle would be way too easy.  Just cast Stop or Slow every few seconds and whale on the boss until it's dead.  Now keep in mind, most standard enemies are not immune to these, but unless you're doing a LV1 Critical Mode run, it's just as easy to spam attack commands on them, no fancy strategy required.

Final Fantasy is no different here: FFX, for example, has Zombie, which converts healing to damage.  Again, bosses tend to be immune to it because, if they weren't, you could just throw a few Phoenix Downs at the thing for a cheap kill (there is one undead boss late in the game that is a total joke because of this; I can forgive it in this instance because it was appropriate thematically).  Not much fun.  Then you have statuses like Doom, which are so intrinsically broken that even standard enemies start to develop immunity to it by mid-game.

To counter this, statuses in Spectacles are much more specific.  Each status effect serves a specific strategic purpose and, for the most part, keep to that niche.  Many also have counterbalances, such as Ignite, which in addition to dealing some damage each turn, also intensifies incoming Fire damage; however, it weakens incoming Ice damage by the same factor.

To give you a better example of what I mean, here are a few of my statuses:
Title: Re: Spectacles: Bruce's Story
Post by: Flying Jester on March 25, 2014, 02:13:53 am
I was actually really impressed with the attention put into FF zombie. My favorite part of FF zombie was that heal-stealing from normal-to-zombie hurt (as did zombie-to-normal), but zombie-to-zombie still worked correctly.

And on the undead boss in FFX, it was so much work to kill it the first time, I didn't mind what amounted to a free pass the second time. it was satisfying, even.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on March 25, 2014, 10:04:07 am
Zombie is actually one of my favorite FF statuses because it's so balanced (despite my picking on it my last post).  The fact that the final boss of FFX is not immune to it is a testiment to that: A well-designed enemy AI can compensate for it.  That balance is exactly what I'm shooting for with all statuses in Spectacles.  That I was able to set up a final boss that doesn't have a single immunity shows it's working. :-)

But wait, you mean to tell me that two zombies in FF can heal each other correctly?  How did I not know this?!  That would have made the battle with a certain ancient summoner so much easier...
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 01, 2014, 01:24:43 pm
So my latest commit on GitHub for this is not gameplay-related at all, but something lower-level than that: an overhaul to the AI engine.  My original system, for as powerful as it was, was ultimately pretty basic: The battle engine calls a strategy function on the enemy class and performs the action it returns.  Well, technically I had a queuing system in place so the AI didn't have to be called every single turn, but the effect is ultimately the same.  The system led to some pretty dumb bosses overall; most of the seeming intelligence came from the fact that the strategy function had access to the turn predictor.

The new system is much more flexible.  It's object-oriented, allowing the AI to maintain its own state (the old system had rudimentary support for this through a data object, but it was still very clunky), and--here's where all the flexibility comes in--event-based.  The .strategize() method is still there to choose moves, however the AI can hook events on the underlying BattleUnit to adjust its strategy in realtime based on what happens to it, the same way a human player might.  For example, the Headless Horse has a two-turn move (Rearing Kick) where, if the attack is interrupted during the first turn by hitting it with a physical attack, it retaliates with Flame Breath, which hits the entire party and Ignites them.  This wasn't possible with the old system, where enemies could only act on what was known on their turn, meaning things like units' current health and magic, stats, that kind of thing.  Now they can also track things like what attacks are used against them, who is attacking them, etc., allowing for much more dynamic strategies.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 23, 2014, 10:24:26 am
Just posted a new battle engine demo, showing off nearly the full potential of my battle system, as well as the awesome "Hollow Mind" AI engine.  Check it out, and try to beat Robert Spellbinder! :D

...I promise he's beatable this time, I swear!  My beta tester has managed to do so several times. :)
Title: Re: Spectacles: Bruce's Story
Post by: Rahkiin on April 23, 2014, 07:26:01 pm
Too bad there is no working Sphere engine for OSX. I would really like to play it.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 27, 2014, 10:53:50 am
So has anyone tried the new demo yet?  I really want to see what everyone's reaction to the AI is.

I also just updated the version linked in the OP to the most recent version as of today, which includes the full implementation of the Stance system I mentioned earlier in the thread (the last one had a rudimentary--and glitchy--prototype implementation).  For convenience, here's the Google Drive link:
https://drive.google.com/file/d/0BxPKLRqQOUSNdHR2akhMYmhwdGM/edit?usp=sharing

Edit: Just re-uploaded the demo to fix a severe bug caused by the recent Link update--if you changed to a non-attacking stance, you would get locked into it permanently!
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 27, 2014, 01:34:27 pm
That battle is nearly impossible for me! I don't see any healing items, possibly because the graphics/descriptions are not there. Also, my moves just deal next to nothing against the opponent and I can die in two moves.

I don't know man, just because you had a playtester defeat him doesn't mean it can be done so easily. He developed a trick and optimized around it, this always happens in focused playtesting. Not until you put it into the hands of someone who hasn't played your game before do you realize things like difficulty, UI and controls being either perfect or awkward.

That said I think the UI is rather good, and  I know the graphics will come later.

After some time I was able to get a bit further, the super tonic seems to heal you for a lot but then sometimes it insta-kills you and I don't know why. Maybe because you become a zombie? I'm lost at that stage. All in all I can barely get his health down by 10%. :/
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 27, 2014, 01:48:49 pm
Okay, here are a few hints:
- Healing damages you if you're a zombie, use Holy Water to remove. (Necromancy inflicts Zombie)
- Higher ranked attacks set you back further in the turn order
- Rank 3 magics (Hellfire et al.) inflict statuses.
- Crackdown reduces damage from consecutive attacks of the same type
- Alcohol is a full heal (excluding zombie) but makes you drunk
- Red Bull restores all MP; MP also regenerates slowly over time
- You can switch to Counter Stance (default key: C) for a double-powered reprisal against an incoming attack, or Defend Stance (default key: V) to halve damage or endure an insta-kill with 1HP.
- Vaccine grants immunity to most statuses for 3 turns

He's definitely beatable - you just have to manage your turns and resources right and make good use of statuses.  But it's not meant to be easy--even I can't beat him 100% of the time!
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 27, 2014, 03:08:27 pm
I guess I'd have known more of those tricks if I were to play a full game! :P It's been some time since I played any FF game and I didn't know exactly what mapped to what. I'll definitely consider more of those combos the next time through.

But yeah, if you develop more of the game then people can have an introduction on statuses like zombification etc. by playing through it. I was partially lost during that battle since I was like thrown into it all of a sudden. I'm sure it's fine, and I can't honestly say if it's balanced well enough until there is more of a game.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 27, 2014, 06:19:32 pm
To be fair, I wasn't really looking for critique on balance yet.  Like I said, the battle is winnable, which is what matters for the purposes of the demo.  What I was actually hoping for was reactions to the AI.  I've created what I think is a very intelligent boss with no "computer is a cheating bastard" factor at all; I was showing off the power of my AI engine. :D
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 27, 2014, 06:44:52 pm
Well it felt like an FF game that's for certain! The AI I think seems pretty solid. But to be sure I'd like to see more battles with it, however I think it's really quite good. Then one day someone will come along with an exploit or two. :P
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 27, 2014, 08:23:51 pm
It's funny you mention exploits; there are actually several ways you can exploit Robert's AI right now that I purposely left in just to make the fight feel more realistic, and then just rebalanced around them.  It takes away from the fun when the AI is too perfect!

In case you were wondering, what I was referring to when I said there was no "cheating bastard" factor earlier is that, literally, the computer doesn't cheat.  Hollow Mind is built on the premise of the CPU observing what happens in the fight the same way the player does--what attacks are performed, items utilized, etc.--and deciding what to do based on what it sees.  For example, Robert will defer his first use of Necromancy if you use your Vaccine in the beginning of the fight, waiting until the immunity wears off to cast it.  This is done internally exactly the same way a player without access to the enemy's current status would: After observing that Scott used a Vaccine, count turns until the immunity is due to expire, then cast Necromancy.  Not once does the boss directly read the player's statistics, only his own.

To put this as succinctly as possible: The AI is imperfect by design. :)  And it's STILL a challenge! I like to think that's pretty impressive.
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 27, 2014, 11:25:27 pm
So you hard-code these behaviors in? Because unlike a human, there could be hundreds of possibilities. We have the ability to think on our feet so to speak.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 27, 2014, 11:54:14 pm
Some are hard-coded, others are decided by an RNG roll with dynamic odds.  For example, the chance of Robert re-casting Necromancy after curing it goes down with each action taken between--simulating complacency.  The point is that the trigger itself always activates--it's up to the boss's AI to decide if and how to act on it.  Obviously the ultimate method of attack selection is quite different from a human player, but there's enough of a balance between hard-coded behavior and RNG use that it gives the illusion you're fighting a real battler as opposed to a computerized simulation of one.  Which is honestly a lot more than I can say for most of the FF bosses I've fought.

But yes, the AI can think on its feet to some extent.  A great example of this is if you try to exploit zombification to do a ton of damage to Robert with Power Tonics.  His usual mode of action in that case is to use a Holy Water as soon as possible to cure the status, heal himself, then blast the player with magic.  But this move combo is not set in stone: If you re-zombify him immediately after Holy Water, he substitutes the healing for Desperation Slash, an instant-kill attack.  This in turn can be countered by the player by having Scott Defend to endure the insta-kill, heal, and continue on.

Another example of this: In the fifth phase (after a certain... um, pivotal event), as the battle is winding down, he hits you with one final Rank 3 magic, either Hellfire or Windchill, to try to kill you with residual damage.  Which one he uses is decided on who got more turns over the course of the fight.  If the player had more turns than the boss, this means they are likely turn-whoring (as Robert is faster than Scott) and so casts Windchill, since Frostbite does more damage per hit than Ignite.  This is information not directly available at the time the attack is decided, but the AI is able to compile it over the course of the fight by hooking the unitReady event and observing the turn patterns. Even though the behavior is hard-coded, it's quite a bit more complex than "Oh hey, the player just did that, let me do this as a countermeasure and hope it works".  Decisions can be made based on anything that happened at any point in the fight, just as they can for the player.  And sure, there are lots of ways you can exploit it.  But there are lots of ways you can exploit a human player's assumptions as well!

Essentially I designed the AI with the assumption that the player WILL try to find exploits, and balanced the difficulty from there.  This ensures that there are multiple viable strategies to win (essentially turning the exploits into full-fledged strategies), making feel like a real boss battle instead of just a glorified puzzle, while at the same time minimizing the chance of gamebreakers arising.

If it makes you feel any better though, the difficulty of the demo as posted was indeed way too high--my playtester confirmed this. :-[  I've since made a few modifications, available on GitHub, that bring it back to being a fair fight.  For example, reducing the rank of Defend and increasing the base power of counterattacks.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 29, 2014, 11:06:11 am
So I have to apologize, the demo I posted above turned out to have the difficulty set much too high. :-[  Here's a version that's much more fair:
https://drive.google.com/file/d/0BxPKLRqQOUSNbXBfbFprMVVOMm8/edit?usp=sharing

I will also update the OP to link to the new version.  Hard to get a feel for the AI with an unwinnable fight!
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 29, 2014, 09:16:06 pm
Much better at that difficulty. I can only get him just below half health before I run out of all useful items. :/

The zombie/tonic combo is really great but reduces the tonics you can use on yourself. The higher mp spells do lots of damage but the mana goes down quickly. I actually feel threatened more by the resources than the boss. :P

With wiser healing choices I think I could have lasted, but it's a marathon like any good boss challenge. Is this a simulation of the first boss or last boss of the game? Is the players items and level right as they should be? Or is this demo just a giant what-if for testing purposes? Because I think as a standalone it's great but depending on how you levelled before the boss - what skills you invested more in can determine how it's played out.

Sometimes FF bosses may feel awkward since you might have made a character build slightly off from one that would see the boss at that time if they followed a more normative leveling approach (whatever that is). I feel a robustness test can really only be done with an actual Act I (for example) to play with.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 29, 2014, 09:33:54 pm
This is the actual final boss of Bruce's Story.  Bit of a spoiler really, but I figure there will be three games in the saga, so it's not giving away too terribly much in the grand scheme of things. :-)  In the demo, all your skills are set at the highest level, as if you leveled them up fully in-game (skills level individually in Specs), and Scott is set at level 50, equal to the boss.  And in case you were curious, the one-on-one final battle is 100% canon. :)

I want to know how you pulled off a zombie/tonic drive, though!  The AI is set up to do everything in its power to make that strategy extremely difficult to pull off effectively--curing Zombie, healing himself, insta-killing you if you press the issue...  Not that it can't be done, but it's designed to be a very risky proposition. :P

Also, overall, what did you think of the AI?
Title: Re: Spectacles: Bruce's Story
Post by: Radnen on April 30, 2014, 01:28:47 am
I couldn't keep that tactic going, if you really wanted to know. What does Flare do? I think it has something to do with it.

Overall I think the AI is really quite good. I'm impressed! :) I like how you have the ability to scale the difficulty up and down, which is a good design strength. Tells me you made a lot of early on considerations which is nice. Pokemon's battle system to me felt ad hoc, whereas yours was carefully planned and it certainly gives a better impression on the player when you realize attack-attack-attack doesn't quite cut it.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on April 30, 2014, 01:53:18 am
Flare is just a standard fire-element magic attack.  Unlike in FF, where it's one of the most powerful magics there is. :P

So yeah, Robert's attack patterns were carefully balanced for fairness over several play-testing sessions, so I can be sure any difficulty concerns at this point are likely due to the numbers being off somewhere else.  For example, in my original, way-too-hard demo, Frostbite didn't do enough damage per hit to make it a viable tradeoff compared to Ignite, its opposite, and Defend/Guard left you wide open due to its rank being too high.  Merely adjusting these parameters was enough to bring the difficulty back in line without touching the boss's AI logic at all.

As for "attack-attack-attack", yes, Robert's attack patterns were purposely designed to punish that kind of strategy.  What the hell kind of final boss would he be if you could just blast him into oblivion with no strategy at all?  Not a very good one, that's for sure! :)  And believe it or not, you actually have it easy here--I gave you a free Scan in the demo.  In the final game you won't be able to see the final boss's MP and status afflictions like that, since Scott never learns the technique that reveals that info.  The battle is much more of a challenge without constant access to that information.
Title: Re: Spectacles: Bruce's Story
Post by: Rahkiin on May 03, 2014, 08:15:23 am
Wow....

I am at my parents with my Windows PC now, and I played your demo... Wow. It is awesome. I like the music and the gameplay, although I have no experience with it so I fail in battle xD (I know nothin of combos).

Keep up the good job!
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on May 03, 2014, 10:47:28 am
Haha, yeah, that's the downside to releasing a demo of the game's final boss (well, other than the obvious spoiler potential of course! :) )--you're kind of throwing everyone who plays it to the wolves since it's meant to be the most difficult boss in the game.  But I figured hey, that's the best way to demonstrate the full potential of the battle system, plus I can show off with the AI :D, which is something I couldn't really do if I were demoing an earlier boss.

Just because I'm nice and I really want to see someone beat this boss, I'll give you a hint as to why you're probably losing: I don't know if you've ever played FFX, but the battle system here is essentially an enhanced version of it.  It's called CTB (Count Time Battle or Conditional Turn-based Battle, depending on who you ask) and is turn-based, but not in the traditional sense: turn order is variable and asymmetrical.  You can create more turns for yourself relative to the boss by using lower-ranked attacks, which is how Robert sets up those Quickstrike combos in the first couple phases (QS is Rank 1).  The rank is displayed next to the attack name--that's the little box with a number in it (the color of the box indicates the element, which barely matters in this case as Robert has no affinities).  You get reckless and start throwing around high-ranked attacks without thinking?  You will be killed, that I can guarantee.

Here's a link to the Readme file on GitHub that explains a little more about how the battle system works, and also explains the different status effects:
https://github.com/fatcerberus/spectacles-i#spectacles-bruces-story
Title: Re: Spectacles: Bruce's Story
Post by: Harry Bo21 on May 13, 2014, 09:02:34 pm
Ive played a lot of games, that have debug rooms you can get to that were obviously used for battle testing?

Usually theres a way to toggle abilities and stats prior to a battle starting, then there are some custom enemies designed to use as many aspects of the engine as possible?

I wouldnt say "the final battle" is a requirement, just for testing (Hell FF7 had some giant pyramids).

But ill check it out when I get in :)
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on May 13, 2014, 09:56:51 pm
Well technically this is just the final battle of the first entry in the saga, so not terribly spoileriffic, just a little. :-)  But I picked this battle in particular to use for a demo because it was the best way to show off the powerful AI.
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on March 06, 2017, 03:16:20 am
I've started working on this project again, now that miniSphere has become a more-than-worthy successor to Sphere 1.x ;)

The first thing I did was to go through the codebase and update everything to take advantage of ES6 awesomeness wherever I could.  Prototypes became classes, string concatenation became templates, arrow functions are used where appropriate, you name it.  The end result is that the code is much, MUCH more readable and ultimately, maintainable.

Just to illustrate what ES6 can do for a codebase, compare this (BEFORE):
https://github.com/fatcerberus/spectacles-i/blob/aa9775a420004711e7b39c4807d77b5fd2034edb/scripts/Stat.js

To this (AFTER):
https://github.com/fatcerberus/spectacles-i/blob/master/src/battleEngine/stat.js

I don't even feel that I need the long-winded comment blocks describing the methods anymore, that's how expressive JS has become.  It's awesome. 8)
Title: Re: Spectacles: Bruce's Story
Post by: Fat Cerberus on March 07, 2017, 10:09:27 am
Having finally gotten around to resuming work on my flagship project again, I would say that my goal of making the Sphere v2 transition as painless as possible has largely been realized in practice.  Things can be upgraded locally as you learn the new API without touching large swaths of the codebase at once, and the new stuff works seamlessly with the old.  Which is important, because the Sphere v2 API is such a paradigm shift compared to Vanilla's API (<-- my retroactive codename for the original engine) that forcing veterans to learn the whole thing upfront before migrating is just not practical.

The thing is, I don't know how many extant Sphere v1 projects there actually are at this point.  But rest assured that for whatever ones there are, the transition will be a smooth one. :)

Anyway, I'll post some more about the game soon.  In particular I'd like to lay out how the battle engine has shaped up, as it's ended up surprisingly complex of late.  There's a lot of different battle mechanics now; more, even, than I envisioned in my original ideas.