PDA

View Full Version : The best way to make LARGE scale cities, and not have lag



Dracconus
27-08-08, 10:18 PM
First off
**Warning, the setup for this will be slightly different depending on what core you're using, and what database. However, that being said it is still 100% possible to execute this to make your once "lag city" into a festival, Guild City, or whatever the heck you want to call it.**

-----------------------------------------------------
HOW TO MAKE A CITY AS LARGE AS YOU WANT WITH NO LOAD TIME WHEN YOU GET THERE.
---------------------------------------------------------

** So, you just made this completely L33T city, and it's looking sweet, everything is lined up perfectly, and it's the size of Storm wind. But, what's this. It's taking 20 MINUTES to load, is hogging your processor, and ram, and is lagging your server to high hell. How can you fix this? Simple...Read below, and follow the steps.

------------------------------------------------------------
1. You will HAVE to have database access to do this, and will NOT need anything else (except being able to spawn in game...that normally helps if you're worried about this kind of thing :P.)

2. Open your your servers WORLD DATABASE with whatever gui program that you have.

3. Open the Gameobject_spawns table, and sort the column labeled "ID" to be sorted ASCENDING.

4. Scroll to the bottom, and jot down the LAST 'ID' number. Jot this down in notepad for referencing later.

5. Close all of your database Gui programs application windows.

6. Go in game, and spawn whatever you want to your hearts content.

7. Once done, go BACK to the servers WORLD DATABASE and open Gameobject_spawns again.

8. Sort in ascending order again.

9. Scroll down to the number you recorded into notepad to be your last.

10. Copy every line below it. You can do this by clicking the first one underneath it, then while holding 'SHIFT' click on the VERY LAST one by using your scroll wheel to get to the bottom. You can also click th 'DOWN ARROW' and hit space per line as well, but, the shift trick is easier.

11. Make sure that you copy the data structure, not just the information. To do this. (I only know how to in Navicat) right click beside the 'ID' Number Column to the right (where the red circle is) and then select 'COPY.'
http://img258.imageshack.us/img258/4610/copyherebx0.jpg

12. (DO NOT DELETE THE INFORMATION IN THE LINES FROM GAMEOBJECT_SPAWNS)Once you have copied all of the lines you need from Gameobject_spawns close it out, then go to Gameobject_staticspawns.

13. You will NOT need to sort this one at all as 99% of the time, ppl do not use it. If you DO have it used, just sort is ASCENDING, and scroll to the bottom.

14. Using the same method you did to COPY the information. You're now going to PASTE the information.

15. Once you click 'Paste' a confirmation window will pop up (in navicat...not sure about others) asking you "ARE YOU SURE YOU WANT TO PASTE THESE RECORDS?" Cick 'OK'.

16. Congratulations. Just restart your server, and go to the last area that you spawned all of the game objects at.

You'll notice that now, the MASSIVE city construct that you've built does not take up ANY load times, and only uses an incredibly slight fraction of your processor VS the (up to) 50% that it could. [and that's not mentioning the R.A.M, and lag it can cause on a network.]

I've tested this, and it works. I've also been able to prove (by spawning over 50000 go's) that this takes little to NO extra processor, network usage, OR eventual memory usage. It's a static map...just like the games.. So, it's data in incredibly small.

**EDIT** I also had someone ask if it's possible to perform this method with existing game objects. The answer is yes, you can do it with things (cities, and such) that you've made before. Just find the first, and last id of the go's that you spawned.

Hope you guys like my Guide. I know it saved me a TON of creation timing and efforts. hope it does you all as well.
Dracconus

TO THE SkEPTICS LIKE>>>BALLWINKLE
here are pictures taken before the Game master went to the area with cpu usage included for not ONE, but TWO servers, and a website(plus all of xp's crap)

BEFORE
----------------------
http://img135.imageshack.us/img135/5915/beforeja5.jpg

After
---------------------------
http://img261.imageshack.us/img261/628/afterzn7.jpg

Look at the chat logs, and processor log...it'll tell you everything you need to know. THIS DOES WORK.

This was originally posted by me around 4 months ago on *******, and was created for use with NCDB
However, this will work for any database, and core, you just have to edit the core to be able to load additional tables on startup (contact your C++ Dev for that, I don't have the slighteest on how to add that in), and then you just have to make the table that you want to load, and copy the data over.
These INCREDIBLY simple task will have your server running a LOT more smoothly than it EVER did, and the best part is...You can do it with ANY gameobject you spawn, so there is no need to worry, it'll just take the server a hair longer to boot, literally, not that much time at all.
The "GO'S" will still ONLY "load" (take up proc, and ram) when the cahracters get there, but instead of a progresive loading, it'll be an all around instant. That will result in less load time, less interface lag, less server lag, and a LOT more happy campers on your server.
Have fun, and GL

*NOTE** On some databases, and core revisions, it MAY be necessary to delete the existing data from the game_object spawns table (or the new name it has now w/e it may be) to keep this working. Just fiddle around with it, and you'll get it to work.