I'm planning to make a shmup game with RPG Maker, but I'm not sure which version to choose. I expect my game to have 1000~3000 sprites moving on screen for most of the time, and I want to make this game run smoothly on as many devices as possible.
I've created a test case in RPG Maker VX, but not MZ yet - I'm not an experienced JS programmer and JS didn't leave me great first impressions. In this test case I deleted all built-in scripts and wrote my own game loop, in which it created 5000 sprites on initialization, and every frame those sprites would be set to a random position in window. Here's my PC specs and test results:
OS : Windows 10 Home 21H2 (19044.1826)
CPU : AMD Ryzen 5 5600 6-Core Processor 3.50 GHz
RAM : 64.0 GB
GPU : AMD Radeon RX 6750XT
Sprite Count : 5000
FPS : 10 constant
CPU util : 12.2% max, none of the cores showed any sign of full utilization
GPU util : 2.1% max
RAM : 191.6 MB max
As to what did to those sprites every frame:
And this is it, nothing fancy.
If this is still not enough, here's all the code for this simple test:
I wonder if this is because the inherent limitations of RGSS backend or that I'm moving those sprites in an unoptimized way, will MZ be a better solution for handling a large amount of sprites?
I've created a test case in RPG Maker VX, but not MZ yet - I'm not an experienced JS programmer and JS didn't leave me great first impressions. In this test case I deleted all built-in scripts and wrote my own game loop, in which it created 5000 sprites on initialization, and every frame those sprites would be set to a random position in window. Here's my PC specs and test results:
OS : Windows 10 Home 21H2 (19044.1826)
CPU : AMD Ryzen 5 5600 6-Core Processor 3.50 GHz
RAM : 64.0 GB
GPU : AMD Radeon RX 6750XT
Sprite Count : 5000
FPS : 10 constant
CPU util : 12.2% max, none of the cores showed any sign of full utilization
GPU util : 2.1% max
RAM : 191.6 MB max
As to what did to those sprites every frame:
Ruby:
for i in 0...5000
@@sprites[i].x = rand(600) - 300 + 640
@@sprites[i].y = rand(600) - 300 + 360
end
If this is still not enough, here's all the code for this simple test:
Ruby:
module TestSpritePerformance
def self.main
initialize
loop do
update
end
end
def self.initialize
Graphics.resize_screen(1280, 720)
Graphics.vsync = false
Graphics.frame_rate = 120
@@sprites = []
@@bitmap = Bitmap.new(32, 32)
@@bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 255, 255, 255))
@@bitmap.fill_rect(1, 1, 30, 30, Color.new(255, 255, 255, 0))
for i in 0...5000
@@sprites.push(Sprite.new)
setup_sprite(i)
end
end
def self.setup_sprite(i)
@@sprites[i].bitmap = @@bitmap
@@sprites[i].x = 640
@@sprites[i].y = 360
@@sprites[i].update
end
def self.update_sprites
for i in 0...5000
@@sprites[i].x = rand(600) - 300 + 640
@@sprites[i].y = rand(600) - 300 + 360
end
end
def self.update
Input.update
update_sprites
Graphics.update
end
end
TestSpritePerformance.main
I wonder if this is because the inherent limitations of RGSS backend or that I'm moving those sprites in an unoptimized way, will MZ be a better solution for handling a large amount of sprites?