• Welcome to Freedom Reborn Archive.
 

perfect flying melee

Started by bearded, May 14, 2007, 11:46:26 AM

Previous topic - Next topic

bearded

i have an idea.  have to post something about it, so i won't forget, but going to work out the details before i say anything substantial.
i think i know how to do flying melee perfectly.  as in, fliers can melee other fliers, and will get a super advantage vs ground opponents; fly in, melee and fly away.  all using the ingame system as is.
i'm super exhausted, which is probably where the epiphany came from.  xanadu, anyone? 
please, someone reply here, so it will remind me tonight when i click on 'show new replies to posts'.

crimsonquill

Sounds like a great idea... Good luck.

- CrimsonQuill

yell0w_lantern


Revenant

*Flies in and bumps this thread, without landing first, and then flies away*

tommyboy


Ares_God_of_War

must... see... flying... melee... *dies*

zuludelta

Wouldn't it be horrible if it turns out that bearded was working on a "Little Mermaid" mesh all this time (see the thread title!)?

Ares_God_of_War

awww now I have "Under the Sea" stuck in my head  :thumbdown:

Lunarman

.... The subject is interesting.

Finally the greatest problem in FF may have been solved :)

bearded

thanks guys, i appreciate the support.  i'm pretty sure this is going to work.  i'll start on it now, and by morning i will know.

it works.  but only in very specific conditions.  here's what i did.  i renamed flying to running, and hovering to melee idle.  then i used max to move the new running and melee idle up several units.
when fighting a flying opponent this way, he will fly up to you, hover and swoop down for melee hits.
if you are fighting him with a wieldable weapon, it is perfect.  when he is up high, you can't hit him.  when he swoops down for an attack on you, you can smack him.
but, when you use your melee powers, you can hit him if he is near you.  it seems that the bounding box is the reason.  with wieldable weapons, the box comes into play, you have to hit the box to hit the character.  with melee powers, you have to be able to hit the...heck, i dunno...selection circle?
using the flying for running method, the flying character can now do all ground based things, like pick up wieldables and throwables.
i've been reading the docs, and i can't see why melee doesn't work with the bounding box correctly.
wieldables can hit actual flying characters anyway, if they are low enough, so this doesn't solve anything.
how to make melee powers that function just like wieldables? 
edit update:  ranged powers seem to react to the bounding box correctly.

TaskMasterX

Just to clarify, bearded:
You renamed the fly and hover animations to run and melee_idle, respectively. So, the character will never run now? He'll always be flying everywhere?

You increased the height of the the run and melee_idle animations? So the character will never be in a "Landed" state, except when attacking with melee?

While it wouldn't take near as much time to edit KFs for this method compared to the method I found, I still think the method I discovered functions better. Did you see this?:
http://freedomreborn.net/archive/index.php?topic=41583.0

bearded

QuoteYou renamed the fly and hover animations to run and melee_idle, respectively. So, the character will never run now? He'll always be flying everywhere?
yes.  why run when you can fly?  of course it's not true flight, so you don't get the ingame flight bonuses.  i got the idea from some of the meshes that seem to hover all the time, like one of the storm meshes.
QuoteYou increased the height of the the run and melee_idle animations? So the character will never be in a "Landed" state, except when attacking with melee?
not quite, the regular idle is grounded.  and so is walk.  so, custom walk commands would be non flight, as well as when the character is in mental blank state.  what happens is you are landed, when a bad guy is detected, you immediately hover.  the melee attacks should be the same ones you use, based on hover, but lower, so the character swoops down.
unfortunately, it's not just editing keyframes, as that results in the flight animation being at ground level.
i did see yours, it's what got me thinking about it.
i just can't figure out why the melee's work when you can't reach the character.  it's only melee that does this, everything else in the game totally supports my idea.  it just occurred to me, when 2 fliers would melee each other, they would swoop down also.  maybe there should 2 melee's for each flier, ground target and other flier.  this would be tough for the ai's to figure out tho...
assuming i can work around the melee bounding box block.
also, if i get it all working, this throws cp cost for flight.
i note that ffvttr considers the bounding box more important.  maybe this would work better in ffvttr.  what have ppl discovered about melee and the boxes?
i think i know why the ranged attacks look for the bounding box.  it's because the projectile is actually an object isn't it?
somehow must make melee attacks be objects, so they need to contact bounding box verts.  if we could do this, then we wouldn't need my silly keyframe renaming.  wieldables track height of target.  if in range, they smack.  there must be a way to transfer melee powers to wieldable objects.  with weapon master attribute, a gun is attached to the characters hand.  is the gun an fx, or an actual ingame object?  does the custom shoot power come from the gun or the character?

