Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / All I did was execute this code(Not inside the loop), and my frames drop from 60 to 35~45 FPS in a specific spot.

Author
Message
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 30th Oct 2017 20:25
global grass1Img,grass1

function ldObjs()
grass1Img = LoadImage("grass.png")

stnX = 8
stnZ = 8
for stnCX = 1 to 400

if stnX = 328
stnX = 8
stnZ = stnZ + 16
endif

stnFlr = LoadObject("grass.obj") //CreateObjectBox(16,16,16)
SetObjectImage(stnFlr,grass1Img,0)
SetObjectPosition(stnFlr,stnX,0,stnZ)
stnX = stnX + 16
next stnCX
endfunction

This is supposed to create 400 grass blocks(that are 16x16x16) across the floor from 0,0(XZ) to 320,320(XZ)
Nothing seems wrong and everything works fine until I reach a specific X Y Z position then the fps drops to about 40 FPS.
I'll provide the specific position if needed.
I love games, who doesn't?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Oct 2017 22:52 Edited at: 30th Oct 2017 22:56
try CloneObject ( objID )
but normal i would say it should share the texture image.
i guess your grass block is low poly and the grass.png have power of 2 size.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 31st Oct 2017 00:56
I will try that, thanks.
I love games, who doesn't?
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 31st Oct 2017 01:22
Quote: "i guess your grass block is low poly and the grass.png have power of 2 size."


It does. Is it the cause of the problem?
I love games, who doesn't?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Oct 2017 03:29
power of 2 can be better, but width or height is more importent for memory, should be ~ 512 or 1024 pixels for a tile map at pc.
if this png have alpha channel try SetObjectTransparency with mode 0 is opaque
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)

Login to post a reply

Server time is: 2024-04-25 19:51:37
Your offset time is: 2024-04-25 19:51:37