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

#3241
Quote from: Dave Gilbert on Tue 18/01/2022 15:12:23
Hello! I upgraded from 3.6.0.12 (alpha 13) to 3.6.0.13 (alpha 14). My game loads, compiles, and runs just fine. However, when I added some sprites to sprite editor, I got this error on saving:

So, ^ this is a bug found in the latest 3.6.0 build, it was reported just recently, and I will be releasing an update soon.

It happens whenever you are changing sprites in your game and then try to save.
#3242
By the way, this is somewhat related, but theoretically one could write a stand-alone application that either reads the engine log on the fly, from the file or stdout; or connects to the engine using same "Debugger" interface as editor uses, and then displays all messages in a window. This way one would be able to see game's log even without the editor.
#3243
Quote from: Volcan on Mon 17/01/2022 02:31:20
I don't get it since SDL2.dll is included with AGSController.dll.

Have you copied SDL2.dll to where your game.exe is?

BTW, I could not see the picture that you posted until I copied the address into browser by hand, and answered to captcha.
#3244
Engine Development / GUI Controls clipping
Tue 11/01/2022 22:09:18
Following this request, I want to add a game setting that makes the GUI controls clip their graphic contents, that is limit the drawing to their formal rectangle defined by X, Y, Width, Height.

https://github.com/adventuregamestudio/ags/pull/1495

I don't know why, but in AGS controls don't clip, so the text may extend outside of the control. The only exception here is a button with image, which image may be clipped by setting specific property.

My initial plan was to introduce a global setting, that affects all controls, and is enabled by default (for the new projects). Personally, I believe that it's normal for gui controls to restrict their contents, and most graphic frameworks seem to do this. But since AGS has its own history of use, and there may be strange cases, I also would like to hear opinions.

Theoretically, I may also add a per-control property, merging it with the Button's "Clip Image". Technically this should be trivial, as this is just an internal engine's flag that may already be applied to any control (but only buttons know how to handle); so that's not a big deal. But in this case I'm more worried that it will make engine's design more complicated, and perhaps game design too, as people will have to specifically remember to toggle this on or off per each thing that needs it.



EDIT: this was done in 3.6.0.
#3245
Well, yes, if you restored a save where your character already had a tint applied, then it will keep that tint.

Quote from: Rik_Vargard on Tue 11/01/2022 19:22:19
Could it be that AGS doesn't crash every time you make some changes, but the changed game scripts (like Tint here) are not working ?

There are changes that break saves and changes that do not break saves. In regards to scripts, only changing global variables breaks saves (the variables that are outside of function), but changing functions does not.
#3246
I understand your explanation, but what you describe is not supposed to happen.

Here, I made a quick test game that simulates this situation. There's a small room with 3 tinted regions, and a second character. Player begins standing on one of the regions (tinted).
If you Interact with the character (the "Hand" verb), the player will blocking walk there, through 3 different regions. And the tint changes as he walks:

https://www.dropbox.com/s/kiabg7cn7wvnwo6/test--regiontints.zip?dl=0


So maybe something else affects your player's tint? Could you post that variant of a room script?

Quote from: Rik_Vargard on Tue 11/01/2022 17:46:42
PS: I could share the game files if you ever needed it.

Yes, I may take a look, because this is very curious.
#3247
Quote from: Rik_Vargard on Tue 11/01/2022 17:07:16
And just for info, here's the room script:

Right, see, you have both kinds of tints used here.

1) Your regions have an active tint. You configure it by calling "region[1].Tint", and so on, in the Room_Load. This is the tint that is supposed to be automatically applied to any character or object which passes through these regions, and automatically removed when they leave the region.

2) But besides that, you are also assigning an explicit tint to the character, in "region1_WalksOnto" function (and similar for other regions).

So, my suggestion is: remove these walk on / off event functions altogether, and remove a call to player.RemoveTint() too. Then only the automatic region tint will work, and there will be no conflict between tint types.
#3248
I still think that's a mistake that you are applying a tint to the region in the repeatedly_execute_always. There should not be a need to do that. Your code sets exactly same tint configuration to the 3 regions multiple times per second, over and over again. Instead, you could simply do that once, in room's "before fade-in" event. Or even simplier - in the region properties.

