For context, I'm not that experienced in coding store systems, and my community is running the second ever store that I've made.
The servers both get ping issues when they reach 14 or more players. I know the store is causing this because when i remove the store, the server can reach 20 players with no change in player ping. Using net_graph, i can see that there are usermessages being sent every frame, and when the store is removed, there are only usermessages on round start, round end, player spawn, etc etc. However, the only networking in the store being done is through timers, which only happen on spawn, death, and other infrequent events. The store uses PData to check ownership of an item, and then (if it is a hat, accessory, or pet) creates a serverside entity.
Do serverside entities require copious amounts of usermessages? Most don't even have defined Think hooks (only pets do, but removing pets does not remove the ping issues). The entities are using base_gmodentity.
If it is the serverside entities creating lag, how can i recreate the effect of hats/accessories with clientside entities? I have looked at Pointshop code, but it doesn't make sense to me how the clientside models are created.
If more information is needed i can provide it on request.
We can't really do anything without any code.
The lag is probably being caused by you repeatedly setting the positions of entities of the server side.
You'll have to create client side models with the function ClientSidemodel which will create a model that you can treat kinda like an entity. Every frame you should set the model's position to the player's head position (or use some fancier rendering code to manually render it there. NOTE: ClientSide models can be garbage collected so you need to keep a reference to them at all times, they are more primative than entities.
[QUOTE=thelastpenguin;44686096]The lag is probably being caused by you repeatedly setting the positions of entities of the server side.
You'll have to create client side models with the function ClientSidemodel which will create a model that you can treat kinda like an entity. Every frame you should set the model's position to the player's head position (or use some fancier rendering code to manually render it there. NOTE: ClientSide models can be garbage collected so you need to keep a reference to them at all times, they are more primative than entities.[/QUOTE]
Thanks for the help, I'm on my laptop and not my PC so I don't have the code to post, but since I have the entities parented to the player's attachment (eyes, chest, and others) does that essentialy have the same effect as setting the position every frame? I will try and set up clientside models soon.
It probably does have the same effect though I'm not really sure, but in any case there's no reason cosmetics with no physical interactions shouldn't be purely client side.
Sorry, you need to Log In to post a reply to this thread.