PDA

View Full Version : It's a problem? Big array


Noliax8
04/07/2014, 12:54 PM
It's a problem?

I'll create my object system, but I'll need infos about each object. Create a array with 15000 size, for each object, or i wanna create a array and using the index 1, 2, 3.

N1: Bad, but practice

enum e_v
{
o_SlotWear
};
new Obj[15000 /* X */][e_v];

// I can:
CreateObject(/* obj X */, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 0.0);


N2: Good, small array, but not practice.
enum e_v
{
o_objID,
o_SlotWear
};
new Obj[500][e_v];

// I can:
CreateObject(Obj[X][o_objID], 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 0.0);

It's a problem to create a array size 15000, 20000...
Thanks you,
Nlx

BroZeus
04/07/2014, 01:03 PM
use the small array one the second one
creating big arrays caz big LAG

BroZeus
04/07/2014, 03:07 PM
Southclaw;3107491']Since when?
I have 64k+ cell arrays for SIF entities which contain lots of enumerated properties.

But still, go with the second option though. If you're making something that extends/uses SA:MP objects then give that it's own set of IDs rather than using the existing ones from whatever entity you're extending/using.

Well it surely increases mem usage of players
and player with low end pc [ like me] have lags in areas with many objects

Noliax8
04/07/2014, 04:56 PM
Ok, anyways i'll use the second solution.