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

#841
if by "managed arrays" you mean "arrays (whether static or dynamic) of managed types", then let's forget about those for a moment. They are of limited interest for the paradigm that i'm trying to address here.
The really important arrays here are arrays of unamanaged types. arrays of int for general use, arrays of String for dictionaries, arrays of float for coordinates, etc.  Those are indeed always passed by-copy.
Anyway, you get my point. I was just suggesting another "relatively easy" way of unlocking some difficulties in AGS scripting.


Spoiler

Just to avoid a misunderstanding in "programmers talk" -- yes, the pointer's array is passed by reference, but then if you change values inside the function it does not reflect back when the array is returned from it. So in the end you may say it's passed by copy.
[close]


EDIT I'm so confused right now. I recal running tests some time ago to check if arrays of unmanaged types were passed by copy or by ref, and I came to the conclusion that they were passed by copy.
I even wrote it here (and I got conforted in my result by the fact that nobody contradicted me)

I just ran this test :
Code: ags

void dummyFunc(int ar2[])
{
    ar2[0]=88; ar2[1]=99;
}

void Test2()
{
    int ar[] = new int[2];  ar[0]=66;  ar[1]=77;
    dummyFunc(ar);
    Console.W("values after call: %d, %d", ar[0],  ar[1]);

}


...And indeed the console shows : "values after call: 88, 99"

Maybe it's because I ran my tests on Strings back then, and made a mistake. I'll never know.
It's still not possible to reference an array from another array, but it's made unnecessary since arrays can be passed around and worked on, with no limits, very cheaply. Now I'm praying not to trip on some unexpected AGS bullshit (you know, something like "even though we just pass the array by reference, the function call is still proportionally slow to the number of items in the array"), but I can't see why something like that should arise.

EDIT: passing arrays by reference does not solve every problem (I'll update with a new post)
#842
I forgot to mention: another (relatively easy) way to unlock most of AGS issues would be to let arrays be passed by reference into functions, instead of by copy.
#843
Quote from: Crimson Wizard on Tue 14/02/2017 12:33:19
Since monkey's Stack module was mentioned here, I think I'd mention my own module I wrote back in 2010 to be used in conjunction with Stack:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=41243.msg545630

Module is called StructStream and what it does basically is encoding a list of varied parameters into string. Such strings then may be stored inside other strings (encoded similarily) or with dynamic arrays, monkey's Stack, etc.

While it does not solve speed issue, I think it is convenient to use if you have a complicated data structure.

Thanks for the link. I know that module, it's definitely a cool module based on a cool concept. And every now and then I consider using it -- but then I remember that it wouldn't work well in a large-scale use (large arrays), because all the String conversion would impact performance.
#844
Haha i didnt have time to read the second part of your message, I do it only now. Sorry for contributing to grinding your gears! Your ranting is perfectly legitimate.
About the team project: truth is, I'm not good enough in C++. I can program in C++, but not well enough. Believe it or not, yesterday I pulled the engine project from git to see if I could start a branch that does what I'm suggesting. I haven't been too far yet, but like every time I have a feeling I'll get overwhelmed. That said, considering how much time I've wasted on those stupid data structures, the engine C+++ learning curve could be worth it .

About the online manual: another funny coincidence: yesterday a friend of mine stumbled upon an online manual for AGS. I was puzzled as I thought this actually never went through, bit it seems rather official. That's excellent news. But if your concern is the manual not being up to date, then you're totally right, people like me should work on updating it. I'll see what I can do. -- I forgot literally everything I learnt from the help file generation, from the time I worked on it.
#845
thanks for taking time to think about all this.
I'll just address the additional questions you raised:

- about plugins : we made a choice not to use them for our game, because we don't have the skills/maintenance workforce to ensure final compatibility on all the targetted platforms. (I would have difficulties making one for Windows, because like everything there's a learning curve, especially in C++, but then I'd probably go insane trying to compile it for Linux, and then trying to figure out it's possible at all to make it work on Android, iPhone, etc.)

- about managed/unmanaged : I keep mixing up the two words, so I probably meant "managed". As in : custom structs. My point being : you can't have pointers on those. You addressed the core issue with this sentence : "Current most wanted changes to script are: being able to store managed pointers inside managed (user) structs. This alone solves tons of problems." --> Well, if you think this is within reach, then go for it and skip my suggestion. I'd be deliriously happy.

