Page 1 of 2

EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 9:29 am
by CliveEvenstar
On average about how much memory should the EQ2 client be using? Running around on TessEQ2 I noticed lag spikes that I wasn't getting yesterday, so opening Windows Task Manager I wanted to check the memory usage. As it stands EQ2 is using:
805,566 K and around 60 CPU
I believe the actual eq2 client only uses around maybe 300,000 - 500,000 K, I could be wrong, anyone else placed at about 800 mbs of ram usage?

-- Clive

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 5:22 pm
by Arremis
There are too many factors to list, but anything you see on the screen can cause a spike in memory and cpu usage. Other clients connected, graphics heavy features turned on, mobs spawning and despawning, mobs casting spells, UI windows updating, things running in the background, scheduled tasks running, automatic updates, the list is endless. The client itself was built several years ago on the concept that single core processors would reach beyond 10GHz, however, years down the line, it was too late when Intel decided to make smaller, dual-core processors instead - the worst possible thing that could have happened to the EQ2 engine. For years now, people have been asking SoE to rebuild the engine from scratch, and they haven't budged yet. They have done some tweaking to get some of the load onto the GPU, but honestly, only a full engine overhaul is going to get it up to specs with the latest competition.

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 6:31 pm
by John Adams
EQ2 has got some pretty kick ass graphics and effects, for a 5+ year old game. At least it's not Disney Cartoons on Acid (WoW). And Vanguard, with it's "Next Generation" graphics is such a piece of shit to run, it's recommended to use a ramdisk for the cache files. Seriously?

I'll take EQ2 gfx and engine anyday.

Clive, our memory management is nowhere near what SOE's is, though we have come a long way since the beginning. As Arremis said, many factors contribute to memory usage - including things you cannot see. How we are spawning zones, maybe too many NPCs in an area, inefficient movement scripts, and of course... pretty graphics :)

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 10:03 pm
by CliveEvenstar
Yes, pretty graphics I agree. I remember beta testing EQ2 when I was still playing EQ and was AMAZED at the world I was running through. Course I did the same thing when I beta tested Vanguard, that's not to say VG is awful, and it could be so much better, but it has a lack of a development team to do much.

I often wondered on the lua scripting. Wouldn't it be more efficient to hard code some the of things lua scripts are doing? Aka abilities (skills/spells) would run faster hard-coded versus calling a script for each use? I could be wrong but wouldn't there be differences in speeds from say 100 players using skills/spells that are hard-coded versus 100 players using skills/spells that have to execute a script?

-- Clive

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 10:44 pm
by Scatman
Hard coding would be a lot faster but you're talking about hard coding 5000+ abilities? :P No thanks. Also, there wouldn't be any customization if it were all hard coded which wouldn't be fun at all!

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 10:48 pm
by CliveEvenstar
True true, I'm just thinking on the long term usage of lua vs hard-code. Because EQ2EMU will get to a point where servers well have up to 100 if not more, and the stress tests of that many invoking lua scripts at the same time or various times could be a huge resource strain, at least I would think so.

And 5,000+ doesn't seem *so* bad.... Considering you would still have to write 5,000+ lua scripts for each ability right? :P

-- Clive

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 10:53 pm
by Scatman
CliveEvenstar wrote:And 5,000+ doesn't seem *so* bad.... Considering you would still have to write 5,000+ lua scripts for each ability right? :P
No. One script can and should be able to handle a type of spell. So a Taunt.lua file should be able to able every taunt spell in the game unless there's a bunch of extra stuff (which could be handeled using if statements and adding the extra stuff based on what spell it is).

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 10:56 pm
by CliveEvenstar
Ah so basically taunt.lua could handle taunt plus all the upgrades to it with if statement checks. That would seem to make things easier. Question regarding skills atm, are you guys trying to figure out what the correct animations are for skill uses? I know I've tried each skill and so far the only one that looks correct is pathfinding.

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 10:59 pm
by Scatman
CliveEvenstar wrote:Ah so basically taunt.lua could handle taunt plus all the upgrades to it with if statement checks. That would seem to make things easier.
Exactly
CliveEvenstar wrote:Question regarding skills atm, are you guys trying to figure out what the correct animations are for skill uses? I know I've tried each skill and so far the only one that looks correct is pathfinding.
Yep, Zcoretri is doing a lot of the spell stuff. We just got a lot more support for spells (server side) this past week so the spells will start pouring in eventually.

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 11:01 pm
by Zcoretri
CliveEvenstar wrote:Ah so basically taunt.lua could handle taunt plus all the upgrades to it with if statement checks. That would seem to make things easier. Question regarding skills atm, are you guys trying to figure out what the correct animations are for skill uses? I know I've tried each skill and so far the only one that looks correct is pathfinding.
How did you try each skill? or you mean spell/ca? In either case, spells/ca's are not 100% done.
Hopefully soon I can have some focus testing on some classes....stayed tuned :mrgreen:

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 11:03 pm
by CliveEvenstar
Kk, just let me know if there's anything I can do to help, I got nothing but time on my hands. Also, as it stands for lua script upgrades for abilities is that in yet, example:

Code: Select all

if ability->skill("taunt")
  do this
else if  ability->skill("taunt_adept")
  do this
else if ability->skill("taunt_master")
  do this
Now I know that's not the correct syntax at all, but it's easy to look at and understand what I mean. Is that flexibility for lua scripts to handle yet? or is that something being waited on server side? Cause if that is in I might be able to help flush out some abilities for you guys as it really is a lot of repeated usage with just upgrades to each statement.

-- Clive

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 11:28 pm
by Zcoretri
looks kinda like this

Code: Select all

function cast(Caster, Target, MinTaunt, MaxTaunt)
    -- Taunt component
    if MaxTaunt ~= nil and MinTaunt < MaxTaunt then
        hateAmount = math.random(MinTaunt, MaxTaunt)
        AddHate(Caster, Target, hateAmount)
    else
        AddHate(Caster, Target, MinTaunt)
    end
end
MinTaunt and MaxTaunt values come from a table in the DB and get passed in based on what tier the spell/ca is.

Re: EQ2 and Memory Usage Question

Posted: Mon Feb 08, 2010 11:39 pm
by Scatman
If you wanted to see which spell it was, you'd go to the spell_data table and pass in the name of the spell along with the mindamage and maxdamage values. That way you could do:

Code: Select all

function cast(Caster, Target, SpellName, Damage)
   if SpellName == "Taunt" then
      -- taunt only
   elseif SpellName == "Taunt and Damage" then
      -- taunt
      -- spell damage
   end
end

Re: EQ2 and Memory Usage Question

Posted: Tue Feb 09, 2010 5:33 am
by John Adams
Yeah, no offense Clive, but we have been building data for 2 years now (sloowwwwllly) and we know exactly how scripts will work in nearly every scenario. Re-inventing how it's done now will not happen. Much of LUA scripting is documented on these forums and the Wiki, so feel inspired to search for LUA or Script to see what we have already accomplished.

Scripts are not run like DOS Bat files. They are loaded at world/zone startup, and utilized when needed from memory. Can't get much faster than that.


(i can't believe I just defended LUA)

Re: EQ2 and Memory Usage Question

Posted: Tue Feb 09, 2010 7:09 am
by CliveEvenstar
@Scat - That looks and sounds pretty easy!

@John - No offense takin! Was mostly curious as I know from working with other game engines that use a scripting language they often cause lag issues depending on the amount of usage. The wiki has references to lua? I'll have to go check that out! Also, when using lua, do I need to install anything onto my pc to use it? Example, to program in C I need to use a C development program aka VC++ or Borlands, do I need to do the same with lua?

-- Clive