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

Topics - Monsieur OUXX

#1
Suggestions :

1) A separate shortcut for "search al files" and "search this file".

At the moment, pressing Ctrl+F opens the search dialog box. It is set on "Current document". In order to search all documents, the user has to press "Tab" followed by "down arrow".
It would be better if there was two separate shortcuts, which would either open this popup window directly on "current document" or directly on "current project".
Note: Unfortunately Shift+Ctrl+F is already taken by "Find All" which has a different meaning (it produces a list of results).

Which leads me to...

2) "Search this document" should have its own, smaller GUI control

Look at how it's done in VSCode or IntelliJ or other UIs. When searching the currently-open document, the search box is a tiny widget in the top-right corner of the open document. The "Look in" dropdown does not exist because it is accepted that it will search only here. the "case sensitive" tick box is just a small button with an icon. The "find next" button is just an "arrow down" icon, with F3 as a shortcut.
"Replace" would be the same widget but with an extra textbox underneath, for the new text.

Which leads me to...

3) (MAYBE) "Look in current project" (i.e. "search all files") should just be the "Find all" which I mentioned before.

The popup window could disappear entirely.
This one is a bit trickier than the to previous suggestions because I'm not sure how "replace all" would work in that situation. Don't spend time on this.


All in all, the center of the suggestion is to make "search all files" immediately accessible.

And an extra suggestion :

4) Add a shortcut for opening a script by name OR add filter to tree items

Now, an AGS game can have many script files.
In VSCode and IntelliJ, there's a shortcut which opens a textbox (Ctrl+P in VSCode). You start typing the name of a file in the textbox. It offers suggestions of files (scripts) that match.You select the file you want, you press enter, it opens it.
ALTERNATIVELY, add a small search textbox on top of the game tree (in the Editor's right panel) and let the user filter on that name. Of course it would search in tree items that are not currently expanded, otherwise it defeats the purpose.

At the moment, the two available flows are :
a) Shift+Ctrl+G to open the global script, then Ctrl+F to open the search, then Tab followed by arrow down to select "current project" (i.e. search all files), then press "find next" or use right-click+Go to definition, to open the wished script.
OR
b) click in the list of items in the right-side panel of the editor, and type the first letters of the script. It will select it IF IT'S OPEN (i.e. visible) IN THE GAME TREE.


Finally:

5) (BUGFIX) Fix the scrolling to the highlighted line of code

I'm working with a very wide screen (3840x2160). When I search for text in a file, it often happens that the highlighted result is actually outside of the file's viewport (i.e. a few lines of code below the last line of code currently visible). In other words: The search doesn't make the file scroll low enough to see the result.

I know these kind of issues are not easy, because there's a lot of geometry and assumptions involved. It can probably be reproduced by opening the AGS Editor and resizing the window to be short but very wide.

#2
Code snippet :

Code: ags

///////////// IN THE HEADER FILE ////////////////

struct MyStruct
{
  import static attribute int SomeStaticValue;
};


//////////// In THE BODY ////////////////////////

int get_SomeStaticValue(this MyStruct*)
{
  ...
}

void set_SomeStaticValue(this MyStruct*, int value)
{
  ...
}


The compiler complains that
Code: ags
'MyStruct::get_SomeStaticValue' has the qualifiers '' here but 'static' elsewhere. See ./MyStruct.ash

If I change it like this :
Code: ags
static get_SomeStaticValue(this MyStruct*)
It still doesn't work.
Error:
Code: ags
Expected 'static', found 'this' instead
#3
I upgraded my game to AGS 4.00.00.18-alpha22.
I'm still using the AGS3 compiler, not the AGS4 compiler.

Here are the problems I'm experiencing so far :

ISSUE #1 After about let's say, 5 to 10 "rebuild all" which all end up with errors found in the script, I get an Exception in the editor. I haven't screenshot it; my focus is not on that right now. But it happened every time (I would close the editor, open it again, run "rebuild all" 5 to 10 times, and get the same exception).