EDIT: Also, it's curious how calling player.RemoveTint() might change anything.

Thing is, there are two kinds of tints: 1) explicit character's tint, which is unrelated to regions, and 2) the tint it gets from the regions. The Character may get either one or another, but not both at the same time.
player.RemoveTint() removes character's explicit tint, which is normally set using Character.Tint script function. It should not remove region's tint.
Could it be that character was tinted by command previously in your script? That's the only reason I know why RemoveTint would affect anything. Which might also explain why the character was not tinted by the regions. Not sure if that makes sense, as I don't know much of a context of your game or room.

EDIT 2: Ahhhh.... you had this in the first post:
Quote from: Rik_Vargard on Mon 10/01/2022 21:09:49
- Region 1 has a tint script (walks onto/off)
Do you maybe still have this walk onto/off script, that adds explicit tint to the player?
If yes, then this would mean that you have conflicting tints that the game will try to apply to the character: one by script command, and another from the region properties.
#3249
Quote from: Pax Animo on Tue 11/01/2022 00:28:10
Would a walk to x, y off of the region. (give the blocking action time to be updated and switching the region tinting on) and then walk to x, y. not work?

The thing is, you order player to walk to certain object. If you also need to separately walk them to the region first, then you will have to calculate their path intersection with that region to find out whether they will cross the region at all, and at which point. AGS currently does not provide enough information about character's walk paths, but even if it did, that would be extra scripting work compared to the other solutions.

If other solutions don't work for some reason, then it's easier to just test whether character is crossing the region in repeatedly_execute_always.
#3250
Yes unfortunately there's this issue, that script events are not called during blocking actions due to how script system works in AGS. Therefore regions don't trigger "walk on/off" when there's a blocking walk.

Does it work if you just add Tint in the region's properties in the editor, as eri0o suggested?
Note that if you do that in script (region [1].Tint(..) ), try doing that in "room before fade-in" event instead of "repExec", as "repExec" also is not called during blocking actions.
Above of course refers to a case when region has constant Tint, which suppose to act all the time.

Note that if you need to use "walk on/off" events in some other circumstances, you may instead simulate blocking walk:
Code: ags

player.Walk(... eNoBlock);
while (player.Moving) Wait(1);

^ this code starts the non-blocking walk and then loops, waiting until player stops.
If you put this code in a custom function and call that function everytime instead of player.Walk, then you will probably get these and other events. The issue with this approach is that rep-exec will also work during these walks, so you may find a need to adjust the game logic there.
#3251
I apologize for possibly misreading this, but would like to clarify: is this a kind of a general survey, or a you are wondering whether to put sounds in your game being concerned that players will not like it?

If the first, then for me personally it varies from game to game and from mood to mood. Some games just have sounds made so well that are pleasant to listen to. In horror games the sounds are part of the core experience. Point n click kind of games in general require focus to follow all the narration and dialogs, and puzzles, so listening to someone else talking would distract me greatly.
On the other hand there are games with very badly made sounds, which i'd rather not listen to, and sometimes games which don't require as much focus. If these are long and i'm getting bored for any reason, i might turn something else at the same time. Not too often too, guess i just don't have such a habit.

If this is about second, I do not think that it's a good approach to not have sounds in a game only to accomodate people who want it to be silent, because this is what in-game volume controls are for. Adding a volume slider or a mute checkbox is quite simple, and let everyone customize this to their needs.
Also, afaik, many operating systems today have an application sound mixer where you can choose volume per application. e.g. Windows 10: https://www.howtogeek.com/wp-content/uploads/2016/03/top_2-650x300.png
#3252
We have TONS of messages like this in the engine. I believe this should be fixed systematically, after we have some good plan about it.

But in general idea is to have same message format for all contextually connected errors. E.g. if it's an error about Views, then it should include view/loop/frame and their valid range. If it's error about room object it should include object's name, and if about character - character's name; and so forth.

I'll try to write a task ticket for this, for the future reference.
#3253
I'm sorry, I did not have time to look into this yet, and I definitely should have written a better documentation.

Quote from: deadsuperhero on Fri 07/01/2022 22:16:37
I ended up doing a dirty hack for the time being, but I hope to sit down and adapt it properly at some point. :)

