|
| 30 Apr 2012 06:23 PM |
http://blog.roblox.com/2012/03/how-roblox-is-improving-its-network-physics/
that thingy. I have a bunch of humanoids that are pretty much just 1x1x1 cubes walking around on the ground. I click with a tool to make them move. Sometimes, they stop moving entirely. After very very annoying debugging, I've concluded that it's Roblox's improved physics causing this issue. Here's why i believe this:
When they units get stuck, they get stuck while they're in the middle of walking to a destination. (so they suddenly stop, seemingly randomly) When I walk towards the "stuck" units, (not clicking or touching them) they suddenly start working again and continue along their destination.
So, wat do I do? I've seen a game that does a similar thing and they don't have these problems. Making the units bigger isnt really an option either. Any ideas, and is it really the issue I think it is? |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2012 06:28 PM |
| use BodyVelocity, BodyPositon, CFrame or something as a substitute for movement? |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2012 06:31 PM |
I was hoping for some kind of "physics hack" to make it work.
BodyVelocity isn't an option because I'd have to do checks every frame (or something close) to see if they've reached teh destination and stop moving if so.
BodyPosition wont work because it goes really fast at first, then slows down as it gets closer.
CFrame wont work because I need physics. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:36 PM |
BodyVelocity+BodyGyro You can use .magnitude to tell if they have reached destination.
BodyPosition for units that stay at one altitude.
I don't use Humanoids.
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2012 06:40 PM |
@Helper
thx for that godly advice.
That was what I was originally going to do, but Humanoids seemed to do the job so I switched to them. Looks like imma go with my initial gut.
Still, I don't like the thought of having to check if they're near the destination. I'll have to check fairly often (I'm thinking every 0.5 seconds?)
Anyway, I appreciate it, HH. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 30 Apr 2012 06:42 PM |
Fools. :)
It's been around for a while, longer than most of your would expect. I've come across this, and to simply fix it I did:
repeat wait() humanoid:MoveTo(Point, Part) until (torso.Position - targetPoint).magnitude < 2.2 |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Apr 2012 06:45 PM |
@MrNicNac
What exactly would that achieve? I suppose that it would give the unit a (metaphorically speaking) "nudge" to make it start moving again, but surely doing that every frame (where there could be 240 - 360 of these humanoids) isn't a good thing. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:45 PM |
" repeat wait() humanoid:MoveTo(Point, Part) until (torso.Position - targetPoint).magnitude < 2.2"
Thats even worse. Thats every .03 seconds, while he was saying he'd have to check for every .5 seconds.
|
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:46 PM |
This is when I only had single part units: http://www.roblox.com/Testing-RTS-place?id=51448577 |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 30 Apr 2012 06:47 PM |
You kids and your efficiency paranoia.
I use that along with 600+ lines of code per each of my AI. It has no noticeable affect. Besides, go check it in the performance window yourselves before sounding...well...**bad**. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:47 PM |
| Whats wrong with checking .magnitude? Is it that difficult a calculation? Keep in mind you'd have to do a bunch of those to see if an enemy is nearby(unless you have a better idea) |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:48 PM |
There is nothing wrong with being efficient if not being efficient in that way is dumb. No point checking a distance 30 times a second when a few times a second would suffice just as well.
|
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 30 Apr 2012 06:51 PM |
| I'm a doctor, not a programmer. I don't care for efficiency if it doesn't have a physical effect. Especially with 20+ moving AI. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2012 06:51 PM |
@HatHelper Your units have several bricks that have physics? o.O I have several parts making up mine, of course, but only one of them is actually physical.
@Oysi I was thinking the same thing.
@MrNicNac 600 lines of code, maybe, but when you're doing that 30 times per unit per second, it gets a little bit out of hand. (when, as I said, there could be 300+ units at a time)
|
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:52 PM |
Then what is physical. Besides microscopic changes in RAM and stuff, there is no difference. Even if you were instancing a thousand parts every second.
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2012 06:52 PM |
"Whats wrong with checking .magnitude? Is it that difficult a calculation? Keep in mind you'd have to do a bunch of those to see if an enemy is nearby(unless you have a better idea)"
oh god, you're right. I hadn't coded that part yet, so I hadn't even thought to think.
HatHelper, my savior. lol. @MrNicNac, I think I'll be using something like what you posted, though not nearly as frequently. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 30 Apr 2012 06:53 PM |
| By physical, I mean CanCollide = true (actually conducting physics) |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:53 PM |
| I have units, and each one has parts in it to make it look like something. I dont know how to "turn off" physics for them, I'd love to. |
|
|
| Report Abuse |
|
|
HatHelper
|
  |
 |
| Joined: 02 Mar 2009 |
| Total Posts: 46305 |
|
|
| 30 Apr 2012 06:54 PM |
| Okay, then I do remove some unnecessary physics. I make what I don't really need cancollide=false. |
|
|
| Report Abuse |
|
|
HotThoth
|
  |
 |
| Joined: 24 Aug 2010 |
| Total Posts: 1176 |
|
|
| 30 Apr 2012 06:55 PM |
| Assuming the scripts are all NOT LocalScripts (or else it makes sense you have issues), and that you're NOT using :SetDesiredAngle(), then it does sound like a potential networking issue-- I'll check it out; what's the PlaceId? |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 30 Apr 2012 06:55 PM |
"I'm a doctor, not a programmer."
Well...medical student who can diagnose illnesses by symptoms and perform minor surgeries. |
|
|
| Report Abuse |
|
|