gm size
#1

well,each time i add a system my gamemode gets more mb....like now i added a small system,no bugs and from 7mb went to 9mb,is that okay ,and what could make it increase like that?
Reply
#2

Your .amx size increases depending on how you write your systems. You can decrease it by generally optimizing your code.

For example, fixing string sizes: there's no point defining 128 characters when you only need 50. The same goes for huge unnecessary arrays.

Also, fix your loops by using foreach; and by changing values you use to loop. To give you an example: if you don't have 500 players or vehicles, don't loop through 500 players/vehicles. Redefine the value to the amount of players or vehicles you have.

PS: 7 MB is alot, I personally never got more than 4 MB.
Reply
#3

That doesnt only happen when i add systems,i tried now changing the hostname from the gamemode from Test to Test Test,it gave me it became from 9000000 kb to 9,000,420 kb
Reply
#4

Don't forget, There are a lot of causes which may make your Amx size big, Includes can cause that too, It depends on the memory they use.
I don't think the server will lag because of the amx file is big, It will just take time on uploading it .
Reply
#5

You perhaps have a lot of strings, if you do try to make them low (sufficient) for example:

pawn Код:
new string[6];
for "Jacob";
instead of
pawn Код:
new string[128];
another thing is having a lot of objects.. well you cannot do anything about it if you REALLY need these objects.

another reason that might affect on the size of your amx file is the commented things that you have in your gamemode, if you don't need them just delete them.

I hope I helped, any feedback would be appreciated!
Reply
#6

Mistake
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)