Jump to content
MakeWebGames

Improving load speed


Macintrash

Recommended Posts

I notice some mccode games load so fast you dont see the page move. Others, you click a link and it turns black and re-renders everything. What can be done to increase loading speed? I heard echo/print can make a difference. I also heard the use of <div> would help. Anyone know any good specifics that dont need a complete engine conversion just to implement?

Link to comment
Share on other sites

For faster loading time's, you got to think about server side, now what is serverside? PHP, that is the background of the engine. To speed this up, you'll need to update your script, modify and even delete some thing's.

A lot of mccode's game's when they get like over 1k member's daily then it start's loading like a pig :P a full recode should help you fix your problem :)

Link to comment
Share on other sites

for loading time a lot can be done things like query's can ve updated using least can cut down on how many times you need to run querys things such as echo over print and using mysql_query over $db->query (if your using v2) adds a micro of a sec however not noticed on the user end in my opinion anyway.

 

just keep pages small and everything optimized and you will be fine you can also use javascript so pages do not need to reload everytime someone clicks a submit (e.g usernotpad) works wounders on the feel of a website to the user

Link to comment
Share on other sites

There are many places where improvements can be made:

PHP code

Database queries

Database schema

Server specs (cpu, ram, etc)

Server network speed

To get the best improvement in speed, you'll need to do some testing to see which area is slowest.

Link to comment
Share on other sites

Im going to be hiring someone real soon to fix this all. Im looking for someone who can do awesome graphic layouts to improve the standard MC tabled login page, improve tables, horizontal rules, css, fonts etc. I want it to look better and load quicker at the same time. I want someone i can trust. So with that being said, is scriptlance a good place to do this? As an owner with decent donations coming in i could probably afford $100 worth of updates at a time. Should i stick with MWG or should i use something like scriptlance and use someone who's never even heard of MCCode?

Link to comment
Share on other sites

if you read this 5 times and actually learn something i bet you could do it on your own without hiring anyone

Make your site faster step by step :P

i wouldn't mind helping you if you find something on there you don't understand :)

this is a start that im 100% sure if done well you can get a much better loading time, but there is more to be done to be a grade A on mcc

Link to comment
Share on other sites

nitpick through your site. yslow Firefox addon and then see how badly your doing.

.htaccess setting ExpiresByType and SetOutputFilter

GZIP is something is often overlooked and will significantly improve your site speed.

Decent hosting. Sorry but all of the unlimited everything is BS hosting. No such thing as unlimited bandwidth or disk space and its more than likely that the server is over sold.

http://www.rulerofzu.com is on a dedicated server - Intel i7-920 quad core, 12gb ddr3 ram and raid 1 2 x 1500GB drives. With secure passive ftp backup

Link to comment
Share on other sites

if u want to make it run faster simply change things like print to echo and if ur using V2 change mysql_query to $db->query :) it will improve the time to load the page by a bit, theres a modification that u can put onto your game that allowes you to see he exact time it takes to load it (even miliseconds ;D) i cant remember were i saw this modification but im sure the search engine will help that way u can expiriment changing the code to see if it loads faster or slower :)

Link to comment
Share on other sites

how is $db->query more secure then mysql_query ? all $db->query does is

 

mysql_query($query,$c) or die(mysql_error());

 

via the class folder, it is faster to use mysql_query() since you are not calling a whole new file however in v2 its nothing since the database class is always called anyway

Link to comment
Share on other sites

[mysql]$db->query("SELECT * FROM `users`"); = V2

mysql_query("SELECT * FROM `users`"); = V1 & V2[/mysql]

$db-> Is more secure then mysql alone. Either way your query can be used through $db-> or mysql in V2.

 

Did someone tell you that or was it a stab in the dark?

Plus, you've got bigger problems here: You're selecting all the data from the table 'users', and with the size of that users table in V2 it's not really advised, the difference won't be that noticeable in a small game environment but it's still not advised.

And, a way to improve speed is to use your database to it's full potential - don't cram a bunch of crap into one table, for example 'users'. I've seen people putting ALL their crimes into the users table and recording what crimes the user has completed by updating it to the users table. And it gets worse in the fact when they want to display the total amount of crimes accomplished, they done something like:

 

$Select = mysql_query("SELECT * FROM `users`);
$User = mysql_fetch_array($Select);

$Total = $User['Crime1'] + $User['Crime2'] + $User['Crime3'] + $User['Crime4'] + $User['Crime5'] + $User['Crime6'];

echo $total;

 

It's shocking, that could easily be accomplished by recording the data into a separate database table.

There are a lot of aspects of a site that you can alter to improve your site speed.

Djkanna posted a very good way of doing things, with the video. I actually bookmarked links from that site as I'd never heard of them so thanks Djk ;)

You will hear so many different ways on how you can go about this, but at the end of the day, for me it comes down to preference. I have my own preference like everyone else and I believe that my way is efficient enough, just like so many others.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...