AGS 3.4.0.6 (Alpha) - Builder Patch

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

Previous topic - Next topic

AGD2

Ah, thanks for the clarification, Gurok.

Regarding the bigger issue, check your PMs. (And yes, I've confirmed that the source compiles if I delete dialogs, views, and enums. I just deleted a bunch of dialogs in the 3.4.0.3-compiled game source code, which pushed it back under the limit and made it start compiling again.)

Rhye

Could anyone please check if the icons are properly working with this AGS version? Actually setup.ico is working just fine, but USER.ico isn't. (it displays the default blue cup icon)
What I have tried:

*setup.ico=USER.ico

360mb exe on AGS 3.4.0.3 + setup.ico + USER.ico = Only setup.ico is shown.
5mb exe on AGS 3.4.0.3 + setup.ico + USER.ico = Only setup.ico is shown.
360 and 5mb exe on AGS 3.3.2 + setup.ico + USER.ico = Both icons are shown.

And I tried doing this with different images, sizes, converters and projects.

---

Second problem: splitting exe into resource packs always generates 2 files with constant sizes, ignoring my input.
Some real examples on AGS 3.4.0.3:
*.exe size without splitting: 360mb
Input: 10mb - .exe=9mb - .001=355mb - .002=4mb
Input: 50mb - .exe=9mb - .001=355mb - .002=4mb
Input: 200mb - .exe=9mb - .001=355mb - .002=4mb

And the same problem occurs with another projects:
*exe size without splitting: 132mb
Input X-mb - always: .exe=2.5mb - .001=130mb - 002=22kb

And using AGS 3.3.2, the same.

*I'm using Windows 7.

??? ??? ???

monkey0506

I can look into the icons, but regarding the split resource files, certain things have always been packed into the first file, such as the sprite file, which generally speaking makes up the bulk of your non-audio files. Additionally, the way the asset manager works, single files cannot be split across multiple resource files, which will also limit your minimum file size.

It might be possible to look into external compression libraries that allow split files, but that would be no small amount of work to include a relatively small feature. I would not expect this any time soon.

Crimson Wizard

#163
Quote from: monkey_05_06 on Thu 29/01/2015 12:15:05
It might be possible to look into external compression libraries that allow split files, but that would be no small amount of work to include a relatively small feature. I would not expect this any time soon.
Personally, I can't find any reasoning why there is a need of custom package, when AGS could simply use ZIP files for this. If we will ever want to improve the system, I'd suggest to consider using zip archives first.

monkey0506

Does the ZIP format allow encryption? I know most game devs wouldn't want their resource files readily readable and/or replaceable like that. It's possible to extract the resources anyway, but at least it takes some work to do it.




UPDATE on broken USER.ico

I have been tracing this back in the code and all of the paths passed on from BuildTargetWindows to the NativeProxy are correct. The problem is that the native code is not returning an error message, which is to say that even with full, absolute paths (which I have tested as a possible fix), UpdateResource is returning true, indicating success.

For what it's worth, the code in BuildTargetWindows.UpdateWindowsEXE has not changed, nor has the native ReplaceIconFromFile function. This will require further investigation to determine why the main EXE is failing to have its icon updated.

selmiak

#165
Quote from: monkey_05_06 on Thu 29/01/2015 13:48:35
Does the ZIP format allow encryption? I know most game devs wouldn't want their resource files readily readable and/or replaceable like that. It's possible to extract the resources anyway, but at least it takes some work to do it.

For an easy start AGS could change the file extension of every open file to something like .ARF (AGS Resource File, not RUFF RUFF!) and strap off the file header. Then later add the header on runtime and treat the file as the file it is. Guessing the correct file extension takes some work already (well, then, videos are bigger than pictures, which are bigger than highscoretables in plain text, but you know what I mean.)
I bet this is easier to implement than file encryption. But encrypted files with the key hard coded into the game .exe are a bit harder to crack, but since you can extract resources from the exe already, this also not unbreakable I think. But at least a lot of work and more rewarding for the person that really wants that element of the game and is too lazy to write an email to the gamedev (or hack the gamedev and demand that resource with the compromizing data gained...)

btw, what files are openely added to the gamefolder and not already stuffed into these ressource containers and the game .exe?

Crimson Wizard

#166
Quote from: selmiak on Thu 29/01/2015 14:06:32
For an easy start AGS could change the file extension of every open file to something like .ARF (AGS Resource File, not RUFF RUFF!) and strap off the file header. Then later add the header on runtime and treat the file as the file it is. Guessing the correct file extension takes some work already (well, then, videos are bigger than pictures, which are bigger than highscoretables in plain text, but you know what I mean.)
I bet this is easier to implement than file encryption. But encrypted files with the key hard coded into the game .exe are a bit harder to crack, but since you can extract resources from the exe already, this also not unbreakable I think.

Yes, yes, and lets also add 123 to every byte.

All those attempts to encrypt the game are silly and worthless. Someone will copy/paste decoding part from the open sourced engine and make a program that just runs decoding on game file and writes files to disk, and all "encryption" may be thrown to the trash bin.
We will spend much more time writing this system than the "hacker" will spend "cracking" it.

The only serious way to secure the data is when game creators modify the engine with their individual encryption, and then hide the modified source code.

Alberth

QuoteThe only serious way to secure the data is when game creators modify the engine with their individual encryption, and then hide the modified source code.
And even that is dubious. At the end of the day, a foreign computer has to be able to use the program and its resources, which means that at some point after delivering all data to the foreign computer, it must have all assets to decode and use what it needs.
Finding the spot may be a little tricky, but it's mostly a matter of finding the spot just after decoding, stop the program at that point (ie a standard debugger at machine instruction level can do that), and write an amount of data from memory to disk.

In other words, if you want your data to be really safe, either don't give the data away (eg an online web service where you can play but not download), or give the data without a way to decrypt it (but that is of course totally useless for using the data).

cat

I didn't find it here, but with managed structs and arrays and stuff that was added to this version, is it now possible to pass structs as function parameters? I think this was not possible in earlier versions.

Crimson Wizard

#169
Quote from: cat on Fri 30/01/2015 11:34:50
I didn't find it here, but with managed structs and arrays and stuff that was added to this version, is it now possible to pass structs as function parameters? I think this was not possible in earlier versions.
Yes, you may pass user managed structs by pointer, similarily to how you pass any build-in pointer type, like Character*, InventoryItem* etc.

Actually, there is a script sample in the first post, although it displays returning struct from a function:
Code: ags

managed struct Point
{
    int X;
    int Y;
};
 
Point *GetPosition()
{
    Point *result;
 
    result = new Point;
    result.X = 30;
    result.Y = 40;
 
    return result;
}


Yet you may easily use same pointer as an argument to function:
Code: ags

void SetPosition(Point *at);

monkey0506

You can also make use of the hidden autoptr and attribute keywords, because they're awesome:

Code: ags
// Script.ash
autoptr managed struct Point
{
    protected int x;
    protected int y;
    import attribute int X;
    import attribute int Y;
    import Point Copy();
    import void SetLocation(int x, int y);
    import void SetLocationFromPoint(Point);
    import static Point Create(int x, int y);
    import static Point CreateFromPoint(Point);
};

// Script.asc
int get_X(this Point*)
{
    return this.x;
}

void set_X(this Point*, int value)
{
    if (value < 0) AbortGame("X value cannot be negative!");
    this.x = value;
}

int get_Y(this Point*)
{
    return this.y;
}

void set_Y(this Point*, int value)
{
    if (this.y < 0) AbortGame("Y value cannot be negative!");
    this.y = value;
}

void Point::SetLocation(int x, int y)
{
    this.set_X(x); // can't call attributes directly from same script where accessors are defined
    this.set_Y(y);
}

void Point::SetLocationFromPoint(Point p)
{
    this.SetLocation(p.get_X(), p.get_Y()); // can't call attributes directly from same script where accessors are defined
}

static Point Point::Create(int x, int y)
{
    Point p = new Point;
    p.SetLocation(x, y);
    return p;
}

static Point Point::CreateFromPoint(Point p)
{
    return Point.Create(p.get_X(), p.get_Y()); // can't call attributes directly from same script where accessors are defined
}

Point Point::Copy()
{
    return Point.Create(this.x, this.y);
}

// SomeScript.asc
Point p = Point.Create(30, 40);
Point p2 = p.Copy();
p2.X += 2;
p2.Y -= 2; // and so-forth

cat

Thanks guys!

I saw the sample in the first post, but I didn't know if only returning a struct was possible or also passing one as parameter.

I think this feature is enough reason for me to try the Alpha.

proximity

I don't know C++ language very well. I see most of C++ commands integrated to AGS script language. Am i right ?
Proximity Entertainment

Crimson Wizard

Quote from: proximity on Fri 30/01/2015 23:26:34
I don't know C++ language very well. I see most of C++ commands integrated to AGS script language. Am i right ?
You mean operators? Yes, pretty much of them.

proximity

Quote from: Crimson Wizard on Sat 31/01/2015 01:07:24
Quote from: proximity on Fri 30/01/2015 23:26:34
I don't know C++ language very well. I see most of C++ commands integrated to AGS script language. Am i right ?
You mean operators? Yes, pretty much of them.

Yes, i meant operators :)
Proximity Entertainment