Just as a note, you may use switch for simplier code:
Code: ags

switch (hoverOver)
{
case gDetails:
case gResume:
// etc
    DragDrop.AutoTrackHookKey = true;
    break;
default:
    DragDrop.AutoTrackHookKey = false;
    break;
}
#3254
Quote from: Baguettator on Fri 07/01/2022 16:59:43
Until now, it seems that resizing a 140*140 sprite into a 30*30 one gave me an ugly result.

EDIT : well maybe it's because I resize it too much ?

Erm, indeed! You have 140 pixels and want to somehow accomodate them into 30? Afaik, nearest-neighour method downscales basically by skipping pixels; it does not "merge" the colors to create a better illusion of same image.
Usually when there's so much scaling with pixel graphics it's best to create at least few "key frames" at varying scales.


Quote from: Baguettator on Fri 07/01/2022 16:59:43
They use the sprite (that is already in the game) and resize it smaller and put it on another background.

So, this is supposed to be a part of the room background? Perhaps if you try the method with scaled down object or character it may work better (assuming you have "Render sprites at screen resolution" enabled).  I cannot 100% guarantee that would be suitable, because there may be other problems with that, but it's one option.

Maybe there are other solutions, which i cannot think of right away.
Like, in theory, one could make a module or a plugin that uses different scale filter. Although, I have doubts that any filter may downscale that much and keep good quality.
#3255
Dynamic sprites are resized as raw bitmaps in their own resolution of course, using most trivial nearest-neighbour method.
It is also important to remember to not resize already resized sprite again, but resize from original sprite all the time, because when you continuously resizing a dynamic sprite it will be getting worse and worse every time (same as with rotating).

Depending on what you are trying to do, but in theory you may get better results by applying original sprite to the room object or character and scaling that object or character instead.
If you have "Render sprites at screen resolution" option enabled in setup, these objects will be rescaled in the window resolution.
#3256
EDIT: well, looks like this was not necessary, but I'll leave my answer just in case someone has similar questions.

Do you need full 2D distance, or distance only along the X axis?

Full distance is calculated as
Code: ags

float dist = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));

where x1,y1 are coordinates of one point and x2,y2 are coordinates of another.

If you need only distance along the axis, that's obviously
Code: ags

int dist = x2 - x1;


Converting a value to the percentage of something is done as
Code: ags

float percent = (value * 100.0) / full_value;

where the "full_value" is the value corresponding to 100%.


Important thing is that in AGS float and integer values do not covert automatically, but have to be converted using IntToFloat and FloatToInt.

So the final code may look like (in the full 2D distance case):
Code: ags

float x1 = IntToFloat(player.x);
float y1 = IntToFloat(player.y);
float x2 = other location's x
float y2 = other location's y
float dist = Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
float percent_f = (dist * 100.0) / 300.0;
int percent = FloatToInt(percent_f);
#3257
A small note, I had to reupload this patch, adding one tiny correction. The list of Changes is exactly the same.
#3258
Quote from: Stranga on Thu 06/01/2022 12:46:53
Yes, it was custom properties I set up for  "Description"/"Name" of Items to be specific, but I'm sure it obtain the same result for any custom properties.

I'm afraid there's a misunderstanding again. These are not "custom properties", they are regular properties. Custom properties are a completely different thing:
https://adventuregamestudio.github.io/ags-manual/CustomProperties.html

So i guess you were speaking about normal properties, that you see on a "properties" panel for the selected item?..

Could you try the latest 3.6.0 build and see if it still does not work?
#3259
AGS 3.5.1 - Patch 7
Full release number: 3.5.1.14


For Editor
Spoiler

For Android
Spoiler

For Engine/Editor developers
Spoiler

Released: 6th January 2022

Previous stable version: AGS 3.5.0 P10 forum thread


This release is brought to you by:

- Alan v. Drake
- Crimson Wizard
- eri0o
- James Duong (implemented "--console-attach" option for Windows)
- Morgan Willcock
- Nick Sonneveld
- rofl0r
- Thierry Crozat (bug fixing)
- vga256 (bug fixing)



Summary

3.5.1 is a minor update after 3.5.0, which contains mostly utility additions, fixes and perfomance improvements.

