Look Kedaman, the problem is not all the wrappers VB puts around those calls. Remember that in a tile engine you have to do multiplications for each tile. And loops in VB aren't very fast...
My Tyrian game was lightning fast before I implemented the tile engine, even with all the effects. Now it's so slow that it slows down when a 100x100 pixels effect shows up on the screen
I managed to optimize it by replacing the multiplications with additions:
In my RPG (the one that's gonna take a while until it's finishedCode:Dim TileX as Long, TileY as Long 'Position of the tile in the map Dim TilePosX as Long, TilePosY as Long 'Position of the tile in the screen For TileX = 0 to 49 For TileY = 0 to 37 'Blt the tile. The position in the screen is TilePosX,TilePosY TilePosY = TilePosY + 32 Next TileY TilePosX = TilePosX + 32 Next TileX) this technique made the FPS a lot faster (can't remember the exact numbers)
![]()





) this technique made the FPS a lot faster (can't remember the exact numbers)



Reply With Quote