morganw

When testing, AudioChannel.SetSpeed doesn't seem to work for an AudioChannel that is playing a WAV file. Is this expected?

Crimson Wizard

#176
Quote from: morganw on Sun 01/02/2015 19:55:19
When testing, AudioChannel.SetSpeed doesn't seem to work for an AudioChannel that is playing a WAV file. Is this expected?
You made replies in the thread earlier today: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51666.msg636506436#msg636506436, where you stated that it works for you under some circumstances. Here you simply tell that it does not seem to work.
This confuses me. Can you please elaborate?

Also, does it work same way in previous versions of AGS (3.2.1, 3.3.3), or just stopped working in 3.4.0?

I am going to look into this too when I get time.

morganw

My other thread was reading AudioChannel.Position and calling AudioChannel.Seek, both issued resolved by using a WAV file of a smaller length (I guess there is some implementation restriction as all I did was clip a short section from the original audio, no change in bit depth or sample rate). Using the smaller WAV file, I can't alter the playback speed.

I'm testing with:
Code: ags
function on_key_press(eKeyCode keycode) 
{
	//music is a global *AudioChannel
	if (keycode == eKeyV)
		music.Speed = music.Speed - 50;
	if (keycode == eKeyB)
		music.Speed = music.Speed + 50;
}

...no problems with an OGG file.

