• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Stream of consciousness - Dueling

  • Marrend
  • 07/28/2014 11:15 PM
  • 635 views
I've probably said on several occasions at this point that my intention is to have the boss battles of this game be done via a Suikoden-style duel. How often I've mentioned that I've done some upgrades to the system seen in Chance Encounter to support multiple dualists, and even have something of a test-demo of that system sitting on my computer is something else.

Mostly, the reason this is coming up at all is because of a little event. The challenge that was brought to my attention was to have the AI more reactive to what the player has chosen. My initial thoughts were to have the AI be "balanced" for maybe three rounds before reading the action history. Then, I got to start thinking about how the action history would actually be stored. Would it not be an array, with each object therein being an "action ID" that can be used with the functionality that's already there?

I'm certain the first action would, essentially, be from the "balanced" AI (ie: decided at random, which each possibility having the same probability). After that, it would react to the player, with the results being tied to whatever the player inputs the most. Which may create some interesting interactions with the AI, as the player will want to beat whatever the AI is trying to throw at him/her/it/whatever. I imagine that, under the optimal circumstances, this AI will seem to act as if it's on plan "balanced". Or, feel like that one rock-scissors-paper guy in Xenogears that always plays the "wining move" of the move you just made. How it will actually pan out, well, we'll see.

As a side-thought, I never did test the interactions involving a dualist where what is said had no bearing whatsoever on the action being taken. Doing that in combination with this reactive AI concept should be really interesting. Can everybody say "Masako cameo"?

Posts

Pages: 1
Marrend
Guardian of the Description Thread
21781
The thought of Masako making a cameo has given me pause. What if I make a "predictive" AI? This AI wouldn't actually determine it's action until the player does, and would only read the most recent input made. Though, the action performed shouldn't always be the action that would "beat" the move chosen by the player. That would be just, plain, stupid in regards to gameplay. However, I should be able to set it so that the action that would "beat" the player's action would have a slightly higher probability than the other two.

The implementation of the system as a whole would be a bit different if I decide to actually implement this. For one thing, a "predictive" AI would, by necessity, not have quotes attached to specific actions. Thankfully, I believe already have that kind of functionality. However, the implementation of this system as-is has been on the assumption that the AI would choose it's action first, then the player. Not the other way around. Then again, I'm figuring, it can't be too much more complicated than throwing in a few if-then statements, right? Right!?

*Edit: If you excuse the use of a technique used on a certain other gamepage....

Awwwww yeaaaaaaah!

Initial playtesting of the "predictive" AI seems to function without a hitch! Though, call me crazy, but I'm worried that I won the test-bout. I mean, yeah, I was sweating bullets because I had no idea what the AI was actually going to do, but, I still won with about half my health left. I will want to test it out more anyway, just because.

Side note: At some point, I will want to figure out some quotes for the test-AI that's set on "reactive".
Marrend
Guardian of the Description Thread
21781
The "reactive" AI isn't working the way I thought it would. I'm not quite sure how the hell it arrives to the point yet, but, there seem to be random moments that it spouts all the quotes for a given action at once.

So, I'm in the process of trying to figure out exactly what causes this phenomenon, and what I can do to make it work the way it should. From the debugging I've done so far, when the bug occurs, the line...

if @quotes[@action].instance_of?(Array)

...returns false when it should, by all accounts I can think of, return true. Also, I saw a number between 0 and 1 being passed into a function somewhere. Unfortunately, I don't remember where, in the exact processing, I found it, but, I'm pretty sure that's half my issue. Hah, it's probably going something like @quotes[0.2493242].instance_of?(Array), and going something to the effect of "Welp, doesn't exist, so, obviously, it can't be true!"

I'll want to look into this in more detail, though. I guess it would have helped me if I could remember where it was in the code that I saw this floating-point number. If I could find it again, maybe, I could figure out where it's coming from from there. For now...

So tired!

*Edit:
Something's rotten in the state of Denmark this AI functionality. I'm looking at the values passed in to the function that determines the "reactive" AI priority. When it works the way it should, the value passed into it is a floating-point number, and it returns a nil-value. When it fails to work, it gets passed an integer, and returns an integer. Like, the hell? It makes no sense to me that it would work this way!

The weird thing about it is that my "predictive" AI uses this very function that I'm debugging, and, well, that AI works the way it's supposed to. I'm kinda thinking it has to do something with how the "predictive" AI only looks at the last inputted action, whereas the "reactive" AI is supposed to look at a random action in the action history. So, the temptation is to remove the "reactive" AI as an AI preference (and the functionality thereof), but leave the function that reads the action history for the "predictive" AI, do some tests to make sure I didn't somehow screw up the more "normal" AIs, and call myself done.
Pages: 1