Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetRoomMask() for Walkbehinds in game resolution #1883

Closed
WallucePinkham opened this issue Jan 5, 2023 · 9 comments
Closed

GetRoomMask() for Walkbehinds in game resolution #1883

WallucePinkham opened this issue Jan 5, 2023 · 9 comments

Comments

@WallucePinkham
Copy link

WallucePinkham commented Jan 5, 2023

Describe the problem
I would very much like to use the walk-behind mask in my plugin, but I can't because according to the documentation:

The walk-behind mask is exactly the same size as the room, and is at the current resolution. For example, a 320x200 room, being run > at 640x400 in the engine, will give you a 640x400 bitmap.

The walkable area, hotspot and region masks are the size of the current room, but at the 320x200 resolution.

Suggested change
Can we please have a walk-behind mask that is in the 320x200 resolution?

@ericoporto
Copy link
Member

ericoporto commented Jan 5, 2023

Did you test if it really works in this way? In the past I copy pasted the plugin docs from the website without testing.

I think the comment there is from a special case, in the past AGS had only two resolutions, 320x200 and 640x400. That part of the docs is probably just incorrect.

Opened an issue here: adventuregamestudio/ags-manual#212

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Jan 5, 2023

The documentation is wrong, and refers to the very old quirk in AGS engine.

Back in a day AGS did not use proper graphics scaling to the window size, and instead scaled whole game coordinate system. So, running 320x200 game scaled x2 would actually scale not only the gfx, but also the inner logic.

Today all this is in past, and game's logic always works with the native coordinates.

If, on another hand, it still works as mentioned there, I believe this should be considered a bug. So, testing is required.

For the reference, this quote is from plugin API documentation:
https://adventuregamestudio.github.io/ags-manual/EnginePluginRun-timeAPI.html
Paragraph IAGSEngine.GetRoomMask.

@ivan-mogilko ivan-mogilko added res: needs testing issue needs (re)testing to update its status context: plugin api labels Jan 5, 2023
@WallucePinkham
Copy link
Author

Hi, I did test this after I posted and it does seem to be 320x200. Do you think it would be possible to update the docs?
Thanks for your prompt replies and help.

@ericoporto
Copy link
Member

ericoporto commented Jan 6, 2023

Yes! I am updating. In this specific case, afaict the mask is the specific size of the mask, which is usually the size of the room, but in newer ags versions you can actually have a smaller walkable area mask that gets stretched/upscaled, but in the plugin you will get it's original size. Resolution doesn't play a part.

@WallucePinkham
Copy link
Author

WallucePinkham commented Jan 6, 2023 via email

@ericoporto
Copy link
Member

Thanks for pointing this! Updated this specific topic here:

https://github.com/adventuregamestudio/ags-manual/wiki/EnginePluginRun-timeAPI#iagsenginegetroommask

Will look into other outdated mention to resolutions.

@WallucePinkham
Copy link
Author

WallucePinkham commented Jan 6, 2023 via email

@ericoporto
Copy link
Member

It is probably best to ask things in the forums explaining what you are trying to do.

From what I remember they are made into overlays and drawing using the script functions magically rebuilds them, but the plugin api I don't think it works this way, so in case you want to edit them, you may need to invoke the script api to draw a single pixel somewhere to trigger the rebuild of the walkbehinds masks. But this is better to explore in the forums.

@WallucePinkham
Copy link
Author

WallucePinkham commented Jan 6, 2023 via email

@ivan-mogilko ivan-mogilko removed the res: needs testing issue needs (re)testing to update its status label Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants