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

#441
The most incredible revelation is that the whole thing is all static. I thought there was a server that provided the word of the day, but there isn't. All words from now to eternity are visible in the page JavaScript code.

Like, it could be done in AGS and use DateTime.Now to provide the word from a string array and be the same.
#442
Since 0.2.1 of rellax, I switched the camera position to use a float, and clamp to int positions when using it. I recently had an idea to move the viewport too along with the camera, with the residue of these positions!

Code: ags
    Game.Camera.SetAt(FloatToInt(_next_cam_x), FloatToInt(_next_cam_y));
    Game.Camera.SetSize(320, 180); 
  
    int residue_x = FloatToInt(_next_cam_x * 4.0, eRoundNearest) - FloatToInt(_next_cam_x) * 4;
    int residue_y = FloatToInt(_next_cam_y * 4.0, eRoundNearest) - FloatToInt(_next_cam_y) * 4;
    
    Screen.Viewport.SetPosition(-residue_x, -residue_y, Screen.Width, Screen.Height);


Above is an example of a game screen that is 1280x720, when the game camera is for a 320x180 game. This gives us an extra 0.25 times 4 positions we can move around

The effect looks like this: video_1.mp4, video_2.mp4.

It needs some adjustments, but with this, the camera smoothness can be made much better for lower resolution games. This is not yet implemented in rellax, but I am looking into and just thought I would share it here - the experimental commit is here.

Of course, going this route you need to have all your GUIs scaled up to compensate, which is not trivial as we are now in AGS... But, this is interesting still.
#443
Awesome! Let me know how it goes! Any ideas of things to add feel free to add here. :)

When I started, I wrote the features I had in mind to pursue, but of course I expect these and priorities can be adjusted as other people use it: https://github.com/ericoporto/agstoolbox#desired-features

A warn, I have not tested with AGS 4, because it has no releases so far, I have no idea what will happen.
#444
Hey! Thanks for the well written GitHub issue! I was able to understand and track down the issue! I made a new 0.2.2 release, I think it's working now, please verify!

I am also working on a new implementation which will make the camera work slightly different when it's tracking a character that is following a path vs a character that is walking by some other way, the idea is the character following a path we can guess how long it will take for the character to get there, and loosely track the camera towards it, instead of following the character steps. The problem with this approach is that while the whole world looks non-jerky, the character itself is looking a bit weird so far, balance both is being a bit hard...

I also did not forgot shaun, I am thinking about if I should figure a compatibility mode for people coming from Ali's module, haven't figured that yet though...
#445
I will be looking in to add in the next version a way to properly skip texts for this, but it may not be the final form we endup going, but I need something materialized to think.
#446
Question on cloning. Say in the future somehow is decided that the Graphical property (the sprite id) must be also a writable property, if the Overlay was created using a clone flag, does it mean it should copy on change and not really be a reference in that case? I am wondering if an Overlay should have an additional property for the Overlay type (say textual, graphical clone, graphical... ?)
#447
Quote from: AndreasBlack on Mon 02/05/2022 12:11:27
Just tried the new V3 and i'd made sure i've downloaded all the links this time  :-D In V3 i've noticed the character seems to get stuck around the first or second walk frame before walking away, sorta like running on a treadmill a millisecond (Thumbleweed template). Not sure what that is about ??? works fine otherwise, to the untrained eye, at least. Have you tried adding a view with one frame and added audio into the frame and see if it stutters all over? Say forexample the player wants a fist animation view and adds the sound in the view and pushes the button or holds down the button, does it stutter? In my mind, i don't think it should, if it does! Thanks

Sorry, but I don't think I added any handling of views here, is this something in your own code? Or is it something that happens when you click for the character to walk using the button of the gamepad to press a button on the mouse?

QuoteSkipping text and skippable blocking actions should be done in the engine IMO

Yes, but I think it needs it's own functions and place to store things. One problem is one can have two joysticks or more connected, and then they can save the game and load and have zero, there are things regarding the gamepad that seem to belong more in a config file than in an save state. But these depends on how much information is meant to be stored in these.

