Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / set virtual resolution. does it really scale well between devices?

Author
Message
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 2nd Feb 2012 21:21
i am finally working with AppGameKit (trial), and i would like to know from some people who have experience

does SetVirtualResolution() really scale well to different devices?

i want to know what resolution to develop my app in ,
and i want to have total control over where things are,
so i want to choose a resolution.
*but*
i want it to scale.

can anyone speak from experience one way or another, does it work?

Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 2nd Feb 2012 22:17 Edited at: 3rd Feb 2012 02:05
I set my code for a specific resolution and device yet on hindsight I wish I set up a Percentage based Resolution for scalability for other devices (Such as Tablets). There's some great code in the UCFP page that's great for helping with Percentage systems you should check out.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Feb 2012 00:07
Quote: "does SetVirtualResolution() really scale well to different devices?"

Try it out for yourself.

You have control over two things when using the virtual resolution. You control the physical size of the screen which can be customized in the setup.agc and you can control the virtual resolution via the SetVirtualResolution command. It is important to know that these are two different things.

You can have a Virtual Resolution of 1024x600 inside a screen of 480x480. But there is a catch, black borders will be visible when the aspect ratio of the virtual resolution isn't the same as the physical screen resolution.

A small demo:


Change test out different virtual resolutions and different screen resolutions. The 'white space' is where your game will take place. You can't do anything about the black space at this point.

Hope this helps.

Greg_C
13
Years of Service
User Offline
Joined: 22nd May 2010
Location:
Posted: 3rd Feb 2012 02:15
Does this scaling effect physics at all? For instance when you change the size of an object it changes the mass unless you set it yourself so when you change the resolution and the size of objects change will this effect the mass of the object?
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Feb 2012 03:01
Quote: "Does this scaling effect physics at all? For instance when you change the size of an object it changes the mass unless you set it yourself so when you change the resolution and the size of objects change will this effect the mass of the object?"

I haven't actually tried (haven't done a lot of physics work) but in theory, no. I think all it does is just changes the render, the actual drawing of your game, not the size of sprites. So your physics sprites should be fine.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Feb 2012 09:54 Edited at: 3rd Feb 2012 09:58
Quote: "Does this scaling effect physics at all?"

No, you set the size of the sprite and its mass is based on that. You can think of the screen as if you are looking at a tv screen. The "View Offset" is the part of the 2D world you are looking at (top left of the screen) and the "View Scale" is how close you are to it (a scale of 1.0 is the world at actual size 2.0 would be double size etc.)

IBOL, in answer to your original question, yes it does scale it. If you set the resolution to 320x240 and then go fullscreen your whole scene will scale up (at the same aspect ratio) but not become pixelised. The actual resolution scales up but the positioning system doesn't so if (after going full screen) you position a sprite at 160,120 it will be positioned at the centre of the screen. You can also set mag and min filters to decide how sprites look when scaled up or down.

IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 3rd Feb 2012 21:14
well, thanks to all, good answers.

now on to my next headache...:

Files. i can't get any data trying to read them.
i might start a thread unless someone addresses it here.
when i try the examples, the actual data files are invisible,
so i can't see what they're using.
and when i make my own, it says they exist,
but won't read them.

i don't care if "Data" statements are "Legacy".
they work and we should have them for some things.
(/irrelevant rant)

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Feb 2012 21:43
An example of the code you're using might help?

IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 4th Feb 2012 04:52
my file tribulations...
i got halfway there, but am baffled as to my problem.

this shows that at least some data is being read from the file:



here i try to put the data i read into a variable d$[]
it displays no results when i try to print it.






here is " Formdat.txt "
(it is meaningless, but is an example:


Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 4th Feb 2012 08:30
If you change ReadString() to ReadLine() it works.

Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 4th Feb 2012 13:22 Edited at: 4th Feb 2012 13:22
I use ReadLine() for reading all data be it string or integer.

AGK Documentation: ReadLine()


My example usage.

IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 4th Feb 2012 15:59
well, you guys are right, using readline() works. so thanks.
i feel like that's a bit buggy behavior , but i'll take it!

now i can start building my data files.

IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 4th Feb 2012 18:52
datafiles working, resolution chosen.
thanks again!

Login to post a reply

Server time is: 2024-05-06 04:37:49
Your offset time is: 2024-05-06 04:37:49