File size - bytes
#1

Would it be too much for my gamemode to be 122,000,000 bytes? The 100 million is mainly because of the furniture system due to the multi-dimensional array.
Reply
#2

Bytes ... What year is it? But yes, 122 MB is really, really large.
Reply
#3

Would it matter if my host for example has more than 16 GB of ram available?
Reply
#4

Fellah 122mb why don't spare it in includes to make I softer? But no it couldn't be a problem
Reply
#5

why so much memory, give an example of use
Reply
#6

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
why so much memory, give an example of use
Fur[MAX_HOUSES][MAX_FURNITURE][H_FURS],

MAX_HOUSES = 800
MAX_FURNITURE = 300

pawn Код:
enum H_FURS
{
    furID,
    furModel,
    furObject,
    furName[25],
    furLocked,
    furOpened,
    Float:furFirstZ
}
pawn Код:
Public::OnHousesLoad()
{
    new start = GetTickCount();
    new i = 1;
    for(new row = 0; row < cache_num_rows(); row++)
    {
        new ORM:ormid = House:i[ORM_ID] = orm_create("houses");
        orm_addvar_int(ormid, House:i[DatabaseID], "id");
        orm_setkey(ormid, "id");
        orm_addvar_float(ormid, House:i[Enter][0], "x");
        orm_addvar_float(ormid, House:i[Enter][1], "y");
        orm_addvar_float(ormid, House:i[Enter][2], "z");
        orm_addvar_float(ormid, House:i[Enter][3], "a");
        orm_addvar_int(ormid, House:i[EnterInt], "enterint");
        orm_addvar_int(ormid, House:i[EnterWorld], "enterworld");
        orm_addvar_float(ormid, House:i[Exit][0], "exitx");
        orm_addvar_float(ormid, House:i[Exit][1], "exity");
        orm_addvar_float(ormid, House:i[Exit][2], "exitz");
        orm_addvar_float(ormid, House:i[Exit][3], "exita");
        orm_addvar_int(ormid, House:i[ExitInt], "exitint");
        orm_addvar_int(ormid, House:i[IntType], "inttype");
        orm_addvar_int(ormid, House:i[Empty], "empty");
        orm_addvar_int(ormid, House:i[Complex], "complex");
        orm_addvar_int(ormid, House:i[Door], "door");
        orm_addvar_int(ormid, House:i[InsideHouse], "insideHouse");
        orm_addvar_int(ormid, House:i[OutsideHouse], "outsideHouse");
        orm_addvar_string(ormid, House:i[Owner], 45, "owner");
        orm_addvar_int(ormid, House:i[Owned], "owned");
        orm_addvar_int(ormid, House:i[Locked], "locked");
        orm_addvar_int(ormid, House:i[Price], "price");
        orm_addvar_int(ormid, House:i[LevelBuy], "levelbuy");
        orm_addvar_int(ormid, House:i[Rentable], "rentable");
        orm_addvar_int(ormid, House:i[RentPrice], "rentprice");
        orm_addvar_int(ormid, House:i[Cash], "cash");
        orm_addvar_int(ormid, House:i[Heal], "heal");
        orm_addvar_int(ormid, House:i[Faction], "faction");
        orm_addvar_int(ormid, House:i[FType], "factype");
        orm_addvar_int(ormid, House:i[RDX], "idx");
        orm_addvar_int(ormid, House:i[FurRank], "furrank");
        orm_addvar_int(ormid, House:i[Elevator], "elevator");
        orm_addvar_string(ormid, House:i[SemiOwner], 45, "secowner");
        orm_apply_cache(ormid, row);
        // CREATE THE DYNAMIC CHECKPOINT
        UpdateHouseEntrace(i);
        LoadHouseFurnitures(i);
        LoadHouseWeps(i);
        i++;
    }
    printf("[ Loaded %d houses from the database - took %d ]", cache_num_rows(), GetTickCount() - start);
    return 1;
}

LoadHouseFurnitures(house)
{
    mysql_format(dbHandle, query, sizeof(query), "SELECT * FROM `furniture` WHERE `houseID` = %d ORDER BY `ID` DESC LIMIT %d", House:house[DatabaseID], MAX_FURNITURE - 1);
    mysql_tquery(dbHandle, query, "OnHouseFurnitureLoad", "i", house);
}

Public::OnHouseFurnitureLoad(house)
{
    new i = 1, Float:pos[3], Float:rot[3], object;
    for(new row = 0; row < cache_num_rows(); row++)
    {
        Fur[house][i][furID] = cache_get_field_content_int(row, "ID");
        Fur[house][i][furModel] = cache_get_field_content_int(row, "model");
        cache_get_field_content(row, "name", Fur[house][i][furName], dbHandle, 50);
        Fur[house][i][furLocked] = cache_get_field_content_int(row, "locked");
        Fur[house][i][furOpened] = cache_get_field_content_int(row, "opened");
        Fur[house][i][furFirstZ] = cache_get_field_content_float(row, "firstrot");
        pos[0] = cache_get_field_content_float(row, "x");
        pos[1] = cache_get_field_content_float(row, "y");
        pos[2] = cache_get_field_content_float(row, "z");
        rot[0] = cache_get_field_content_float(row, "rotx");
        rot[1] = cache_get_field_content_float(row, "roty");
        rot[2] = cache_get_field_content_float(row, "rotz");
        object = CreateDynamicObject(Fur[house][i][furModel], pos[0], pos[1], pos[2], rot[0], rot[1], rot[2], house + 100);
        Fur[house][i][furObject] = object;
        mysql_format(dbHandle, query, sizeof(query), "SELECT * FROM `textures` WHERE `F_ID` = %d ORDER BY `idx` ASC LIMIT %d", Fur[house][i][furID], MAX_FURNITURE_MATS);
        mysql_tquery(dbHandle, query, "OnFurnitureTexturesLoad", "i", object);
        i++;
    }
    return 1;
}

Public::OnFurnitureTexturesLoad(object)
{
    new index, model, txdname[45], texturename[45], color[45], newHex;
    for(new row = 0; row < cache_num_rows(); row++)
    {
        index = cache_get_field_content_int(row, "idx");
        model = cache_get_field_content_int(row, "model");
        cache_get_field_content(row, "txdname", txdname);
        cache_get_field_content(row, "texturename", texturename);
        cache_get_field_content(row, "color", color);
        sscanf(color, "h", newHex);
        SetDynamicObjectMaterial(object, index, model, txdname, texturename, newHex);
    }
    return 1;
}
Reply
#7

i doubt you need so much furniture.. even 100 objects for one house is too much.. how can u hold 300? put it at like 50 or smthng... and why do u need to name a furniture?

but even with this array isnt it suppose to use only like 12 mb? how is ur GM 122mb
Reply
#8

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
i doubt you need so much furniture.. even 100 objects for one house is too much.. how can u hold 300? put it at like 50 or smthng... and why do u need to name a furniture?

but even with this array isnt it suppose to use only like 12 mb? how is ur GM 122mb
This ^^
Also even 50 furniture for an average house are too much i guess!
Reply
#9

It's because there's an option to switch to a completely empty interior and design your own custom interior, that's why.
Reply
#10

Correct if I am wrong but reaching so big size it could mean a lot.. For example big defines like max furniture arrays are huge also you maybe use big string lengths unnecessarily(using 250 length for a string when you need less) et cetera.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)