TaskMasterX

Quote from: bearded on May 15, 2007, 04:39:27 AM
yes.  why run when you can fly?  of course it's not true flight, so you don't get the ingame flight bonuses.  i got the idea from some of the meshes that seem to hover all the time, like one of the storm meshes.
Yes, but not all characters fly everywhere. Take for instance Wonderman and Northstar. Wonderman is just as likely (if not more likely) to engage melee standing on the ground where Northstar would probably be zipping everywhere, and attack from the air. This doesn't seem to really apply universally to all fliers.

Quote from: bearded on May 15, 2007, 04:39:27 AM
not quite, the regular idle is grounded.  and so is walk.  so, custom walk commands would be non flight, as well as when the character is in mental blank state.  what happens is you are landed, when a bad guy is detected, you immediately hover.  the melee attacks should be the same ones you use, based on hover, but lower, so the character swoops down.
Hmm. This sounds pretty cool. I'll have to test it out.

Quote from: bearded on May 15, 2007, 04:39:27 AM
unfortunately, it's not just editing keyframes, as that results in the flight animation being at ground level.
i did see yours, it's what got me thinking about it.
i just can't figure out why the melee's work when you can't reach the character.  it's only melee that does this, everything else in the game totally supports my idea.  it just occurred to me, when 2 fliers would melee each other, they would swoop down also.  maybe there should 2 melee's for each flier, ground target and other flier.  this would be tough for the ai's to figure out tho...
Yes, I was wondering how this would work with flier vs. flier. I've begun to edit the flying_melee animations I've been doing to fly a bit more forward and at less of an angle. I have them flying more straight, rather than down, so it looks better whether they're attacking someone on the ground or in the air. Also, using a trick Renegade showed me, I've been making the flying_melee animation have both a contact and a leave_hand so the animation can be used as either a melee attack or a ranged. As for the AI, try something like this to get them to attack correctly:
'TLand(subtype="not flying")',
'TAirSuperiority(time=0.88,subtype="flying")',
"TMelee('flying melee',time=2.83,subtype='flying',situation='flying')",
"TMelee('flying melee',time=2.83,subtype='not flying',situation='not flying')",
'TMoveTo(mindist='melee',time=0.88,subtype="flying")',

I'm going to try this out and see how it works and get back to you.

tommyboy

One idea I had and just tried was to physique the bounding box to to custom bones and then animate these to move up during melees, and down during flight, so the bounding box would get bigger/taller then return to normal size. The idea being that a bigger bounding box would somehow allow air/ground ground/air melee contact.
Easy enough to implement in Max and export, it turns out to be not much use in game. A flyer still has to land to melee a walker, and still has to be landed to be melee'd by a walker. You still need to set up powers that work around the game's "flyers cannot melee/be melee'd" rules.
The best solution is still the ranged projectile using an altered melee animation with leave hand replacing contact, as far as I can see at the  moment.
That or someone altering the game's executable...

bearded

could custom ai be used to trigger powers based on targets height?  if so, you could use my fake flying to determind if an ai would even attack at all.  it sounds likely, as ai's don't attack characters on buildings.
there must be some data based on the characters ground level.  the bottom of the character is x,y,z = 0, so no matter where you put the mesh, the x,y,z still is zero, and targetable by melee.
does target's height start at x,y,z or at the bounding box?  could you target the bounding box's height?

i've discovered, with fake flight, a player can not pick up a trash bin if he is in melee_idle/hover mode.  if he is in idle on the ground he can pick it up.

if there were a way to generate an object, invisible or even sim it with an fx, then check to see if the object is in line with the target, and if not cancel the melee, or somehow make sure it misses...
what if every character were spawned with an invisible object attached to them?  woa, something just him me!  delete the selection box on the character, but the invisible objects selection box is big!  the invisible object would have the same material as the character, and damage done to it would be transferred to the character!
change the ai to attack the invisible objects!
it occurs to me this would work for straight damage, even resistances, and characters shields would still block, but is there a way to transfer knockback and stun?

TaskMasterX

I tried it out and found a few things (BTW, I used the male_basic mesh w/ Gren's male_swimmer KFs):
1.) The character would start the mission in his new melee_idle animation even though there were no enemies anywhere near him. So he always began hovering. I tested this in the M25 Team Mode.
2.)When I chose to fly, because I now had no fly animation, he'd use the idle animation while flying. (This is simple to fix but time-consuming using Nifskope. Just make a copy of the fly animation for fly and use the original fly for run.)
3.)While flying, I couldn't use the melee attack, it was greyed out. I had to land, then use the melee. Of course, this is obvious, but I'm already used to using my method, which you don't need to land before attacking.

I have no clue when it comes to working with bounding boxes and such, probably because it's something you can only play around with in Max, which I don't have. I hope a solution can come out of going in that direction because I'd really like to see a "perfect" aerial melee!

tommyboy

I have been thinking a bit about this.

What we want:
flyers can hit(ie melee) each other in the air, can hit grounded targets without landing. Groundlings(ie heroes on the ground) can hit each other, and hit flyers when they are close enough (ie within 2-10 feet?).

What we have in the game:
flyers cannot hit flyers. They have to land to hit groundlings. Groundlings can hit each other, and hit flyers only when the "melee airborn" dinosaur flag is active.

So it seems like the game does the equivalent of an "if  x then y" when a character flies, and says "if flying, disable the melee mechanism (both as hitter, and hitee) ".
Now, wouldn't the best solution be to find the bit of code (in the games executable most likely) that checks for flying and disables the melee mechanisms, and disable it?
As long as only that part of the flying code was affected,  you could only be melee'd whilst flying when close enough (as with normal ground-ground melee) and would be out of range of melee the rest of the time. Flyers could melee each other when close enough, or do air-ground melees when close enough.
It seems to me that since you can only melee when in close proximity anyway, that flyers who are above that limit would be safe from melee, so would have the advantage, but would not be untouchable.
I'm going to poke about in the exe and see if I can identify the bit that says "flying=no melees" and break it...I mean turn it off...
I'll report back when I know more..

bearded

Quote1.) The character would start the mission in his new melee_idle animation even though there were no enemies anywhere near him. So he always began hovering. I tested this in the M25 Team Mode.
that sounds like the 'war' command is in effect.  try it with the 'peace' command.
Quote2.)When I chose to fly, because I now had no fly animation, he'd use the idle animation while flying. (This is simple to fix but time-consuming using Nifskope. Just make a copy of the fly animation for fly and use the original fly for run.)
yes, my fake flying is supposed to be a replacement for true flight.  fake flight, or below the radar flight  would be for arial melee.
to compensate for no running, and immediate hover type things, the thing to do would be to set the ai to wander goal.  then the character would walk around.

another interesting thing i've noticed.  when a ground character with a wieldable left clicks on a flier, if they are to high, out of range, the grounder will not approach the flier.  if they are low enough, the grounder will follow the flier until he hits him, or he is out of range.
the key to this is smackdown, or rather, objects.  objects are apparently smarter than characters and can track melee-able opponents.  there must be some way to transfer an objects tracking to a character type.

