AGS engine Web port

Started by eri0o, Wed 26/05/2021 02:45:17

Previous topic - Next topic

Crimson Wizard

#140
Quote from: uma on Thu 05/10/2023 13:36:08It's a first person game with only about 40% of the screen used for what I'd think of as the "room" in a regular 3rd person p&c with the rest being UI. The other 60% of those 5 images is mostly empty white space, with some "noise" behind where the UIs sit to give them some life. I knew this was inefficient when I started but I couldn't see how how to get a room background image to be anything other than stretched across the whole screen, and equally wasn't sure how to animate UI elements, so I padded all the backgrounds.

Padding also counts when loading or drawing images, as pixels are data regardless of whether they represent anything in the game.

This belongs to the tech help forum section, but from a quick glance this may be resolved by either:
1) having a smaller object or overlay on background, and animating that;
2) configuring room's viewport and camera so that the room is displayed exactly the size you want. This will also allow to have rooms of smaller size than the game itself. (See Viewport and Camera sections in the script API in the manual)

eri0o

@uma , try setting filter = linear in in the Editor, in your project Default setup - I forgot the exact name of the setting. If this doesn't change a thing on macOS, I believe there is a directory where the save files goes, so perhaps an acsetup.cfg is there.

I also think it's valuable to share a full-resolution screenshot of your room in case others have ideas.

@Crimson Wizard I think when downscaling, we always want linear filtering, maybe the solution would be to have a different setting for when upscaling and when downscaling, so they could have different defaults.

kikiMa

Hello, first of all, thank you for this fantastic software. :)

I am currently working on my first game, and unfortunately, I have encountered the following issue. The game is intended to be published on the web, but it is not running on Firefox. I have searched on Google but couldn't find any relevant information. Is it possible that I have overlooked some setting? :confused:

I am receiving the following error message:
"AGS Alert
Unable to initialize SDL library.
Gamepads not supported
Make sure your browser is compatible with SDL2 Emscripten port."

I would greatly appreciate any help with this issue. Thank you! 8-)

eri0o

#143
That sounds like a bug in SDL2, but just out of curiosity, do you have actual gamepads connected to the computer? If you do does disconnecting makes it work? Can you share information that helps identify the exact gamepad you have (a serial number would be sweet, but at least brand and name).

In AGS the issue is we initialize the video, audio, gamepad and all subsystems together - so if any of them fails, ags fails entirely. It would be best to initialize them separately, so we can recover if the system in the particular platform can be dismissed - which I think that gamepad for the web port is one we could survive errors that appears.

But there has to be an error in SDL2 too, because even if your gamepad is not supported, it should not block the gamepad subsystem from initializing entirely - it should be possible to connect later one or more gamepads and those may be supported.

The fix on AGS side should be very easy, but in SDL2 there are two things: add support for your gamepad, and making it not fail the entire system. The gamepad is only relevant for ags4, I don't remember why it's initialized in ags3 too.

kikiMa

Thank you very much for the quick response!

Hmm, that's strange. I'm not using any gamepads, and I've tested it on different PCs. It also works on Chrome, Safari, etc. Is there a way to exclude gamepads in the scripts at some point?

Crimson Wizard

Quote from: kikiMa on Mon 09/10/2023 08:20:31Hmm, that's strange. I'm not using any gamepads, and I've tested it on different PCs. It also works on Chrome, Safari, etc. Is there a way to exclude gamepads in the scripts at some point?

It's not your problem, it's the engine's issue, it has to be fixed in the engine.

kikiMa

hmm Ok.
Thank you nonetheless!

eri0o

@kikiMa , as mentioned by cw, there is an issue in ags and it should be fixed in the next update. Still, I am trying to understand what happened, you mentioned you don't have a gamepad and that it works in different browsers. Does it means it has the same error in different browsers or you only have this error in a specific browser? Do you see this error in other PCs? Sorry for the additional questions, it's just that this may indicate a problem in SDL2 too, so I would like to look into that too.

Regardless, it should work without this issue in the next AGS update.

RootBound

I'm working on a game with an "export text" feature that saves data to an external text file. Does that work in web versions?
J. They/them. Here are my most recent games:

eri0o

You can't download that specific file. If you are saving it in the same directory as saves, they will be persisted - so you can load it from the same place next time the game opens in the same browser.

RootBound

Hmm. I wanted it to be a plain .txt file the player could keep if desired. Sounds like that won't work for the web port.  :-\
J. They/them. Here are my most recent games:

eri0o

I haven't properly tabulated this, but I guess at some point I (or someone motivated) has to inspect the iframe a of the webstores (itch io, gamejolt, Newgrounds, ...) and make a relation of what types of Feature-Policy are allowed in those. This would give a general idea of what is allowed and what isn't.

---

My general feeling towards file download is that it's best to have it inside a Share action instead, which can have files attached to it. This is more portable - in Android these translate to intent. This avoids having to concede file permissions to an app and instead allows to work with these as they are needed - general file access in Android would require blank permission access to files, which is weird for a game.

Unfortunately SDL doesn't include anything similar to a share action so we would have to either maintain our on or contribute some version of this for SDL. I think in this specific case MAYBE maintaining our own is easier, but I would need to think about this.

RootBound

Thanks, good to know. It's not an urgent issue and I may just make that feature available on the download version only.
J. They/them. Here are my most recent games:

SMF spam blocked by CleanTalk