I will write down the bits of the problems I am trying to figure out, since, I do not have been able to figure the roadmap yet, maybe some of the problems I am thinking are just in my head and may not be that relevant for now. I revised a bit the notes on the original issue in GitHub, I will try to update there with things on my mind.

I really need people to play around with this and come up with the problems, that arise. :/
#448
on_ events don't happen when something is blocking. Also they are not good when you need to get something continuously, like keep the character walking.

I also think I am handling wrong the pointers in my code, I think ideally objects that represent the same index should get the same pointer - right now this is countered because you can't connect to the same joystick twice, and that is only factory function that produces gamepads. But in the engine I could theoretically pass the pointer of the pressed joystick in an on_ event so you could inspect which joystick/gamepad had the button pressed, which would be easy if the pointers were guaranteed to match. I am not sure the best approach right now to guarantee such uniqueness.
#449
QuoteOne optional idea is to have gamepad buttons merged with eKey codes. The benefit of that is that you may assign them to the same variables as keys, both in engine API properties, and script variables.

That is interesting, but I think I prefer to figure some dedicated way to do so, Gamepads have predefined buttons but joysticks don't. But I will keep that approach in mind as a fallback in case things don't work the way I hope.

Things like, multiple Gamepads/Joysticks, I must keep in mind and try to not clash parts that would be helpful to most and the full range of possibilities, like couch co-op.

About on_gamepad_press, I will at some point, but it's not very useful right now (can't skip text) so I will keep using repeatedly execute always at this time. I wonder if for gamepad -> mouse mapping there's something better we could do at this time, like click and holding isn't possible, because there's no way to force a button state in the mouse...
#450
Updating to 0.2.0!

  • additional StandstillCameraDelayY, CameraLerpFactorX, CameraLerpFactorY, CameraWindowWidth and CameraWindowHeight attributes;
  • defaults have changed, hopefully they are more useful for Adventure Games;
  • Camera interpolation now uses a float camera position and this position is synced occasionally to the Camera, this should fix the issue reported by Flugeldufel here...;
  • demo is now built using AGS 3.5.1.17;

If someone would like to come up with a demo room that uses parallax and is a more traditional adventure game room, please hit me up, I did not have any ideas and also Adventure Game assets are hard to come by, so if you have an abandoned one, or have the art chops, send it my way.

I will at some point answer other things, I am still thinking about Laura's issue with traditional AGS walking characters that have MovementLinkedToAnimation, so far the only way I could come up is to have an additional character with anti glide off and move both at the same time, with the camera targeting the second... Unfortunately that is not very portable to put in a module...

Quote from: Tarnos12 on Mon 21/02/2022 21:03:27
Hello,

I have a question regarding this module.

Is there a way to snap camera to the player x/y position on room load?(before fade in)
It looks weird when the camera moves when entering new area.
I would like the camera to be at the center(including offset) when entering new room.

Can this be achieved?

Thanks

Updating to 0.2.1!

Not sure if I understood, made a new 0.2.1 release, added AdjustCameraOnRoomLoad property, default is true, it should quickly adjust the camera on room load, you can set it to false to keep the old behavior if you miss it! Please verify if this is enough.




I am currently investigating if there are better ways to provide smoothness as the current implementation may not be as smooth in some cases, like low resolution and slow characters... Finding lots of interesting stuff in other places too.

I am also investigating a camera specific to following a character walking a path, if I can estimate the time it takes for the character to reach the destination and I know the destination, I can do something similar to a camera tween to that instead of directly tracking the player, and in this way I can ignore the stepped interval the character normally moves on screen.
#451
Was just playing around with Room Overlays, figuring out what could be done with unlimited things in the room!

#452
Added a deadzone parameter in GetAxis and updated the description above to explain how it works.

This allows switching the code to a slightly simpler comparison. It will also nudge in the importance of deadzone if someone wants to modify the parameter.

Code: ags
float gamepad_mouse_x, gamepad_mouse_y;
bool update_mouse;
bool prev_button_a_pressed;

