Spawning Clientside-Physics

General discussion for off-topic subjects.
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Spawning Clientside-Physics

Postby D3CEPTION » Mon Feb 15, 2016 6:37 am

Looking at Entity.properties it shows that "m_iPhysicsMode" is a valid property for Entity.
How does sp gather this information? i assume it dumps them from the sdk or sthn?

The problem i have is that i cant find any entity, who actually successfully changes this value. and prop_physics, definately should do..
so i thought, maybe the property is somehow wrong, but the only other similar property i found was this:
"m_bClientPhysics".

both dont work. ive tried it on "prop_physics_multiplayer".

could it be that the "Entity" object automatically gets networked? and therefor certain properties get dismissed? get read only?

if so, how could m_physicsmode be used outside of tempentites?

(1) looking at tempentities, they probably use a function to "unnetwork" edicts OR (2) a function that adds them into an "unnetworked" dict..

if first is true, is the server able to call such a function? if second is true, is it possible, to copy "sendtables", that are used to add to the dict?
is the server able to directly push sendtables to the client? ( to skip the entire "entity.create()" process, that probably does a few unneeded checks ) ?

thanks
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Mon Feb 15, 2016 11:20 am

You can put entities into 3 categories:
  1. server entities - exist on server only
  2. shared entities - are shared across the network between server and clients
  3. client entities - exist on clients only

BaseEntity covers 1 and 2. Entity covers only 2. With the effects package you can only spawn client side entities, but you can never modify them. The reason is quite simple: if the server is able to modify a client side entities, the entity isn't really a client side entity anymore, right?

SP knows about "m_iPhysicsMode", because it accesses the entity's datamap at runtime. Datamaps contain a information about a few properties of an entity (but not all of them).

Since your title says "spawning client side physics", the best way to go is to take a look at the effects package.
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Postby D3CEPTION » Mon Feb 15, 2016 4:47 pm

if so, how could m_physicsmode be used outside of tempentites?


i have used temp entities, as stated above and that is exactly why i am trying to find a workaround.

to make things a bit clearer for you:
with hammer editor you can spawn a prop_physics_multiplayer and change performance mode to clientside. after compile that entity, then ingame, after maplaunch, has become completly clientside. (index -1)

now there are only two possible conclusions:
1) on hammer compile the hammer engine interpretes the multiplayer_physics and changes class to another prop, running clientside OR 2) multiplayer_physics supports clientside indexing via the input "m_iPhysicsMode".

if 2) is true, (which you havent addressed yet) why cant sp change that input? i am still as lost here, as before :D

if sp actually can change that input, why is the entity left and handled as networked?

this makes no sense at all. also, i am obviously trying to find some uncommon ways to spawn prop_physics, outside the native method. so im trying to think of some experimental, maybe even "hacky" stuff. thats why i mentioned sendtables.
i still dont know if that is even a possible approach etc.

if you would look carefully into how temp entities are processed on clientside ( in hl2 sdk for example ) , you will find that physicsprop are not handled as tempentites, but rather have their own class.
therefor they follow different rules, and can become interesting. maybe this gives you a better idea of what my question was about? :)

thanks!
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Postby iPlayer » Mon Feb 15, 2016 6:24 pm

Clientside prop_physics_multiplayer is considered clientside by the client based on the map, not because the server tells it so. That's how I see it.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image

Return to “Whatever”

Who is online

Users browsing this forum: No registered users and 11 guests