Call stack (most recent call first) 0x000E61D0 => 0x0000743c()
#1

I'm having a few issues with objects at the moment, specifically ~15,000 of them crashing players/me in different locations every time.

I'm not going to post the code because it's just the ordinary CreateDynamicObject function to create objects using Incognitos streamer. On the crash I get the Op code: 0x00544BBE which is object related. Now Incognitos streamer should certainly be able to handle more then 15k objects so what is causing this.

However; In the server_log.txt using the crashdetect plugin I get these errors:

Код:
[21:33:33] [debug] Run time error 4: "Array index out of bounds"
[21:33:33] [debug]  Accessing element at index 16000 past array upper bound 15999
[21:33:33] [debug] AMX backtrace:
[21:33:33] [debug] #0 0000748c in ?? (0x00000360, 0xc50598a4, 0x44d99c29, 0xbe8f6944, 0x00000000, ... <2 arguments>) from Objects.amx
[21:33:33] [debug] #1 000e6220 in ?? () from Objects.amx
[21:33:33] [debug] #2 000ea36c in public Objects21 () from Objects.amx
They occur any time the server is restarted and every time the player crashes because of the '0x00544BBE' error. There is literally 0 results on ****** for these so yeah.... Any help at all is good.

EDIT: This is the original code. It's only missing the rest of the objects.
Код:
#define STREAM_CONSTANT 180

//forward Objects1();
//forward Objects2(); ...
forward Objects21();

public OnFilterScriptInit()
{

    SetTimer("Objects21", 21000, 0);
	return 1;
}

new objects[15000][2], some_var = 0; 

stock r_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	objects[ some_var ][ 0 ] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, -1, -1, -1, STREAM_CONSTANT + GetColSphereRadius(modelid));
	objects[ some_var ][1] = modelid;
	some_var++;
	return 1;
}

stock CreateObjects21()
{
	r_CreateObject(2000,-983.6800000,2811.7900000,73.7900000,0.0000000,0.0000000,0.0000000);
	return 1;
}

public Objects21()
{
	CreateObjects21();
	return 1;
}
Reply
#2

We are not magicians and can't possibly guess what function is located at address 0x0000743c. Recompile your gamemode with the -d3 flag in pawn.cfg.
Reply
#3

Already done, doesn't work.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
We are not magicians and can't possibly guess what function is located at address 0x0000743c. Recompile your gamemode with the -d3 flag in pawn.cfg.
Stop being an idiot and be polite for once. Being 'godfather' doesn't exclude you from having manners.
Reply
#5

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
Stop being an idiot and be polite for once. Being 'godfather' doesn't exclude you from having manners.
He's just trying to help, at the moment I'll take any help. I really need this fixing.
Reply
#6

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
Stop being an idiot and be polite for once. Being 'godfather' doesn't exclude you from having manners.
There was nothing insulting regarding the reply. The only one looking like the idiot here is yourself.
Reply
#7

Try updating crashdetect, you're using a pretty old version
Reply
#8

Quote:
Originally Posted by xeeZ
Посмотреть сообщение
Try updating crashdetect, you're using a pretty old version
Good idea,
Код:
[21:33:33] [debug] Run time error 4: "Array index out of bounds"
[21:33:33] [debug]  Accessing element at index 16000 past array upper bound 15999
[21:33:33] [debug] AMX backtrace:
[21:33:33] [debug] #0 0000748c in ?? (0x00000360, 0xc50598a4, 0x44d99c29, 0xbe8f6944, 0x00000000, ... <2 arguments>) from Objects.amx
[21:33:33] [debug] #1 000e6220 in ?? () from Objects.amx
[21:33:33] [debug] #2 000ea36c in public Objects21 () from Objects.amx
This is not all of the code obviously but just to show you how it is. The object creation is on timers because otherwise SA-MP can't handle 15k of them being created at once. r_CreateObject() is used for streaming purposes with ******'s modelsize include so that an object with a larger collision radius is streamed before a smaller object.
Код:
#define STREAM_CONSTANT 180

//forward Objects1();
//forward Objects2(); ...
forward Objects21();

public OnFilterScriptInit()
{

    SetTimer("Objects21", 21000, 0);
	return 1;
}

new objects[15000][2], some_var = 0; 

stock r_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	objects[ some_var ][ 0 ] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, -1, -1, -1, STREAM_CONSTANT + GetColSphereRadius(modelid));
	objects[ some_var ][1] = modelid;
	some_var++;
	return 1;
}

stock CreateObjects21()
{
	r_CreateObject(2000,-983.6800000,2811.7900000,73.7900000,0.0000000,0.0000000,0.0000000);
	return 1;
}

public Objects21()
{
	CreateObjects21();
	return 1;
}
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
SA:MP should have no problem with that many at once. Anyway, it looks like the problem is in r_CreateObject, but without real code I can't say more than that.
That is the real code, the only thing missing out is the rest of the objects and I'm not posting all 15k of them so I just put the first one.

SA-MP or SA do have problems with loading a lot of objects it's just figuring out what. Many people have said to me different things like; too many materials are loaded, too many objects are condensed into a small place and the objects are too far out of SA but testing these show no different signs and these errors still show.

Also it's not the r_CreateObject because just using CreateDynamicObject() under OnFilterScriptInit() give the same errors/crashes.
Reply
#10

You could use this:
pawn Код:
#define STREAM_CONSTANT 180
#define MAX_OBJECTS 15000

//forward Objects1();
//forward Objects2(); ...
forward Objects21();

public OnFilterScriptInit()
{
    SetTimer("Objects21", 21000, 0);
    return 1;
}

new objects[MAX_OBJECTS][2], some_var = 0;

stock r_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
    if(some_var < MAX_OBJECTS)
        {
        objects[ some_var ][ 0 ] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, -1, -1, -1, STREAM_CONSTANT + GetColSphereRadius(modelid));
        objects[ some_var ][1] = modelid;
        some_var++;
        }
    return 1;
}

stock CreateObjects21()
{
    r_CreateObject(2000,-983.6800000,2811.7900000,73.7900000,0.0000000,0.0000000,0.0000000);
    return 1;
}

public Objects21()
{
    CreateObjects21();
    return 1;
}
It will not give you the error anymore, what I am guessing is that you got more then 15K objects and if that's the case this code will just not create all of your objects. If that's true, increase "MAX_OBJECTS".

Best regards,
Jesse
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)