erayzesen
Member
Hi. Firstly I want to explain with samples what's my problem.
I have vec2 based point object, just like that;
I store all these point objects that I created in the room in an array; obj_physics_system->points
And I make a loop and call in step event of an game object.
In my test, every time I click with the mouse, it creates 4 points and adds it to the array.
And every time I click it drops incredibly more real-fps. I can not understand how it fell this much. Isn't that so strange in your opinion?
What should I do for this, please guide me. Generally, I consider the performance of the game maker sufficient, but I had serious disappointments in this project.
In the past, I wouldn't even count how many loops, how many queries, how many functions I run simultaneously in Adobe Flash. I hope I'm doing something wrong.
I have vec2 based point object, just like that;
GML:
function physics_point(_x,_y,_r,_mass):vec2() constructor{
x=_x;
y=_y;
old_x=x;
old_y=y;
r=_r;
static update_velocities=function (){
//Verlet
vx=(x-old_x);
vy=(y-old_y);
vx+=mass*get_gravity_x();
vy+=mass*get_gravity_y();
old_x=x;
old_y=y;
x+=vx;
y+=vy;
}
obj_physics_system.points[array_length(obj_physics_system.points)]=self;
}
And I make a loop and call in step event of an game object.
Code:
//Step Event
var point_count=array_length(points);
for(i=point_count;i>-1;i--){
var point=points[i-1];
point.update_volecities();
}
And every time I click it drops incredibly more real-fps. I can not understand how it fell this much. Isn't that so strange in your opinion?
What should I do for this, please guide me. Generally, I consider the performance of the game maker sufficient, but I had serious disappointments in this project.
In the past, I wouldn't even count how many loops, how many queries, how many functions I run simultaneously in Adobe Flash. I hope I'm doing something wrong.
Last edited: