Is AGS3.12 compatible with low resolution coordinates?

Started by EnterTheStory (aka tolworthy), Tue 23/03/2010 19:06:38

Previous topic - Next topic

EnterTheStory (aka tolworthy)

I recently converted several 2.72 games to 3.12, using 'low resolution co-ordinates in script.' The character startX and startX coordinates were automatically scaled to high resolution.

When I then ran the game, the startX and startY values were automatically doubled, so all the characters disappeared off the screen. So I manually changed all the startX and startY values. But now the behavior has changed, so they all appear in the top left hand corner of each screen.

Has anyone had any success with converting large and complex 2.72 games to 3.12? It's looking like the only option is to go through the code, line by line, and convert everything manually to high res.

EDIT: the problem with coordinates seems to be related to using RunAGSGame. That is, a game will show characters in the right positions when run directly, but run it through RunAGSGame and all startX and startY character coordinates double.

monkey0506

Is one game using high resolution and the other game using low resolution co-ordinates per chance?

EnterTheStory (aka tolworthy)

No, they all use low res. I've replaced all those initial values with scripted values and it seems to work, so far. I'm getting a lot of odd behavior when using RunAGSGame - see the other thread for an even bigger problem.

EnterTheStory (aka tolworthy)

I found a related issue with causes a similar problem, and it looks like system.viewport_width might be the problem. E.g.
Code: ags
Overlay.CreateGraphical((system.viewport_width- graphicWidth)/2,y,slot)


In the above example, running a low res game (old style coordinates) from a high res game will cause the graphics to be placed far off to the right. I'm guessing that a similar thing happens with startX and startY values.

The 3.12 help file says that system.viewport_width is in 320x200 coordinates, but this does not seem to always be the case.

If system.viewport_width is the problem then the solution is to never call it, and manually override any features that use it (e.g. startX and startY in the editor).

Does anyone know if there are other internal functions that use system.viewport_width?

Pumaman

Quote from: tolworthy on Wed 24/03/2010 00:58:54
No, they all use low res.
QuoteIn the above example, running a low res game (old style coordinates) from a high res game will cause the graphics to be placed far off to the right

Can you clarify whether you're mixing games with low-res and high-res co-ordinates with RunAGSGame? There might well be a bug with that, I can look into it.

EnterTheStory (aka tolworthy)

Quote from: Pumaman on Thu 25/03/2010 21:33:06Can you clarify whether you're mixing games with low-res and high-res co-ordinates with RunAGSGame? There might well be a bug with that, I can look into it.

Thanks. My first three games were made with 2.72 using low res (640x480, but internal units are 320x240). I imported them to 3.12 using the "scale script coordinates" option. My latest game and the front end are made using high res.

When testing high res to high res everything seems fine, but testing high res to low res (e.g. launch the front end and select one of the first few games) then there are issues. E.g. initial character locations specified in the editor, and any command that uses system.viewport_width.

SMF spam blocked by CleanTalk