MMOItemVariable/UserVariable floats and sfsobjects ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

MMOItemVariable/UserVariable floats and sfsobjects ?

Postby genar » 29 Mar 2021, 16:17

I have some questions regarding the MMO/User Variables...

Is it somehow possible to just store a float inside the MMO/User-Variables ? No larger double ?
And is it possible to store a ISFSObject inside of them and if so, is it recommended ? How does it perform ?
Creating new Variables each entity update is quite expensive, is there a way to update their value instead ? Without creating a new MMOItemVariable or UserVariable ( existingVariable.SetValue(...)) ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MMOItemVariable/UserVariable floats and sfsobjects ?

Postby Lapo » 30 Mar 2021, 08:02

Hi,
Is it somehow possible to just store a float inside the MMO/User-Variables ? No larger double ?

No.
And is it possible to store a ISFSObject inside of them and if so, is it recommended ?

Yes it is possible.
How does it perform?

I don't know how to answer this question. It depends on the context: hardware, traffic conditions, volume of requests per second etc...
Generally speaking it should pose no issues, if used with common sense.

Creating new Variables each entity update is quite expensive,

It shouldn't be. What makes you think it is expensive, exactly?
Those are very basic objects, with a very light memory footprint.

It's also not clear if you're talking about server or client side. Since you have mentioned MMOVariables I think you're referring to server side in which case I can assure you that those object are definitely not "expensive".

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: MMOItemVariable/UserVariable floats and sfsobjects ?

Postby genar » 30 Mar 2021, 11:08

Lapo wrote:Hi,
Is it somehow possible to just store a float inside the MMO/User-Variables ? No larger double ?

No.
And is it possible to store a ISFSObject inside of them and if so, is it recommended ?

Yes it is possible.
How does it perform?

I don't know how to answer this question. It depends on the context: hardware, traffic conditions, volume of requests per second etc...
Generally speaking it should pose no issues, if used with common sense.

Creating new Variables each entity update is quite expensive,

It shouldn't be. What makes you think it is expensive, exactly?
Those are very basic objects, with a very light memory footprint.

It's also not clear if you're talking about server or client side. Since you have mentioned MMOVariables I think you're referring to server side in which case I can assure you that those object are definitely not "expensive".

Thanks


Thanks ! Im using floats pretty heavily... so storing a double inside MMOitems is too much overhead. Would it reduce the packet size to create a ISFSObject with a float and store it into the MMOitem ?

Well im updating my MMOitems in regular intervalls and to update some variables, im always forced to create new MMOItemVariables. Which IS quite expensive. Caching or reusing those IMMOitemVariables is not possible yet which is quite a pitty, due to the garbage being created during the frame. Im talking about Serverside.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: MMOItemVariable/UserVariable floats and sfsobjects ?

Postby Lapo » 30 Mar 2021, 14:37

See my reply to the other thread you've started on this same subject.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 51 guests