understanding, then applying, the Shapeshifter attribute

Started by ElijahSnowFan, January 20, 2009, 12:09:58 AM

Previous topic - Next topic

ElijahSnowFan

Hello, everybody. Hope someone can take a second to help.

First, the basics: I'm running FFvsTTR, with FFX3.2. i use the built-in AI scripter (thanks to Dr. Mike! if i left out someone else, thanks, as well, but that tool helps tremendously) to create the character AIs.

i've been around long enough to get in the ai files and tweak them to behave relatively closely to what i prefer (though Batman's AI has proven to be as elusive as the character is in comics.).

but the one attribute that i just flat-out can't seem to master is...Shapeshifter. that attribute has been killing me for years. i absolutely cannot get it to work "right." a quick example: i have Emma Frost, who has telepathic powers in her human form in the base character. she has an alternate "diamond form" which she uses when she's in physical danger, but no telepathy.

i use the shapeshifter attribute, create both characters, give them AIs. i make Frost's diamond alternate her custom form, and even get it to the point where, sometimes, she'll actually use the form in the watch mode of Rumble Room...but the diamond form won't move. it does absolutely nothing. just stands there. changes back to the base form sometimes, then, if she doesn't get beaten to death first, might change back to the diamond form...only to stand there. GAH!!!!

so. as a firm believer that if someone teaches me how to fish, i'll catch my own dinner, i'm requesting (please! please!) for someone to treat me like a total idiot and walk me through the creation of a character with an alternate form, with an AI for the base and alternate form. (if it's capable of working that way? maybe i'm expecting too much of the attribute?)

but if someone teaches me this once, i'll be able to make characters like Mystique, Beast Boy, werewolves, the aforementioned Emma Frost...why, you'll be giving me more characters than you realize. it would be sooooooo appreciated.

then, once you've forgotten about all the time you've spent lecturing, i'll be back for more instruction on "Summoner" -- because Jakeem Thunder and the Thunderbolt are killing me, too!

M25

I did all of the custom AI, including the AI generation tool, so don't blame Dr. Mike for that.

The generator doesn't handle shapeshifting very well as it cannot decide when to transform, so you need to manually add some conditions to tell the AI when to transform.

Run each of the characters through the AI generator (I'm sure you did this already), and then go in and edit the TShapeShift() lines in each AI.

I did an ant-man/giant-man shapechange character that has this entry in ffxcustom.py under FFX_SHAPESHIFT_CUSTOM

["ant-man","effect_entropy_spawn","power","CUSTOM_SHRINK","giant-man","","","","",""],


You can use these parameters to help specify when to shapeshift:

mindist : minimum distance from an enemy, normally set to 20 which is very close.  If you had a melee form and did not want to change when in melee with an enemy, you could set this higher, say to 100.

maxdist: the maximum distance from an enemy, normally set to 500.  If you only wanted to change into that melee form when very close to an enemy, you can lower the maxdist.

subtype: conditions that the enemy or enemies must fulfill (from the big list in the AI documenation)

situation: conditions that the character must fulfill (same list as subtypes)

pct: the percentage chance the AI will use this each time it needs to make a decision.  This is set to 40 (%) normally, but you could raise it as high as 100 if you want the character to always shapeshift in a certain sitiation.



ant-man has an entry in its AI that tells it to transform into giant-man when facing enemies that are melee types:

'TShapeShift(subtype=["ismelee","not flying"], form="giant-man")',

giant-man transforms back when facing flying enemies or ones that used mostly ranged powers:

'TShapeShift(subtype="isranged or flying", form="ant-man")',


If an AI isn't doing anything (not even transforming), then you need to look at the AI file to see if you are missing any commas, quotation marks, etc.  Or post it here and we can look at it.




Xenolith

You could also try to set up priorties for you AI by weighting certian factors and/or using subtypes.  For example, I've classified all my heroes and villains as blasters, bricks, brawlers, controllers, etc, like City of Heroes.  Then, I tell each AI to look for certain types of opponents to attack.  With the shapeshifter trait, you could tell it to prioritize "controllers" for example, and stay in ESP form when doing so.  Your ESP form AI would also have to tell Emma to stay away from all attackers and just mess with them at long range.  If there are no controllers then she should swtich to diamond form, which would have a different AI, telling it to when to swtich back, or set the conditions is CC (stunned, out of energy.

My Alpha Flight team is set up in this way and they can take out about any other team that doesn't include Superman.  Puck and WildChild go after controllers and brawlers, Sasquatch fight other bricks, Windshear messes with blasters, etc. 

I've found that the AI has a hard time with Shapeshifter, and that is completely reasonable.  You really need to give it a reason to shift back and forth.  A reason that is very specific.  It seems to me that the AI addresses many possible opponents many times during an interval, and will spend time shapshifting/reacting to the different threates instead of actually doing anything.

My impressions, anyway.

ElijahSnowFan

gah! sorry, M25! had a total brainlock -- of course i know it's your AI generator! :doh:

thanks much, to you and Xenolith for your advice. i'm going to get in here and try to tweak a character or two and see if i can get this thing running. if/when i do, believe me, i'll come back and let you guys know -- as always, i appreciate the time you guys take to respond.

ElijahSnowFan

hi, guys!

just wanted to report what's going on: tweaking the AI, as directed, in the m25aidata file has helped a great deal; Emma Frost actually survived a couple of fights with halfway-decent use of her alternate form.

however, for whatever reason, while the character does maintain the alternate form longer while facing melee characters, there has been a consistent pattern of the character switching back to the base character, then running away, even while engaged in a fight. it's like she'll take a couple of swings, then the AI will run through its paces, and simply shapeshift the character.

i'm pretty stubborn, so i'm going to try to figure it out myself, if i can. if i can't, though, i'll post the AI i have and see if anyone can spot what i'm doing wrong -- trust me, i know it's me. :banghead:

ElijahSnowFan

hi, guys!

after tweaking it a little more, i'm happy to report that i'm pretty satisfied with the results -- Emma Frost is a load now, especially when teamed up with Cyclops. the character's able to use her powers effectively, in either a lead or support role, which is all i could ask.

thanks, M25 and Xenolith, for taking the time. it's appreciated, and knowing how to create characters that shapeshift makes it that much more likely that i'll NEVER stop playing this game -- which is a good thing. :thumbup:

Xenolith

Good to hear. 

Man, I reread my post.  I need to take my time when typing or proof read what I wrote.  :)