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

#701
This temp build should have the problem with autocomplete crashing fixed:
https://cirrus-ci.com/task/6320305364271104
#702
There was an old request to be able to access Room descriptions in script, and maybe number of rooms in game too.

I opened a PR for adding this to AGS 4.0:
https://github.com/adventuregamestudio/ags/pull/2626

But here's a issue: rooms are not sequential, and room list may have gaps in it.

Suppose I add following:
Code: ags
/// Gets the total number of the rooms in game.
static readonly attribute int Game.RoomCount;
/// Gets the room's name (description) by its index, returns null if such room does not exist.
static readonly attribute String Game.RoomNames[];

RoomCount returns the number of valid rooms in game.
If RoomNames[] is accessed by a room number, then it will have gaps in it.
If RoomNames[] will represent a sequence having only valid rooms, then you won't be able to tell which rooms are these.

If we leave the first variant, it will work easily to get a name for particular room by its number,
but it will make it more difficult to iterate,
and also RoomCount becomes ambiguous.

The only idea I had so far (besides leaving as it is), is to introduce a second array which stores numbers of valid rooms in a sequential array, like:
Code: ags
/// access sequentially 0 to RoomCount
static readonly attribute int Game.RoomNumbers[];

Then iterating over all valid rooms will be performed as:
Code: ags
for (int i = 0; i < Game.RoomCount; ++i)
{
     String name = Game.RoomNames[Game.RoomNumbers[i]];
}


What do you think?
#703
There's a bug found in the latest 3.6.2 and 4.0 updates,

I'm not entirely certain, but i think it happens when you either declared a function without parameter names (only types), or when you are typing a function declaration and delete one of the parameters and retype its type, or something like that.

In such case editor shows error message with "index out of bounds". But you can continue to work.
The error comes from autocomplete, so while annoying, should not affect your game.

I will be posting a fixed builds soon.



UPDATE: following temp build should have this fixed:
https://cirrus-ci.com/task/6216491441324032
#704
Quote from: Rik_Vargard on Fri 20/12/2024 08:43:58I searched for such a tool but this is new to me so I'm not sure which one is a good one.
If you know/use one, maybe you can direct me? Thx!  :)

There are not a lot of them, and all are suitable for a simple work when you have only 1 development branch.

I used only 3 in my life: cvs, svn and git. SVN seemed to be most simple to understand.
#705
Engine Development / AGS engine Mac OS X port
Fri 20/12/2024 03:47:09
The old forum thread may still be found here. Please beware that it was started many years ago and may contain alot of outdated information.

This new thread is dedicated to discussing the Mac OSX port of AGS engine. Following is a brief cover of the topic.

NOTE: I used information provided by @eri0o in other forum threads to write the following, but I am not a Mac developer myself, so the instructions below may contain gaps or mistakes. If you notice anything wrong or missing, then please report that in comments.



AGS engine runs natively on 32-bit and 64-bit Mac OSX.
To run AGS games on Mac at the very least you need the Mac engine executable and a game data.

In general, there are two ways to prepare a game for Mac: a "proper" and "quick and dirty" ones.

A proper way is to create a Application Bundle: which is a package containing game data compiled by the editor (gamename.ags and any other custom files), engine executable, and additional files required by the Mac. The Bundle may also be signed and notarized. This is the way to officially distribute your game for Mac, whether commercially or for free.

A "quick and dirty" way may be used whenever you need a quick test of your game. This method requires simply a engine executable and game data files, placed together in a single folder. Running engine exe will make it look for a nearby game data, load and run it. The same method could be used to run virtually any game made in AGS, even if it was not released for Mac.

We discuss this in more detail further.



Building games for Mac OSX in the Editor

Unfortunately, at the time of writing this post, AGS Editor does not support preparing a Application Bundle for Mac. This may change in the future, in which case this section will be updated.

