Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - eri0o

#181
Added a new version 0.2.0

This version should work with AGS 3.5.1 release too! If you are running the example usage code, in AGS 3.5.1 Overlays can't have the graphic property written to, so the code for that usage would be

Code: ags
DistFX fx; // somewhere with the same lifetime as the output surface while distorted
Overlay* ovr;
DynamicSprite* spr;

function room_RepExec()
{
  fx.Update(Room.GetDrawingSurfaceForBackground(), spr.GetDrawingSurface(), 2 /* effect */);
  if(ovr != null) {
    ovr.Remove();
    ovr = null;
  }
  ovr = Overlay.CreateGraphical(0, 0, spr.Graphic, true);
}

function room_Load()
{
  if(ovr == null) {
    spr = DynamicSprite.CreateFromBackground();
    ovr = Overlay.CreateGraphical(0, 0, spr.Graphic, true);
  }
}

Beyond this, there is no significant change in code.
#182
Don't use mp3, use ogg instead. If I remember correctly ogg files have a fixed bitrate and mp3 files can have a variable bit rate, when the mp3 has a variable bitrate it's length I think can result in a gap - but position in MS in both cases should work.

But overall, ogg can compress voice better than mp3, so you get a smaller file size too, so overall, I think it's always best to use ogg files. Really, mp3 is not a good file format and if you can you should avoid.

If syncing is a must, and it's only Voice, you can use Audacity to label your audio source and export your audio in sliced pieces - I recommend in Audacity also using fade in and fade out at each begin and end of sentence to avoid a puff sound, in this way, if you want later, you can also have it run in some dialog system, so that the text doesn't advance by itself and a person can press a key to advance a text.
#183
Engine Development / Re: AGS engine Web port
Mon 20/03/2023 15:34:52
Thank you for the tests. About iOS, I discovered the fullscreen API is not supported in iPhone, only iPad

https://caniuse.com/?search=fullscreen

There is a Safari specific fullscreen API, but it is also iPad only - and apparently Emscripten doesn't implement it. It appears this api may work better - but need to test this. For your iPad version specifically though, there's a toggle in the experimental toggles of your Safari browser that needs to be turned on.

The Safari specific API looks like is intended to be used only with Videos, but it is this: https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1633500-webkitenterfullscreen

About Emscripten I think I found a way to force it to generate a wasm code that MAYBE can be loaded in the iOS version you have, but I couldn't yet make it work, I can try later so we can test this.

Back to macOS Safari, I don't know yet what is going on. I think I can later try to use the Safari specific API and see if it makes it magically work. Edit: reading the Emscripten source code it looks like it can use the Safari specific API, I may need to set a specific variable at build time to make sure this actually is built in.

Found a really nice API for getting the real pixel size of things

https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/devicePixelContentBoxSize

Unfortunately it's not supported on Safari
#184
Engine Development / Re: AGS engine Web port
Mon 20/03/2023 11:30:57
Hey, the iOS Safari fix for the touch input has been merged and should be in the next AGS Editor release.
#185
Engine Development / Re: AGS engine Web port
Mon 20/03/2023 08:31:31
You just use System.Windowed, true is windowed and false is full-screen.

I forgot to ask, what happens when you use alt+enter?
#186
Engine Development / Re: AGS engine Web port
Sun 19/03/2023 21:18:14
The behavior on Chrome is expected, you need to interact to get it to go in fullscreen, it's a bit complicated, but the click interaction doesn't propagate inside the wasm and the fullscreen can only be initialized by user action, so you get this two step thing. There's no way to workaround this as we want to go through this to get SDL internals to sync with the state of the browser - if you go Fullscreen, then click to go to Fullscreen either with the gears button or with some in-game button, the state of SDL will be "wrong" and from there on you kinda get the sizes of things not working correctly. There is a way to workaround this, which would require to render the gears icon and the modal menu inside AGS Engine, if we do this, then the element we are clicking is the canvas and the canvas is the thing going Fullscreen, so this is the only way to have Fullscreen working without this two step. This may be a thing in ags4 at some point, but not right now. If you want to try this, you can edit the index.html to remove the gears button and add a Fullscreen button in-game, using a regular AGS GUI and button.

