polygon slowdown?

For whatever reason, polygons slowdown my graal editor A LOT. I’m not talking 100 polygons or anything, right now I’m just displaying 15 and it was enough for Graal to tell me it was running at a low framerate. I’ve asked others if it lagged(with my same script) and no. It’s odd, because opening the debug window seems to remedy it somewhat. Happens in both old versions(that came with Graal Reborn) and the one packaged with Graal itself.

Any idea? I can display 100’s of images with no lag at all, but as soon as I show polygons it starts up.

That is very strange. I can do a fair amount of showpoly without lag, its just when I had to use lots of math and floating points to calculate each vertex that I would notice an impact on my frame rate. Does it lag when the showpoly are not in a loop?

Even if it’s just in a static array, with a for loop, it lags. I’ll check in a minute about outside of a for loop. Regardless I’ve never had this problem before.

[php] showpoly 200,{20,20,30,20};
showpoly 201,{20,25,30,25};
showpoly 202,{20,30,30,30};
showpoly 203,{20,35,30,35};
showpoly 204,{20,40,30,40};
showpoly 205,{20,45,30,45};
showpoly 206,{20,50,30,50};
showpoly 207,{20,55,30,55};
showpoly 208,{20,60,30,60};
showpoly 209,{20,65,30,65};
showpoly 210,{20,70,30,70};
showpoly 211,{20,75,30,75};
showpoly 212,{20,80,30,80};
showpoly 213,{20,85,30,85};
showpoly 214,{20,90,30,90};
showpoly 215,{20,95,30,95};
changeimgvis 200,4;
changeimgvis 201,4;
changeimgvis 202,4;
changeimgvis 203,4;
changeimgvis 204,4;
changeimgvis 205,4;
changeimgvis 206,4;
changeimgvis 207,4;
changeimgvis 208,4;
changeimgvis 209,4;
changeimgvis 210,4;
changeimgvis 211,4;
changeimgvis 212,4;
changeimgvis 213,4;
changeimgvis 214,4;
changeimgvis 215,4;[/php]

This slows it down. And I’m on XP.

But THIS does NOT:
[php] for (i=0;i<50;i++) {
showpoly 200+i,{
20,20+(i5),
30,20+(i
5),
30,20+2+(i5),
20,20+2+(i
5),
};
changeimgvis 200+i,4;
}[/php]

It only lags when it’s lines, not shapes. WTF???

Don’t know what to tell you, no more retarded showpoly methods o_o

:edit: Oh snap, 1k post :open_mouth:

[QUOTE=Shiny;14148]
[php] showpoly 200,{20,20,30,20};
showpoly 201,{20,25,30,25};
showpoly 202,{20,30,30,30};
showpoly 203,{20,35,30,35};
showpoly 204,{20,40,30,40};
showpoly 205,{20,45,30,45};
showpoly 206,{20,50,30,50};
showpoly 207,{20,55,30,55};
showpoly 208,{20,60,30,60};
showpoly 209,{20,65,30,65};
showpoly 210,{20,70,30,70};
showpoly 211,{20,75,30,75};
showpoly 212,{20,80,30,80};
showpoly 213,{20,85,30,85};
showpoly 214,{20,90,30,90};
showpoly 215,{20,95,30,95};
changeimgvis 200,4;
changeimgvis 201,4;
changeimgvis 202,4;
changeimgvis 203,4;
changeimgvis 204,4;
changeimgvis 205,4;
changeimgvis 206,4;
changeimgvis 207,4;
changeimgvis 208,4;
changeimgvis 209,4;
changeimgvis 210,4;
changeimgvis 211,4;
changeimgvis 212,4;
changeimgvis 213,4;
changeimgvis 214,4;
changeimgvis 215,4;[/php]

This slows it down. And I’m on XP.

But THIS does NOT:
[php] for (i=0;i<50;i++) {
showpoly 200+i,{
20,20+(i5),
30,20+(i
5),
30,20+2+(i5),
20,20+2+(i
5),
};
changeimgvis 200+i,4;
}[/php]

It only lags when it’s lines, not shapes. WTF???
[/QUOTE]

For me, the ‘for’ script lags way and way more… or was that just sarcasm?
-_-

ANYWAY, can anybody tell me an efficient way to draw polygons without lag? I’m very interested in hearing :slight_smile:

Thanks!

~ÐR

[QUOTE=Darkrazor;14157]ANYWAY, can anybody tell me an efficient way to draw polygons without lag?[/QUOTE]

These aren’t your typical “3d polygons”, think of it more like a “fill” tool.
And it depends what you’re drawing.

[QUOTE=Beholder;14159]
These aren’t your typical “3d polygons”, think of it more like a “fill” tool.
And it depends what you’re drawing.
[/QUOTE]

Let’s say … youre server, how’d you make it without the lag?
the slopes and everything are polygon based right?
i’d be thankfull if you could answer me on this :stuck_out_tongue: it’s been bugging me for a while now…

Originally the slopes were polygons, there are a few show poly to make up where I’m missing tiles/unable to layer tiles. But now the tiles are a mixture of tileset, and showani.

showpoly 200+i,{20,20+(i5),30,20+(i5),30,20+2+(i5),20,20+2+(i5),};

can someone explain these place values ? i thought there were just x1,y1,x2,y2 .

vertex1x, vertex1y, vertex2x, vertex2y, vertex3x, vertex3y etc etc

[QUOTE=MysticalNinja;26381]
showpoly 200+i,{20,20+(i5),30,20+(i5),30,20+2+(i5),20,20+2+(i5),};

can someone explain these place values ? i thought there were just x1,y1,x2,y2 .
[/QUOTE]

It’s an array of values. Think of it like this:
[x1,y1],[x2,y2],[x3,y3]…

Except you’re removing the brackets, and you can add as many points as you wish. Each two values represent a point on the graph(the level or screen), which connects chronologically and then fills. So it basically performs a ‘connect the dots’ and then colors it in.

My example, however, implements a for loop with the variable ‘i’. i will = 0 the first iteration, then 1, then 2… so on and so forth until it hits its max. So it will repeat the showpoly as many times as the for loop asks, and each time the i will increase, and thus also increase the placement of the polygon, depending on the formulas used. In this case it was 20+(i5), which means the first polygon would be:
20+(0
5) = 20
20+(15) = 25
20+(2
5) = 30…
so on and so forth.