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 - Crimson Wizard

#1381
Quote from: celadonk on Sun 28/04/2024 21:46:03Is it possible to rotate this diagram entirely? Like so:


Hmm, no, it does not "rotate", only "scales" towards height or width.
At the theoretical maximums the 4 lines would merge into 2 lines, either left-right or up-down.

I keep forgetting how diagonal loop selection is calculated.

If it's not possible to do the wanted effect with the above factor, then perhaps this feature may be amended.
I am just not sure how. If someone can suggest a good way to configure this (from design perspective), we would try implementing that.
#1383
Quote from: Baguettator on Sun 28/04/2024 21:09:28I'm waiting for a proper update !

Could you try the test build from this link on a copy of your project? This will be useful to know if it works for you, and in case if there are any more problems:
https://cirrus-ci.com/task/4745331093536768

You may download a zip file and install into a separate folder.
#1384
So, I tested and confirmed, that String.Replace causes engine to crash if the result is longer than 2048 bytes (could be less in chars if using Unicode mode).
This is apparently a very old bug, might happen in any previous version of AGS.
EDIT: hm, the limit is actually 3000 bytes in 3.6.1, but that does not change the fact that it's still wrong.

Opened a PR: https://github.com/adventuregamestudio/ags/pull/2396

Test build will be available for download here in a short while:
https://cirrus-ci.com/task/4780320447266816
#1385
Engine should not be closing without error in any case, there at least has to be a error message. So there's engine's fault in this, regardless.
AGS Strings have technical limit of 2+ billion of bytes. Strings of 100 or 1000 chars should not be causing any problems.

Do you know which line exactly crashes the game?
If not, could you set a breakpoint in this function (F9), run the game, then when it breaks there, go step-by-step (F11) until it crashes, and tell at which line it does?

If nothing else helps, given the code is complicated and depends on certain data, I guess we might also try running this game under debugger...



EDIT:
Looking at String.Replace function, there seem to be an unexpected limit of 2048 bytes for the resulting string, and very unsafe code using it, so that could be a problem. This was still ignored somehow, after all these years.

Also I found another potential mistake that may happen if there's a Unicode string and replaced part is at the very beginning of a string.
#1386
Baguettator, previously you were saying that you tried to write a random string into the same file, and it did not crash, but your function crashes.

This means that either:
- There's something specific about what file you open or how you open it in that function.
- There's something specific about what strings you write and how do you write them in that function.

You may try commenting all the writing in your function, and add writing of a primitive string, and see if it crashes. If it does not crash, then this means that this crash is related to how you write data.

Could you also please post few of the first String.Format and WriteRawLine commands here?
If we are to fix this, we need to diagnose the problem, and for that we need to know exactly what do you do.
#1387
Quote from: Baguettator on Sun 28/04/2024 13:16:39If I turn the option "Use old style keyboard handling" false, CtrlF won't do anything anymore... Is it normal ? How can I deal with that ?

Yes it's expected, and it is explained in the manual:
https://adventuregamestudio.github.io/ags-manual/UpgradeTo36.html#changes-to-key-input-handling
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_key_press
#1388
Quote from: Baguettator on Sun 28/04/2024 12:48:04The code is a bit long, so perhaps I shouldn't share it here for convenience...

I did not ask to post all the code, I asked to post small part where you open a file and begin to write.
Could you post at least the first File.WriteRawLine where it crashes? Can you tell what kind of string is written there?

Also, as eri0o said, try logging the same string with System.Log and see what it prints into the Log Panel in the editor, or use Display and tell what it prints.
#1389
Quote from: Baguettator on Sun 28/04/2024 06:52:56I'm using a function to write some data in .txt files. But recently the game crashes when I launch that function, without any error message. It just says "the game engine does not appear to have shut down properly. If the problem persists, post the problem on the tech forum".

What happens if you run this game not from the Editor, does it display any error messages at all?


Quote from: Baguettator on Sun 28/04/2024 06:52:56the function worked for more than a hundred of files, but the engine crashed for only 4 files.