Fullscreen is a bit problematic that the size of Fullscreen is NOT your monitor resolution or whatever you expected but it's a mystery size that depends on the actual element that is going into Fullscreen (we draw things in a canvas) and if this size is bigger than the maximum that it would be possible, it fails to enter in Fullscreen (but doesn't necessarily reports a failure, it usually simply doesn't work).

So, just to explain a bit more, when using the itch icon what it does is like if your monitor enlarged and the window that the game is ran resizes to the size of this window - but if you query AGS in game it will still report that the game is windowed. The element that is fullscreen in this case is the html document.

Quote from: Manu on Sun 19/03/2023 20:39:20Instead on Safari for Mac 16.3:
- you click the gear
- the popup appears, and you click "toggle" -> nothing happens
- then you click inside the canvas -> it switches to full screen for a second, then goes back to normal (the itch icon works, instead)

I am curious if the in-game Fullscreen button would work in Safari, but it's possible the maximum size for Fullscreen is not calculated correctly there. I can check this later.
#187
Engine Development / Re: AGS engine Web port
Sun 19/03/2023 17:03:02
Quote from: Manu on Sun 19/03/2023 16:44:55Fix2 works too. Which one is better to use?

The second fix is I think closer to how it will be the solution in the end, so probably better to use that one.

Quote from: Manu on Sun 19/03/2023 16:44:55Unfortunately, the upscaling quality is very bad, but this is probably inevitable? It's strange because the iPhone has a very high resolution, I suppose there are enough pixels to upscale it better

There are, but the Safari on iPhone lies about it resolution and you need to use the resolution it says and deviceRatio to calculate the actual resolution.  Other devices usually lie a little less about their resolution, this is why it's usually not as perceptible in them.

But we aren't setting the resolution by hand, this is hidden by SDL and SDL uses Emscripten on top of it. I have been upstreaming fixes I find in these but there's a bug in it's highdpi handling (that is aware of deviceRatio) that causes the canvas size to grow indefinitely on going in and out of fullscreen, until it eventually crashes things. So highdpi handling from SDL is not used because of this.

There are some other things that makes this particular non-trivial, so haven't advanced much here. But right now the css size of the canvas is used to guess the resolution to use inside of it directly.

Quote from: Manu on Sun 19/03/2023 16:44:55I prefer to keep the fullscreen itch button, because it works on desktop, while the toggle full screen ags button doesn't seem to have any effect (at least on Chrome).

Wait, which Chrome? I am using Google Chrome (111.0.5563.65 64 bits) on Windows 10 and it works in your game. Can you tell me specifically what browser and OS you are getting this behavior?
#188
Engine Development / Re: AGS engine Web port
Sun 19/03/2023 16:22:40
@Dungeonation , in your acsetup.cfg, what do you have set for game_scale_fs ? I suggest using proportional for both the game_scale_fs and game_scale_win in the webport.

Code: ags
[graphics]
game_scale_fs=proportional
game_scale_win=proportional

@Manu can you try setting your game_scale_win to proportional ? It being small should be related to this I think.

About the stretching in the width, I am not sure what it could be, but this will take a while to figure it out. :/

Ah, the fullscreen button from itch can probably be disabled, and instead it's best to use the one in the engine.
#189
Engine Development / Re: AGS engine Web port
Sun 19/03/2023 16:14:28
I tried a new approach to fix this here : ags_web_ios_fix_v2.zip

Hopefully it works too?

Quote from: Manu on Sun 19/03/2023 16:05:24The only problem now is the size of the screen. I configured it 960x600 (the game is 320x200), but it's in a small rectangle in the center of the screen, both in landscape and portrait. The itch full-screen button doesn't have any effect.

Uhm... Is this anywhere or only in the iPhone Safari? Can you share me your acsetup.cfg ?