For now, you have to build your game normally, and then find the files located inside Compiled/Data folder. These are "raw game data" files, independent from any operating system. You should be using these when preparing a Mac package yourself.



Making a Application Bundle

Let's talk about the proper way of preparing your game for Mac, that is - creating Application Bundle.

In macOS, a bundle is a directory with a standard hierarchical structure that contains executable and resources.
Here's the Apple technical documentation regarding this:  Application Bundle. It may be not trivial to understand for a non-technical user at the first attempt, but I recommend getting acquainted with it nevertheless.

At minimum, your ags game application bundle will look like this:

Code: ags
📁 MyGame.app/
  📁 Contents/
      📜 Info.plist
      📁 MacOS/
        ☕ ags
      📁 Resources/
        📦 mygame.ags

At the top level we have a directory that has a name that ends in .app, e.g. "MyGame.app".
Below there's a subdirectory called Contents. This is where you place the bundle files, some of them in further subdirectories.

1. Info.plist

Info.plist - this is a runtime-configuration file called the "information property list". This file is a plain-text xml file, which contains information required for the Mac to handle your app bundle correctly.
You may find an example of this file in our engine repository:
https://github.com/adventuregamestudio/ags/blob/master/OSX/xcode/AGSKit/AGSKit/Info.plist
This file may be used as a template for the plist in your bundle.

If you look inside, you will see a series of <key> and <string> entries. These are like "property name" and "property value". You may edit values (inside <string> entry), but should not touch the "keys" unless you know what are you doing. You may also add more key/value entries if necessary.
Related Apple docs:
- Application Bundle
- About Info.plist Keys and Values


The most important entry there is CFBundleExecutable. You must enter the value for this entry, which is the plain name of the engine executable (without any paths). Usually that should be ags, for example:
Code: ags
<key>CFBundleExecutable</key>
<string>ags</string>

2. MacOS directory

This directory must contain the engine executable (called plainly "ags" or similar).

3. Resources

This directory must contain all the game resources: these are the files that you normally distribute as "AGS game" (except ".exe" file, of course): gamename.ags, audio.vox, speech.vox, acsetup.cfg, translation files, and so on. In the usual case you should just copy contents of Compiled/Data folder there.

Signing and Notarization

In theory you may skip this, but if you do then whenever a player tries to run your game, they would have to go through a number of steps to allow this game to run on their Mac computer. So ideally you should Sign and Notarize your game before distributing. You will need an Apple developer account for this.

Here's a Apple doc on this topic:
https://developer.apple.com/documentation/security/notarizing-macos-software-before-distribution

KNOWN ISSUES

If you have prepared the Application Bundle on Windows, there will be a problem that the engine executable will not be marked as "executable" for Mac, and won't be run. If that's the case, then you can fix it on Mac using "chmod" command from the terminal:

Code: bash
chmod +x ags

This mark can be then preserved if you distribute your bundle using archive type that keeps it: such as "dmg" or "tar.gz". There's also an information that Steam may take care of this, but this has to be double checked.



Getting the Mac engine

NOTE: this section is currently underway, we will need to gather more information on this.

There are obviously 3 ways you can get the AGS engine for Mac:
1. Build it yourself, from the source code in our repository. You shall have Mac computer with Xcode IDE installed for this. This is explained in this readme: https://github.com/adventuregamestudio/ags/blob/master/OSX/README.md
2. Get it from someone else who built it. Please note that the built executable will only be compatible with a certain range of OS versions.
3. We might provide the Mac port executable in our AGS releases, but if we do, then these likely will only be guaranteed to work on the recent versions of Mac OS.



Game-written paths and files

Following are the default locations of files created by the game:

User config: Users/<username>/Library/Application Support/GAMENAME/acsetup.cfg
Game saves: Users/<username>/Library/Application Support/GAMENAME/
Shared game files*: Users/<username>/Library/Application Support/uk.co.adventuregamestudio/GAMENAME/
Engine log location: Users/<username>/Library/Application Support/uk.co.adventuregamestudio/