EDIT : It seems my game opened the file (created it if it didn't exist), but didn't write anything inside because I can only see a blank .txt file. So the crash seems to be just before the WriteRawLine function, but the opening seemed to not bug.

When you say "for only 4 files", do you mean there are 4 specific files that cause this, or that it happened 4 times out of hundreds in the same place?
Is there anything changed recently before it started crashing?
Can you show a bit of your script, where you open the file and begin writing?
#1390
This question was asked many times, so I once wrote a quick answer in the FAQ:
https://adventuregamestudio.github.io/ags-manual/FAQ.html

QuoteQ. What resolution should I make my game in?

A. AGS games are not different from any other games. Think on what resolution would match your chosen game design and graphic style. Experiment, make few test games to find out what's best fit.
It's important to know the difference between "native resolution" and "window resolution". Your game itself may be as small as 320 x 200, but AGS allows players to stretch the game window to any size, scaling your game up (or down, although that usually is not a good thing), without any extra effort from you. So if you want to use "old-school" low-res graphics you don't have to worry about how to display your game on larger monitors.


The thing is, "look good" is not a accurate definition. Everything depends on the artistic style you are working in. For example, if you use pixel art, then there's not much reasons to use high resolution.

Also, if that's your first game ever, I would not suggest bothering about resolution yet, and just find the one which you are comfortable to work and learn with.
#1391
Quote from: Cassiebsg on Sat 27/04/2024 10:43:25I tried using export/import but ended up with a weird result of my mask becoming half the size of the room (no idea why though)

Because masks can have different resolution than the room bg. Historically masks were 1:2 to the room if game's resolution is anything above 320x200. Today they are 1:1 by default, but there's still a setting called "Room Mask Resolution" that lets change that.
#1392
I find it difficult to understand what Alan is proposing there. At first I thought that he meant a custom web "frontend" for a github repository, to ease looking up for releases and sending patches, but each next comment gives me more doubt.

There has to be a maintainer, and access control, because if anyone can just replace source code with no restrictions, there will be no guarantee for the quality of the code, nor its usability, or consistency in design.

There has to be a source control, because a contributor needs to know which version they are fixing (which commit they are applying their changes to); and maintainers must be able to revert back in case of bad changes.

If there were a webpage "frontend" that would allow to browse and find releases, as well as quickly send a patch for review, that's fine, but it should have something solid underneath.
#1393
Quote from: Snarky on Fri 26/04/2024 16:35:00But I can't figure out just how you would group a bunch of repos in github. They have things like "projects" and "organizations," but I can't fully wrap my head around the semantics.

This is called "organization", it's a "super-user" that may have members, teams (with varying repository access) and repositories.

Example:
https://github.com/adventuregamestudio/
#1394
Is this function connected to the event, on that character's events table? To which event?
#1395
Quote from: SebastianEl on Fri 26/04/2024 13:37:53however I'm recieving only a message "Got nothing to say" when clicking JC character

"Got nothing to say" likely comes from "unhandled_event" function; it's in default templates. This means that there's no proper function connected to that JC character interaction event.

Which template do you use? The choice of event to use also depends on template.
- In Sierra template you should use TalkTo event
- In BASS template you should use Interact event for everything (and LookAt event for looking)
- In Verb-coin, probably also TalkTo event
#1396
@edmundito when you say you want to do this "with the help of the admins", which admins exactly are you referring to, and which help exactly do you need? At the moment this is not clear.

I agree with what eri0o said about maintainer, these things never work without leadership, they just stall and get disorganized, so you either take responsibility yourself, or wait until someone volunteers, which may be a very long time.
#1397
AGS does not scale a game text automatically.

If you are using TTF fonts, you'd need to reimport them with different size.
If you are using WFN (bitmap) fonts, you could try setting SizeMultiplier in font's properties.
Using SizeMultiplier for TTFs is also possible, but with TTFs reimporting with wanted size is a better solution, because glyphs may look differently in different font sizes.
#1398
I would like to criticize the current API of this module, because, in my opinion, it is giving too many high-level features (like text typing and overriding Say), but at the same time is hiding most basic things that should have been exposed instead, in order to give maximal customization capabilities. Perhaps, the intent for the existing API was to quickly deliver most common actions for the users. But in the long term this may lead to this module doing too much job itself and the "text fancifying" system being less flexible.


The way I look at this fancy text problem, is that it has 3 distinct steps:
1. Parsing the input string, and building a list of tokens, or "text items", which describe how the text piece should look like. If I understand correctly, this is currently done using FancyTextToken struct.
2. (OPTIONAL) Applying a chain of filters / transforms to the list of "text items".
3. Drawing the post-filter list of "text items" using chosen method (drawing surface, constructing overlays, or whatnot).

In my opinion, ideally, these tasks should be separated, and exposed as a low-level API of this module.
When using this low-level API the user would do something like this (in pseudo code):
Code: ags
FancyTextTokenList *fancy_list = Fancy.Tokenize(input_str);

// do some custom stuff with this fancy_list of tokens

// then draw it using provided drawing methods:
DrawFancyList(drawsurf, fancy_list, x, y, <...>);
// etc

The high-level API may be reorganized to use same methods internally (maybe they already do, I did not delve too much into the implementation). I might also suggest to move them out to a separate "helper" module, but that's also may be a matter of personal preference.

My main point is that if you give the token list to the user, then users may write custom processing over these tokens in a way they prefer. They may change their properties dynamically, specify how much of them should be drawn anytime (custom typing effect), and so forth. They may even write their own custom tokenizers which produce your FancyTextTokens as an output. Or implement their own "text drawers".

On the other hand, I don't think it will be possible for you to predict all kinds of effects people may want, so trying to have them inside the module itself may be counter-productive.



UPDATE:
I should throw in few examples of that those "custom processing" / filters could be:

1. Text wrapping - is a filter. It takes a list of tokens on input and inserts "linebreaks" into them. I think that your module is already doing this as a separate operation internally, which is very good.
2. Text typing - is either a filter, or drawing controller. I suppose this may be implemented in various ways. Either tell the text drawer the range of text positions, or insert a "BREAK" token into the list.

Random examples of user-made filters:
1. Blinking part of text: toggles particular token on and off (may be also made by switching color between foreground and background).
2. Change text's color using a custom Tween.
3. Wiggle particular token around (change x,y position) using a custom Tween.
#1399
Quote from: Baguettator on Sun 21/04/2024 14:04:36Well, using PNG files will be always easier, this way you don't need to save a BMP file in a "magic pink" background to "emulate" a transparent background. It would be a quality-of-life improvement I presume ?

EDIT : also, I'm always working with PNG files, never with BMP files. But perhaps I'm a lonely bad guy :)

Everyone seems to be working with PNGs today, and AGS allows to import PNGs into your game.
It's just that creating dynamic sprites from image files is not a very common thing, so extending image format support for this function was never addressed.
#1400
Opened draft PR: https://github.com/adventuregamestudio/ags/pull/2390

The test build may be downloaded here:
https://cirrus-ci.com/task/6250684968861696

This is based on AGS 4 (alpha) version.
SMF spam blocked by CleanTalk