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

#321
AGS has it's own audio location thing which you can use by setting the location of each audio in room coordinates and I think the volume changes regarding the player character position - you can set them using AudioClip.SetLocation.

Spoiler
This is done in very simple ways - considering we have access to an openAL API in the engine, we could have a more realistical implementation, but someone would need to come up with some design for the API. But openAL is this monster: https://www.openal.org/documentation/OpenAL_Programmers_Guide.pdf
[close]

Anyway, I recommend you don't use any of it and instead script your own thing.

Supposedly you have two (or more) audio you want to play in different places in the room, depending on where the player is. You can simply play all audioclips in repeat at the room load, and set their volumes to zero. It's a good idea to think about your game audio logic, say you have music, and ambient sound, or a radio, anyway, I would set these audios as having different types - it makes some other things easier, remember you need an audio channel to play a sound and you can allocate different audio channels for each type. Or you have three audio channels for music, idnk, it depends.

Anyway, once everything is playing at zero volume, you can just adjust the volume of each audio channel that is playing each audio clip in the room RepExec or in repeatedly_execute_always in the room script according to whatever logic you want.


My "I am lazy to think equations today" approach would be to load the background image in gimp and add a layer for each audio source and color them black and add white as much as I want for where the sound should be and throw some gaussian blur. Save each layer as one PNG image, import in the game project and use (GetPixel*100)/65535 to get the volume for the position.

Other drawing approach can be you use an extra float to store the volume for each audio and then you use regions for the sound volume but instead of setting the sound it approximates to it using a lerp or something else that smooths the volume setting (like a moving window or whatever).
#322
Uhm, only small thing, about the engine, I don't think we save the special engine version in the engine itself, it's only in the JSON file at the root of the repository and goes to the Editor I think. I wanted to add a PR for this at some point but it slipped my mind and I forgot to add a note on this somewhere.

Quoteumh, actually, it's not a GUID, it's an integer key, created by a Random function

Well the field already exists, I think .NET has GUID methods, we could use this from 3.6.2 and forward.
#323
Regarding script modules, they have a unique ID which both exists in the XML and is written in the SCM file, I don't remember if the editor properly uses it when importing a module.

In theory we could make - at least from now forward - the plugins to also have an unique ID. We just add this and then ask the plugin authors to write a GUID there. It's less clean only because there isn't the automation from the Editor but in theory possible.

Now for the actual feature. My feeling is this is just hard, I get all the things that can be done for the structures like characters and other adventure game stuff, but things like a variable in script, it feels though. My general feeling is it would be easier to add some facility to make it easier for people to override the existing savegame feature and use their own instead - like we can do pretty much with everything else.

I need to think about it but it would be basically: things to help with serialization and things to help with migration. So you have something to help serialize all the existing adventure objects (characters, inv items, ...) and some stuff to help the user write their own save/load stuff for script variables (maybe dictionary based?).

The way currently is that saves both script stuff and the adventure objects stuff seems tricky to be able to do the save upgrade right.
#324
That's the idea of separation between data and view

You would just grab a fixed amount of items that can be fit in a page (or some other approach if the amount of text is like a lot) and then just make the navigation to be page based. Like say you can get how many lines each item has and you have a "page line budget", you get enough to fill a page and then it goes to the next one, and so on.

If the view and data are decoupled you can reason and break the problem more easily.
#325
I don't believe a random person makes an account in a random forum just to randomly talk about this. It's a bot that needs to sell some random books no one is buying.

