ID:163331
 
How can I reduce lag in my games?
get a better host, and less crappy code.
o.O
In response to Falacy
based on what i just saw from logging in to your full moon fantasy game id say its you could definetly use a beter host <.<
In response to Falacy
Yeah, I logged in also and did not even get passed downloading resources. That has to be a dial up connection host, my suggestion get someone with high speed internet to host your game.
You can do a lot to reduce lag. Try purchasing a webhost with decent bandwidth. ixwebhosting.com has fair prices and decent service, but you have to pay for a year up front, so it may not be ideal for what you are looking for.

Essentially, this webhost can take a LOT of pressure off of your game if you host the .rsc file on an external website, instead of having players download it from the host running the game. Downloading resources really bogs down the world.

As for other ways to slim down lag, if you have NPCs that randomly move around, etc. Try making them not move unless a player is within a certain range of them. I generally turn off NPC processing completely to all NPC that are on a map Z-layer when no players are in that Z-layer.

Also, the hardest way to reduce lag is to make sure you are using efficient methods. Efficiency can only shore down the lag a little bit, most of the time, though.

Overall, reduce unnecessary functions that run all the time, make use of the spawn() command instead of the sleep() command. Set heavy functions to the background, and try to seperate the weight of the people downloading game resources from the game server.


Any other questions?
In response to Soldierman
As a suggestion, if you are just porting .BMPs/.PNGs into the game as subsitute for mapping. DON'T. That also creates lag for compiling AND for people trying to download the game, takes up alot of resources too.
In response to Enzan
Uh... What?

First of all, PNGs are more capable, and much smaller than BMPs, supporting alpha channel and all, thus, BMPs should never be used EVER for any reason on the internet, or in BYOND games.

Second, using PNGs used on the map would be included in the .rsc file, just like any .dmps would. So using a broken up .png for mapping would have the same effect as popping a png onto the map. That's irrelevant. Totally beside the point.

Download lag can be solved completely by setting the preload_rsc variable to a URL, then uploading your RSC cache to that url. This is a technique not many people seem to use, but is exceptionally useful.

Sorry Enzan, but it's just not a valid observation.
In response to Ter13
pngs werent supported untill 4.0 came out though
previously you had to include it as a bmp, map it, then change it to an imported dmi
thats how i did it at least lol
In response to Falacy
Nope. PNGs were very much so supported before 4.0 However, alpha channels just didn't work.

I used them extensively in the early 3.0 days.
In response to Ter13
hrm, strange, im pretty sure 3.4 only supports bmp or dmi for icon file types
In response to Falacy
Well, thats wrong.

People were encouraged to change their .bmps to .png to reduce the size of the rsc.
In response to Kalzar
hrm, looks like u guys are right, guess the byond help files are wrong!
ill have to start using pngs, would be much easier then the way i been doin it lol
In response to Ter13
You forgot the most important rule of all: profiling!

Hit that "Profile World" button in Options of DreamSeeker (or Server -> Profile in 4.0's Options and Messages window) and use it to determine what procs are causing lag. Then fix them! Optimize them! Make them better! PURIFY THEM ALL!

-- Data
In response to Falacy
It's a common misconception. Don't worry. I was pushing my friends to move to .PNG about five years ago, and now the format's being popularized all over the internet.

Most people think BMP is the only format that isn't lossy and allows 24-bit images other than commercial formats.

Most people don't even know that MSpaint XP can save files in 24-bit PNG format (minus alpha channels, though, sorry. =P)

So, logically we can conclude that most people on BYOND are only just discovering this format, and think it's new to BYOND due to the widespread lack of knowledge about the PNG format itself.
In response to Ter13
Well the whole size of my rsc file is 423kb

And I did have lots of things on my desktop had not defragmented in over a year my computer seems so much faster.

also I have High Speed Internet

I was hosting in safe mode by accident I now switched to trusted.

on my map I have lots of overlaying icons

On my title screen map I have animated icons all over the place

I did just switch to 4.0 instead of 3.5

I deleted all the bmp to icon things I made and replaced them with png's

I have yet to test for lag
In response to Hellonagol
safe mode shouldnt matter, its probably actualy best to host in safe mode
and are you sure you have highspeed internet? because the resources were downloading incredibly slow when i logged in
In response to Falacy
I have Shaw High Speed Cable
In response to Ter13
Thank you... I wasn't aware of the idea of using a url to host the rsc. Would my BYONDspace be a good place to put that, or would that be too slow? Thanks again, and sorry for butting in on the topic.
In response to KirbyAllStar
Well... If it's big, it'll waste a lot of your monthly bandwidth. It's probably best to get a real webspace.
In response to Ter13
I thought that they stopped limiting Bandwidth... Or maybe they just stopped showing how much you've used?
Page: 1 2