* - shared game files are ones that are written in script using $APPDATADIR$ path token.

NOTES:
1. You, or players, may assign a different savegame location in game config, see these docs:
https://adventuregamestudio.github.io/ags-manual/DefaultSetup.html#environment
https://adventuregamestudio.github.io/ags-manual/EngineConfigFile.html#configuration-file-options
2. Because there's no analogue of WinSetup on Mac, the "user config" may only be written by the engine if you call System.SaveConfigToFile() in script.
#706
Quote from: Radiant on Thu 19/12/2024 19:07:10So on MacOS, where do I find my saved games? For some reason, using Finder to locate agssave doesn't do anything.

I am getting confused about Mac myself all the time, but here's the trick: engine supports a number of command-line arguments that print various information. They may be found here:
https://adventuregamestudio.github.io/ags-manual/RuntimeEngine.html#command-line

If you run the engine as "ags --tell-filepath" it will print all known paths in terminal.

EDIT:
I think it's supposed to be: Users/<username>/Library/Application Support/GAMENAME/
#707
OTOH, if we are to keep the original bitmap, then it could be aligned to the top, and have something distinct below, like a horizontal strip of different color.
#708
In 3.6.2 and 4.0.0 New Game Wizard displays a template's description under the list of game templates.

Without changing the overall dialog's height these controls look cramped:
Spoiler

[close]

IMHO it needs at least 1 more row for the list of templates, and increase the Description field maybe x1.5 in case the text is longer.

Unfortunately, it's not easy to do because of the first page that has this bitmap:



I'd like to find a way to redesign this wizard's intro page in such way that will let us increase the height at least once, or ideally - will make it easier for us to adjust its size in the future, if such need arises.
#709
Updated to Alpha 16
(Please use download links in the first post)

Contains all the new features and fixes from 3.6.2 Beta 4 (excepts ones related to backwards compatibility).


Own changes:

Editor:
- Added Flip property to View Frame, replacing a boolean Flipped property. The new property supports all 3 flip variants: horizontal, vertical and both at once.
- Fixed certain errors like "not terminated string" in Dialog Scripts did not report correct Dialog and line, making it difficult to find the cause of mistake.

Compiler:
- Fixed function bodies mistakenly declared with "import" keyword could cause program memory corruption during compilation.

Scripting:
- When calling a function you may specify parameter names like "name1: value, name2: value", and when doing so - pass arguments in any order.

Script API:
- Added Overlay.Flip property that lets to set one of the 3 standard flip styles.
- ViewFrame.Flipped property now returns eFlipDirection instead of bool.

Engine:
- Engine now supports up to 1024 simultaneously loaded scripts (was 128).
- Fixed Type.GetByName() not working (regression since one of the previous v4.0 Alphas).
- Fixed Software renderer not handling all the Overlay transformations correctly (like rotation).



In regards to naming parameters in the function call.

When calling a function, you can pass parameters having their names explicitly specified. This may be advantageous for the clarity of code. But in the end this is a user's choice of code style.

For example:
Code: ags
import int Func(int param, float fparam, String str_param);

void CallAnother()
{
    int result = Func(param: 10, fparam: 5.7, str_param: "text");
}

There are following rules:

* A function call must have either all passed parameters named, or none named. These two syntax styles cannot be mixed in the same function call.
* If you pass parameters named, they may go in any order.
* But, in any case, non-optional parameters (ones without default value) must be passed in the function call regardless of the syntax style used.
* If you are calling a variadic function (such as String.Format), and pass fixed parameters named, then you won't be able to pass variable parameters at all (because they don't have names!).
#710
@yarooze I checked your project, and it has a mistake in script that is known to cause all kinds of weird issues.

This is when you have "import" keyword used in function's body, like:
Code: ags
import void HemisphereElement::HemisphereElement(int id,  Hemisphere *hemisphere)
{

}

