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

#281
Quote from: Crimson Wizard on Mon 09/03/2020 14:03:07
I think most of this may be done in script.
No. It's the answer that's given every time, and no it can't be done in script
Again : You can't do dynamic arrays of arrays in AGS, and when you pass an int[] you have to pass its length (or save it as metadata and then you ruin your straightforward for loops like you said) and return the int[] if you changed it, it's a nightmare. I have the exact same Array module as you have, and both our modules do exactly that : pass the length and return the new int[]. If you want to implement something as simple as Pop (which must return the resized array and the value) you hit a wall and the hacky solutions start.

If you go that way, Dictionary and Set could also have been done in script.
I don't want to throw tantrum, it's just that I have to same the same things every time for 10 years. I can even continue the conversation on my own : "But of course you can do arrays of arrays, if you store a two-dimensional array into a regular array", at which point I reply that then the biggest array determines the size of all arrays (unpractical for hundreds of arrays of wildly different sizes) or you have to implement crazy-complicated memory allocation routines.
#282
Quote from: Monsieur OUXX on Sat 07/03/2020 13:55:19
What kind of object for "arrays of int"?

Code: ags

IntArray* a = IntArray.Create();
a.Insert(0, 666); // a == [666]
a.Insert(0, 777); // a == [777, 666]
Display ("%d", a.Length); // "2"
a.Set(0, 888); // a == [888, 666]
a.Remove(0); // a == [666]

// If you have the energy : 
a.Sort();

// If you have the energy : 
FloatArray* a = FloatArray.Create(); //If you do that, you divide the size of the Tweens module's script by 3. :-D


The main difference with int[] being that you can pass the object to functions (without having to return the new pointer to it if you increased its size inside the function), create an array of it (arrays of arrays: the holy grail), and get extra attributes (like Length) without hacky programming.
At the moment I'm doing it using the Dictionary but all the String to int conversion is so slow.
#283
Don't worry, it's crystal clear.
Yes, I'm afraid there's no magical solution to break the depencies cycle.
I can see one possible enhancement (I won't detail here) to let A and B route themselves which of their methods is called by the event at a higher level. They would contain their own "switch case" where every case calls directly a helper function that's just right next to it inside A or B,. This way the events "depiler" doesn't have to know anything about A or B except their existence.

Also maybe add classes AB here and there in the chain of depencies for doing the same kind of routing, grouped by classes themes (some sort of degenerate system of namespaces)

Long things short: it's kinda possible, but as you said it requires a ton of work.

That said, the new Dictionary object alleviates the whole serialise/deserialize madhouse and object pointers. I wish there was the same kind of object but for Arrays of int (Crimson A and the gang wink wink this is my monthly whining about that feature).

The one thing that bums me out, though, is still the same thing: the absence of control on WHEN the stacked events get unstacked. Gurrr.
#284
Quote from: eri0o on Fri 06/03/2020 19:31:04
AGS has a limit of 4 "native", events per frame (on_key_press, on_mouse_click, on_event, ...), like, if more than four happen in the same frame, the others get dropped.

No that's correct I've read it in the manual too.
#285
Warning: This is advanced.
This is purely a question about programming in AGS language, to push its boundaries as far as possible. I'm exploring ways of implementing pseudo-callbacks in AGS script. For example, to be able to easily trigger stuff (in arbitrary locations of my scripts) whenever a Tween ends. But that's just one use case among thousands. And if I find a way I'd even go as far as implementing reflexivity.


Here's the scenario:

- In most modern programing languages, you can declare the classes in any order and then call the methods of any class from the methods of any other class
- Not in AGS, though. It works pretty much like C:
      You define a class "A" (actually a struct), that has a method "foo",
      then a struct "B", that has a method "bar",
      then inside B.bar() you may call A.foo(),
      but you cannot call B.bar() from inside A.foo(). Because the script file for A hasn't encountered B yet during compiling.
      => You need to think of the order of your dependencies properly.


However I do want to try to find a way of calling B.bar() from inside A.foo().
I see two ways of achieving this :

Idea #1 : you manage to implement an events pump as a hack for making dependencies loop

This one would only allow asynchronous calls (callbacks) because you can't predict when the event will be taken off the pile.
First you need to create an object to pile up so-called events, very low in the dependencies chain. So that every class can call it and say "I want to call a function please".
Then those events remain stored there until someone else decides to unpile them and start calling the requested functions.
I see two entities that could start reading the events from the pile :
- Either I have a dormant piece of code in late_repeatedly_execute_always that does it and calls all my callbacks at the very end of the game loop.
OR
- (Not sure if this one is technically possible) use AGS' built-in events to trigger a custom event. I'm just not sure when AGS would then read it, in the frame's lifecycle (in never use on_event because I suck). Then in on_event I would do the same thing as in the previous variant: read what function needs to be called, get the data (parameters and stuff) from the pile,  and call all the callbacks in an infinite loop until there are none left to call.

Idea #2 : Both are actually the same class, and the code is stored externally to AGS.

This is very hard. I'm not so much interested in that as  I am in idea #1. But this would allow an immediate, synchronous call.

Think Javascript. In a nutshell, their methods are not "real", they're just strings that you store in a dictionary when you initialize the game. Both A and B are actually some struct "Class" that has only one static method "Class.Call(structName, methodName, parameters)". Then, with more custom scripting, you let AGS run the relevant bit of code (the classe's method) from that, with nothing but a fancy giant "if (functionName=="foo") { ... }".

