EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   Custom Character Data (https://www.eqemulator.org/forums/showthread.php?t=36276)

Drajor 01-17-2013 12:33 AM

Custom Character Data
 
This post is directed at current or future server developers. I have added a wiki page showing an example of how to store custom character data on your server.

You can find it here!

My reasoning for creating this is that nearly every server seems to require this and yet I have not been able to find any related how-to information. Maybe this will give new folks a good starting point for making custom systems.

c0ncrete 01-17-2013 03:20 AM

most, if not all, servers that use character-specific data likely use the qglobal system.

Akkadius 01-17-2013 03:57 AM

Yeah and qglobal system is going to be far more appropriate for this kind of use because the values are stored in Zone memory and accessed through Perl hash values which obviously won't require database hits every single time.

Drajor 01-17-2013 04:40 AM

Actually the purpose is to not use the quest globals :p

In regards to zone memory / hashed values - unless you are using this thing every second on every mob then neither of those are much of an optimisation.

Akkadius 01-17-2013 04:51 AM

Quote:

Originally Posted by Drajor (Post 216475)
Actually the purpose is to not use the quest globals :p

In regards to zone memory / hashed values - unless you are using this thing every second on every mob then neither of those are much of an optimisation.

It might work, but it's definitely not very scalable and performance conscious.

Might as well use Perl DBI to do the same thing.

Drajor 01-17-2013 04:53 AM

Quote:

Originally Posted by Akkadius (Post 216476)
It might work, but it's definitely not very scalable and performance conscious.

Might as well use Perl DBI to do the same thing.

It works, I have tested it. I am not sure how it is not scalable? If you need to add new data, ALTER character_vars ADD new_field int DEFAULT 0.

Lol I actually considered using perl DBI to allow people to integrate it without touching the source.

Secrets 01-17-2013 05:20 AM

What's wrong with the extended player profile for more static variables or as Akkadius mentioned, perl DBI for dynamic variables?

They aren't going to realistically impact the database nor zone performance.

Only reason I would advise against perl DBI is because if the connection hangs, the script has to execute before anything else can go on.

trevius 01-17-2013 05:46 AM

Quote:

Originally Posted by Secrets (Post 216478)
What's wrong with the extended player profile for more static variables

It is just one more blob which I think we can all agree should be removed. Those blobs are a real pain and very limiting due to their nature. I dream of an EQEmu with no blobs. Now, if only it wasn't going to be so much work to get rid of them :P

Derision 01-17-2013 05:32 PM

Quote:

Originally Posted by trevius (Post 216480)
I dread of an EQEmu with no blobs.

Auto-incorrect ? :)

zippzipp 01-17-2013 07:18 PM

Why are you all hating on him? He was just trying to contribute. I personally could see this being useful for a feature I just implemented on my server that doesn't work very well through the qglobal system. Sure there are other ways to accomplish the same thing but he made an effort to help. I am fairly new here and have a few things I would like to contribute to the community soon and hope I do not get blasted like this the first time I share something.

Akkadius 01-17-2013 07:53 PM

Quote:

Originally Posted by zippzipp (Post 216504)
Why are you all hating on him? He was just trying to contribute. I personally could see this being useful for a feature I just implemented on my server that doesn't work very well through the qglobal system. Sure there are other ways to accomplish the same thing but he made an effort to help. I am fairly new here and have a few things I would like to contribute to the community soon and hope I do not get blasted like this the first time I share something.

He's not getting blasted, I've built plugins on the Qglobal system to do this exact thing and trust me it makes much more sense to use the qglobal system to store and get values like this for players because they become completely static in memory until they are called to change.

So for example, let's say you want to have the play check their credits for whatever, they're lagging out or just being assholes and they hail the NPC many times.

Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select

So for each of those NPC hails you're telling me it makes more sense to hit the DB rather than having their balance stored into memory?

No one is trying to 'blast' him, it just doesn't make sense to use when there is already a better system out there for it.

I would like to know what is not suitable in qglobals that this is trying to replace. Plus, this system that is proposed only allows for one type of virtual 'value' that can be used for only one thing.

c0ncrete 01-17-2013 08:12 PM

Quote:

Originally Posted by zippzipp (Post 216504)
Why are you all hating on him? He was just trying to contribute. I personally could see this being useful for a feature I just implemented on my server that doesn't work very well through the qglobal system. Sure there are other ways to accomplish the same thing but he made an effort to help. I am fairly new here and have a few things I would like to contribute to the community soon and hope I do not get blasted like this the first time I share something.

i think you've mistaken constructive criticism for blasting. in either case, welcome to the internet.

the other fellows you've seen posting here have been around and involved for a while and they have some idea what they are talking about.

Drajor 01-17-2013 09:36 PM

Quote:

Originally Posted by Akkadius (Post 216511)
He's not getting blasted, I've built plugins on the Qglobal system to do this exact thing and trust me it makes much more sense to use the qglobal system to store and get values like this for players because they become completely static in memory until they are called to change.

So for example, let's say you want to have the play check their credits for whatever, they're lagging out or just being assholes and they hail the NPC many times.

Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select
Hail, NPC - DB Select

So for each of those NPC hails you're telling me it makes more sense to hit the DB rather than having their balance stored into memory?

No one is trying to 'blast' him, it just doesn't make sense to use when there is already a better system out there for it.

I would like to know what is not suitable in qglobals that this is trying to replace. Plus, this system that is proposed only allows for one type of virtual 'value' that can be used for only one thing.

I am not entirely sure about this - If you see Parser::Event (parser.cpp) you will notice that any NPC that has qtglobals enabled, the database is hit each time.

Drajor 01-17-2013 09:59 PM

The perl function setglobal calls QuestManager::setglobal which calls QuestManager::InsertQuestGlobal which inserts directly into the DB. I can't see any caching here at all.

lerxst2112 01-17-2013 10:03 PM

Yes, changing a qglobal writes to the database, but reads are cached, and it's likely that reads are more common than writes.


All times are GMT -4. The time now is 02:27 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.