- about base type "DataStructure": I can't give you a solid reason right now why it should create a bridge between all the subtypes, it's just my instinct. If that makes no sense, then just drop that aspect. If each of those types instances have an int ID, then the rest is secondary for manipulating and storing them. That said, if it turns out to be like DynamicSprite, where an instance gets disposed of if a pointer to it is not stored, then it would be much simpler for the programmer to keep an array of all of them together, rather than an array for each type.
#846
Warning: the module does not compile in AGS 3.4 (patch 2), because the array "inventory" does not exist anymore.
I haven't found a workaround yet.
#847
Quote from: Radiant on Mon 13/02/2017 09:57:44
Frankly, this sounds like something that should be in a module (that's also what it is in languages like C++). This is just not something developers frequently need when designing adventure games.

I addressed all this in the first "hidden" section. I frankly think the exact opposite, both from a functional perspective and a technical perspective.

I do need that all the time, and it's clearly a glass ceiling that prevents from achieving powerful modules in AGS (for example the source code of the "tweens" module would be 50% more compact with such classes -- and we can consider ourselves extremely lucky that Edmundito is a good enough programmer to have worked around those issues with hard work and persistence. Otherwise we wouldn't have tweens).

Consider the Stacks module by monkey0506. It's quite powerful, and it is a good starting point to achieve what I'm describing. And yet : it's hard to go beyond one "level" of storing those structures into arrays, because they're unmanaged structs. On top of that, the module relies on lots of function calls  to get/set/convert. Performance-wise, it's not very good (stil because it's AGS script handling all that). Whereas a simple wrapper from AGS to the underlying C++ would go at the speed of light.


About C++
Spoiler

This example is not very relevant because, by nature, C++ is a continuation of C, which was historically designed to loosely follow underlying hardware structures. It was meant to be the best compromise between assembly and high-level languages. That's why data structures are (by choice) out of its scope. But every "modern" language offers such structures natively : Java, C#, Python, etc.

Also C++ has something that AGS doesn't have, and I will repeat it again and again: pointers. I'm not saying that AGS needs pointers, I'm saying that in C++ pointers allow virtually infinite re-usability of components, since you can store anything into anything without being annoyed by casting types.
[close]
#848
OK, I know this is not easy, but bear with me.

The biggest issue I encounter when programming in AGS is the lack of data structures classes -- stacks, heaps, dictionaries, linked lists, hashmaps, etc.
Apart from arrays (whether dynamic or static), there's nothing.

Why I'm saying that :
Spoiler