We have this crash already fixed and the fix will be included in the next update (coming soon).
Instead compiler will report a syntax error.
But you have to fix the script anyway.
#711
Quote from: yarooze on Wed 18/12/2024 14:13:58So my questions:
1. Is there any possibility to write some logs to find the problem?
2. Do anybody have such problem with the crushing editor?

There's no logging in the editor, other than compiler's errors.

You could PM us your project for a test, if this is a bug in the editor then we'll be able to see what is happening.
#712
Quote from: Khris on Wed 18/12/2024 11:00:492. use a container inventory item like a binder or folder, then use a custom struct to keep track of which pages have been found. Looking at the binder will display a dynamic message telling the player about the page numbers

You may also encode this information in the item's custom property too, for example, a String property that holds a comma-separated numbers of pages.
#713
I've started to document loading older saves feature in the manual.
https://github.com/adventuregamestudio/ags-manual/wiki/UpgradeTo362#loading-old-saves-feature
https://github.com/adventuregamestudio/ags-manual/wiki/ValidateRestoredSave

And I wonder if using a "RestoredSaveInfo.Result" would be difficult to understand to users.
Right now it's a combination of bit flags, so you have to use bitwise operators in order to check specific values, like:

Code: ags
// If there's no missing data, then simply accept it and return.
if ((info.Result & eRestoredSave_MissingData) == 0)
{
    info.Cancel = false;
    return;
}

I wonder if it makes sense to find other way.

One method that I've seen somewhere else, is to instead make an boolean "array" property and use these flag values as index. In which case their tests would be coded like:

Code: ags
// If there's no missing data, then simply accept it and return.
if (!info.Result[eRestoredSave_MissingData])
{
    info.Cancel = false;
    return;
}
#714
Without plugins, in theory this is possible to do:
1. Create a translation, export all texts there ("Update translation" command),
2. In translation file keep the original texts unchanged, and fill the corrections as "translated" lines.
3. When finished, do "Make default language" on that translation. That will replace all the texts in the game with the "translated" texts.

I would strongly advise to make a full game backup before doing the last step.
#715
Hmm, supposing the second mentioned alternative, if we have a sort of "decorator" or a keyword to mark the "flag enums", how would that affect the situation?
Would that be used in autocomplete hints?
#716
Quote from: eri0o on Mon 16/12/2024 17:22:50Most of these are new - except flip and alignment - so I don't think that is that big an issue.

So you want to rename only newer ones?

Is this suggested for ags3 or ags4?
#717
There are more enums that are defined like flags:
- Alignment (although they are not necessarily used like flags right now),
- eFlipDirection (has flag-suitable values either by intent or by accident),
- eKeyMod (since 3.6.0),
- InputType (since 3.6.0).

The new ones in 3.6.2:
- RenderLayer,
- RestoredSaveResult
- SaveComponentSelection,

in AGS 4:
- StringSplitOptions,

While I am not entirely against the idea of a prefix itself, changing all of them consistently will break scripts that use these enums, and will require users to change their typing habits, which may be more damage than advantage gain from this change.
#718
The Score counting was removed from AGS 4.
This is mentioned in the Changes here: https://www.adventuregamestudio.co.uk/forums/ags-engine-editor-releases/ags-4-0-early-alpha-for-public-test/

Quote- Removed built-in support for Game Score, including related game settings and GiveScore script command. Users are advised to script their own score counter if they need one.
#719
We started documenting new 3.6.2 features. Their partial documentation may already be found in the manual along with the latest Beta, more will follow.

For the reference here's a wip version of "Upgrading to 3.6.2" article, that discusses important new features:
https://github.com/adventuregamestudio/ags-manual/wiki/UpgradeTo362
#720
I suppose that resetting to defaults may have uses if you have implemented "restart game" in script, or when you have a reusable pool of objects. Without the "reset" function, one has to set each property explicitly to their default values.
SMF spam blocked by CleanTalk