tommyboy, are you sure it's not stashed in a python somewhere?  what is ff.py?  i can't find it.
i opened the exe with a hexer, and i think you are very very correct.  i found a lot of interesting things, just by searchign for the string fly, i'm sure you'll run across all the states i found.  i have no clue how to change things.

there seems to be the list we want to change under the heading 'Melee_Controller'.

tommyboy

Quote from: bearded on May 15, 2007, 08:39:20 AM

tommyboy, are you sure it's not stashed in a python somewhere?  what is ff.py?  i can't find it.
i opened the exe with a hexer, and i think you are very very correct.  i found a lot of interesting things, just by searchign for the string fly, i'm sure you'll run across all the states i found.  i have no clue how to change things.

there seems to be the list we want to change under the heading 'Melee_Controller'.

Yep, for those who've never opened the EXE in a hex editor, I find the following particularly interesting:


Note the "melee attack on a flying character", "airborn melee attack on a grounded character"  etc. The stuff is in there, but I am no programmer, so it's a bit like trying to fix a car by randomly hitting engine parts with a hammer....

bearded

i've got an idea for how we could start figuring this monster out.  remember back in the day, when speeding bullet worked while flying?  then in the patch they changed that.
if we open an old exe and the patched one, and compare the difference, maybe we could reactivate the flying speeding bullet.  this could tell us how to activate the other things.

tommyboy

I should point out that I am looking at the FFV3R exe NOT the FF one, but much of it is very similar to the FF exe when it comes to this stuff..
FFV3R has the "sonic boom" power, which is a sort of aerial speeding bullet....

tommyboy

Hmmm...I wonder if this is part of what I'm looking for...

bearded

that has got to be it.  there has to be a number it references.
i noticed that right after melee_control there is another melee_control that has a series of numbers.
what is the heading under what you found?

bearded

after the heading melee control there are 16 categories.  after the second heading melee control there are 16 series of 0's.  after each series there are 5 numbers.

Revenant


TaskMasterX

Nice find TommyBoy! This is looking good guys! :thumbup:

bearded

that last bit of code is not in  :ff: at all.
i'm wondering if we even manage to activate melee fighting if we would still have the same range problem i had with my fake flight.  so not only do we have to make valid targets, we also somehow have to activate the range finder that is used in the wield valid target code.
for some reason valid targets register with melee regardless of height.  but that's not entirely true, is it?  becuase if a target is on a rooftop, they are not valid.

tommyboy

Quote from: bearded on May 15, 2007, 11:11:35 AM
that last bit of code is not in  :ff: at all.
i'm wondering if we even manage to activate melee fighting if we would still have the same range problem i had with my fake flight.  so not only do we have to make valid targets, we also somehow have to activate the range finder that is used in the wield valid target code.
for some reason valid targets register with melee regardless of height.  but that's not entirely true, is it?  becuase if a target is on a rooftop, they are not valid.


I think that the "weild object" type attacks use an "arc" or "area" type attack, and most melees don't. This may be one reason why they catch fliers when normal melees don't.
As for range, my thinking is that there is already range finding code built into the standard ground-ground melee (ie nobody swings till they are next to the target character, and if they aren't, they run to them then swing), so if we can convince the melee_controller that flying characters are the same as grounded ones, that range finding code will still work. So if character A is on the ground and character B is flying on a rooftop right next to A, neither will be able to hit the other till one moves to the level of the other.
Of course this is pure speculation on my part at the moment, but it makes sense to me.

tommyboy

Well, no joy yet.
I just put strings of zeros in place of some of the references, saved the exe and ran the game, and was surprised to find nothing had changed. I thought at the very least I would have broken the game by doing this so it would CTD, but no.
I'll hack at it some more.... :P

bearded

i wont' be able to look at it for hours, but when i do, i'm going to compare the changes in the speeding bullet power in the different patches.
assuming the code is similiar in  :ff: and  :ffvstr: (and i'm guessing they probably are even the exact same code, in spots), that will give us a starting point for what sort of numbers to look for, for other stuff.