At the moment, even arrays (even dynamic arrays!) are a real pain. Because even if you write a fancy module (to implement, let's say, a stack) (and God knows I and others have done that a trillion times), then, because of AGS language limitations, it will immediately become quite complex to make an array of those custom "stacks". Close to impossible to store that array into another array. And clearly impossible to reach a third level of arrays referencing each other.

Are you wondering why on earth that would be required?
Spoiler

Well, that sort of things is required all the time when you want to do "serious" progrmaming.

Look, for the skeptics, here is an example that I'm inventing right now, on the spot :
- a sprite is virtually an array of int
- a collection of sprites (for example, a loop) is an array of the previous
- a view is an array of the previous
- a character has an array of views
- a game has an array of characters
See, even before you realize it, you have 5 levels of arrays referencing each other.
[close]

The example above is taken from AGS built-in situations. So you don't need such strcuture. But as soon as you're trying to escape that, you're screwed. if some arrays contain int, some contain String, some DynamicSprite, etc. ... It's a nightmare.

Some clever people manage to get away with it (temporarily) by resorting to some tricks, such as :
- keeping a unique int ID for each item in their collections (that they can then use as some sort of pointer)
- moving the data storage array outside of the "struct" to be able to create arrays of complex types
- providing a unique interface (a struct with public functions) for all the data structures of the same type (for example, one struct dedicated to all stacks of int.

But then again, you quickly reach the maximum level of complexity for a normal human being if you want each new array to be put into another array. Especially if you don't just grow your data strucutres, but (a perfectly legitimate need) also want to be able to reduce memory use each time you delete stuff. You quickly have a case of memory management involved. At first it's easy. But after 3 levels of referencing between arrays, storing different data types, good luck!
[close]

I hope I've convinced you. Every language does that. Not AGS.

So now, for the suggestion :
The most natural suggestion would be...
Spoiler

... to allow pointers to unmanaged structures, allow (dynamic) arrays of them, and let arrays of structs store such dynamic arrays --or that kind of difficult stuff. I say difficult, because it requires deep modifications of the script parser and compiler. Only someone with a good understanding of the AGS parser classes and the virtual machine pseudo-code can do that.
I'm sure it will come eventually, it's on its way. CW and the boys are working hard on it. But there's no guarantee.
[close]
It would take forever, so I'm putting that aside.

There's something much simpler though.
Think fo the way GUIControl* is implemented.
Spoiler

There's the base class, GUIControl.
It's polymorphic. You can give any kind of control to a functin that expects a GUICOntrol, but then you can cast it using .AsButton, .AsList, whatever. And then you can use it as that specific type of control, with the methods that come with it.

[close]

Now imagine if AGS was providing a generic new type :
Code: ags

DataStructure* //the equivalent to GUIControl*



Then you would have several types of standard data structures:
Code: ags

DataArray //the basic wrapper to dynamic arrays. It offers 'count' (aka 'length') conveniency
DataDictionary //for quickly matching keys and values. Quick reading of values
DataList //For easily inserting or removing items anywhere in the list
DataStack //for pushing and popping shit
DataHeap //you know what a heap is
DataHashMap //Expensive in terms of space, but storing and reading values is almost immediate ( O(1) )


Then you would do this:
Code: ags

DataStack* myStack;
DataDictionnary* myDictionnary;
DataStructure* myDataStructure = myStack; //Just like you would do GUIControl* c = myButton

//you can also use it in arrays of mixed data structures types : 
DataStructure* myDataArray[10]; //just like you can do GUIControl* myControlsArray[10];
myDataArray[0] = myStack;
myDataArray[1] = myDictionnary;


Casting types would also be permitted (again: like it's already possible with CUIControls) :
Code: ags

DataStructure* myDataStructure1 = myDataArray[0];
DataStructure* myDataStructure2 = myDataArray[1];

myStack = myDataStructure1.AsStack; //throws an error or returns null if myDataStructure1 is not an actual stack. Just like ".AsButton" does
myDictionnary = myDataStructure2.AsDictionnary; //throws an error or returns null if myDataStructure2 is not an actual dictionnary. Just like ".AsListBox" does


Instanciation would look like what exists for DynamicSprites :
Code: ags

DataStack* myStack = DataStack.Create(10); //initial size: 10


Each data structure type would have the usual functions know to each of them :
Code: ags

//Stack : 
   - ID (a unique int value, just like DynamicSprites or GUIControls have one)
   - create (initial size)
   - push (value)
   - pop (value)
   - count

//dictionary : 
   - ID (a unique int value, just like DynamicSprites or GUIControls have one)
   - Create
   - AddValue(key, value)
   - GetValue(key)
   - KeyExists(key)
   - ...

//array:
   - ID (a unique int value, just like DynamicSprites or GUIControls have one)
   - Create (initial size)
   - Add (at the end)
   - Insert (arbitrary place)
   - Sort (by value if contains [i]int[/i], by alphabetical order if it contains [i]String[/i], by ID other wise) 
   - ...



Now all of that is, I suppose, well within reach if we stick to structures meant to store int.

It could get more complicated for structures meant to contain several types of values:
Spoiler

It might be needed to duplicate all the prototypes of all the functions :
Code: ags

DataDictionnary.Create_int
DataDictionnary.Create_String
DataDictionnary.Create_DataStack

DataDictionnary.AddValue_int
DataDictionnary.AddValue_String
DataDictionnary.AddValue_DataStack


...But I suppose that code wizards could use the code generation features of their favorite IDE (such as Visual Studio with ReSharper) to generate billions of functions without needing to write much code.
[close]

The beauty of this is that, apart from the wrapper AGS classes, not much coding would be required, since everything else is already implemented within the underlying language and/or libraries. Don't tell me that Allegro or whatever does not offer a Dictionnary class that already implements all the functions I suggested?


So what do you think of that?
#849
Anyone still has the "Raiders of the Lost ark : Tanis" demo? (In English, if possible, but I'd still like to get the Spanish version if it's the only one available)
I actually seem to recall that there were two demos but I'm not sure. One of them was the opening jungle scene for sure.

Literally everything related to this project has disappeard (hosted images, domain name, etc.)

#850
what am I doing wrong?
- I downloaded 3.4.0-P2 (3.4.0 Patch 2) in zip version from the main AGS website
- I created a new game with the Empty template
- I get the warning "player is set to start in room 1 which doesn't exist" (that's normal)
- I create an empty room. It receives number 1.
- I run the game.
- PROBLEM: I get runtime error "unable to load 'room1.crm'. This room file is assigned to a different game."


=========

EDIT: found solution here (not tested). Weird. It used to work before with the default black background.
#851
Critics' Lounge / Re: mountain scene
Thu 09/02/2017 10:40:33
Quote from: NickyNyce on Wed 08/02/2017 23:55:36
this is the end of the game

Nope ;)
the end of the game will BLOW. YOUR. MIND. Guaranteed!  (nod)
#852
Critics' Lounge / Re: mountain scene
Wed 08/02/2017 20:17:09
To thank you all for your help, here is something that I wanted to keep secret, but it's going to please all the Indy lovers who are impatiently waiting  (roll)

[imgzoom]https://68.media.tumblr.com/d59ddbbfcf816b506b395780d6336646/tumblr_ol2nmaULGi1tsfksfo1_540.gif[/imgzoom]
#853
Critics' Lounge / Re: mountain scene
Wed 08/02/2017 20:15:16
Quote from: Snarky on Wed 08/02/2017 07:41:57
Kumpel, I'm pretty sure all those things you've marked "valley?" are actually mountain sides, and that the white thing in the center is just the snowy slope of a mountain. The lowest point in the image is then the bit that is covered up by clouds, further down that slope. I'm not sure whether there is actually a village on the slope or whether the dots are merely boulders or something. But it's probably a little unfortunate that it's so centered and symmetrically triangular, so it can be tempting to read it as continuing the perspective of the slope down. And why is it covered by snow to a lower altitude than any of the surrounding mountains? And doesn't that stream on the right jump from one peak to another?

What I would suggest to make the perspective clearer is to show a glimpse of the bottom of the valley, with some green of vegetation to make it clear that it is a lower altitude, perhaps a stream running along it. I think the lowest line of peaks on this side of the valley (i.e. right below the left area marked "valley?") could be removed, and instead offer a line of sight down to the bottom (if there's a gap in the clouds).

Snarky got it. the dark patches on the sides are dark, well... just because they're not snowy but instead grassy.
Yes, the triangle shape and symmery are infortunate. I'll see what I can do. Your suggestins might be an issue, snarky.
#854
Quote from: Crimson Wizard on Sun 05/02/2017 17:06:32
Since I was reminded about this, JJS had written a snow/rain plugin variant that probably works with D3D and OpenGL renderers, but I never tested that out myself.
The plugin code is open source and located in our repository here: https://github.com/adventuregamestudio/ags/tree/master/Plugins/ags_snowrain
Might be worth checking out, but I personally do not have much free time now.

Why use a plugin when modules do the same job? Nowadays the cpu use of modules is almost neglictible.
the is a snow/rain module (which has been dug up very recently in the modules subforum, by me and cat more recently).
It definitely works with 32 bit games, even though I recall you might need a little tweek (Like forcing the alpha parameter to true when calling DynamicSprite.Create or somethingg like that)
#855
Quote from: aml on Tue 07/02/2017 14:41:22
actually more full-orchestral like the original cinematic score.
That (but you know, nowadays, with modern MIDI compositing programs, the boundaries between cheap old MIDI and full orchestral tend to be very blurry)
But first we need to settle on very simplistic melodies. We were not fully satisfied with earlier proposals.
#856
Critics' Lounge / Re: mountain scene
Tue 07/02/2017 15:45:12
Quote from: Kumpel on Tue 07/02/2017 14:22:34
maybe you should make the cairn stand out more to the left from the rock it's placed on.
Well it was originally like that (watch previous verisons) but apparenlty it was too much.

Quote from: Kumpel on Tue 07/02/2017 14:22:34
I still don't get the dark areas left and right from the village in the valley.
What dark areas? ???
#857
Critics' Lounge / Re: mountain scene
Tue 07/02/2017 13:44:57
@Matti thanks for pointing those out, I have actualy corrected them already (won't post the last version, too lazy).
@selmiak: I don't know. I can't shade. Leave me alone :~(

Also this: http://www.adventuregamestudio.co.uk/forums/index.php?topic=40184.msg636552850#msg636552850
#858
Have you ever seen Indiana Jones twerking?

No?

WELL NOW YOU HAVE.
And it cannot be unseen.

[imgzoom]https://68.media.tumblr.com/c920bf632b3301797482a2fb3cf40fa0/tumblr_ol0bayy45J1tsfksfo1_250.gif[/imgzoom]
#859
Critics' Lounge / Re: mountain scene
Mon 06/02/2017 22:56:01
Quote
Will Indy have a fist fight with a Yeti here? Hopefully such wild mountain ape is drawing inspiration from my favorite BD Tintin in Tibet.
Hey you know what, just yesterday I was daydreaming about the Yeti discretely appearing in a corner and watching Indy slide away during the credits. That would be so fun but I won't do it for two reasons: that would break the suspension of disbelief, and that would confuse the player and distract him from the sense of closure that he's supposed to get from this scene.
#860
Critics' Lounge / Re: mountain scene
Mon 06/02/2017 18:58:26
aThere you go.
Unless there's a major flaw in this one, I'll keep it.

[imgzoom]https://68.media.tumblr.com/d26f24bf0cd6b0712c7facc7b38598a7/tumblr_okyva74Vur1tsfksfo1_1280.png[/imgzoom]

PS: I realized that one of the issues in sizing is that my image hosting website actually embeds the image's width in the file name - so when I copy&paste the url from the bad place, I get a random result. The site actually downsizes the image depending on the url. Please forgive me if this is still too big. I'm trying to figure out how the damn thing works. too fancy for its own good.
SMF spam blocked by CleanTalk