Quote from: Crimson Wizard on Sat 27/09/2014 17:25:18
AudioChannel.Speed.
The new property used to get or set audio clip's playback speed. The value is defined in clip's milliseconds per second; 1000 is default, meaning 1000 of clip's ms in 1 real second (scale 1:1). Set < 1000 for slower play and > 1000 for faster play.
NOTE: the engine will also map "AudioChannel.SetSpeed" function to this property, therefore you can run Gord10's "Self" game using new interpreter (e.g. on Linux).

This feature is brand new in 3.4 according to the first post.

Crimson Wizard

Oops, I am sorry, I completely misread your question here.

No, it does not work for WAV at the moment. I will fix the description for now.
I will check if that could be implemented for WAV and MOD files a bit later.

Rhye

Quote from: monkey_05_06 on Thu 29/01/2015 13:48:35
UPDATE on broken USER.ico

I have been tracing this back in the code and all of the paths passed on from BuildTargetWindows to the NativeProxy are correct. The problem is that the native code is not returning an error message, which is to say that even with full, absolute paths (which I have tested as a possible fix), UpdateResource is returning true, indicating success.

For what it's worth, the code in BuildTargetWindows.UpdateWindowsEXE has not changed, nor has the native ReplaceIconFromFile function. This will require further investigation to determine why the main EXE is failing to have its icon updated.
Thank you for the explanation, monkey_05_06.
I'll be waiting for a fix, then. :)

SMF spam blocked by CleanTalk