ID:167538
Mar 1 2006, 3:04 am
|
|
Is there actually a way to avoid the lag in onscreen-menus? It is really annoying, if you want to select something, but the cursor needs 2 seconds to move or the new menu pops up slowly. I'd need something like having the menus work without connection to the server, I suppose o.0
|
Mar 1 2006, 3:09 am
|
|
are you using images
|
In response to Mxjerrett
|
|
No, I'm using .dmi's.
|
There are ways to speed it up. As Mxjerrett was getting at, you can avoid extra network traffic by making some of the objects in the menu /image objects attached to some of the /obj objects in it.
One of the best ways to speed up menu time is to avoid deleting and recreating them every time you need them. Store the objects in a list and recall the same ones next time. Heck, you can even reuse some of the objects between players. In some of my games I have had all players with open menus looking at the same instances of all the menu objects, except for the numbers and pictures that were unique to them. For example... //If you have it like this... You could change that up a bit like so. var/list/menus[0] If you go that route, you can also make a menu function that calls the other two to make it easier on you. client/proc That does only help the local processing load though, and it has nothing to do with the network traffic. However, if the processor gets bogged down, that can be worse than too much network traffic. As for using /image objects, you can look them up in the help file. You just attach some to a base object and give them a pixel offset that makes them appear a tile over. When you do this, you only have to add the base object to the client's screen list, and all the images attached to it will show as well. The reason using image objects can help network traffic as opposed to making them all /obj objects is that each object in the screen list creates constant traffic between the server and the client. /image objects, being attached to the base object, don't create this overhead since their placement is determined by the base object. I'm not sure how much this could reduce lag, but it should help somewhat. It can be a lot of work though, depending on how your system is setup, and it requires quite an overhaul of it. |
In response to Loduwijk
|
|
Thanks :) Are there actually other tricks to avoid lag?(not only for the menus)
|
In response to CIB
|
|
CIB wrote:
Are there actually other tricks to avoid lag?(not only for the menus) Yes; the best one is to get a midrange server or mainframe with a fiber optic connection to the nearest high-speed access point. Seriously though, there are some things. For instance, if you have a lot going on in your world, don't make it all happen at once. Many people have creatures with AI in which they are all sleeping together then all act at the same moment. Spread it out a bit. And putting the game's resources on a different host than the running instance of the game. Oh, another thing that creates constant downloads are those games where you can customise your color. Every time a new person comes into view, you have to download new icons - more than 1 if it uses overlays for different aspects. |