HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Stateful door that moves - Physics type???  (Read 214 times)

Prometheus2012

  • General Accounts
  • *
  • Posts: 627
    • View Profile
    • Exile-Online
Stateful door that moves - Physics type???
« on: Aug 07, 17, 03:34:20 PM »

We have doors that can move by clicking on them or by pressing a switch. This is done by making them a stateful object.

Ok this is the dilemma as it is.

1 - Setting door that moves as static physics type destroys performance in the entire area when it moves

2 - Door needs to be dynamic or kinematic physics because it moves

3 - When door interacts with other objects or people as dynamic physics it goes bouncing all over the place

4 - Setting physics type as kinematic seems to solves this, as it doesnt go bouncing around when it touches something, but puts out and error saying "will result in performance hit"

5 - Making a recess into the walls so the door can slide into would not solve the problem of a player running into the door (with dynamic physics type) and making it bounce all over the place and falling onto the floor

What do we do? Set them as kinematic and dont worry about this "performance hit"

Any advice would be helpful. Cheers.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1392
    • View Profile
    • Forever Interactive, Inc.
Re: Stateful door that moves - Physics type???
« Reply #1 on: Aug 07, 17, 05:09:25 PM »

See this page for clarification on Physic Type settings:
http://hewiki.heroengine.com/wiki/PhysicsType

So, dynamic appears to be what you want. Have you tried setting the Physics Density to a large number?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Amanda_Brooks

  • General Accounts
  • *
  • Posts: 503
    • View Profile
    • Heroes and Villains
Re: Stateful door that moves - Physics type???
« Reply #2 on: Aug 07, 17, 05:22:49 PM »

Wouldn't just making the doors be normal animated meshes work better?
Logged
"Heroes and Villains" - www.heroes-and-villains.com
Facebook: https://www.facebook.com/HeroesAndVillainsMMORPG
Twitter: @Plan_Z_Studios

Thazager

  • General Accounts
  • *
  • Posts: 1093
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Stateful door that moves - Physics type???
« Reply #3 on: Aug 08, 17, 12:23:03 AM »

Tried a few diff "High Values"

Physics Density to a large number = 99
Physics type - Dynamic
Physics shape - convex hull

values set, target another object and 1st object goes wacky
-------------------------------------------------------------------


Physics Density to a large number = 999 to 999999
Physics type - Dynamic
Physics shape - exact-mesh or convex-hull or default-shape

values set, target another object and 1st object fell over on floor
-------------------------------------------------------------------


Physics Density to a large number = 99999999
Physics type - Dynamic
Physics shape - convex-hull

values set, target another object and 1st object shifts around a little (maybe a foot off from start, in all 3 positions)
-------------------------------------------------------------------


Physics Density to a large number = 999999999999
Physics type - Dynamic
Physics shape - convex-hull

values set, target another object and 1st object fell over on floor and made character bounce
Logged
Heroes and Villains Lead programmer/scripter
Exile Online Lead programmer/scriptor

Prometheus2012

  • General Accounts
  • *
  • Posts: 627
    • View Profile
    • Exile-Online
Re: Stateful door that moves - Physics type???
« Reply #4 on: Aug 08, 17, 07:09:03 AM »

See this page for clarification on Physic Type settings:
http://hewiki.heroengine.com/wiki/PhysicsType

So, dynamic appears to be what you want. Have you tried setting the Physics Density to a large number?

Dynamic doesnt really work because when we make the door dynamic, it drops to the floor and falls over. Or when it slides into the wall it bounces off. Or when a person runs into it, they knock the door over.

Prometheus2012

  • General Accounts
  • *
  • Posts: 627
    • View Profile
    • Exile-Online
Re: Stateful door that moves - Physics type???
« Reply #5 on: Aug 09, 17, 11:11:37 AM »

Any ideas?

Thazager

  • General Accounts
  • *
  • Posts: 1093
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Stateful door that moves - Physics type???
« Reply #6 on: Aug 09, 17, 12:11:03 PM »

Had an idea, will try it in game.

object made as static

when its clicked
  set property to dynamic
  (0.1 delay) transform to position
  (0.2 + transform time, delay) set property to static

object now static again
Logged
Heroes and Villains Lead programmer/scripter
Exile Online Lead programmer/scriptor

Prometheus2012

  • General Accounts
  • *
  • Posts: 627
    • View Profile
    • Exile-Online
Re: Stateful door that moves - Physics type???
« Reply #7 on: Aug 09, 17, 02:14:06 PM »

What about if a player is running into it while it moves open or when it touches a wall and the floor? When i changed a door to dynamic it dropped to floor as it had the effect of gravity applied to it.

Thazager

  • General Accounts
  • *
  • Posts: 1093
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Stateful door that moves - Physics type???
« Reply #8 on: Aug 09, 17, 08:05:55 PM »

Added the Idea in.

When clicked normally, the door works making it DYNAMIC and not giving the error mesg.

When clicked and player runs into door, the door moves all over, because its an interactive object.

I then tried setting door to NO_PHYSICS, the player could not effect the door, as it had no physical existence.
It did give a warning, but no error.
   SYSTEM:system:WARNING: Tried to set position on a static object: 9223372087021021587
Logged
Heroes and Villains Lead programmer/scripter
Exile Online Lead programmer/scriptor

Prometheus2012

  • General Accounts
  • *
  • Posts: 627
    • View Profile
    • Exile-Online
Re: Stateful door that moves - Physics type???
« Reply #9 on: Aug 10, 17, 09:57:44 AM »

Hmm i think making it have no physics at all when moving would be the best option.

So the door acts thus -

When not moving - Static physics
When moving - Physics turned off
When finished move - Return to static physics

When it is moving the player would be able to run through it but that is no bad thing as far as i can see. I believe this is how it works on swtor as i remember being able to run through doors when they were opening and then they returned to being physical when they stopped.

Also i think the best physics shape would be exact mesh shape as it would hug the door closely.