Data Realms Fan Forums http://45.55.195.193/ |
|
Non removable forces http://45.55.195.193/viewtopic.php?f=73&t=18244 |
Page 1 of 1 |
Author: | Grif [ Fri Mar 26, 2010 3:28 am ] |
Post subject: | Non removable forces |
Alright, so this is an issue that's been bugging me for a while. When you have a system set up, through Lua, to move craft around completely without .ini code, you tend to have forces stack up and cause discrepancies in movement, despite what your Lua code is telling the object to do. ClearForces and ClearImpulseForces doesn't really help this. At all. |
Author: | Lizardheim [ Fri Mar 26, 2010 7:29 am ] |
Post subject: | Re: Non removable forces |
Maybe a stupid idea, but I think it would be possible to have the script spawn heavy mopixels that is sent directly into the craft from the side/top/bottom. Or negative mass mopixels that pull it. |
Author: | Geti [ Fri Mar 26, 2010 7:49 am ] |
Post subject: | Re: Non removable forces |
Negative mass particles behave strangely, like negative strength glows do, but even stranger. The impulses they produce are never very consistent. However, with this project paul is doing the movement with lua, not ini/particle based anything. The forces are just a bit broken. I think this thread is a complaint in the vein of "this annoys me dan. fix it faster" more than a "what do I do now?", but cant be sure. As an addendum, good to hear you're working on it somewhat |
Author: | robolee [ Fri Mar 26, 2010 3:12 pm ] |
Post subject: | Re: Non removable forces |
one method of working around this would be to implement your own small little physics loop: self.AccelY = self.ForceY/self.Mass; self.AccelX = self.ForceX/self.Mass; self.InitVelX = self.VelX; self.InitVelY = self.VelY; self.VelY = self.InitVelY + self.AccelY; self.VelX = self.InitVelX + self.AccelX; self.PosY = self.PosY+self.VelY; self.PosX = self.PosX+self.VelX; self.ForceX = 0; self.ForceY = 0; won't be as good as using the games physics engine, unit issues (vel=m/s, pos=pixels) and all force gets added instantaneously, but you can mess around with it and make it as complex as you want and at least you know what you're dealing with. |
Author: | Grif [ Fri Mar 26, 2010 3:16 pm ] |
Post subject: | Re: Non removable forces |
The thing is, that's not too far from what I'm doing, and the engine still overlaps all lua velocity and overlap if there's some forces added up. Some way to counter it would be lovely, but literally nothing I've tried has worked. |
Author: | Shook [ Fri Mar 26, 2010 3:37 pm ] |
Post subject: | Re: Non removable forces |
Does the system HAVE to be based on forces? If not, i've found that working with velocities works pretty well. I can post the script i use if you want. If it does... Well, i assume you have tried using impulse force? |
Author: | Grif [ Sat Mar 27, 2010 1:34 am ] |
Post subject: | Re: Non removable forces |
That's the thing. I'm not doing anything related to forces. I'm setting Velocity and RotAngle and nothing else. The problem is that the game engine sometimes decides that because I hit something, a constantly applied lua script can be ignored in favor of doing its own calculations. In fact, thinking about it further, this is actually exclusively a problem related to RotAngle. Velocity changes don't matter at all; it's just that RotAngle, for whatever reason, is considered an engine property on a significantly higher priority than it is a lua property. |
Author: | Shook [ Sat Mar 27, 2010 12:15 pm ] |
Post subject: | Re: Non removable forces |
Hmm, odd. Tried using AngularVel instead of setting RotAngle, or just setting it to 0 every frame? I suspect that the engine might not be removing the angular velocity of an impact, so if it has a negative angular velocity and you're trying to rotate it in the positive direction at the same time, weird stuff will happen. Kinda like how you can partially negate gravity by constantly adding upwards velocity, but not enough to actually fly upwards. |
Author: | Grif [ Sun Mar 28, 2010 1:46 am ] |
Post subject: | Re: Non removable forces |
Constantly setting AngVel to 0 helps marginally but doesn't wholly solve the problem. Also, "Kinda like how you can partially negate gravity by constantly adding upwards velocity, but not enough to actually fly upwards." what |
Author: | Lizardheim [ Sun Mar 28, 2010 1:49 am ] |
Post subject: | Re: Non removable forces |
If you make it fly upwards in Lua, as in, not fast or anything, just the force of gravity, kinda like how a helicopter does when it hovers. |
Author: | Grif [ Sun Mar 28, 2010 4:19 am ] |
Post subject: | Re: Non removable forces |
Haha oh wow I just realized that shook is exactly correct. I had a post detailing why I didn't think so until I thought about and realized this: if you set any engine property to itself plus anything else, the engine factor will be destabilized between lua updates by standard physics engine interactions if you directly set the engine properties, there's no trouble at all It seems really obvious, now, but I never really though that through. Well, that solves that problem. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |