AGS 3.4.0.6 (Alpha) - Builder Patch

Started by Crimson Wizard, Sat 27/09/2014 17:25:18

Previous topic - Next topic

ollj

#280
v3.5.0.5 gives a pretty confusing error message on;

import int[] testfunction();

//---

int[] testfunction(){
  int Array[];
  Array=new int[2];
  return Array;
}

and the message is that it can not convert a dynamic array in a dynamic array of the same type.


-----

i have not figured out if there is any fast way to get the length of a dynamic array.
so far i always add ine integer, always being set to the array length of another dynamic array of the same struct. this i not too efficient.

-----

i have not figured out if there is any way to give any type of dynamic aray to any type of function as a function parameter. i assume there is none, except for having a dynamic array in the struct to directly paste to and have the function read this.DynamicArrayParameter from

-----


and i really want dynamic arrays to be able to be put inside of managed structs.

Crimson Wizard

#281
Quote from: ollj on Fri 17/07/2015 17:19:49
v3.5.0.5 gives a pretty confusing error message on;

import int[] testfunction();

//---

int[] testfunction(){
  int Array[];
  Array=new int[2];
  return Array;
}

and the message is that it can not convert a dynamic array in a dynamic array of the same type.

I do not get any errors from this script. Does the error message reference the line inside this function?
Could you show how you use this function? (and copy the actual error message text?)

-----

Quote from: ollj on Fri 17/07/2015 17:19:49
i have not figured out if there is any fast way to get the length of a dynamic array.
There is no way to do this in AGS script now, except for storing additional variable with length value.

Quote from: ollj on Fri 17/07/2015 17:19:49
i have not figured out if there is any way to give any type of dynamic aray to any type of function as a function parameter.

Like this:
Code: ags

import void try_this(int a[]);
------------------------------
void try_this(int a[])
{
  a[0] = 1;
}
------------------------------
void test()
{
  int a[] = new int[10];
  try_this(a);
  Display("%d", a[0]);
}



Quote from: ollj on Fri 17/07/2015 17:19:49
and i really want dynamic arrays to be able to be put inside of managed structs.
This is in development plans for the future version.

Khris

I just tried to run a game on Linux and got this:
QuoteAGS: Requested engine version: 3.4.0.5
This game requires a newer version of AGS (3.4.0.5). It cannot be run.Invalid file format. The file may be corrupt, or from a different version of AGS.
This engine can only run games made with AGS 2.5 or later.

(I also had to set the execute permissions manually.)

Crimson Wizard

Quote from: Khris on Tue 21/07/2015 13:54:50
I just tried to run a game on Linux and got this:
QuoteAGS: Requested engine version: 3.4.0.5
This game requires a newer version of AGS (3.4.0.5). It cannot be run.Invalid file format. The file may be corrupt, or from a different version of AGS.
This engine can only run games made with AGS 2.5 or later.

(I also had to set the execute permissions manually.)

I forgot to update linux binaries again. :(
Try the ones made by monkey0506: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.msg636517051#msg636517051

Khris


ollj

#285
Code: ags

//this is mostly resolved, and only about a confusing compiler error message...
//...on returning an array of a managed struct from a (static) function:...
//"Can not convert 'DynamicSprite[]' to 'DynamicSprite[]'  " 
//...and like many compiler errors, this is not only confusingly fuzzy, ...
//...but this one is a straight out nonsensical logic response to throw at anyone.

//this requires AGS version 3.4.0.3 (alpha 3) or higher (due to dynamc arrays)

//as an example i have this function that produces the error...
//...this static function wants to merge 2 arrays of DynamicSprite[] (as part of a struct for such functions):

struct ArrDyn{};// a struct-set to group static array-functions for DynamicSprite*[] into.

///Returns DynamicSprite*[0..LengthLeft+LengthRight] of LeftSmall[0..LengthLeft] having RightLarge[0..LengthRight] merged to its right, changing all #indizies of RightLarge[#] to #+=LengthLeft.
import DynamicSprite*[] Merge2Dyn(static ArrDyn, DynamicSprite *LeftSmall[], DynamicSprite* RightLarge[], int LengthLeft=1,  int LengthRight=1);

//end of header // start of body//
//end of header // start of body//


DynamicSprite[] Merge2Dyn(static ArrDyn, DynamicSprite *LeftSmall[], DynamicSprite *RightLarge[], 
                                              int LengthLeft,             int LengthRight){
  DynamicSprite *r[];//set merged array for return value.
  r=new DynamicSprite[LengthLeft+LengthRight];
  while(LengthRight){//copy LeftSmall[] to r[]
    LengthRight--;
    r[LengthLeft+LengthRight]=LeftSmall[LengthRight];
  }
  while(LengthLeft){//copy RightLarge[] to r[]
    LengthLeft--;
    r[LengthLeft]=LeftSmall[LengthLeft];
  }
return r;}//on the return call the compiler cries: 
//Can not convert 'DynamicSprite[]' to 'DynamicSprite[]'  //--tehehe

//i reported this before. but my example was flawed, possibly by not using a MANAGED struct array in my previous example.
//i think it makes a difference if its a managed struct, like DynamicSprite, or a (non-managd) struct.
//the compiler is however fine with this correct example, only replacing:...
//DynamicSprite[] Merge2Dyn
//...with...
//DynamicSprite*[] Merge2Dyn
//...which is possibly unneccessarily confusing in your script syntax to even make an explicit  difference here.

DynamicSprite*[] Merge2Dyn(static ArrDyn, DynamicSprite *LeftSmall[], DynamicSprite *RightLarge[], 
                                              int LengthLeft,             int LengthRight){
  DynamicSprite *r[];//set merged array for return value.
  r=new DynamicSprite[LengthLeft+LengthRight];
  while(LengthRight){//copy LeftSmall[] to r[]
    LengthRight--;
    r[LengthLeft+LengthRight]=LeftSmall[LengthRight];
  }
  while(LengthLeft){//copy RightLarge[] to r[]
    LengthLeft--;
    r[LengthLeft]=LeftSmall[LengthLeft];
  }
return r;}

Gurok

It seems like you worked out that the return type had to be DynamicSprite *[]. Was that entire post just to say that the error message was confusing or did I miss the point? I'm confused by your post, to be honest.
[img]http://7d4iqnx.gif;rWRLUuw.gi

Crimson Wizard

#287
Ollj, I took a responsibility and added code formatting to your post, because you posted both comments and script as a plain text, making it pretty difficult to read.

Please, when you post code samples, use [ code=ags ] [ /code ] tags to make them stand-out.


From what you say I understood that:
1. You actually solved the problem you were having(?).

2. AGS compiler produces confusing error message on trying to return DynamicSprite *r[] as DynamicSprite[] (it names both types as "DynamicSprite[]".
This is indeed a mistake, which I will add to our bug tracker.

3. AGS syntax on declaring array of managed pointers is confusing. Possibly that is because you create the array as
Code: ags
new DynamicSprite[N]

and not as
Code: ags
new DynamicSprite*[N]

Which I have to agree. But that is a legacy issue that is many years old, and I doubt it will change in nearest future (not to break compatibility with existing scripts).

Crimson Wizard

#288
NOTE: I want to split this thread to make it easier for forum users to see new alpha releases.
Will try to do this later today.
NOTE2: this package does not have "Linux" binaries at the moment. I will update the package with them included a bit later.


AGS 3.4.0.6 (Alpha) - Builder Patch

ZIP-archive:
http://www.mediafire.com/download/8xw5wv5bs95jrie/AGS_3.4.0.6-Alpha-BuilderPatch.zip

Debug symbols (for developers):
http://www.mediafire.com/download/jwu9jg3hm0bwlmo/PDB_3_4_0_6.zip


This update is mainly dedicated to fixing most annoying bugs and oversights related to new game compilation, as well as custom resolutions.
Includes all content from 3.3.4.


Changes since 3.4.0.5:

Editor
Improvements
* Better descriptions of Resolution property values for Sprite and Room.

Bug Fixes
* Fixed sprite, font and room background size issues occuring if the game native resolution had one parameter higher and another smaller than 320x240 (e.g. 400x200).
* Fixed graphics renderer selection in config was reset to default game's property every time the game was recompiled.
* Fixed game configs were not updated with the new game builder when game native resolution, color depth and title were modified.
* Fixed Debugging game did not use proper configuration with the new game builder.
* Fixed custom icon was not integrated into the compiled game.


Scripting
Improvements
* Added support for "switch" statement. Strings and other variable types are allowed to be checked in switch condition.
Standard case statement features like fallthrough and break are also supported.

Example:
Spoiler
Code: ags

String x = "a";

switch(x)
{
case "a":
    Display("X is A");
case "b": // fall-through
    Display("X is B");
    break;
case "c":
    Display("X is C");
case "d": // fall-through
default: // fall-through
    Display("X is D");
}
[close]

Bug Fixes
* Fixed compiler crash related to using global variables in "for" loop header.
* Fixed incorrect compiler parsing of a static function call inside array index brackets.
E.g:
Code: ags

int i = array[Game.GetColorFromRGB(0, 0, 0)]; // there was parse error after '['



Engine
Improvements
* Engine ignores "match_device_ratio" config parameter and never tries to match device aspect ratio when initializing display mode, if the latter is defined explicitly ("screen_def=explicit" in the config file).


WinSetup
Improvements
* Added an option to choose full-screen resolution based on scaling filter.



"Bind to game scaling" means that engine should try choosing display mode equal to scaled game's size.
"Bind to game scaling (force desktop ratio" means that engine will look into first display mode equal or higher than scaled game's size, that has same aspect ratio as your current desktop resolution.


cat

Quote from: Crimson Wizard on Tue 28/07/2015 07:49:22
* Fixed custom icon was not integrated into the compiled game.
Awesome, thanks!

Quote from: Crimson Wizard on Tue 28/07/2015 07:49:22
"Bind to game scaling" means that engine should try choosing display mode equal to scaled game's size.
"Bind to game scaling (force desktop ratio" means that engine will look into first display mode equal or higher than scaled game's size, that has same aspect ratio as your current desktop resolution.
I don't really understand what this means and I don't think the average player will know. The setup is much smaller and less complicated now compared to previous versions. However, I think it's still too difficult to understand for most players.

Crimson Wizard

#290
Quote from: cat on Tue 28/07/2015 09:02:35
Quote from: Crimson Wizard on Tue 28/07/2015 07:49:22
"Bind to game scaling" means that engine should try choosing display mode equal to scaled game's size.
"Bind to game scaling (force desktop ratio" means that engine will look into first display mode equal or higher than scaled game's size, that has same aspect ratio as your current desktop resolution.
I don't really understand what this means and I don't think the average player will know. The setup is much smaller and less complicated now compared to previous versions. However, I think it's still too difficult to understand for most players.
This means that display resolution will be equal to (game size X scaling), and you do not have to choose precise resolution, just choose filter and scaling value.
I am open for suggestions to how improve this or name it in a more clear way. I felt I had to add this in last minute to provide all variety of choices in setup dialog.

E: Actually, I think I will have to change the setup window again on later stages.

proximity

I think i got it :

Bind to game scaling : if desktop res. is 1920*1080 and scaled game size is 1440*900, the engine set the resolution to 1440*900, as it is already available resolution for the graphic card.
Bind to game scaling (force desktop ratio) : if desktop ratio is 16:9 and the scaled game ratio is 16:10, the engine set the ratio to 16:9.

Do i understand correctly ? :)
Proximity Entertainment

Crimson Wizard

Quote from: proximity on Tue 28/07/2015 15:58:23
I think i got it :

Bind to game scaling : if desktop res. is 1920*1080 and scaled game size is 1440*900, the engine set the resolution to 1440*900, as it is already available resolution for the graphic card.
Bind to game scaling (force desktop ratio) : if desktop ratio is 16:9 and the scaled game ratio is 16:10, the engine set the ratio to 16:9.

Do i understand correctly ? :)

Yes, this works like that.
Actually, this is a return of old way to select resolution we still have in 3.3, just with tad more variety.

I am seriously considering on overhauling the setup once again when the 3.4 will be closer to final stage, because I realized user have to set too many things there. It might be done easier.

cat

Ok, tried the newest alpha. The user.ico is working now, so thanks for that!
Interestingly the setup also uses the game icon in the Windows taskbar but the setup icon in Windows Explorer ??? (but it doesn't really matter, I just noticed it.)

About the setup: We should probably think about the purpose of the setup. Should the average player even need to start this? Or is this mainly for troubleshooting?

The average player will need to:
- Change the language
- Choose windowed vs. fullscreen mode
- If windowed mode, choose a resolution

What do those filters do? What is the difference between setting a different resolution and using scaling? Is it not possible to determine this automatically?
Currently, there are too many options that also seem to somehow exclude each other. If possible, I'd simplify the options even more and move all the complex stuff to advanced. This shall then only be used for troubleshooting.

Also, what is the purpose of the Save button (I know it has been there for ages, but who changes the config and does not try if it works)? I'd remove that. I think everyone will just use Save&Run. This could then also be renamed to "Start game".

Crimson Wizard

#294
Quote from: cat on Wed 29/07/2015 21:40:41
What do those filters do? What is the difference between setting a different resolution and using scaling? Is it not possible to determine this automatically?
Currently, there are too many options that also seem to somehow exclude each other. If possible, I'd simplify the options even more and move all the complex stuff to advanced. This shall then only be used for troubleshooting.

These options do not really exclude each other, for they could be used in combinations; rather they are excessive, and only limited combinations are useful in a common situation.

It seems to me that there could be two paths to choose a display mode:
1) If I want to use particular resolution, then I would usually like to have maximal scaling for that resolution;
2) If I want to use particular scaling (x2, x3, etc), I would usually like to have window size just enough for the scaled game to fit.

Therefore, I may suggest to modify setup following way:
- Add a big switch which would define a method of selection: [ Choose Resolution / Choose Scaling / Expert ]
(the "Expert" word should probably scare away users who are unsure of themselves :)).
- When "Choose resolution" is pushed, user can set Resolution (window size) and Filter, but not filter scaling factor - for it always will be "Max possible".
- When "Choose scaling" is pushed, user can set Filter and Scaling factor, and resolution will be determined by them.
- "Expert" will enable all options simultaneosly, as they are now; this possibility will be meant for some extraordinary cases.

cat


proximity

Hello again :)

I'm having trouble with idle view. No matter what i do, idle view still plays at 5 animation delay i think. I set every animation delay options in the editor to zero. I get good result in the view editor but in the game, it plays very slow. Is its delay 5 by default and can't be changed ?
Proximity Entertainment

Crimson Wizard

#297
Quote from: proximity on Thu 13/08/2015 04:29:07
Hello again :)

I'm having trouble with idle view. No matter what i do, idle view still plays at 5 animation delay i think. I set every animation delay options in the editor to zero. I get good result in the view editor but in the game, it plays very slow. Is its delay 5 by default and can't be changed ?

Is this problem specific to version 3.4.0? Thing is, this thread purpose is for discussing new features and/or problems arising in new version. Did you try searching/asking at the tech forums?

proximity

#298
Quote from: Crimson Wizard on Thu 13/08/2015 16:16:17
Quote from: proximity on Thu 13/08/2015 04:29:07
Hello again :)

I'm having trouble with idle view. No matter what i do, idle view still plays at 5 animation delay i think. I set every animation delay options in the editor to zero. I get good result in the view editor but in the game, it plays very slow. Is its delay 5 by default and can't be changed ?

Is this problem specific to version 3.4.0? Thing is, this thread purpose is for discussing new features and/or problems arising in new version. Did you try searching/asking at the tech forums?

Yes, i've tried it on 3.4.0.6 builder patch. I've searched tech forums related to that but i've found only complaints about idle view plays during dialogs or unwanted situations etc. If default idle view animation delay is 5 and can't be changed, i have to remove all idle views from the game. Would you try it yourself and share your opinion ?

Edit : I can send you my idle view sprites if you like for better testing.
Proximity Entertainment

Crimson Wizard

#299
I searched on forums for "idle speed", and found this:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=36779
I guess delay 5 is hard-coded after all.

EDIT:
I found and updated a ticket in the old suggestion tracker: http://www.adventuregamestudio.co.uk/forums/index.php?issue=139.0
I guess we will be able to fix this in 3.3.5 (and then copy changes to next 3.4 update).

SMF spam blocked by CleanTalk