Adjusting a huge room for a upscaled game

Started by AndreasBlack, Sat 01/03/2025 14:59:24

Previous topic - Next topic

AndreasBlack

I'm trying to see if i can get this to work.
The original room is 7000pixels wide and 200 in height done in a 320x200 template originally. However i realised i need to upscale the game to get parallax scrolling to look better according to @eri0o if i'm not mistakening and while i did that it turns out some of my large rooms crashes AGS :~(

Shouldn't i be able to use the camera to just "zoom in" the room on the original 7000x200 background so AGS doesn't crash and then "move the camera" sideways on those 7000pixels? But that type of coding is way beyond my knowledge unfortunaly :~( hope it's not too complex. Perhaps someone can put me in the right direction, thanks

Crimson Wizard

Please always tell what exactly happens when the game crashes:
- what do you do?
- is there an error message? what does it say?

Otherwise we won't be able to answer your questions.

AndreasBlack

#2
I'll gladly answer yours since you've helped me so much over the years! (nod) Since you've asked for it and didn't answer my question (laugh) My question i know the answer to (kinda) instead of upscaling every other sprite in the game i've realised that the engine likes the small sprites upscaled in the engine. Rather then outside of the engine. May sound stupid but hey..It's easier to "see what you're doing" in the AGS editor rather then dabble around in the dark(!) lowres original sprite form, but at the cost of extreme Framedrops! So that's great now i can get the parallax going 

edit: I've solved it by making the image in two pieces/rooms and that seemed to do the trick, so it's probably just me being stupid not reading the "limits of the engine".  (nod)


Crimson Wizard

#3
This is not so much a limit of AGS, but a limit of a 32-bit program, which can allocate at most 3 GB on Windows.
Judging by the error message, your game tried to allocate over 4 GB just for one item (was that a room background?).

If the room memory requirement is the issue, then usually it may be solved either by splitting the room into multiple rooms, or making room itself small and emulate scrolling by moving sprites around.

I was not able to understand how the question about camera is related to this, maybe I do not understand the context very well.

AndreasBlack

No worries, i'll try again! The question was regarding if i could make the game work without changing the original bakground sprite frame to the "higher resolution" and instead changing the room's camera temporarely to "upscale inside the engine" if that makes sense? I mean it works on objects/characters, maybe now you get the idea ex
Code: ags
object.Scaling=600%; (1920x1200)
and you could go perhaps.
Code: ags
BackgroundFrame(1).Scaling=600%;

I have a vague memory of your Camera demo(?) zooming into smaller images making them appear larger psuedo "another resolution", that's what i was after. But since i've possibly solved it by splitting the image, no idea wasting more time on this unless it can be a new AGS feature :-D I do remember still suggesting the idea of scaling objects aswell and god have i had use for it now (!!!). Let me tell you. I've just learnt by experimenting. When i upscaled blinking stars in a parallax it dropped from 50fps to 35fps.

and it is the parallaxing that makes the room lag. Now i just upscaled the original sprites inside of AGS engine instead and it works 100%, zero framedrops, phew! :) Perhaps worth noticing for those having lag issues with their high res games in the AGS manual, unless it's there already!

Crimson Wizard

#5
Quote from: AndreasBlack on Sun 02/03/2025 02:00:32The question was regarding if i could make the game work without changing the original bakground sprite frame to the "higher resolution" and instead changing the room's camera temporarely to "upscale inside the engine" if that makes sense?

If your intent is to keep low resolution in the room while having bigger resolution in GUI (more detailed UI and texts), then it is easily done with Viewport/Camera zoom. Assuming you keep the rooms small:

Code: ags
function on_game_start()
{
    Screen.AutoSizeViewportOnRoomLoad = false;
    Game.Camera.SetSize(low_res_width, low_res_height);
    Screen.Viewport.SetPosition(0, 0, Screen.Width, Screen.Height);
}


SMF spam blocked by CleanTalk