But then there's still the issue that the contents of the function (its instructions) have to be stored in an actual function, that's part of an actual module, and the dependencies order comes back (unless you want to write every functio of every class in the same struct, which is suicidal). So you'd need every so-called function to be accessible from anywhere. Basically, if the "events" hack described before is not enoug, then the only solution, I think, would be to write an AGS interpreter in AGS script and store the functions in external text files that would be read at runtime (there is already a primitive interpreter as part of module AGSConsole, or Ultravariables , that's a start).


=

So, what do you smart people think? Maybe focus on the on_event scenario for a start.
#286
Quote from: Privateer Puddin' on Fri 14/02/2020 12:16:03
Feria is a 320x200 game.

For the title screen / options, I have a 1920x1080 sprite (character) which I manually scale at 17% (roughly 320x200, think in reality it's like 16.x%) and then just enable the option to render sprites at screen resolution. If the player is playing at something above 320x200, they'll benefit from higher res on those screens.

So I'm not sure it's doing what you want.

You scoundrel! That was a plan B that I briefly considered but then I got scared that the hack would break with some unforeseen AGS update!
I never thought that Feria d'Arles worked like that. You have a gazillion hi-res GUIs with animated buttons!

@Danvzare : thanks for the tips
#287
The game "Feria d'Arles" does exactly what I want to achieve. And they didn't bother with the mixed resolutions when the character is downscaled.
I'll contact its makers and see if there's any hidden difficulty.
#288
Quote from: eri0o on Wed 12/02/2020 15:27:22
If you set character scaling to 50% with Direct3D9, then you get mixed resolution

I that still true? I thought this had been "fixed" a million years ago?
#289
Quote from: Khris on Wed 12/02/2020 23:18:38
I'm curious about one thing: why create a bigger game in the first place? Why not create an actual 320 game?

There is a handful of elements for which I'd like sub-pixel positioning.
Mostly :
- Fonts for complex translations (Chinese characters)
- smooth scrolling of both the scene and the potential parallax (the background moves slowly and 320x200 makes it look jaggy)
- GUI movements (fancy buttons or areas moving smoothly)
- hi resolution debug interface with a lot of data to pack in a small screen

Just the same way 32-bit colors can be used to achieve "luxury" VGA (transparency, etc.), sub-pixel positioning could be used to achieve "luxury" low-resolution games.

#290
Quote from: eri0o on Wed 12/02/2020 14:43:47
Some future version of AGS will have object Scaling (code is already in) and character already has scaling. You can make the background an object too so you can scale it. You will still need to supply a blank background of the size you want the room to be.

OK so it's basically back to the original solution : Upscale everything on screen to x2, either beforehand (scaled up sprite) or dynamically (scaled up character). With the issue that a character might be scaled up to only 150% instead of 200% (if he's walking on a walkable area where the character is not meant to be at full size) and then the mixed resolution is slightly visible to the player.
#291
eri0o your solution is quite elegant (love it! I didn't realize the the camera's size is now a thing)

It allows this :
- place a GUI on a half pixel

However it forbids this :
- place an object in the room on a half pixel

The latter would be nice to make smooth scrolling even smoother.

More ideas on how to fake-downscale a game with minimal effort and minimal supersampling ugliness?
#292
Quote from: eri0o on Wed 12/02/2020 10:20:24
Do everything at 320x200, and set the viewport as the screen size and camera at 320x200.

I didn't understand.

Let me know if I understood properly :
- the game is 640x400
- the room is ... 320x200? 640x400?
- the viewport is 320x200

