Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

Hey, first of all I can't not laugh at sneak any time I see that goofy bastard's grin.

That being said, I've been trying to get this game to run on under powered hardware like very old pcs, ARM Handheld/SBCs, etc, but for some reason the game seems incredibly CPU heavy. :(

Those are devices that chew through things like AM2R, Nuclear Throne, Aquatic Adventures of the Last Human and other GM:S bytecode games, so I was wondering if there's anything a bit more obvious you might've missed in terms of optimizations that would help here.


I fully understand that this use-case might be unsupported since those are rather low end, but I thought I would ask anyways.

(+3)

Took me a bit to get around this since UTMT was having trouble opening the game's data, my initial findings is that a lot of performance is wasted on the camera's instance deactivation procedure.

You're calling scr_deactivate_offscreen for _every_  physics/monster in the room, which in turn calls instance_activate_region, which is costly since you have a lot of objects in your room.

As an experiment, I rewrote it like this:

instance_deactivate_object(obj_monster_parent)
instance_deactivate_object(obj_parent_physics)
var vx = camera_get_view_x(view_camera[0])
var vy = camera_get_view_y(view_camera[0])
var vw = camera_get_view_width(view_camera[0])
var vh = camera_get_view_height(view_camera[0])
var px = x
var py = y
instance_activate_region((vx - (vw * 2)), (vy - (vh * 2)), (vw * 5), (vh * 5), true)
if (obj_player_cache != noone)
    instance_activate_object(obj_player_cache)
if (framecount == 0)
{
    instance_activate_object(obj_npc_parent)
    instance_activate_object(obj_touch_buttons)
    instance_activate_object(obj_controls_cover)
    instance_activate_object(obj_crt_filter_test)
    instance_activate_object(obj_controller)
}

Behavior is somewhat different, but it provides enough gains to be playable on RK3399 boards.

woah! thanks for investigating! yeah that script was a quick & dirty optimization on my part. I tried your method and it seems to function as intended after a few tweaks (unsure what framecount is for but those objects should always reactivate, obj_player_cache is just obj_player). 

I can't do a hotfix at the moment so this'll be in the next major patch, which should (hopefully) be out within the next month or so.

thanks again for helping optimize the game! I would love to see it running on old hardware!

Deleted 2 years ago
(3 edits)

I am documenting my changes as they happen on https://gist.github.com/JohnnyonFlame/9a8817430f7ecef06a1a13d2200e6c47

Example of increase in performance:

This was previously fps_real: 13-ish


Dang man, I was going to try getting this game running in Portmaster but you're already on it. I tip my hat off to you man. Hopefully I'll get to play this on my RG552 soon.