void repeatedly_execute_always()
{
  if(pad != null)
  {
    if(pad.IsButtonDown(eGamepad_ButtonA) && !prev_button_a_pressed)
    {
      mouse.Click(eMouseLeft);
    }
    
    prev_button_a_pressed = pad.IsButtonDown(eGamepad_ButtonA);
    
    float x_lstick = pad.GetAxis(eGamepad_AxisLeftX);
    float y_lstick = pad.GetAxis(eGamepad_AxisLeftY);
  
    if( x_lstick != 0.0 || y_lstick != 0.0 )
    {
      if(update_mouse) {
        gamepad_mouse_x = IntToFloat(mouse.x);
        gamepad_mouse_y = IntToFloat(mouse.y);
        update_mouse = false;
      }
      
      gamepad_mouse_x += 8.0 * x_lstick;
      gamepad_mouse_y += 8.0 * y_lstick;
      
      mouse.SetPosition(FloatToInt(gamepad_mouse_x, eRoundDown) , 
                        FloatToInt(gamepad_mouse_y, eRoundDown));
    } else {
      update_mouse = true;
    }
  }
}


Note for the web port:

  • mouse SetPosition is not allowed unless the game enters in fullscreen once (through either alt+enter or by script, but only after the player clicks on the screen once). We would need to support a fake mouse and some way to click in a specific position to circumvent this, but I am not sure how to handle this at this time. This is because a Browser protects you from evil websites that may want to hijack your mouse.
  • after the game is loaded and in focus, you need to hit one button in the joystick at least once, before the browser recognizes it for that tab and we can find it.

Edit:

I ninjad a new update to v3 itself, just a small adjustment to guarantee the float values from GetAxis are always sane.
#453
I cannot reproduce... Are you sure you are using the new V2 version I provided above and not the previous V1 version that was available before? In V1 GetAxis was giving an integer, but now in V2 I changed to a float, because I felt it was easier to people understand the range available.

If someone else could try too, it would be great.  (roll)

Edit: I may implement an additional axis_deadzone parameter in GetAxis to simplify code for this.
#454
Small update, just switched GetAxis to provide a float value. An example usage is added in the code of the example project as follows:

Code: ags
#define DEAD_ZONE 0.125
float gamepad_mouse_x, gamepad_mouse_y;
bool update_mouse;
bool prev_button_a_pressed;

void repeatedly_execute_always()
{
  if(pad != null)
  {
    if(pad.IsButtonDown(eGamepad_ButtonA) && !prev_button_a_pressed)
    {
      mouse.Click(eMouseLeft);
    }
    
    prev_button_a_pressed = pad.IsButtonDown(eGamepad_ButtonA);
    
    float x_lstick = pad.GetAxis(eGamepad_AxisLeftX);
    float y_lstick = pad.GetAxis(eGamepad_AxisLeftY);
  
    if( x_lstick < -DEAD_ZONE || x_lstick > DEAD_ZONE ||
        y_lstick < -DEAD_ZONE || y_lstick > DEAD_ZONE )
    {
      if(update_mouse) {
        gamepad_mouse_x = IntToFloat(mouse.x);
        gamepad_mouse_y = IntToFloat(mouse.y);
        update_mouse = false;
      }
      
      gamepad_mouse_x += 10.0 * x_lstick;
      gamepad_mouse_y += 10.0 * y_lstick;
      
      mouse.SetPosition(FloatToInt(gamepad_mouse_x, eRoundDown) , 
                        FloatToInt(gamepad_mouse_y, eRoundDown));
    } else {
      update_mouse = true;
    }
  }
}
#455
Thanks Mehrdad! I still need to figure more things, but I wanted to throw together a basic one, since with SDL2, we can roll joysticks for all platforms at the same time when support is in the engine itself. :)

Also sketching the API with users because things on the Engine are hard to change.
#456
Experimental Editor with AGS with Gamepad support!

Download Editor Here: >>AGS-3.99.106.0-Alpha3-JoystickPR.zip<< | installer | Code Source | GitHub Issue | GitHub PR

First the concepts, joystick means a generic input device comprised by binary (button) and analog (axis) inputs. A Gamepad means something that is vaguely close to a Xbox360 controller.