ISSUE #2 The Editor is an old .Net app. As a consequence, when running on high DPI screens (let's say 1280x800 or more), by default its UI doesn't get scaled up and appears pixely and slightly blurry. In order to fix that, we can enable "Change high DPI settings" in the Compatibility tab of Windows, and then tick "Override high DPI scaling behaviour". This works great (and it makes AGS look like a modern app), except for two things :
1) all the icons (run, save, properties, etc.) are tiny. They would need to be scaled up at least 4 times.
2) The "courrier new" font appears weirdly thin in the Code editor. So thin that at first I thought it was all grayed out. I made it work by using the first random open-source font replacement I came across (I went to dafont.com and picked "NK57 Monospace Sc Sb".

ISSUE #3 I've had one room (out of a hundred) that couldn't get converted from AGS 3.6.1 to AGS 4. It wasn't a big deal, I just deleted it. I can provide it if asked. Note that this room was created a LONG time ago, maybe in AGS 3.2, and went through AGS 3.4 and AGS 3.6.

Apart from that it's all good so far. Impressively stable.

I will continue adding items as I find them.
#4
Here's my situation :
- I'm using AGS 4
- I know that there is a ton of new features in the "API" (i.e. the scripting language).

Problem:

- I know of those new features by reading the "Releases" subforum.
- Those new features do not appear in the autocomplete, let alone in the CHM help file.

QUESTION: Is there a simple workflow that I could adopt to navigate the new features?

It's an open question: Anything suggestion would help. Even something less-than-ideal is welcome.

Right now I don't see any other way than browsing all the change logs in the forums, one by one?
#5
I fail to find the absolute simplest way of using method System.Log.
From what I understand (here : https://adventuregamestudio.github.io/ags-manual/EngineConfigFile.html   and here: https://adventuregamestudio.github.io/ags-manual/RuntimeEngine.html#command-line ) one has to add a command line switch.

Is there a way of simply enabling the logging from running the game in Debug, from the Editor?

I tried adding this to acsetup.cfg in the _Debug folder :

Code: ags
[log]
file=all:all
file-path=C:\Users\admin\repos\ags-essential-modules\AGS 4 essential modules\_Debug\log.txt

Unfortunately the file gets reset every time I run the game.

I tried with acsetup.cfg from folder \Compiled\Windows and \Compiled\Data,. those don't get overwritten but do nothing.

#6
AGS 4

- The last parameter of DynamicSprite.Create used to be hasAlphaChannel. Now, it's an int named "format".
- Object DialogOptionsRenderingInfo used to have a property HasAlphaChannel which it no longer has.

The help file of AGS 4 has not been updated yet and I don't know where to look in the forums in order to find out where exactly those changes were introduced (and explained).

A little help?
#7
Download AGS 4 alpha 11 (from the "AGS Releases" subforum) and try to run the Sierra template.
You'll get error message  ".on" is not a public member of "Character"

My question : I've never used that property, I didn't even know it existed.
- Has it been deprecated or did @eri0o simply forget to declare it in AGS 4 ?
- What is a workaround to that? Character has no "Visible" or "Enabled" properties.
 
EDIT: Enabled and Visible have been added, they just don't exist in the Help file. Problem solved!
#8
As AGS 4 cuts ties with old AGS features, should we get rid of the "old" on_key_press, and while doing it remove the old eKeyCtrlA, eKeyCtrlB, etc. ?

old way:
Code: ags
// Check that only Ctrl is pressed
void repeatedly_execute()
{
    if (IsKeyPressed(eKeyCtrlLeft)) { ... }
}

// Check that ctrl+A is pressed
void on_key_press(eKeycode keyCode) {
  if (keyCode == eKeyCtrlA) { ... }
}

New way

Code: ags
// Check that only Ctrl is pressed :
void on_key_press(eKeycode keyCode, optional int mod) {
  if (mod & eKeyModCtrl) { ... }
}

// Check that ctrl+A is pressed
void on_key_press(eKeycode keyCode, optional int mod) {
  if (keycode == eKeyA && (mod & eKeyModCtrl)) { ... }
}

See the help article of on_key_press for more details.

I'm adding a question mark because maybe those would still be useful do scripters who still brute-force key reading in their main loop?

Code: ags
void repeatedly_execute()
{
    if (IsKeyPressed(eKeyLeftCtrl)) { ... } // make the spaceship go pew pew
}

EDIT : yeah that last use case is definitely still valid for keeping eKeyLeftCtrl... Once again, writing a forum post made me walk myself through the process :-P

=====================

On a side note, I think the article could provide better examples :
Code: ags
//This checks if Ctrl was pressed : 
if (mod & eKeyModCtrl)

It could do with an example showing Ctrl+A instead of just Ctrl. I'm guessing most scripters are after that.
It could also do with an example of Ctrl+Alt+A as it is where the modifiers and the binary logic will shine
#9
Hello,

I haven't visited the forums in a million years and I have a lot of catching up to do.
I've been looking at AGS 4 (which is amazing btw, it resolves 99.9% of my grudges with the AGS scripting language -- remove the "export" keyword and headerfiles, and we'll be at 101% :-D ).
- I've downloaded the early version and I saw that all the standard templates are here (BASS, Sierra, etc.).
- I've also read that AGS 4 breaks compatibility with AGS 3.x.

Which brings me to my question : Have the scripts of the templates been updated?

For example in the Sierra template I see the KeyboardMovement 1.04 module. Is that module written in AGS 4 fashion or is it still AGS 2.x or 3.x script that just happens to work in AGS 4?
(Note: I've been trying to search the forums myself but the search feature is extraordinarily slow today... I had only one search out of 7 attempts coming to completion. Therefore I'm blind)

I'm asking because I remember that some 3.x template scripts had to do some backflips to work around the limitations of "struct", keeping track of indices -- instead of just putting structs inside structs (was it Tumbleweed? Can't remember. I think tween does that too).

So anyways no that it is the summer holiday I could put a bit of effort into dusting off the most important scripts. If you have suggestions feel free to let me know.
#10
Hints & Tips / Adventures of the black hawk
Thu 15/02/2024 18:05:38
I'm stuck when
Spoiler
Saint Cove needs to find some food to give to Olivier's dog
[close]

I don't know what to do because
Spoiler
there's food laying around literally EVERYWHERE in the game, there's even a dining room and so on, but Saint Cove adamantly refuses to pick up any of it, in pure point-n-click fashion.
[close]

I think that the solution might be that
Spoiler
I'd need to enter the tavern's kitchen, and to do so I need to distract the owner by recovering the grog's recipe. He mentioned that a woman stole it but I can't remember any other clue about it or where to go to find that woman, and unfortunately the dialogs can't be repeated.
[close]
#11
Godot drives me insane.

I can see that it has all the capabilities to achieve amazing things.
The issue is... No one has the knowledge.


Allow me to rephrase that : There are a TON of people who have Godot knowledge. The issue is... Unless you know someone who's willing to be fully involved in your project then it seems impossible to receive consistent and proper help with Godot.

There used to be some sort of Godot forum, similar to the AGS one, which has now shut down (every time you click on a google result you get a 404). Not a good move, I would say!

Then there's Discord. Have you ever visited the Godot Discord? Let me tell you, it's nothing like AGS. There's a gazillion posts per minute. And since it's a continuous flow of chat messages, there's zero consistency. Messages about several topics are mixed together, and you never know what will be the quality of answers. It's like a Russian roulette. The people helping have either no time to try to understand what you're doing, or give crude answers without explaining why the solution is the solution. When the answer is not plain wrong!

I remembered fondly my early days in the AGS forums, when there were people like Ashen, monkey0506, Khris etc. who knew what the hell they were talking about. The information was clear, correct, and there was room for follow-up questions.

Yesterday I tried asking ChatGPT about Godot. The quality of the answer was amazing.... I had a brief moment of euphoria, thinking I had finally found my solution... Until I realized it was ChatGPT3 and its knowledge stops in 2021. It was giving answers incompatible with Godot 4.1.1 (deprecated classes)! And of course, the Godot help page doesn't clearly state that the lass is deprecated (well, it does, but... at the end of the page!)

I'm literally banging my head against the walls. AGS is awesome. Godot is even more awesome (because it's a heavyweight) but all that awesomeness goes to shit instantly, every time.


I was tempted by an upgrade from AGS to Godot. But now I'm seriously considering reverting my experimentations and throwing away those last 2 years of experiments with Godot.
#12
Trying to build the unit tests (Common.Lib.Test and Engine.app.Test, in solution Tests) of branch ags4
On windows 10 with Visual Studio 2022

Is there a help page? (I don't think so).
I think I need third-party libraries Allegro (4?)  and gtest. Anything else?


PS: Please tell me I can use a prebuilt version of Allegro and that I won't have to rebuild it myself.
#13
I see in main.cpp that there's this main_process_cmdline function to parse command line arguments.
But I also see in cmdlineopts.cpp that the same code has been rewritten in modern c++.

Is the new code supposed to be part of AGS4, and, if yes, what do I need to toggle to enable the new code? Nothing seems to be using CmdLineOpts::Parse.


My bad. It's used by the new compiler. The Engine's startup simply hasn't been updated to use this too.





#14
I'm currently in a professional environment.
the acwin.exe from AGS AGS-3.5.1.19-P12 triggered the following false positive : https://www.f-secure.com/v-descs/w32_malware.shtml

I've submitted the file to FSecure (by using their dedicated form)  in the hope that their automated heuristics will learn not to flag AGS.

I'm not looking for solutions, just sharing knowledge.
#15
EDIT - useless first post
#16
I'm looking at the engine source code.
In this file ( cc_instance.cpp ), I see that the engine looks at the "actions" that have been queued, and then pops them in order to execute them (by calling the c++ function that has a matching prototype).

A function "matches" if :
- It has the same mangled name
- It has the same number of parameters.

To check that it has a known mangled name, it iterates over every known function name, and does a strncmp each time
Code: ags

if (strncmp(thisExportName, mangledName, mangled_len) == 0) { ... // line 352


Is that still a thing?
If yes, that would be a spot for extraordinarily beneficial somewhat beneficial optimization. EDIT: I realize that checking on the string's length first probably removes a lot of work from the comparison. But still, just a few function overloads can add quite many loops! E.g. comparison of mangled names "Button::Animate^4" with "Button::Animate^7"
Or maybe I misunderstood the purpose of this function and it's not meant for executing one instruction but instead for linking modules (and their symbols) together, only once? Or maybe this applies only in Debug mode, and the Release code gets rid of mangled names entirely?



#17
Is there still a technical reason for the "int" value of a color to be awkward?

By awkward I mean two things :
1) The fact that R, G and B values work by increments and maintain backwards compatibility for palettes, which doesn't let us use all the values for B (see help article for DrawingSurface.GetPixel). Blessed be the innocent soul who does SetPixel 0-31.
2) the fact that int colors go roughly from 0 to 65535, which means 16 bits

Maybe there's a smart way of making those values 32 bits and getting rid of a lot of crap?
#18
I remember CW saying that one of the obstacles of easily "managing" managed objects inside the AGS virtual machine is that they share the same address space as basic pointers. I don't remember exactly which kind of difficulties it was causing but I clearly remember that it was creating a technical glass ceiling -- because in the end everything is a pointer. So this limitation was indirectly impeding some glorious steps towards engine modernity and dynamic objects. 

This message is not to ask "what is the problem exactly" but to suggest a solution. Maybe what I'm about to write is dumb and has nothing to do with the issue, but here goes nothing. I've done that successfully in some pseudo-VM I was writing in AGS :

Split the pointers address range in two. I mean, a pair of completely artificial "fake" addresses ranges. For example :
0x0000 --> 0xFFFF = old-style pointers, nothing changed.
0x10000 --> 0x1FFFF = managed objects. You generate those exactly like you used to (values from 0x0000 to 0xFFFF), but you immediately add 0x10000 for as long as they're passed around as value from C++ function to C++ function-

With a simple binary mask you can tell which value represents which type. <= 0xFFFF = regular pointer. >=0x10000 = managed pointer.
Whenever you need to actually read/write to memory, just remove the bogus offset : For example, convert managed pointer 0x100AA to 00AA, then do whatever you would normally do (pointers arithmetic, real address in memory, etc.)

Food for thought.


#19
Context:
AGS has no problem working with high-resolution games : With hardware acceleration it can display lots of sprites and tint them, etc. The engine is also performant enough for scripting effects when you stick to built-in operations (native sprite scaling, native transparency, etc.).

But AGS becomes slower when you want to make the AGS script handle more intensive algorithms, such as iterating on large arrays of hundreds of thousands of items, or trying to perform per-pixel operations on larger sprites, or when your function calls stack exceeds a certain depth.

This is why when it comes to scripting, especially special effects, AGS is better suited for low-resolution games : 320x200 or 640x480. And that's also why advanced shaders written with the AGS scripting language are out of the question.


I sometimes ask myself why that is. What are the reasons why the AGS scripting language is not lightning fast?

Having very little knowledge of the engine's code, I can't seem to come up with a reason :
- It uses SDL, which is very close to the hardware. If not the fastest possible option, it's pretty close.
- It's written in C/C++
- The virtual machine is running pre-compiled code, literally just byte code.

So, what is slow in all this?
Is it that the VM's instructions are not mapped directly to the underlying CPU instructions? Is it that the engine uses simple data structures with a lot of overhead and lookups? Etc.

#20
I want to add a new sort of "Component" in the AGS project tree.

- I duplicated "ScriptsComponent" and named it "FooComponent".
- I replaced the word Script/script/Scripts everywhere relevant.
- I did "AddComponent" in ApplicationController.cs
- Finally, I duplicated "scripts.ico" and "script.ico" in the Resources folder and named the new files "foos.ico" and "foo.ico".
- I added those files to the Resources folder in the project ("Add existing item").

Everything compiles, but when the Editor starts, ResourceManager.GetIcon crashes. It says that "System.ArgumentException: 'Resource 'foo.ico' cannot be found in class 'AGS.Editor.Resources.ResourceManager'.'
.


Again, I did everything like ScriptsComponent does it, except with "Foo" in place of "Script".

So, my question : Do new resources (icons) need to be added explicitly to some sort of Resources manifest file or some list that I failed to locate?
Why are the new icons not found? Not found in what? (in the file system? In some list?)

SMF spam blocked by CleanTalk