Are you saying that the viewport is rendered automatically scaled up when it's smaller than the game's window?
Would your solution still allow me to position some elements, let's say, at 401 pixels ? (making them appear inbetween 200 and 201 pixels in the fake 320x200 resolution)
#293
I'm wondering what would be the best way to achieve this :
- The AGS game is 640x400 (or more, whatever). To keep it simple, we stick to a resolution that is a multiple of 320x200.
- You want it to look like a 320x200 game.

How would you do that?

The easy answer :
- import every background scaled 2x
- import every sprite scaled 2x
- etc. Everything 2x!
- Align sprites on a 320x200 grid instead of the game's real resolution. (in other words: if your game is 640x400 then don't use odd numbers coordinates)


The challenges :

- Character scaling : instead of having a walkable area that lets the character go "from 80% to 100%", you'll set it to "160% to 200%". Simple. But then the scaling won't be "nearest neighbour in 320x200"; When the sprite walks around at 160%, you will see that the sprite is actually at a higher resolution than 320x200 (if you're familiar with scaling issues you'll know what I mean).
- character positioning : the character can stop at "half" pixels.

Allowed cheats :
- it doesn't matter of the room's scrolling stops at "half pixels"
- it doesn't matter if tweens make use of half pixels

So in the end it's actually two questions :
1) Am I missing a challenge? Something that will be extremely time consuming?
2) Do you have ideas on how to make it look "more authentic" in general?

#295
Critics' Lounge / Re: Jurassic Park Sprite
Wed 12/02/2020 08:55:49
Same critics as 90% of sprites submitted in Critics Lounge: Contrast is too low.

Solution :
- Drop one or two shades in the shirt (you indulged in unnecessary anti-aliasing)
- Instead, darken the darkest shade.
- make sure that the light comes from the top : illuminate the top of the hat (not its side!) and illuminate the top of the shoulders (not their sides!).
- The face which is under the hat should also maybe be a bit darker -- but the choice is yours for readability.
- Same thing for the legs : Darken the darkest shade a teeny bit (the one that's under the knees) OR add a highlight at the bottom of the legs, where the pants rest on the shoes.
#296
I mentionned the plugin on the Fonts wiki page but only now am I realizing how powerful it could be for pushing AGS' limits, especially in regards to translations.
#297
Quote from: daneeca on Tue 11/02/2020 10:11:26
Hi guys!

We are working on an adventure game and the investors really want to have a chinese translation. They already started to translate it in a Word document. Is it possible to use this method to create a chinese translation?

Any ideas and advice would be greatly appreciated. Thank you!
I'm guessing you'd be the first person ever to translate an AGS game to Chinese. If you succeed, then please post your method. Do you speak Chinese yourself?
Food for thought : https://www.localizedirect.com/posts/chinese-game-localization-factsheet
#298
Quote from: eri0o on Tue 11/02/2020 15:55:41
Can you elaborate on which options you think requires additional explanation through tooltips?
Well stuff like the vertical sync or DirectX. Only a handful of people know what that's about. I can only imagine their anguish, trying to decide what to click.

Quote from: eri0o on Tue 11/02/2020 15:55:41
About the large and clear minimalistic ui, I lack the design capabilities to design it, but if someone can come up with such design, I can implement.
For example imagine several tabs : One for graphics, one for sound...
Quote from: eri0o on Tue 11/02/2020 15:55:41
About the preview, I don't understand how it would work.
Like you said, just a static image showing you how the game would stretch, or be surrounded by a black box, stuff like that.


Quote from: eri0o on Tue 11/02/2020 15:55:41
I also found an old request in the forums to hide options from the ui
Yes, the most obscure options should be hidden.
#299
Perfect

Can you explain the difference with Winsetup? It looks stricly identical.

A big plus to the basic Winsetup would be this :
- A large, clear, minialistic UI (with icons and tabs or whatnot) in the style of modern websites.
- A preview of what the selected graphic options would look like.
- A short explanation text appearing each time you hover or click on an option.

EDIT: Is the novelty here that winsetup.exe was not available on Linux and Mac`?
#300
Quote from: Snarky on Tue 11/02/2020 10:02:06
Quote from: Monsieur OUXX on Thu 06/02/2020 15:52:51
I don't understand : Does this apply to AGS?


EDIT: Oh yes, yes it does! And I already have the logging module ;)


Please explain. How would you performance-profile an AGS game?

I was mistaken. This does not apply to AGS. At least for performance. For a moment there I thought it could be useful to visualize stuff like "how much time does my tester spend in that room?" if you write it into a Json file during the game session.
SMF spam blocked by CleanTalk