We can expand the API later, but the basics is joystick connection and disconnection is handled inside the AGS Engine and we can skip things by pressing A,B,X,Y or the symbols in PS controller.



@Alan v.Drake made a beautiful test project!



Playable AgsGameGamepadV4.zip | project | Online https://ericoporto.github.io/agsjs/gamepadtest/




Joystick Static Methods

Joystick.JoystickCount
Code: ags
static readonly int Joystick.JoystickCount
Get the number of connected joysticks. No joysticks should return 0!


Joystick.Joysticks
Code: ags
static readonly Joystick* Joystick.Joysticks[int index]
Gets a joystick by index from the internal engine joystick list.


Joystick Instance Attributes and Methods

Joystick.IsConnected
Code: ags
readonly bool Joystick.IsConnected
True if joystick is connected.


Joystick.Name
Code: ags
readonly String Joystick.Name
joystick name.



Joystick.IsButtonDown
Code: ags
bool Joystick.IsButtonDown(int button)
checks if a joystick button is pressed, by index. DPad is usually mapped separately as a hat.


Joystick.GetAxis
Code: ags
bool Joystick.GetAxis(int axis, optional float deadzone)
get a joystick axis or trigger, trigger only has positive values, by axis number. Values varies from -1.0 to 1.0 for axis, and 0.0 to 1.0 for triggers.


Joystick.GetHat
Code: ags
eJoystick_Hat Joystick.GetHat(int hat)
returns hat value


Joystick.AxisCount
Code: ags
readonly int Joystick.AxisCount
get the number of axis in the joystick


Joystick.ButtonCount
Code: ags
readonly int Joystick.ButtonCount
get the number of buttons in the joystick


Joystick.HatCount
Code: ags
readonly int Joystick.HatCount
get the number of hats in the joystick



Joystick.IsGamepad
Code: ags
readonly bool Joystick.IsGamepad
True if joystick is a valid gamepad connected - this means SDL2 recognized it as a valid GameController and has successfully mapped it's buttons to an Xbox360 gamepad.


Joystick.IsGamepadButtonDown
Code: ags
bool Joystick.IsGamepadButtonDown(eGamepad_Button button)
checks if a gamepad button is pressed, including dpad.

Possible buttons:
  • eGamepad_ButtonA
  • eGamepad_ButtonB
  • eGamepad_ButtonX
  • eGamepad_ButtonY
  • eGamepad_ButtonBack
  • eGamepad_ButtonGuide
  • eGamepad_ButtonStart
  • eGamepad_ButtonLeftStick
  • eGamepad_ButtonRightStick
  • eGamepad_ButtonLeftShoulder
  • eGamepad_ButtonRightShoulder
  • eGamepad_ButtonDpadUp
  • eGamepad_ButtonDpadDown
  • eGamepad_ButtonDpadLeft
  • eGamepad_ButtonDpadRight


Joystick.GetGamepadAxis
Code: ags
float Joystick.GetGamepadAxis(eGamepad_Axis axis, optional float deadzone)
get gamepad axis or trigger, trigger only has positive values. Values varies from -1.0 to 1.0 for axis, and 0.0 to 1.0 for triggers.

You can optionally pass an additional parameter to use as deadzone. If an axis absolute value is smaller than the value of deadzone, it will return 0.0. Default value is AXIS_DEFAULT_DEADZONE, which is for now 0.125, use the name if you need a number.

Possible axis and triggers:
  • eGamepad_AxisLeftX
  • eGamepad_AxisLeftY
  • eGamepad_AxisRightX
  • eGamepad_AxisRightY
  • eGamepad_AxisTriggerLeft
  • eGamepad_AxisTriggerRight


CHANGELOG:
  • v1: initial release
  • v2: GetAxis now returns a float
  • v3: GetAxis now has an additional dead_zone parameter. Default value is GAMEPAD_DEFAULT_DEADZONE, which is for now 0.125, use the name if you need a number.
  • v4: Using correspondent A,B,X,Y buttons can skip Speech and Display messages, as long as you Connect to the Gamepad.
  • v5: ditched Gamepad-only approach for a Joystick first approach similar to löve.
  • v6: connection and disconnection handled in-engine, new AGS 4 approach.
  • v7: api renamed get,getcount to instead retrieve from array of joysticks, also fixed save/load game bug
