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

#161
So, rereading your explanation and the article on python garbage collection, I think any actual code reference has to be the actual python code, so if necessary, it's here: https://github.com/python/cpython/blob/main/Modules/gcmodule.c (I mostly like code references to steal variable names...)

But I would say to stick to the concepts you narrowed down in your comment, which I think is a good reference for the AGS version of a GC.

The MicroPython code - lets call it just MP to avoid confusion - is doing something a bit different, which I think is some optimization on top of a Mark and Sweep implementation. A note that like, 20% of issues from MP are Garbage collector related - it seems it matters a lot in embedded systems. The Mark and Sweep in the wikipedia article on GC, it looks like it's the basic GC to implement - not optimal but reasonably minimal. There is a good visual in the article for it.


#162
If you want to instead play around in a debugger, I found an implementation of it that is not that big

https://github.com/micropython/micropython/blob/master/py/gc.c

I am trying to look if I find some version of this that is even smaller, perhaps for some of those tiny languages available in GH. But this one has a "design document" to compare it seems.

But the most interesting parts of the code above are the comments and the general skeleton of the garbage collector.
#163
Not sure if it's because I am doing a lot of python recently, but the first result for garbage collection in Google for me was this: https://devguide.python.org/internals/garbage-collector/

From the link, see

QuoteIn this example, container holds a reference to itself, so even when we remove our reference to it (the variable "container") the reference count never falls to 0 because it still has its own internal reference. Therefore it would never be cleaned just by simple reference counting. For this reason some additional machinery is needed to clean these reference cycles between objects once they become unreachable. This is the cyclic garbage collector, usually called just Garbage Collector (GC), even though reference counting is also a form of garbage collection.
#164
I don't think I get quite well what circular dependency case you mean here, can you explain it with some example?

I am curious if it's something that would be possible to detect at compile time and just not allow for the time being.

QuoteSupposing we only run GC between the scripts, during the game frame update

Would the GC not need to happen on each scope change? Or would this only affect the circular dependent object?
#165
I kinda expected ai to automate the boring stuff, but for some reason it started to automate what I actually wanted to do...

I recently discovered something called Low Rank Adaptation, I believe people are shortening to LoRa, I haven't really tried, but it appears something that one can use for making it consistent. So for drawing, it would mean you could teach an AI to draw consistently in whatever style.

I tried playing a bit more with code and so far the only thing I can make it do that requires low corrections from me is unit testing self contained functions. I also tried to use it to generate some fake data - for the purpose of unit tests - but it really only works if the data is really really small.

One thing that I managed though is showing it my code for a command line interface and asking it to make a documentation and also example usages and small tutorial like docs. It can generate these things if your software is small or if you feed it in pieces. The documentation texts are not great, but once it gets you the format and general skeleton well you can redo it easier than starting from scratch, for this particular usage.
#166
Is this error message in AGS or is this a parallels error message?
#167
Hey, 0.4.0 version of agstoolbox.exe adds a small search bar! Not much you can do in it yet, but it's useful for filtering stuff!



Also check past improvements in the command line version atbx.exe.
#168
Just to try to understand, all the context of what you are talking here is ags3? Because on ags4 (we are unicode only there, right?) we could use a bidi library - it's not simple to integrate and requires some refactoring, but it's possible. (There's also the issue of vertical text with horizontal typesetting as a next hard thing, which requires a bit more thought)
#169
A small memory dump, Freetype can draw text, but it needs Harfbuzz for ligatures - and they have a circular dependency where both libraries depend on each other, so if you aren't building both from source together, you have to do a weird thing that is build FreeType, build Harfbuzz pointing to FreeType, and then build FreeType again pointing to Harfbuzz. Ligatures also have special functions for emojis - changing color or type of a emoji.

Now, neither support the characters that inverts text, so you need a bidi library. There's also care when doing this to look for the library with the correct license.

Here's the issue for the feature of bidi in SDL_ttf : https://github.com/libsdl-org/SDL_ttf/issues/135

I remember there was also some drawing library (Cairo?) that did have support and it was what chromium used.
#170
Tweening Overlays is a god send for my random things! Thank you for this! I can probably now refactor a good portion of my old manamatch with this! (that code was before there was unlimited overlays too, so it was all using a hackedup software renderer made in script)
#171
Spoiler
maybe it's 4MbShort  :-D
[close]
#172
Once you create a GUI in the Editor, and you name it, say gCloseup, you can show it by making it Visible.

Code: ags
gCloseup.Visible = true;

https://adventuregamestudio.github.io/ags-manual/GUI.html#guivisible

You can add a button in this GUI for closing in it, in the Editor, and name it, say btnCloseCloseup.

https://adventuregamestudio.github.io/ags-manual/EditorGUI.html#gui-buttons

In the events panel (⚡), you click on the on click event and it will write up a skeleton in the global script. There, actually closing the GUI is just making it not visible.

Code: ags
gCloseup.Visible = false;
#173
AGS Script is very niche and these tools require way more data to learn.

They can't pounder about state very well, specially well defined and strict states, so in the very object oriented nature of AGS where all the things have their state they often spout non-sense.

Additionally, the context they operate when coding emanate solely from the code - they can't tell you to go to the editor and create a GUI, place a button, and name the button, link a function and then write the code for this button.

Overall, they are better used for purely creative purpose or helping with something that you can define well the expected input and output, even if you have to manually prepare the input data.

I would avoid using them when scripting for the time being, until you get more experience in AGS Scripting - the code is obviously wrong as even the grammar used is incorrect - there is no arrow operator in AGS Script, there is no include in AGS preprocessor, ...
#174
Added a new 0.2.0 release

  • running it a second time raises the AGS Toolbox window instead of opening a second instance
  • added a setting to add itself to the Windows startup (it doesn't work on other OSes yet)

Note: if you use the startup with windows setting, I recommend to move the agstoolbox.exe file to a suitable place. I maintain my portable binaries under a directory I created in "C:\Users\MY_USER\software", if someone has a suggestion for a non-ProgramFiles location, mention yours.

Edit: Well, seconds after I realized I wasn't able to fetch 3.6.0 Release with this, and had to hack a better way to detect the AGS Release assets, so now it's a 0.2.1 release

Edit2: Minor adjustments to try to silently recover from invalid settings. Not sure it's enough yet.

Edit3: From 0.2.3 and onwards, right clicking on it on Explore you will be able to read which agstoolbox version you have.
#175
Really minor release fixing a crash that happened when the Editor version was too short - happened with Editor 3.4.3.

Working on additional things now.
#177
Just to check it's three things?

  • Support remapping shortcuts on the AGS Editor
  • Add a way to create custom shortcuts to open user created module scripts
  • Add a shortcut to open Sprite Manager and a shortcut to open the Global Variables panel
#178
Engine Development / Re: AGS engine Web port
Tue 21/03/2023 14:47:26
There's no API for this currently, so no - we could have one, but at the moment there isn't. Because this is Web specific I would like to take a little time before implementing something - maybe additional web specific stuff will appear.

There's a hacky way you can do this through deleting files using the regular AGS Script file API and after do a write in a small text file, it will save that one file but when it does it will sync the write on the database and it will sync the deleted files as deleted, so they would disappear.

Note the FS library we use in the web port also doesn't have an API to delete all files, so the button uses JS to delete each file in the directory recursively in MEMFS and then syncs the resulting empty dir with IDBFS, causing IndexedDB to clear up. If you open a file in AGS and then don't close it, and then uses the cog wheel button to delete all files the specific file you had not closed I believe should trigger a permission denied exception because it's being used by AGS - I believe I made it generate an error popup later but I don't remember if it says what happened.

(sorry for being overly verbose, but I can use these messages as annotations for myself to remember things later)
#179
Engine Development / Re: AGS engine Web port
Tue 21/03/2023 13:09:08
Just a minor update, I haven't advanced much in iPhone, it simply doesn't support fullscreen so some workaround is needed. There is one case iPhone supports Fullscreen, which is in a PWA app (installable web app), but the iframe in itch prevents PWA, and apparently there is no known way to circumvent this for itch - this is apparently true for other "web game stores" but I haven't profoundly checked this in non-itch case.

The way to go with iPhone it seems is to load the iframe directly and use some strategy to make sure this uses the most of the browser area - I actually think it should be doing this already but I haven't checked this yet.

About the iPad version you have, I really would need to use an old version of Emscripten because even with the build flags on the newer I thought could generate compatible wasm it didn't work when I tested, it looks like they didn't affect the actual wasm part of the code only the JS, so I think I misunderstood what they mean. So unfortunately what we can do is workout a better error message for the time being on the unsupported browsers.

Overall I don't think I will be able to advance quickly regarding how iPhone is handling fullscreen (Safari doesn't implement the API, except for video only) and resolution.

So what I want to do now is take a step back, create a non-ags minimal SDL demo app, and use it to recreate the minimal reproducible test cases so I can report the issues upstream (SDL and Emscripten) and then later reevaluate what to do.

In the meantime if you want to reshape the html part to move/remove the gears icon (it's covering Uhura), the non-minified html shell is here:

https://github.com/adventuregamestudio/ags/blob/master/Emscripten/launcher_index.html
#180
I assure that ogg files are the correct files for things to work correctly, ogg has a reference implementation from xiph and they are well handled.

Mp3 files doesn't calculate the length correctly for all files.

https://github.com/icculus/SDL_sound/commit/495e948b455af48eb45f75cccc060498f1e0e8a2

It assumes all frames are the same size.

Anyway, this is for LENGTH, I am mentioning because if you have a looping music with mp3 it will fail because of this and will have a gap. And also mp3 never ever beat ogg in encoding quality/size tradeoff. The mp3 are always bigger with worse sounding quality.

The sound file doesn't have time data in the way you are mentioning.

Sound plays in it's own thread so it doesn't desync and the timing in MS is correct in my tests.

Anyway, I still recommend labeling using Audacity, exporting the individual sound files and using a dialog system as it's usually hard to read in a hurry.
SMF spam blocked by CleanTalk