Okay, so for my space-ship for my new gamemode, in my ENT:PhysicsSimulate() function, I am using this for movement control:
[lua] local targetpos = self:GetPos() + (self:GetAngles():Forward() * self.cSpeed)
local pilotangs = self.Pilot:GetAimVector():Angle()
pilotangs.r = self.cRoll
local ShadowParams={}
ShadowParams.secondstoarrive = 0.1
ShadowParams.pos = targetpos
ShadowParams.angle = pilotangs
ShadowParams.maxangular = 1000
ShadowParams.maxangulardamp = 10000
ShadowParams.maxspeed = 500
ShadowParams.maxspeeddamp = 1000
ShadowParams.dampfactor = 0.8
ShadowParams.teleportdistance = 0
ShadowParams.deltatime = deltatime
phys:ComputeShadowControl(ShadowParams)[/lua]
And everything works fine, with the [b]EXCEPTION[/b] of the speed. Regardless of what self.cSpeed is set to, with the exception of ridiculously low numbers (around 30 or less), the velocity of the ship is [b]always[/b] the same: 625.
Even for those stupidly small numbers, they're still not even close - I know that a self.cSpeed of 14 sets my velocity to about 176u/s.
Kogitsune and a few others agree that it's something regarding the damps, but they don't know exactly what - someone suggested just to fuck around with the numbers until they're "good enough."
While I'll do that if I have to, I'd rather not. I'm assuming that [b]someone[/b] here knows ComputeShadowControl() to some extent, and I'm assuming that Devinity and the other half a dozen EVE Online clones floating about use ComputeShadowControl() to moderate their ship movements, which implies they would have solved this issue.
That being said, does anyone have any ideas how to manipulate this in such a way to as to make self.cSpeed my actual velocity?
Thanks. :buddy:
STOP! Please.
I went through this same nightmare of a function too.
REALLY, create your own movement function.
[b]You will never find the answer, and this is terrible for PRECISE movements as well. It's actually not quite hitting your target.[/b]
Ummm... instead of doing
[lua]
local targetpos = self:GetPos() + (self:GetAngles():Forward() * self.cSpeed)
[/lua]
find the target position, the *ultimate* target position, then use... oh. I see. Uhm... Okay. Instead of doing *self.cSpeed, get rid of that, and set min speed to self.cSpeed-0.0000000001 and max speed to self.cSpeed. Might work! Also you might want to normalize targetpos.
[QUOTE=bobthe2lol;22953095]Ummm... instead of doing
[lua]
local targetpos = self:GetPos() + (self:GetAngles():Forward() * self.cSpeed)
[/lua]
find the target position, the *ultimate* target position, then use... oh. I see. Uhm... Okay. Instead of doing *self.cSpeed, get rid of that, and set min speed to self.cSpeed-0.0000000001 and max speed to self.cSpeed. Might work! Also you might want to normalize targetpos.[/QUOTE]
I considered doing something like that, until something popped out at me.
The maxspeed, as defined in the ShadowParam, is 500. But my velocity is consistently 625. This implies to me that maxspeed doesn't really cap anything.
Also, can anyone provide a better method of controlling movement and turning? My own attempt has turned out quite miserable - from inconsistencies between my aim vector and the entity's angles (aim vector being a yaw of 270, entity's angles being a yaw of -90, and them never meeting up) to doing absolutely nothing.
I'm terrible with Vector and Angle math, I'll be the first to admit. :blush:
Sorry, you need to Log In to post a reply to this thread.