I have a dungeon generator that does just that generates a dungeon. The problem I'm having with it is lag. It takes anywhere from .2 to 12 seconds to actually generate its map. I also used swap maps to create a new map just so it creates a new map just for the custom dungeon but that process finishes almost immediately. In a multi-player situation the lag is processed by EVERYONE or atleast in the tests I've run I have yet to run dream daemon only hosted it through Dream Seeker but the lag is server-sided. Is there a way I can make the lag effect the client alone then well, EVERYONE.
|
Feb 5 2012, 10:59 am
|
|
There really is no way to do client-side processing in BYOND right now. There are DLL files which run on the server that potentially could speed up map creation due to having them written in another language, but all of your players are going to experience lag because the SERVER is doing all of the calculations, it handles all that.
|
Crapsicle. That's my only response. I need SOMETHING that will speed this up. I'll give this a shot on a server and host it and get process times off debug. I'm going to give it a few other attempts I don't want this to generate massive dungeons and make EVERYONE in the world process this lag. I've heard falacy had a dungeon game with a generator and I'm curious to see if he has any information for me on lag reduction.
|
Proc Name Self CPU Total CPU Real Time Calls |
Well, without posting the code there's really no way to help you...
|
In response to Flame Sage
|
|
This is based off a library I found (Nearly exactly...) JP.Dungeon_Generator (Or something I believe.) I just edited dantum object names for typing simplicity and things. & There's a little bit of Lummox JR's swap maps hidden in my entered procs so I can create a new z level. If I generate the map this way it takes ~19 seconds of no movement on the clients end to finish complete generation.
turf/wall dungeon dungeon |
In response to Flame Sage
|
|
After all that, clearly my paths code is where the longest client wait time lies but honestly, how the heck else am I supposed to do that? I mean I need paths from point a to point b so following the code here I'm unable to find a shorter way to write it, or even...change it.
[edit] I've proceeded to test, if I get rid of my paths generation is instant and without problem. Sooo... Any way to consolidate this code? I can't think of any at all. Would it be smartest to rewrite a path-finding code from scratch using one part of the border of each room and not caring about the length and whether or not there is a dead end possibility? [/edit] |
If your concern is the entire server freezing while the map is generated, just add some sleep()s to the process to spread it out. You can also use the set background=1 setting, although I'm not sure how well it works. It will take longer to generate the actual map, but the rest of the players on the server won't "feel" it.
|
Uhm if its as simplistic as setting it to the background, then I think I might just have to shoot myself in the foot.
Well some bandages and a little testing later if I set it to background (Why the HELL didn't I think of this.) I have near full movement, with still a good deal of lag but atleast I'm able to move around during generation so I'm going to work in some sleeps during my loops. Working sleep in broke everything. The hell? Hahaha. Time to keep trying at this. |