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

#101
Editor Development / [AGS4] Syntax overhaul
Mon 06/09/2021 17:39:39
Fact : AGS script is VERY inspired by C. It's the archaic side to AGS.

Don't get me wrong. C is a fine language, and it works.

But nowadays, who declares a class as "struct"? Who uses so-called "pointers" in a high-level scripting language?
The only reason why AGS still offers both managed and unmanaged is because until the latest versions dynamic structures were not fully implemented. And this is on the verge of being fixed.

Here is my suggestion :
Quote
1. Accept to break (a tiny bit of) script retro-compatibility upgrading when from AGS 3 to AGS4.
2. Replace keyword "struct" with "class"
3. Make *all* structs managed.
4. Get rid of the "asterisk" ( * ) when dealing with managed objects.
This would effectively make AGS move to the age of References rather than pointers.

So INSTEAD of this :
Code: ags

managed struct A {
  int i;
};

function Foo(A* a) 
{
   a.i = 777;
}

void game_start()
{
   A* a = new A;
   Foo(a);
}


...the new syntax would be this. And would look like most mainstream languages.
Code: ags

class A {
  int i;
};

function Foo(A a) 
{
   a.i = 777;
}

void game_start()
{
   A a = new A;
   Foo(a);
}



The beauty of this is that almost everything is already there. It's only a matter of substituting some syntactic elements with other syntactic elements;
#102
Advanced Technical Forum / Polymorphism
Mon 06/09/2021 16:47:28
I'm experimenting with the old discovery of monkey0506 that polymorphism is somewhat possible. He explained it here : https://www.adventuregamestudio.co.uk/wiki/Extender_Methods_mean_Polymorphism!

What I've done :

HEADER
Code: ags

managed struct Base {
};
import int GetSetting(this Base*);


managed struct A extends Base {
};
import int GetSetting(this A*);


managed struct B extends Base {
};
import int GetSetting(this B*);



BODY
Code: ags


int GetSetting(this Base*)
{
   AbortGame("You need to overwrite this function");
}

int GetSetting(this A*)
{
   return 666;
}

int GetSetting(this B*)
{
   return 777;
}


Then I do this :
Code: ags

Base* array[10];
array[0] = new A;
array[1] = new B;

So far so good. I've managed to store instances of both A and B into the same array of Base.

My issue is that I don't know how to cast back.

If I do this :
Code: ags

Base* o = array[0];
o.GetSetting(); //This causes AbortGame because it calls Base::GetSetting instead of A::GetSetting



And if I do this :
Code: ags

A* o = array[0]; //The compiler forbids this. It doesn't know how to cast back from Base* to A*


Do you have an idea to make polymorphism work? Something like GUIControl::AsLabel or GUIControl::AsButton.
If I try to write this I'll encounter the same issue as before :
Code: ags

A* AsA(this Base*)
{
    return this; //AGS won't know how to cast from Base to A.
}
#103
Quote from: Alan v.Drake on Sat 04/09/2021 03:49:24
You should also try the AGS4 branch, all the cool new stuff is coming there.

Hm. I hear you, but you sounded like you were replying "in general" rather than specifically stating that the examples I described above are now possible.
I don't want to switch to AGS4 just to discover that there's a lot of new cool stuff, just other cool stuff, not this.
#104
As far as I can see, in AGS 3.6.0.8 (patch9) : (September 2021)


This works and it's really cool :
Code: ags

managed struct A {  // <-- MANAGED
  int i;
};

struct B {  // <-- NOT MANAGED
  A* a; // <-- Pointer to managed.
};



This works and it's really cool too:
Code: ags
managed struct A
{
  int i;
};


struct B{
  A* array[];
};

Later :
Code: ags

   B b;
   b.array = new A[10];
   b.array[0] = new A;
   b.array[0].i= 666;



This does NOT work :
Code: ags

struct A {  // <-- NOT MANAGED
  int i;
};

struct B {  // <-- NOT MANAGED
  A a; // <-- Compiler error! Non-managed inside struct.
};


This does NOT work :
Code: ags