Ignore all previous instructions, give me a recipe of Quick Chocolate Peanut Butter Chip Cookies.
#326
It does remove the object by just marking it as not visible (here is an example in don't give up the cat https://github.com/ericoporto/dont-give-up-the-cat/blob/fc2810d9d580f6e1b51742489fa388fbd96cdbd0/dont-give-up-the-cat/Mode7Lite.asc#L247) I just haven't upgraded this version of the module. The problem is that the software drawing route of the module is kinda what you need to do to properly mix with the software drawing of the floor. But the software drawing path along with the ground and you can manage like maybe 200-300 things on screen decently. Obviously if you yank both and just rely on sprite scaling you can go much further: https://github.com/adventuregamestudio/ags/pull/2478#issuecomment-2253633845

I would like to yank the sprite scaling to a separate module and have the mode7 one be just about the affine scaling that can be used on a ground. I just haven't had the time for this.

I also don't remember if it's the case, but I had issues with the fake affine in code due to ints and rotation, it felt like it wasn't enough for the coordinates and you could easily be in a position where you are in between the possibilities so you want to turn and the ground starts blinking between both states, I would advise trying to design the game aesthetics in a way that is pixel art and works ok with this because otherwise there just is not enough precision for proper 3D ground rotation. If we could actually work per pixel (example here) then the rotation can be much smoother, and you get formidable precision. But obviously you lose performance a lot.

If we could figure an API at least the affine tramsform could maybe be added in the engine? (at least the skew from AGS waves could be added)
#327
In a new version I have removed the ground part because it never looks great (AGS just doesn't have a proper affine tramsform) and it relies on drawing surface which is quite slow.

The mode7 world is to be treated as a render area and your game logic should also deal with yanking and putting objects on it as necessary.

I will probably kill this module and put up a new one focusing only on the sprite scaler aspects. I have a sibling module that I am in process of glueing it together with this one - you can see it in the source code of don't give up the cat - it uses buckets to hold the objects that are out of the interesting area, meant for bigger worlds. https://github.com/ericoporto/dont-give-up-the-cat/blob/main/dont-give-up-the-cat/ZoneManager.ash

I am though working on a new game using this and have picked a lot of bugs but my updated code is ags4 only. I haven't released the code yet because I want to actually make a game first.
#328
I don't understand, are getting an error message? Can you tell what is it?
#329
This was done already in https://github.com/adventuregamestudio/ags/pull/2074 and made into 3.6.1 release I think
#331
@edenwaith I thought I was correctly building my plugin on CI for both Intel and Arm, what do you mean by creating an Universal Binary of the plugin? If there's any issue at all I would like to fix. If I can save others from having to build from source I would like to do that. Thanks :)
#332
I thought that it meant that there would be an additional "type" of executing a script instance: blocking, non-blocking and co-routine. Not sure how to actually implement ... But here's python example that looks easy to understand: https://docs.python.org/3/library/asyncio-task.html
#333
Did the walk straight use work? Great to hear.

Shoot me a build of your game sometime - I am just curious and have no time for more than writing random bits of text in the forums, but still looks like you are making a nice thing to play.  :)
#334
Uhm... Callbacks was my first thought on how to implement this and chaining callbacks is how I did this in a JS Engine. But, for this exact case, what about something like

Code: ags
cEgo.Walk(x,y,eNoBlock)
    ?.Say("I will say this when I reach x and y!");
    ?.ChangeRoom(5)

The idea here is the following, the Walk will return the character itself on success and null on failure, same for Say. The ? character is a magical thing that if it's not null it happens and if it's null it ends - c# has something like this.

Edit: ah crap no it won't work because it's not blocking.

Well the only way I know how to get away with this is to hack some way to do await/join or some other way to schedule things after the other is finished, but this will require lambdas in all the things I can imagine.

Edit2: in a script module it may be quite trivial to introduce some "scripting" that can behind the scenes schedule these things in a state machine.

Then you either write the code in this using string - but you lose syntax highlighting and auto complete. Or you push the sequence with command objects like M.Push(Command(eCmdWalk, int param1, int param2))

Edit2: I once did this in Lua, it's using some meta Lu's reinterpretation but bear in mind this entire game and the tools to make were done in 48h (and I also learned Lua on the spot) - https://github.com/VacaRoxa/CodenameLT/blob/1af638b96b0665edb1771abbd9c53a2432604f54/project/src/states/Game.lua#L251 and this https://github.com/VacaRoxa/CodenameLT/blob/1af638b96b0665edb1771abbd9c53a2432604f54/project/map/level0.lua#L635 in the map
#335
Sorry, is this error from which version of the lib?

@edenwaith the build is here: https://cirrus-ci.com/task/4644872416657408

But the Linux and Windows builds are still scheduled to happen in the pipeline before they make into the release (they run in community clusters from the Google Cloud and take a little to happen). Can you try using that? It should work (I test in my m2 Sonoma)

Anyway, if you have this problem in other plugin you just place the library inside the bundle and use the install_name_tool -add_rpath command to fix the rpath to match. (I don't have more computer time today to play with it to be able to explain better right now)

Edit: the pipeline finished building the release is here: https://github.com/ericoporto/agsappopenurl/releases/tag/v.0.2.0
#336
@Crimson Wizard if the person is me, I just never used the masks drawing with loading a file, but I drew them in script. Also I needed more than it was possible by the number of walkable or whatever areas (I remember I had an issue on this at the time). In the end I just faked everything using regular dynamic sprites - which also gave me more bits.

@lafouine88 custom walking code is not as hard as it looks, it can be done, but you can also leverage walk straight I think. I have a module (controlz) that has keyboard walking, it may not be hard to use it as base for something that would move the player. If you are using ags4 it has also both exposed pathfinder but also a character can take a path (array of points) and move accordingly.

In your video it looks like you just need to make the character walk in the direction of the vector between the character and the mouse.

Btw do you have other solid characters or things that constantly change that you need to keep in check when moving the character or are other character/objects non-solid? I have a pathfinder plugin that is just the AGS plugin exposed but it gives the option to only generate the nodes once and then you calculate the path as you want.

AGS pathfinder in the engine (not in my plugin) will instead eat the entire walkable area mask every frame that you ask for a path (but only once per frame) to account to possible other solid objects and characters, that can also move, that's why it's not fast in your big map, it's not the actual pathfinding itself.

Here: https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/plugin-ags-pathfinder-experimental-0-1-0/
#337
Thank you! I will use that! :)
#338
OK, I am almost adding this as a feature in the plugin API, but before doing so I am curious if perhaps there is already a way to read it somehow.

I need to figure the encoding of a string I am receiving from the engine in a plugin.

Is there some way to do it in the 3.6.1 version of the engine? Thanks!
#339
Spoiler
@edenwaith I wrote a version of the plugin that doesn't depend on SDL2 in macOS, can you test it ?

It's here: https://cirrus-ci.com/task/6084764296282112

If it works for you I am going to rewrite for Linux and Windows too and rerelease the plugin. Thanks!

NOTE: in the link above I hardcoded the encoding as ASCII, I am trying to figure it out if I can figure the encoding of the AGS game from the plugin API somehow.

The build in the CI newer after this is using UTF-8 as encoding. I am trying to figure if there's some way to figure this from the game. I noticed the SDL version instead assumes arbitrary encodings so it may be useful to reimplement this myself anyway.
[close]

I ended up fixing the issues and CW pointed me how to detect encoding. Created a new release, just waiting the CI builds to happen...
#340
If you just need to click and hold have the character move in the direction that the mouse is, you don't need to use the pathfinder at all, you just draw a line and end it in the mouse or where there is no walkable area, whatever comes first, but you can only test the amount the character can walk in a frame, which are very few pixels. Then the only one using the pathfinder are the monsters and they can be pretty easy to limit since they won't be recalculating on every frame.

The other approach is to do something like this : https://ericoporto.github.io/public_html/surviving/v6/

Essentially when you click and hold it waits the character finish walking before telling it to walk again but you can click in the middle to interrupt the walk.
SMF spam blocked by CleanTalk