[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Ghost velocity  XML
Forum Index -> Druids RPG Go to Page: 1, 2 Next 
Author Message
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

Dru, this afternoon while we were lazily floating across the big ONS maps, you mentioned that you would have to do something about Ghost in the large map gametypes.

I got an idear. In DruidGhostInv.uc, here's the money line (124):
Code:
Instigator.Velocity = Normal(RevivePoint - Instigator.Location) * (Instigator.AirSpeed + Instigator.AirSpeed * 0.5 * OwnerAbilityLevel);


It shouldn't take too much codewise - just some trial and error testing - to add in a distance calculation, like
Code:
VectorVictor *= VSize(RevivePoint - Instigator.Location);


Unfortunately, I can find next to no darn documentation on Actor.Velocity. Either my Google Fu is weak or it's just a mystery to all but the master UnrealScript coders.

I added a Log() line to the GhostInv to check things out, but I can't really understand the numbers with no reference.

But along this track, we should be able to scale Ghost's movement speed not only for its AbilityLevel but also for the distance moved. It would even be possible to lock Ghost to a timeframe - Ghost 1 takes 15 seconds to get wherever it's going, where Ghost 3 takes 5 no matter the distance.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

I'll accept patches

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

It's not possible. Not from what I can see. There appears to be a limit on the magnitude of velocity vectors, at least from the experimenting I've done.

At a velocity vector magnitude of 1, it takes 93 seconds for a player to move 1000 units. At magnitude 660 (the default for Ghost 1 when a player is using it), it takes about 2.5 seconds.

At magnitude 65535, it takes about 2 seconds.

So...yeah. Bad juju

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
KohanX

Godlike

Joined: 03/04/2006 13:40:23
Messages: 350
Offline

Did you try other numbers aside from 65535, or just jump straight to the max? There's got to be a way to do this.
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

I spent about 3 hours testing this, working out numbers, writing down units traveled and time spent traveling, trying to find some correlation between them.

There just flat out doesn't appear to be one. It's consistent, that's for sure, but distance traveled:time traveled doesn't scale in a linear fashion. I was excited when my rough numbers showed that at vector magnitude 660, ~5000 units = ~10 seconds, ~1000 units = ~2 seconds and ~23000 units = ~45 seconds. I was all about that, seemingly a near 500:1 relationship. But then I changed the velocity. Yes, Ghost 2 and 3 move faster than Ghost 1. But not that much. Really, the way the game calculates it (Pawn.AirSpeed + .5 * Pawn.AirSpeed * GhostLevel) where AirSpeed = 440 for players, it seems like there would be some sort of tie in to the physics engine for air resistance and the like. The code even has a check for that. But it really doesn't make much difference either.

Overall, it was a really frustrating few hours of testing, measuring, and tweaking, only to say "forget it" and create that test case where RevivePoint = Instigator.Location + vect(0,0,1000) and start tweaking the velocity vector magnitude. Once I saw that it scales in such an extreme manner - the difference in effect between 1 and ~500 appears to be greater than the difference between 500 and infinity - I gave up.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
Flak Monkey

Wicked Sick!
[Avatar]

Joined: 08/24/2006 12:21:41
Messages: 1098
Location: Land of great Cheese and Beer
Offline

How about making 1 more level in this ability and make it instant like the teleporter artifact? It is frustrating to ghost, even at lev 3 accross a large ONS map. Most of the time I reach the random point, the wave is over and I missed out on a lot of carnage.

My current skin After several other skins, I have reverted back to Bender.

Flak Monkey -> Berserker ( 818 )
Flak Junkie -> AM (60)
Monkey Wrench -> Engineer (27)

Favorite quotes:

"It puts the lotion on it's skin, or else it gets the hose again."

"Every morning is the dawn of a new error"

"But why is the rum gone?"

"The brain is a wonderful organ. It starts working the moment you get up in the morning and doesn't stop until you get to the office." - Robert Frost

"Beer has some Food value, but Food has no Beer value."
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

I must say after doing this study that the Unreal 2 physics engine is FAR more detailed than I had thought it was. The best part is I can do max damage with redeemers now

In answer to your question, that's certainly doable and actually fairly simple. It'd be up to Dru and Shan to put it in (or not) tho.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

So I'm confused. Did you figure out a solution Moof, or did you run into trouble with the velocity thing?

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

Oh! I think I see what you're talking about... you might want to look at the velocity code in RW_Knockback to see how I figured out how to do it. Somehow you have to modify the length of the vector, as in the case of movement, a Vector works differently than a location.

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

Dru, great! I'll check into using the momentum physical property.

Also: right now, ghost appears to iterate through a lengthy "find the spawn point" process. If it fails to find a viable RevivePoint, it falls back to assigning a random spawn point as the RevivePoint.

In my experience, it pretty much always takes me to a spawn point. Would you consider eliminating the RevivePoint discovery process and defaulting to a random spawn point? You'd be looking at eliminating 37 lines of code looped potentially 1000 times PER GHOST.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
TheDruidXpawX

Wicked Sick!
[Avatar]

Joined: 12/19/2004 18:32:13
Messages: 1946
Offline

It's better if it doesn't find a spawn point first, as it will find a point closer to the player. I'm not sure why it's always doing the spawn point thing right now.

Skin download: http://www.disastrousconsequences.com/dcforum/posts/list/1189.page

The fundamental problem is this: The first word we learn as children is NO. From that point forward society teaches women that saying no isn't polite, and society teaches men to respect those who wont take no for an answer.

The world is what you make of it, my friend. If it doesn't fit, you make alterations. -- Stella, The Morning Star
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

I FOUND THE "GHOSTING OUT OF THE WORLD" BUG.

Working on it.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

TheDruidXpawX wrote:
It's better if it doesn't find a spawn point first, as it will find a point closer to the player. I'm not sure why it's always doing the spawn point thing right now. 


Dru, there's two ways to handle that. One, trying to fix the find a random RevivePoint code. Two, picking a random point off LevelInfo.NavigationPointList.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
Moof

Wicked Sick!
[Avatar]
Joined: 06/24/2006 19:42:44
Messages: 433
Location: College Park, MD
Offline

Moof wrote:
I FOUND THE "GHOSTING OUT OF THE WORLD" BUG.

Working on it. 


Status: Here's the money line.
Code:
VSize(Instigator.Location - RevivePoint) > VSize(Instigator.Velocity) * deltaTime


What happens is on the rare occasion that someone's framerate is low, or something else strange happens like a lag burst, the game can actually "miss" when the ghost is supposed to stop. In that case, the velocity never changes, and the player keeps moving in a straight line forever.

There are several ways to handle this. I'm not sure what's best, to be honest. Right now, I have it set so that
Code:
if (10000 * deltaTime) < (player's distance from revive point) {move player to revive point and RevivePlayer()}

That works on my system, but it's still possible to skip past it. So, perhaps we could build in a sanity check for delta player distance increasing. It's all about making a call on granularity vs. looks. If you set it so that you'll never ever ever have the slightest chance of the revive point getting "missed" in this way, you'll have players jumping around/warping/teleporting near the end of each ghost. But if you set it so that the teleporting never happens, you'll have players missing the revive point.

I need to take a break from coding - tomorrow's going to be a really rough day. I'll work on this more later.

Also: momentum can only be used when imparting physical impacts between objects. That works well with knockback since you have a bullet/missile hitting something else. With ghosting, you have no imact, so you're restricted to velocity. Velocity is in turn restricted by a player's terminal velocity and physical resistance, even while flying.

However! All these problems are solved by using Phys_Hovering instead of Phys_Flying. But with faster ghost speeds, you miss the revive point more often. With no restriction on the AirSpeed of the player, multiplying the velocity by even 10 means that ghost NEVER stops. Ever.

Catch 22.

Moof, Scholar of Ni

Moof (W); Dr. Moof (M); Engimoof (E); Moofgineer (E beta)
[Yahoo!] aim icon [ICQ]
BotFodder

Wicked Sick!
[Avatar]

Joined: 01/13/2006 15:23:41
Messages: 1239
Location: Florida
Offline

Moof wrote:
What happens is on the rare occasion that someone's framerate is low, or something else strange happens like a lag burst, the game can actually "miss" when the ghost is supposed to stop. 

Hmmm ... that's wierd.

I was just about to feed you the line "The server is always right and the client shouldn't be able to impact things in this way." That may still be the case, but then I know from what little I've looked at the Ghost code that there's a "disconnect/reconnect" sequence for the player. I guess something around there could get a little wierd - but then you'd think the "ghoster" would see something a lot different from what the rest of the players are seeing ... hmmm.

How often is the "Ghosting out of the world" bug occurring on the server?

I use the Futurama Prof. Farnsworth Skin: http://www.disastrousconsequences.com/dcforum/posts/list/1595.page
WM: (DC)BotFodder 170
MM: (DC)BotDoctor 141
AM: (DC)BotBooster 147
http://ericdives.com/ - My DC Newbie FAQ: http://tinyurl.com/lz229
Twitter: http://twitter.com/ericdives
[WWW] aim icon [MSN]
 
Forum Index -> Druids RPG Go to Page: 1, 2 Next 
Go to: