Raised This Month: $51 Target: $400
 12% 

Need Idea of making equippable item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ashcan
Senior Member
Join Date: May 2008
Old 11-10-2021 , 12:15   Need Idea of making equippable item
Reply With Quote #1

Hey there.
Just worth to mention: im not looking for any complete code, just need an idea.

So simple as that, im developing a plugin where players can obtain Artifacts. Each of artifacts has unique ability. I need to know how would be efficient to:

1. Save artifacts in inventory.
2. Query for Equipping artifacts
3. When would be best to read data of equipped items (like, should i query for owned artifacts and also for equipped ones from sql every "action"?)


I just need bit of help figuring out best way to do it.
Ashcan is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-10-2021 , 19:02   Re: Need Idea of making equippable item
Reply With Quote #2

SQL queries to parse data on connect, store data locally on the server via static or dynamic data and save it either on disconnect or on action so if the server goes down the data is consistent.

I'm not entirely sure how the system you want looks in your head but if it's like a drops and you pick them up sort of thing then 1 query per pickup works in that case.
Drixevel is offline
Ashcan
Senior Member
Join Date: May 2008
Old 11-11-2021 , 08:02   Re: Need Idea of making equippable item
Reply With Quote #3

Quote:
Originally Posted by Drixevel View Post
SQL queries to parse data on connect, store data locally on the server via static or dynamic data and save it either on disconnect or on action so if the server goes down the data is consistent.

I'm not entirely sure how the system you want looks in your head but if it's like a drops and you pick them up sort of thing then 1 query per pickup works in that case.
that was exactly answer i was expecting.

i was thinking about query on every pickup + query on every "action", like on equipping etc. also query every round start but thats why i asked here, cuz it felt very heavy.

and to be honest, even on pickup, it could be stored locally as well, just saving stuff on leave/dc like u said.

anyway, thanks man
Ashcan is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 11-11-2021 , 10:43   Re: Need Idea of making equippable item
Reply With Quote #4

I already worked on some MMO games, so usually, the DB steps are exactly what you said.

We used to save it in local (variables), load data on player connect and only store in DB on player disconnect.

Of course, you may lose some data if the game crashes, another workaround is to save the data every X minutes on DB with a timer aswell.

In valve games, the number of connections may not a big problem (around 64 max), but on MMO where may have 1000+ players these performance tweaks are important.
__________________

Last edited by Marttt; 11-11-2021 at 10:44.
Marttt is offline
Ashcan
Senior Member
Join Date: May 2008
Old 11-11-2021 , 12:26   Re: Need Idea of making equippable item
Reply With Quote #5

Let me ask you guys one more thing tho

If i planned to use "external" gui, like lets say motd with my own webpage,
would there be possibility to transfer data between motd and plugin?
Or in motd-case, i would need to execute query every action like equip/drop/loot etc?

Unless.... there is way for custom gui non-motd way ?
Ashcan is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode