- Joined
- Dec 26, 2013
- Messages
- 1,609
- Solutions
- 11
- Reaction score
- 836
Ok so this isn't really a support issue, I'm kind of just looking for a bit of brainstorming or really opinions on performance and optimization for a kill counter.
YES I know kill counters have been done countless times before.
Here is the thing, kill counters are normally saved via storage values to the player, right? Well that is really a last option for me, and here are the reasons why
1.My system I want to make will include counters for EVERY monster type that exists in the server, and to make a storage value for every single monster in the server, well would frankly be a waste of my storage values.
2. The system I would like to make would only be counting the monsters per server session. What I mean is, once the server restarts, crashes or shuts down, then the kills should be back at 0. Resetting every users storage values at startup could be a bit overkill on resources, and just feels hackish to me.
What I'm looking for is a way to store all this data temporarily, and only use it when necessary. So once the server shuts down , the data is gone and no need to write a script to clear the data. Also I'm looking for a way to implement this without it being super resource intensive, such as 1874 creaturescripts running on every player at login. One way, would be to only register an event with the player once they kill that monster, but then at the same time, everytime someone kills just one monster they now add another event to themselves which could pile on very quickly.
OPTIONS
I could make the data save to a killCounter/PlayerName.lua file for each player and then have the files all deleted on startup.
I could make the creatures themselves hold the events, and then check versus that one player (if player has reached kill limit or w/e)
I could use a global table that is stored in memory at startup and then ofc released at shutdown, but I'm unsure how huge this table could get on memory.
Maybe create a new type of data for the database, tied to each player, that would store their kill counts? This would also be resource intensive I believe, and I honestly don't know much about the types of data that could be stored and read from in the mysql database.
So my question is, how would you do it? Store a counter for every single type of monster in the game, and be able to use it with no latency issues. Register events to players or creatures? Save in a table in the memory or save and utilize the data in another manner? What do you guys think?
I hope no one minds, but I am gonna tag a few people who's opinion I value, and are typically willing to give their opinion and/or help people, and are also still active.
@Sarah Wesker @Xikini @zbizu @forgee @Summ @oen432 @Printer -- sorry I know you don't post much lately but I still highly respect your opinion printer.
There are others I'm not so sure about, how active they are now, and others I can't remember off the top of my head, and no one should feel obliged to respond here, if you want me to remove your name tagged just tell me and I will do so, but I'm pretty indecisive and right now, I'm super indecisive about how to go about a system like this, mainly I want to set a kill limit on each type of monster, and ideally each type would have its own limit (source edit is possible waaaaay later to achieve this), but for now I'm ok with a global limit and a way to do this without causing major lag to the server.
As always I am using TFS 1.x+ , specifically I'm using 1.4 right now
Any ideas guys?
@Evil Puncker
YES I know kill counters have been done countless times before.
Here is the thing, kill counters are normally saved via storage values to the player, right? Well that is really a last option for me, and here are the reasons why
1.My system I want to make will include counters for EVERY monster type that exists in the server, and to make a storage value for every single monster in the server, well would frankly be a waste of my storage values.
2. The system I would like to make would only be counting the monsters per server session. What I mean is, once the server restarts, crashes or shuts down, then the kills should be back at 0. Resetting every users storage values at startup could be a bit overkill on resources, and just feels hackish to me.
What I'm looking for is a way to store all this data temporarily, and only use it when necessary. So once the server shuts down , the data is gone and no need to write a script to clear the data. Also I'm looking for a way to implement this without it being super resource intensive, such as 1874 creaturescripts running on every player at login. One way, would be to only register an event with the player once they kill that monster, but then at the same time, everytime someone kills just one monster they now add another event to themselves which could pile on very quickly.
OPTIONS
I could make the data save to a killCounter/PlayerName.lua file for each player and then have the files all deleted on startup.
I could make the creatures themselves hold the events, and then check versus that one player (if player has reached kill limit or w/e)
I could use a global table that is stored in memory at startup and then ofc released at shutdown, but I'm unsure how huge this table could get on memory.
Maybe create a new type of data for the database, tied to each player, that would store their kill counts? This would also be resource intensive I believe, and I honestly don't know much about the types of data that could be stored and read from in the mysql database.
So my question is, how would you do it? Store a counter for every single type of monster in the game, and be able to use it with no latency issues. Register events to players or creatures? Save in a table in the memory or save and utilize the data in another manner? What do you guys think?
I hope no one minds, but I am gonna tag a few people who's opinion I value, and are typically willing to give their opinion and/or help people, and are also still active.
@Sarah Wesker @Xikini @zbizu @forgee @Summ @oen432 @Printer -- sorry I know you don't post much lately but I still highly respect your opinion printer.
There are others I'm not so sure about, how active they are now, and others I can't remember off the top of my head, and no one should feel obliged to respond here, if you want me to remove your name tagged just tell me and I will do so, but I'm pretty indecisive and right now, I'm super indecisive about how to go about a system like this, mainly I want to set a kill limit on each type of monster, and ideally each type would have its own limit (source edit is possible waaaaay later to achieve this), but for now I'm ok with a global limit and a way to do this without causing major lag to the server.
As always I am using TFS 1.x+ , specifically I'm using 1.4 right now
Any ideas guys?
Post automatically merged:
@Evil Puncker
Last edited: