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 - Monsieur OUXX

#121
The test project can be downloaded here.

The test room is room 130.
You can access it by doing this :
- Start the game
- Ignore error messages (click to dismiss "Display" messages)
- You're presented with a panel. Focus on the right-hand side. Scroll down (you can use the mouse wheel) and double-click on entry named "UPSCALE (no upscale)"

When you enter the room a GUI appears on the left. Top buttons are to increase and decrease viewport size and move it around
Bottom buttons = same but for the camera.

Pay special attention to the fact that the camera cannot go above160x100 (why???) and to the fact that mouse coordinates go up to 320x200, not 640x400, even when the room is zoomed out and you can see that the screen is effectively rendered in 640x400.
#122
Thanks.

There's definitely a problem though (I think?) :
Code: ags

function room_AfterFadeIn()
{
  Display("Room size: %d, %d", Room.Width,  Room.Height);
}

...Displays "Room size: 160,100".

We agree that the Viewport and the Camera cannot impact on the room's size, correct? The only thing that defines the room size is the size of the background image at the time it was imported?
#123
Yes I have a mixup regarding the mouse coordinates (screen coords instead of room coord).
But so you confirm that the image should have been upscaled.

I'm whipping up a prototype game with buttons to change the viewport and the camera in real time, to see what's up, because its so new to me I'm struggling.
#124
Version: AGS 3.5.1.5 patched with latest build

Scenario:
- I had a 320x200 game.
- I changed the resolution to 640x400
- AGS asked me : "Do you want to automatically rescale the GUIs?" - I said no.
- I created a new room
- I set a 320x200 background
   So now I have a 640x400 game with a 320x200 background

- I run the game.
Now, this:
I see the 320x200 image fill only the top-left quarter of the screen. Why not, I'm not really shocked here I didn't expect AGS to upscale it for me.

Then I add this :
Code: ags

function room_RepExec()
{
  if (mouse.IsButtonDown(eMouseLeft)) {
    Display(String.Format("%d, %d", mouse.x,  mouse.y));
  }
}

This way every time I click I see the mouse position in room coordinates.

To my great surprise when I click in the bottom right of the screen the coordinates are 320,200.

Can someone explain this contradiction?
- The actual background of this 320x200 room is rendered as a 320x200 image in the top-left quarter of the 640x400 game (in other words: no upscale)
BUT
- the room coordinates are upscaled so that room coordinates (320,200) match screen coordinates (640,400) (in other words: upscaled)


Is that expected behaviour?
#125
OK it must be Paint.Net that acted too smart for its own good with the "auto" setting.
The weird thing is that it was the second image I saved (exactly like that : grey-scale image just with a different resolution) and the first one worked perfectly

But any ways, it's not an AGS problem, sorry for using your grey cells for that.
Thanks!
#126
Version : Using the Editor from this build (somewhere around 3.1.5.x EDIT: 3.5.1.x).

This doesn't really need to be fixed, just thought I'd let you know.

Scenario :
- 32-bit game, 640x400
- Open the Sprites "manager" from the AGS Editor
- Right-click : "Import new Sprite(s) from file"
- Select this PNG file
- First weird thing : The colors in the preview popup are broken
- Click "Import" anyway. Error popup :" Unknown pixel format".

The image doesn't have transparency, it's a very basic PNG file created using Paint.net 4.2.15

Note: No problem importing when I force Pant.Net to save it with 32-bit colors. The image that caused issues was saved with settings "auto-detect format". I don't know if it created it with a weird palette behind the scenes, I'm just curious why AGS (and its perfectly standard middleware, like LibPNG) fails to read that specific format.
#127
It works!
Perfect.
Back to debugging my own scripts  := ! Thanks again, you two.
#128
Quote from: eri0o on Tue 11/05/2021 12:52:21
Monsieur OUXX, there's a successful build of 3.5.1 (non-released, this is just a build of a commit, please backup your game before!) here : https://cirrus-ci.com/build/4539306049011712 (it's a later commit but should have that fix too)

Sorry to be daft but where in the screen do I click to download that build of AGS?

EDIT: Got it.

#129
Nevermind the hyperbole, you're a f*cking hero. This. this is literally why I stick to AGS.

FYI the continuous build crashed so I can't get my hands on the 3.5.1.x patch. And I've converted my files aay from 3.5.0.x so I can't try it with that one. I'll wait for the next 3.5.1.x build -- as long as I know it's fixed I can work on something else until then  :)
#130
Bump.
I've tried really hard to find what's wrong. I failed. It's really the engine that, at some point, "loses" the meaning/pointer/handle of keys[ i].

If I do this just before using keys[ i]...
Code: ags
String keys2[] = innerObj.GetKeysAsArray();

... then I can use keys2[2] (no crash) but I cannot use keys[2] (crash).

My immediate suspicion is that it was me who somehow messed with array keys while iterating on it (the single biggest no no in programming, as you know), but if that's the case then I couldn't find where!
#131
AGS 3.5.0.24. Same issue with 3.5.1.4 (beta 5) and 3.6.0.2

I've never experienced that issue before in any of the thousands of lines of code that I've written.
Annoyingly, I didn't manage to isolate this issue in a simple piece of code. All I can do is provide the complicated AGS project (DOWNLOAD HERE).
I think the issue is in AGS' virtual machine, not in my code. A bug in the stack/heap or something.

Simply open it and run it. You will get "Error releasing pointer: Invalid handle".

This happens on the line containing a closing curly bracket ( } ) because I'm guessing that's where the engine frees local variables.
The issue is definitely with variable "keys" which contains the result of Dictionary.GetKeysAsArrays (i.e. a String[]), and here is how I know it : If you get rid of variable "memberName" and use "keys[ i]" instead directly, then you will get the same error ("invalid handle") on the line where you try to read keys[ i].

Interestingly the error does not happen in any of the subfunctions that have their own local versions of .GetKeysAsArrays (e.g. function ToConsole). It happens only in this block. So I suspect a weird obscure bug in the virtual machine.
I suspect that the handle to the pointer (I mean the handle that's local to this specific code block) becomes messed up when we call GetKeysAsArrays again on the same Dictionary but in another context (inside a subfunction or something) and then try to use the original handle. But it's just a theory.

I'll try with the new compiler, maybe it will help.
EDIT: I don't know how to get a built version of AGS 4.

Here I've rewritten the function without all the obscure code and macros, it's much easier to read:
Code: ags

void MyFunction()
{
        Dictionary* o = ...
        ...

        String keys[] = o.GetKeysAsArray();
        for (int i=0; i<o.ItemCount; i++) {
          //+DEBUG
          o.ToConsole(); //This uses GetKeysAsArray to iterate on every key and write the vale into a file
          //-DEBUG
          
          //AGS engine is having issues managing keys[i] all the way through. At some point it throws "invalid handle"
          String memberName = keys[i];
          
          String memberValue = o.Get(memberName); //You can try to use keys[i] instead of memberName and see what happens
              
          if (memberValue != "undefined") {
            
              ...
              o.Set(memberName, "undefined"); //You can try to use keys[i] instead of memberName and see what happens
              ...
          }
        }
        
       ...
        
      }
}
#133
Quote from: Creamy on Thu 01/04/2021 22:59:15
Nice graphics. I was surprised to hear a french theme song. Before reading the presentation, I assumed the hero was spanish since he looks a bit like Zorro and the game is developed in Spain.

This is remotely inspired by "The black tulip" which was written by Alexandre Dumas (same as the 3 musketeers and Count of Monte Christo). Even though not massively famous, the original story and its character still had some success in Western Europe, there was a movie with Alain Delon and so on. Hence the French/Spanish vibe : The movie was mostly a French production but it's one of those things that are in the collective pop culture of non-English Europe. So much so that a Spanish team decided to make a game out of it.
And yes, he's like a French Zorro (preceding Zorro's creation by 70 years  ;) ). You could also say he's like a French Scarlett Pimpernel (except the Scarlett Pimpernel is ultra-royalist bullshit  :P ).

In conclusion : This is a very cool project inspired by an underrated main adventure character. And they changed it enough to make it their own. Win-win!  ;-D
#134
OH MY GOD YES.

For those who don't know, Croquetasesina the core team of this project is a talented group who can actually pull off this kind of graphics, it's not just for show.
#136
@nightmarer, don't let this die.
#137
I'm not sure exactly where the 500-characters limit lies (In the code editor itself, when writing a literal String? In the Display function? In Label.Text?) but either way the DATA stuff adds less than 10 characters, plus it's removed after it runs through the SmartString function. Plus you can still declare it in two strings and then display it in one. All in all : I'm confused by your theoretical problem. Let's leave it there, I think you got all the answers you needed by now regarding iterative enhancements of translations?
#138
You're asking two questions:
1) what are the catch-22s of importing an 8bit image into a 32 bit game? How does it work?  Good question. I haven't done it myself. I'm curious: I would have thought that the kind of matrix you want to manipulate is generated from inside the game? But you're suggesting that you generated it outside. Could you detail your process a little more? maybe you should save it as an actual 32-bit image and do the conservation in the script *after* importing the image?
2) yeah there's only 5 bits per channel, and I think blue even has only 4 bits or something, I can't remember.. Again: I'm not sure how you generated the image in the first place, otherwise I would have suggested you configure two channels to get your precious 8 bits. As in: for example using the range of blues to represent values from 0 to 127 and the range of red to represent values from 128 to 255.

If it can help I have a module to store arrays of ints into dynamic sprites and back. If it works for values 0 to 16,000,000, surely it can work for values 0 to 255. 😉😉 It's slow and awful but it does the job, and it will save you the research time to avoid the caveats of GetPixel.
#139
Quote from: Honza on Tue 02/03/2021 00:39:37
"Best programming", heh, glad nobody saw the actual code ;)

I nominated you for that because I saw a few interesting things, like the zoom out, or the shading of the character fading nicely when he goes up and down the elevator (it might just be a semi-transparent black overlay, but nevermind, the illusion worked).
#140
I'm not sure what kind of text you'd be writing that the Editor couldn't handle in one line! Unless you only mean that it doesn't fit in the window and you'd have to scroll horizontally. But then it's the same as with any other line of text. If you're worried about the capacity of the "string" variable type, then, again : What the hell are you trying to do?   ;-D ;-D ;-D

Forget about the SmartString thing, I didn't want to hijack the thread, just to give extra options.  ;-D
SMF spam blocked by CleanTalk