Page 1 of 1
Loading Zone count bug
Posted: Wed Sep 17, 2008 1:09 am
by John Adams
Possibly just a visual thing, but I just noticed after popping Oakmyst forest (zone id 195) that the server console is reporting:
Loading new Zone 'oakmyst'
Loaded 19383 NPC(s), 1234 Object(s), 1 Widget(s), 4 Sign(s).
which is nowhere near accurate. Doing a select count(*) on all records in zonespawnentry for zone ID 195, there are 830 records entirely in this zone. I am not sure where 19,383 is coming from, nor the large objects value. Widgets and signs may be accurate for this zone, we have yet to validate the data.
Any ideas? Doubt it's harmful, but gives my heart a jolt when I first logged in to make sure the zone was working.

Posted: Sun Oct 26, 2008 11:43 am
by Image
NPCs, Objects, Widgets and Signs are loaded at startup. This is your overall count, not per zone. (This might have been changed).
Posted: Mon Oct 27, 2008 6:23 am
by John Adams
Nah, this value is per-zone now, and way incorrect for all things spawned when a new zone starts up. These totals have never been accurate, but in this particular example it was WAYYY inaccurate.
Posted: Mon Oct 27, 2008 6:27 am
by Image
The only place that this information is referenced is in World::init in World.cpp. This is called at bootup of eq2emu after loading the command list.
As I said this may have been changed. I am just looking at the SVN source.
Posted: Mon Oct 27, 2008 6:42 am
by John Adams
Here: WorldDatabase::LoadSpawns(ZoneServer* zone)
That's what spits these lines to the console.
Posted: Mon Oct 27, 2008 6:46 am
by Image
Ah ok thanks John, I will try and take a look at that when I am off work tonight. I will atleast open a bug report when I can recreate your issue.
Thanks for clearing that up.
Posted: Tue Oct 28, 2008 6:54 am
by LethalEncounter
Well, performing the query on your eq2live database produces 6,876 NPCs:
Code: Select all
Showing rows 0 - 29 (6,876 total, Query took 0.0312 sec)
SQL query: SELECT sg.id, se.id, s.x, s.y, s.z, s.x_offset, s.y_offset, s.z_offset, s.heading, se.spawn_id, se.spawnpercentage, s.respawn, s.location_id, s.id
FROM zonespawns s, zonespawngroup sg, zonespawnentry se, spawn_npcs sn
WHERE sn.spawn_id = se.spawn_id
AND sg.id = se.spawngroupid
AND sg.id = s.spawngroup_id
AND s.zone_id =195
ORDER BY sg.id, se.id
LIMIT 0 , 30
The numbers ARE accurate unless there is a problem with the sql query, which I cannot see.
BTW, WB image. Long time no see!
Posted: Tue Oct 28, 2008 2:35 pm
by LethalEncounter
What about adding a group by s.id:
Code: Select all
Showing rows 0 - 29 (325 total, Query took 0.0127 sec)
SQL query: SELECT sg.id, se.id, s.x, s.y, s.z, s.x_offset, s.y_offset, s.z_offset, s.heading, se.spawn_id, se.spawnpercentage, s.respawn, s.location_id, s.id
FROM zonespawns s, zonespawngroup sg, zonespawnentry se, spawn_npcs sn
WHERE sn.spawn_id = se.spawn_id
AND sg.id = se.spawngroupid
AND sg.id = s.spawngroup_id
AND s.zone_id =195
GROUP BY s.id
ORDER BY sg.id, se.id
LIMIT 0 , 30
Does that look about right to you for NPCs?
Posted: Tue Oct 28, 2008 2:57 pm
by Image
Thanks LE, nice to be back, would be nice to have you in IRC sometime, Andrew had some stuff he wanted to discuss with you that pertain to the project.
Posted: Tue Oct 28, 2008 3:11 pm
by LethalEncounter
Yah I just stopped doing IRC because noone ever used it to talk about the project, only about BS. I'll try to login tonight if I have time.
Posted: Tue Oct 28, 2008 3:28 pm
by Image
Lol gotcha, won't take too long just a few ideas for you. I will watch for you in IRC.
Posted: Mon Nov 10, 2008 11:22 pm
by John Adams
LethalEncounter wrote:Does that look about right to you for NPCs?
Sorry, I must have missed this post before. Yes, that total looks more accurate. That is not to say it is always super whacked. Most of the times, if there is 1 widget, it says it loaded 1. etc... just sometimes, and I am not sure why, you get sky high totals that definitely are incorrect.
And again, it's super low priority, since it hurts nothing but my eyes.