Quote from: Manu on Sun 19/03/2023 16:05:24While the "toggle fullscreen" ags button apparently only stretches the game horizontally.

Is this anywhere or just in iPhone Safari again?
#190
Engine Development / Re: AGS engine Web port
Sun 19/03/2023 02:55:15
@Manu I tried an idea here : https://ericoporto.github.io/agsjs/tst2/

If you want to try, replace your ags.wasm and ags.js files from your game with the ones from here: ags_web_ios_fix.zip
#191
Engine Development / Re: AGS engine Web port
Sat 18/03/2023 23:55:48
first, I think it was iOS 15.5 that Safari fixed the bug that Chrome fixed in their 100 version - I think some old version of Safari can load but it will crash at some point when running the game. So in the iPad mini you have it would not work - there's a function in ags that is a very big switch clause when it interprets the engine bytecode, and that function would have to either be rewritten or be generated with an old version of Emscripten (up to 2.0.16) where it used an old compiler that generated a less efficient version but that uses less stack memory.

now, on iPhone, finally manage to narrow down the issue

https://github.com/adventuregamestudio/ags/issues/1954

Now solving is a different thing, but at least it's understood now.
#192
I would have it signed on the left bar with a lightning bolt if it's linked by something, and if matches the style of something that's normally linked but it's not linked, have an exclamation, like this ⚠️.

Or would at most produce a warning right now.

I wouldn't automatically link things right now until the delegates idea advances, since that would probably change things.
#193
No, this would be an entirely different plugin. It would be something based in libcurl and need to be an unblocking request. I have thought about this in the past, what exactly you are trying to accomplish?
#194
First thing would be setting a date
:)

Cotswolds looks lovely
#195
#196
Hey! I am re-releasing this plug-in.

Added new download links at the top, now Linux and macOS builds are also included!

I have added a CI environment to my repository, hopefully with automated builds means anything that comes up will be easy to fix and produce a new release.

Edit: seconds after I noticed I made a small mistake in the code in the original version... I have remade the release and re-re-released! It only took me 50 commits in 6 hours to get this right  8-)
#197
If I remember correctly, right click is used for the PAN gesture in that AGS version, but you can still find that menu using shift+right click (just hold shift, and then right click).

That version is highly experimental and we haven't done any releases of it yet - not even alpha, I would recommend waiting some release is made before doing any sort of bigger project with it.
#198
When you say drop inventory items in empty space, do you mean something like, an inventory where you can place items in any specific place?

Because previously I understood as just not having the item as active, meaning, the cursor returns to normal.
#199
Uhm, I think you can do this simply by using

Code: ags
function gInventoryBar_OnClick(GUI *theGui, MouseButton button)
{
  player.ActiveInventory = null;
}

This is because, if something is on top of the gui that is clickable, it will run it's action instead of propagating the click to whatever is below.

I am going to comment the code you wrote, just to try to explain it - but I believe you should just use the code above.

Code: ags
// this is the OnClick event of the gIconbar GUI, it's on it's ⚡ event properties in the Editor
function gIconbar_onClick(GUI *theGui, MouseButton button){
    // the player has some item selected, so in the next block, we know this
    if(player.ActiveInventory != null{
        // There is no inventory item under the mouse (we use == for equality check)
        if(InventoryItem.GetAtScreenXY(mouse.x,mouse.y) == null {
          // I don't know what it was the idea in this code, so I am commenting it out of actions
          // inventory.AddActiveInventory
          // we set so there is no active item anymore, what was on player hand is back at the bag
          player.ActiveInventory = null;
      } else {
      // in case there was an inventory item below the mouse, we assign it as the active item for the player
      player.ActiveInventory = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
    }
  }
}
#200
Anãs regularly get his drawings on Reddit front page, so he is well known I believe.

One thing fun about AGS I discovered recently is if you use Google Scholar or some of these sciencetific paper specific search engines, Adventure Game Studio is mentioned in a lot of papers on a lot of places, including books. It's very interesting, and also very curious, lots of interesting things and observations but they do not show elsewhere.
SMF spam blocked by CleanTalk