why does AGS compile so quickly? (SOLVED)

Started by EnterTheStory (aka tolworthy), Tue 11/12/2007 07:58:03

Previous topic - Next topic

EnterTheStory (aka tolworthy)

Not a problem, in fact this is a big thanks to CJ for making such an amazing program. I can't understand how it compiles so quickly (so yes, this is a beginner's technical question!) My game is currently 61 MB, and it compiles in the same time it would take to just copy the file - maybe half a minute or even less. But surely there's linking and compressing and table creation and all kinds of other stuff to do? The exact same game took five to ten minutes to compile in Sludge. So I got in the habit of having two versions - a quick version with just two rooms for testing new code, and the full version. Then going for a drink while it compiled. But all that has changed in AGS! What's the secret?

Gilbert

Unless you rebuild all rooms while saving, what it makes in "compiling" an AGS game is actually nothing more than just packing the game files into a large archive (well, actually it should do more stuff like compiling the global script, etc.),
The backgrounds in rooms were already compressed when they were imported while the room scripts were compiled everytime you save a room file.

FSi++

Quote from: tolworthy on Tue 11/12/2007 07:58:03
Not a problem, in fact this is a big thanks to CJ for making such an amazing program. I can't understand how it compiles so quickly (so yes, this is a beginner's technical question!) My game is currently 61 MB, and it compiles in the same time it would take to just copy the file - maybe half a minute or even less. But surely there's linking and compressing and table creation and all kinds of other stuff to do? The exact same game took five to ten minutes to compile in Sludge. So I got in the habit of having two versions - a quick version with just two rooms for testing new code, and the full version. Then going for a drink while it compiled. But all that has changed in AGS! What's the secret?

Because it doesn't compile anything, just encrypts the source so bad, bad people couldn't see them?
Come on, take a room (*.crm file) from game A and put it (with different number) into the game B. Then open game B - and here you are, all the source is there.
The thing is that when you, erhm, take the .crm file from other person's game (too short on time and space to describe the technique) and put it into the game B's folder - here you are, all the source (of somebody else) is there.
I guess it processes global script the same way and puts it into ac2game.dta. But, alas, it won't decode it back (as it does with rooms) and will only use editor.dat file for global script data.

Radiant

Technically because AGS scripts aren't compiled, but interpreted.

Also, compilers are pretty darn fast overall, on contemporary computers.

EnterTheStory (aka tolworthy)

Thanks for the explanations. I am exceedingly grateful for that speed. I can only compare it with Sludge, which created significantly smaller EXE files, but at the cost of a long compile time. I'd rather have a game I can test easily.

GarageGothic

Also, you don't actually need to compile the game to test it.

If you're using 2.72 or earlier versions, instead of using the "Test" function (which compiles the game first) to run your game, copy acwin.exe to your game folder (not the "compiled" folder) and run it to launch your game in it's most recently saved state.

If you're using 3.0 it's even easier, since the "Run" function (F5) in the engine will do the very same thing.

Pumaman

#6
Quote from: FSi on Tue 11/12/2007 08:11:26
Because it doesn't compile anything, just encrypts the source so bad, bad people couldn't see them?
Come on, take a room (*.crm file) from game A and put it (with different number) into the game B. Then open game B - and here you are, all the source is there.
The thing is that when you, erhm, take the .crm file from other person's game (too short on time and space to describe the technique) and put it into the game B's folder - here you are, all the source (of somebody else) is there.

It's worth noting that this is no longer the case for AGS 3.0, since all the scripts are stored externally and only the compiled bytecode is part of the compiled game data.

As for the general speed of compilation, I'm guessing that SLUDGE does some compression when you build the game, which slows it down; as Gilbot says, AGS does this on a "pay as you go" basis -- rooms (and optionally sprites) are compressed when you save them.

SMF spam blocked by CleanTalk