#457
Hey, I know no one asked, but just thought about mentioning. Since this module can leverage files in the game installation directory, if someone doesn't want to do that, and instead want to have the files packaged with the game, since AGS 3.6.0 it's possible. Simply, create a directory at the root of your project, name it say "lipsync". Then note in the property below in General Settings. In the game code, when asked for the path for the files, use "$DATA$/lipsync", to find the files inside the AGS Game package.

Spoiler
[close]
#458
I don't have much to add about 1 at the moment, but I reopened the original room overlay issue, which I had closed when we were at the initial implementations of the SDL2 port, when things were a bit uncertain.

I don't remember about Texture cache, if this was discussed here or separately, and I also couldn't find an issue specific for it, but I think 1 as is gets a bit faster if there's some way to do this.
#459
AGS Toolbox🧰 version 0.4.0

Get Latest Release agstoolbox.exe | companion atbx.exe | GitHub Repo



Hi, I made something intended for those that deal with multiple versions of AGS Editors and multiple AGS Game Projects. Place the agstoolbox.exe in a folder under your user, like "C:\Users\MY_USER\software", before you run it.



After you run the agstoolbox.exe, you will find a bluecup in your indicator area of your taskbar, near the clock area. Double click or right click it, to open the main panel.

Features
  • Editors that you install using AGS Toolbox are called Managed Editors, as they are managed through the tool. Just double click in any Editor available to Download to get one.
  • Editors you have acquired through other means (like installed through Chocolatey), are called Externally Installed Editors, directories to look for can be configured in the Settings.
  • Game Projects are looked for in directories set in the Settings. It will understand the Editor Version it was used to create, open in it by simply double clicking. You can also use right click to open in a different version.
  • You can add it to your Windows initialization if you want a quick shortcut to AGS game development (it's in the settings menu)

Right clicking any item on the list will show available actions, double clicking will execute the command marked in bold.

I made it initially for myself to help handle my own games and modules. It will, in future, have an additional pair tool, that will provide the same functionalities through a command line interface - intended for CI and automation.

For people in Unity, this may be a similar AGS version of the Unity Hub. I actually modeled it on the JetBrains Toolbox, which I use to manage different versions of CLion, Android Studio and PyCharm - it's also developed in PyCharm!

Command Line Usage

NOTE: On Windows, due to OS and PyInstaller limitations, agstoolbox.exe doesn't work with command line arguments, so atbx.exe is for exclusive command line usage.

Code: bash
$ atbx --help
usage: atbx [-h] [-s {bash,zsh,tcsh}] [-v] {list,install,open,build,settings} ...

agstoolbox is an application to help manage AGS Editor versions.

positional arguments:
  {list,install,open,build,settings}
                        command
    list                lists things
    install            install tools
    open                open an editor or project
    build              build an ags project
    settings            modify or show settings

optional arguments:
  -h, --help            show this help message and exit
  -s {bash,zsh,tcsh}    print shell completion script
  -v, --version        get software version.

Copyright 2023 Erico Vieira Porto, MIT.

As an example, a command line to force install the latest 3.6 AGS Editor, as a managed Editor is as follows

Code: bash
$ atbx install editor 3.6 -f
Will install managed AGS Editor release 3.6.0.47
 Downloading... 40475597/40475597 B |████████████████████████████████| AGS-3.6.0.47.zip
Extracting...
Installed release 3.6.0.47

The command line interface is working, but it is still quite limited, if you have more needs for it, please ask me!

Tab completion is also provided, the script for it can be generated with -s parameter, if you need help setting up just ask.



Experimentally, AGS Toolbox is also available on PyPI. Prefer the exe releases above for now, the PyPI releases are intended for uses of it's core parts and the atbx command line utility in a future continuous integration tool.



AGS Toolbox is written in Python, so if you are interested in a new feature and want to contribute code, just ask me and I can explain the basics of it.
#460
Meaning we need an entry for May?
SMF spam blocked by CleanTalk