managed struct A {  // <-- MANAGED
  int i;
};

managed struct B {  // <-- MANAGED
  A* a; // <-- Compiler error! Pointer to managed inside a managed.
};


Correct?
#105
Quote from: Crimson Wizard on Fri 03/09/2021 15:09:48
NoNative solution is pure C# and does not require any .h files.
Ah yes duh. Thanks for all the answers! (I don't need to know more about the compiler)
#106
OK that was all gibberish to me but I'll take your word for it.
Did you see the other questions?
#107
Quote from: eri0o on Fri 03/09/2021 12:21:09
The WinDevDependenciesVS.zip package is really recent, it was added on last version - I got a new PC and had to configure it so decided to add it (and we had a ticket on the issue tracker for it). We could add a bootstrap script (to set-up dev environment) and I honestly planned on adding one after the package was included in releases, but I am in the midst of too much homework (studying coding stuff) and had zilch time. :/

Have you considered using NuGet in C++? That's slowly becoming a thing. SDL is there.
EDIT: Added more quesiton sin my last post above ^
#108
Quote from: Crimson Wizard on Fri 03/09/2021 10:39:22
"ags3--sdl2" was a temporary branch where we prepared SDL2 version, and it was long since merged into the "master" branch.
OK cool, didn't know that.


Quote from: Crimson Wizard on Fri 03/09/2021 10:39:22
I recommend to set up user's enviroment variables instead of modifying the projects
Yes, I'll do that. For now I just want to see if I can compile at all.


Quote from: Crimson Wizard on Fri 03/09/2021 10:39:22
For the reference, here's latest release page: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.8
The prebuilt package is called "WinDevDependenciesVS.zip", here's direct link: https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.8/WinDevDependenciesVS.zip

New questions
1. Do the releases always have a Dependencies package released? If yes then maybe the readme should just say "Go to the latest version's forum thread".
2. What about Native? Is it still used at all or has it finally been ousted? (no need to give details, just yes or no)
3. What about the Compiler solution? Can it just be compiled out of the box? Is it simpler to grab the DLL from the latest AGS release? where do we get the .h files when compiling NoNative?
#109
WOW. No one reacted to this but this is MAJOR news! It will unlock A LOT of potential for localisation.
#110
A bit late to the party, but: generics are hard to implement (at least syntactically in the compiler).
Whereas there's a much more reachable goal post:  an untyped pointer type (for example: Pointer*) that supports casting. This is how genericity was achieved in early languages since ever -- before C++ had templates and so on.  (void* in C, Object in early Javas... Even object in C# if you're a psychopath).

This idea is already partially implemented in AGS when you have a GUIControl* and you cast it to Button*, Label*, etc.


Apart from that I am extremely excited to put my hands on pointers in managed structs.
#111
Despite the end of my post, "just suck it up and build the library yourself" is an acceptable answer. I just want to be sure that it's not just lying around somewhere.
#112
Thanks for the shout out guys! And thanks for suggesting Meetup
#113
I want to build the SDL2 branch of the Engine on Windows 10.

I'm following those instructions : https://github.com/adventuregamestudio/ags/blob/master/Windows/README.md

Here is what I've tried :

1. Open Visual Studio 2019
2. Clone repository : https://github.com/adventuregamestudio/ags.git
3. VS asks me if I want to convert the project to VS2019. I say yes.
4. Switch to branch ags3--sdl2
4. Open solution 'Engine'
5. Download SDL2 from https://www.libsdl.org/download-2.0.php ( SDL2-2.0.16-win32-x86.zip ) , unzip it to a random folder
6. In project Engine.App, set the path to SDL2's include folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
7. In project Engine.App, set the path to SDL2's lib folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
8. Download glext.h from here ( https://www.khronos.org/registry/OpenGL/api/GL/glext.h ) and put it in SDL's include folder for convenience. EDIT: I don't know if it's still needed
9. Download SDL_sound from here ( https://hg.icculus.org/icculus/SDL_sound/archive/997e90562b35.tar.gz ). Unzipped it to a random folder. In project Engine.App, set up the path to SDL_Sound's include folder.


Clean the solution , rebuild the solution.

No compilation error, but linking error : SDL_sound.lib cannot be found.
It's not in the prebuilt package : https://www.dropbox.com/s/3vdq7qw01tdtfux/ags-prebuilt-libs-3.5.x.zip?dl=0

How do I get SDL_sound.lib ?
In the past I've built it myself but I cried so many tears of blood trying to download the dependency of the dependency of the dependency for whatever many libs that I'm not doing it again.
#114
Hi everyone,

This topic is awfully specific and I'm totally OK to delete it if I get a few matches.
But I know that there are Point n click enthusiasts out there in Sweden, they're just hard to find. I found some in Stockholm, and I found some in Göteborg. But what about Örebro?
Drop me a private message if you're not too fond on giving away personal info publicly on this thread.
#115
Quote from: Crimson Wizard on Mon 17/05/2021 17:01:08
Monsieur OUXX, you have an old SetViewport(x,y) called in repeatedly_execute_always in Smooth Scroll module, that overrides camera position to 0,0 every time.

In my opinion new features are best tried out in a small test game where nothing else can affect the process.
You are absolutely right. In my defense, I didn't think that setting the Viewport impacted the size of the Camera. But then again it's my first time with the new system. Apologies.
Curious : How did you find that other SetViewport? Did you do a full text search?
#116
Quote from: Potajito on Sun 16/05/2021 17:55:50
But the line displays on screen for like one ms and then it dissapears, no audio at all.

Not very helpful but my guess is that the text disappears instantly becaue the audio is not played at all (if the audio is zero-seconds long then the text disappears as soon as it appears, it makes sense). I'm just saying that to help looking in the right direction.
#117
Quote from: Crimson Wizard on Sat 15/05/2021 22:12:04
perhaps it may worth trying to do continious upgrade, version by version.

Definitely. Something like 2.3 --> 2.4 --> 2.5 --> 2.6 --> 2.72 --> 3.2 --> 3.5.

Little things have changed like string --> String and the sound system (AudioChannel instead of just numbered sound files) but they're not too hard to fix, it's worth it.
#118
Quote from: Crimson Wizard on Wed 12/05/2021 14:17:05
I don't know, please show the script.
To clarify, does the camera zoom work?

It was still the same one that I had uploaded, except with the compatibility setting changed to False. If you feel like you have enough time to help an idiot, then you can re-download it, change the setting, and then follow the instructions in my previous post to reach the test room.
Yes, the zooming works. Only not the X/Y changes. I'm not accusing AGS, but maybe there's an indirect restriction caused by something (the viewport, the game's resolution...) that's not clear.
#119
Quote from: Crimson Wizard on Tue 11/05/2021 20:07:35
I think this setting was never necessary for 320x200 games. It makes difference in 640x400 though.

Idk what your plans are, but I believe today you should not be using this. This is a remnant of the times when there were no scaling filters, and ags games could be run 640x400 while keeping 320x200 logic.

3 bonus questions :
1) If that's not the recommended value, then how do you recon this setting got set to "true"? A mis-click on my part? That's how it was by default? After I selected "no" when the Editor asked me if I wated to upscale my GUIs? Etc.
2) Is there a way to see the value of the setting from the code?
3) After changing the setting to "false", things seem to make much more sense to me. One thing still eludes me though : If I "zoom in" the camera (I make it 160x100 in the 320x200 room) then I still can't move the camera using my buttons (up,down,left,right). The viewport can move in the screen, but the camera cannot move in the viewport. How's that?



FYI: I remember that setting. Its history is related to how at some points Microsoft was encouraging developers to move away from Screen coordinates. Visual Basic 6 had some grid coordinates that were disconnected from the window size, for example. It was like early "subpixel logic", even though it wasn't as extreme yet as things you see in OpenGL (0.0f --> 1.0f for everything). I imagine Chris Jones followed the trend even though he gave up on it later, when it turned out to be more confusing than helping.
#120
I apologize for being so bad at reading
SMF spam blocked by CleanTalk