For the reference, we currently have another major version in works, which is already usable although may be not as stable, and introduces a SDL2-based engine, planned to be released as 3.6.0. If you're interested you may find it here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=58976.0



Changes in the Patch 7:

Editor:
- Added "Layout -> Reset to Defaults" menu command.
- Editor will now reset panel layout to default state if loading layout fail for any reason.
- Default config is now saved also when the game is run in debug mode (F5). This ensures that the test run is using the latest Default Setup, if the user's config has not been created yet.
- Editor will now display an error if user tried to reserve too many channels for audio types.
- Fixed Editor failing to start if user preferences file is corrupted.
- Fixed "Use old-style custom dialog options API" was not set when importing pre-3.4.0 projects.
- Fixed comboboxes' drop-down arrows were not painted with the right color from a color theme.

Engine:
- Fixed program crash occuring if the game reserved too many channels for audio types.
- Fixed potential crash occuring when player loads a save made in a multi-frame room, but the room was since edited and no longer has as many frames.
- Fixed character may have incorrect Frame (property) values while turning.


Changes in the Patch 6:

Editor:
- Added line numbers in the dialog script editor.
- Fixed Dialog script loosing changes if the pane is closed or redocked.
- Fixed controls arrangement on the Dialog pane getting broken when it's redocked.

