Hi all, been quite awhile since I posted here, but I'm currently having a look at AppGameKit V2 again and am struggling a little with performance issues.
From past experience in DB I have always found instances to run significantly faster than directly created/loaded objects. However in AppGameKit, going from a simple create object loop to a create instance loop I'm not seeing massive differences. Cloning the object rather than instancing, again seems to make little to no difference to speed. Am I missing something? A grid of planes 188x88 is really slowing things down, whichever way I try and I would really want to support at least 200x200 ideally. The only advantage I can see of using an instance or clone here is the fact I can simply delete the original object rather than all of the planes when exiting. Otherwise, I'm seeing no performance gain at all, and I'm unsure if deleting the instance object only will cause memory leaks down the line or not, so I still have code to delete them all in a loop as well.
I seem to remember DB being massively faster when instancing or cloning objects...
Here's a quick example of what i'm trying to do.
xmax=200
zmax=200
basicfloor=createobjectplane(20000,10,10,10)
SetObjectRotation(basicfloor,90,0,0)
setobjectvisible(basicfloor,0)
for x=0 to xmax
for y=0 to 0
for z=0 to zmax
floorid=floorid+1
`CreateObjectPlane(floorid,10,10)
`RotateObjectLocalX(floorid,90)
`InstanceObject(floorid,basicfloor)
CloneObject(floorid,basicfloor)
SetObjectPosition(floorid,x*10,y+5,z*10)
next z
next y
next x
That's the basics I'm using to create my floor. It's using clone object here, but rem that out and rem in instance object and you will get similar results. Similar for making them on the fly, but you want to rem the rotate as well as the createobject line to get them orientated. Obviously when you are using thousands of objects like this I want as much speed as I can squeeze out of it. I also need the individual tiles rather than a single plain, for input reasons (selecting a tile to place another object on), otherwise I could speed things up considerably
. Whatever I choose here, I get similar performance
I'm fairly old school, but this code should be pretty easy to read through
I've taken all array parts out and left it as basic as possible(not actually tested the snippet though).
I was hoping for a massive increase in speed when changing to instances/clones but seeing no real difference
Q6600. Nvidia 260GTX. 8 Gig Ram.