Engine:
- Fixed filepaths in scripts that have backslashes ('\') fail on non-Windows systems.
   All the (script) File functions will now convert backslashes in filepaths into forward slashes for compatibility.
- Fixed engine was still creating standard directories for game saves and data, even if user provided the custom paths for these.
- Fixed TextBox control crashing the game if it's empty and player presses Backspace.
- Fixed controls on a fully transparent GUI were not interactive (this is an original AGS behavior, which was unintentionally changed in 3.5.0 by mistake).

Compatibility:
- When running 3.5.0 games, treat fully transparent GUI as non-interactable.
   In AGS transparent GUIs may be still interacted with, but 3.5.0 introduced an unintentional (and undocumented) change to this, which was reverted in 3.5.1.

Android:
- Support global engine's config file when the game is run from the Launcher: it's located in the AGS games' parent directory, same place where android.cfg is.

WinSetup:
- Added "Custom game shared data path" to complement "Custom save path" option.


Changes in the Patch 5:

Contained no changes and was a formal re-release with only fixed program build instructions for Linux.


Changes in the Patch 4:

Editor:
- Fixed swapping of inventory item's numeric ID could lead to errors.
- Fixed crash when importing pre-3.* games with multiple script modules.
- Renamed "Enforce object-based scripting" setting to "Enforce post-2.62 scripting". This is for clarity.

Compiler:
- Fixed potential memory corruption when user script reaches max nested if/else blocks.

Engine:
- Also tell module name and approximate source line when reporting script import errors for the variables and local functions.


Changes in the Patch 3:

Editor:
- Fixed sprite file over 2 GB could not be loaded (regression since the last patch).

Engine:
- Further improvement to GUI perfomance: don't redraw GUI when the mouse cursor is hovering over or interacting with controls not leading to an actual visual change.
- Fixed ListBox items could become unaccessible if its font or height is changed leading to a disabled scrollbar.


Changes in the Patch 2:

Engine:
- Fixed speech lipsync getting disabled after loading another game with RunAGSGame().
- Fixed MOD/XM clips fail to play (regression).
- Fixed certain OGV videos fail to play (regression).
- Fixed software renderer was not updating game screen correctly when running a game with legacy "letterboxed" feature (regression).


Changes in the Patch 1:

Editor:
- Fixed script compiler sometimes was not specifying actual Dialog number when reporting errors in the dialog scripts.

Engine:
- Fixed Game.TranslationFilename always returning empty string (regression).
- Fixed GUI controls which were toggled from disabled to enabled state not responding to the mouse clicks until the mouse is moved (regression).
- Fixed OpenGL did not apply a Linear filter when "Render sprites in screen resolution" option is off.


What is new in 3.5.1

Editor:
- Added "Attach game data to exe" option to General Settings. This lets you to package game data separately from the game.exe (only important on Windows at the moment).
- Deprecated "Limit display mode to 16-bit" property in Runtime Setup as it's no longer used by the engine.
- Display aspect ratio in game resolution dialog.
- Implemented classic Color Picker dialog for the Color type values in the property grid, instead of the default one which does not allow user-defined colors.
- Improved tab switching performance for script windows.
- Editor will now enforce full game rebuild after upgrading an older project, this ensures that all scripts are recompiled with the new version rules.
- Fixed room lists in property editor were not updated after room number is changed.
- Fixed importing pre-3.* projects broken by incorrect assignment of "Game file name" property.
- Fixed importing Characters and GUI without sprites still created empty sprite folders.
- Fixed crash when exporting/importing Characters with no Normal View.
- Fixed translation compiler did not correctly save some of the escaped sequences, such as "\n".

Scripting:
- Implemented correct parsing of a "const string" function return type.
- Fixed implementing imported functions was forbidden in the room scripts.

Script API:
- Added GUI.Shown readonly property that tells whether GUI is active on screen. This is primarily for GUIs with "Popup At Y" style, because they hide themselves regardless of Visible property. Note that since 3.5.0 GUI.Visible only tells a script-set value.
- File.Open() now supports $CONFIGFILE$ tag which will try to open user config file for reading or writing regardless of where config is located on disk.
- Added System.SaveConfigToFile() which writes current engine settings to the user config file. Only the options that can be changed at runtime are written back at the moment.
- GetTranslation() now returns "const string" (was "string"). This is to prevent modifying returned string using old-style string functions, such as StrCat(), as this string may be allocated in the internal engine memory for its own use.

Engine:
- Support loading audio and video from data packages larger than 2 GB.
- Improved game data loading times by introducing buffered file stream. Initial tests showed 3-4 times faster file reading.
- Improved game perfomance by not reupdating all of the GUIs each time anything changes, instead only affected GUI will be updated each time.
- Some improvement to general script perfomance.
- Some improvement to script Dictionary and Set types perfomance.
- Room Object's Graphic property now can be assigned a sprite with index over 32767 and up to 65535. This restriction is due to internal data format, which cannot be fully fixed without breaking compatibility with plugin API. This may still be worked around by assigning a View, as View's frames may contain sprites of any index available.
- Similarily, Object's View, Loop and Frame can now be assigned a value over 32767 and up to 65535; not that this was ever an issue...
- Removed arbitrary limit of 1000000 dynamic array elements (now supports over 2 billion).
- Dialogs with no enabled options left will be now stopped, instead of raising script error.
- Engine will not longer quit the game when failing to write a save, but simply display an error on screen (...why this was a thing in the first place?!).
- When restoring a save engine will now try to match game pack by GUID rather than using exe/pack name. This resolves potential problems when game package may have different name in distribution to another system. Also makes saves in multi-game collections more reliable.
- In Debug game mode allow to toggle infinite FPS mode (prior it could not be turned off).
- Expanded text parser error messages for easier debugging.
- Adjusted all the command-line options to have consistent prefix convention, where all full-name options must be preceded by double-dash, and one-letter options by single dash.
- Added "--localuserconf" command and similar global config option which tells engine to read and write user config in the game's directory rather than using standard platform path. Game dir must be writeable for this to work.
- Added "--conf" command which forces engine to read only explicit config file on startup.
- Added "--user-data-dir" and "--shared-data-dir" commands for setting save game directory and shared app data directory from command line (this corresponds to existing options in config).
- Fully configurable log output (in both game config and command line) allows to set up which message types and groups are printed by which output methods (sinks), including: file, system console, in-game console. "warnings.log" is now created only if file log was not requested by user.
- Added "--log-" set of command line options for setting up log output.
- Added "--tell-filepath" option for printing known engine's and game's file locations.
- Added "--tell-gameproperties" option for printing some of the game's general settings.
More information on log config and --tell commands currently may be found in following text file: OPTIONS.md
This has to be added to the manual eventually.
- Support proper lookup for Allegro 4 library resources (such as its own config and digital MIDI patches) in the game directory.
- Engine will no longer precreate directories for common files: saves, user config, shared files and so forth, - before actually having to write these. This ensures that no new directories are created on your disk without actual need. Also this fixed a problem that could happen if someone deleted e.g. a game's save directory while game was running.
- Fixed running game from another directory by passing its relative filename as command-line argument: in this case engine was incorrectly using its own directory to search for external game data, opening files for reading by script command, and so on.
- Fixed some of the engine's own hotkeys (such windowed/fullscreen mode toggle) not working during certain skippable game states.
- Fixed overlay was set to wrong position if it were using TextWindow gui and either its text or X, Y properties got changed.
- Fixed crash occuring when the speech is using text window gui with zero Padding and the speech text is an empty line.
- Fixed characters and room objects were not updating their looks if their current graphic was a Dynamic Sprite, and that sprite was modified with ChangeCanvasSize, CopyTransparencyMask, Crop, Flip, Resize, Rotate or Tint function.
- Fixed Views' frames keeping reference to deleted Dynamic Sprites causing crashes. Now they will be reset to dummy sprite 0 for safety.
- Fixed engine crash when button's graphic is set to sprite out of range.
- Fixed animated cursor's normal graphic reappearing in between animation frames if mouse mode is being repeatedly reassigned, for example in rep-exec script.
- Fixed certain interactions did not work with GUI if it was made fully transparent.
- Fixed ListBox.FillSaveGameList() search pattern, it included files which contain save filename pattern but do not exactly match; for example: "agssave.001_".
- Fixed engine was ignoring audio files in game directory when running games which use old audio system.
- Fixed crash in Direct3D and OpenGL renderers that occured if game uses a plugin that performs software drawing on screen, and one of the rooms is smaller than the game's resolution.
- Fixed Direct3D was assigning wrong fullscreen refresh rate sometimes, slowing alt-tabbing.
- Fixed "--test" mode was lost upon restoring a save.

Engine Plugin API:
- Added IAGSEngine::GetRenderStageDesc() function which returns current render stage parameters. As of this version these parameters include 3 transformation matrixes, allowing any 3D render plugin to stay compliant to engine's scene rendering.

Compatibility:
- Fixed engine was trying to read unnecessary data when loading pre-2.72 games.
- Fixed "upscale" mode for old games (was broken in 3.5.0). Also engine will now try to detect if "upscale" mode wanted by reading old config options (if they are present).
- Fixed GUI.Visible not returning expected values for GUIs with "Popup At Y" style in pre-3.5.0 games, breaking some older games logic.
- Fixed potential buffer overflow when reading pre-3.1.0 games with old dialog script texts.
- Fixed engine was applying player's position too early when ChangeRoom was called for 2.72 and earlier games, which could result in wrong placement in the new room if the character was walking right before the transition.

Android:
- Corrected game scanning in AGS launcher, now it will work consistently with the desktop ports, and detect any compatible game data files named "*.ags" or "*.exe".

OSX:
- When looking for game files engine will no longer use hardcoded filename, will search for any compatible pack file instead.

Windows:
- Windows version of the engine now reads global configuration file. It is looked up in "%USERPROFILE%/Saved Games/Adventure Game Studio/acsetup.cfg"
- Default log file location is now also in "%USERPROFILE%/Saved Games/Adventure Game Studio".
- Added "--no-message-box" command line option to hide message boxes when alerts are raised. These messages will be still printed to log (if one is enabled).
- Added "--console-attach" command line option to try attach to the parent process's console. This is useful if you run game from command line and want to see engine's log in the console.

WinSetup:
- Fixed changing fullscreen mode from "use current desktop" to explicit resolution on save.







Thanks to everyone who contributed to and tested this version!



#3260
Quote from: arj0n on Wed 05/01/2022 22:13:17
I see, but how do I check/know the length of the file? By getting File.Position when at the EOF?

I thought there's File.Length, but since there's not, the way to retrieve one is:
Code: ags

File *f = File.Open(...);
f.Seek(0, eSeekEnd);
int len = f.Position;


Or, since you are reading the file anyway, you may check for Position right after hitting EOF.

EDIT:
But I realized that instead, after reading last line, you may seek back and check if there was a linebreak in the end. If not, then append this last char to the last string.
Basically, it seems what you are already doing (checking the last character), except you do not have to write file back, but perform the check in the end of reading strings, and fixup the string, not the file.
SMF spam blocked by CleanTalk