time-killer-games
|
|
Posted on: September 11, 2013, 02:03:54 pm |
|
|
"Guest"
|
I am very capable of learning java and to finish mastering c++ , but the real issue here is time. I don't have time to learn more about these languages with everything else I have on my plate. Though I was thinking, is it possible to write a GMK parser and converter in pure GML? Are there any easy-to-read docs that explain how the different GMK formats work and how to manipulate them with no Java and very little c++ knowledge? Can any of you guys (IsmAvatar, Josh@Dreamland, Robert, anyone?) Give me some tips and advice in creating a GMK parser in GML? Maybe you guys could find the GML equivalents for the Java/C++ code which reads and writes GMKs?
So basically what I'm hoping to achieve is to create a converter which supports conversion of as many of these formats as I can:
•GM 3.X *.GMF •GM 4.X *.GMD •GM 5.X *.GMD •GM 6.X *.GM6 •GM 7.X *.GMK •GM 8.0 *.GMK •GM 8.1 *.GM81 •ENIGMA (Windows|Mac OS X|Linux) X.X *.EGM •GMHTML5 1.0 *.GMX|*.GMZ •GMS 1.0 *.GMX|*.GMZ •GMS 1.1 *.GMX|*.GMZ •GMS 1.2 *.GMX|*.GMZ •ENIGMA X.X (Windows) *.EXE|*.ZIP •ENIGMA X.X (Mac OS X) *.APP|*.DMG •ENIGMA X.X (Linux) *.RPM|*.TAR.GZ
Some of these obviously will no work in pure GML, such as converting to a native binary for Windows, Mac OS X, and Linux. Though If it is simple enough I could write a DLL, DYLIB, and SO to use with external_define/call. Some of these formats aren't even really nessisary, particularly GMF and GMD because of how old the versions of GM they come from are. And GMZ support would also require an external library because we can create ZIP folders in GML by itself.
But anyway I was just brainstorming and listing the possibilities there are. I don't expect to get support for all those formats, I'm just toying withe idea. But yeah thanks guys for whatever help you might provide, I really appreciate it. I feel like a converter sperate from enigma would be good because if written in GML it might open the possibility of doing conversion on mobile devises and such thanks to GMS and/or ENIGMA when the pretty printers are done.
|
|
|
Logged
|
|
|
|
|
|
|
ssss
|
|
Reply #4 Posted on: September 12, 2013, 03:27:22 am |
|
|
Joined: Jun 2013
Posts: 24
|
Your idea is really great but it will be really difficult because GML is a toy language written by yoyo just to waste your time. You are way way better off learning any other langauge. If you really want to then yeah of course you can hack together some GML to read gmk format with file_binary_read functions and chr() and ord(). Robert linked ismavatar's description of the gmk format that is really confusing but its accurate once you figure out what she means. http://ismavatar.com/lgm/formats/gmformat8.txtGMK versions are 800,810 and 820 I think for GM8. Not much difference except I heard they added shaders to 820. 701 and 702 for GM7 with some encryption. 600 and 620 for GM6. Theres a lot of fields that only exist in certain versions of the format for each resource, usually 800+, 600+, 440 only, 530 only, 430-600, 530-702. Theres usually a field before resource fields called GM version needed for the following info that will tell you what version of the resource you should use. GMX is simple because its just a bunch of XML files in directories. The values for things like event number are the same as gmk and are in enigma source. I don't think theres much difference between GMX versions. GMZ is just a 7z compressed (not a zip) archive of a GMX folder. You read about my new CLI http://enigma-dev.org/forums/index.php?topic=1476.0It is supposed to be a format converter besides a compiler. I have python code for reading gmk 800+ and writing gmk 810, egm, gmx, and gmz and I want to add older gmk versions 600 and 702 and gmx/egm writing. I linked to other files that you should look at to get the format. If you need more help I can try to explain the format better than ismavatar's file. Try reading my the CLI code in the file CliClass.py it should sort of tell you how to try reading those file types. https://github.com/DatZach/Gmkhttps://github.com/RobertBColton/LateralGM/blob/master/org/lateralgm/file/GmFileReader.javaEGM is just a folder or a zipped folder with a bunch of files that josh invented the formats for. You need EEF, e-yaml and apng, besides the binary room format that is close to gmk room format. https://github.com/enigma-dev/enigma-dev/blob/master/pluginsource/org/enigma/file/EEFReader.javahttps://github.com/enigma-dev/enigma-dev/blob/master/pluginsource/org/enigma/file/ApngIO.javaFor executables there are decompilers for older GM8 I think but why would you need to convert from them? I think that the entire enigma library itself should be written in GML as much as possible. But GML needs to be changed into a better langauge first. So I think its a good idea but GML needs to be more powerful first.
|
|
« Last Edit: September 12, 2013, 03:41:09 am by ssss »
|
Logged
|
|
|
|
Goombert
|
|
Reply #5 Posted on: September 12, 2013, 04:23:14 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Technically, we use EDL, not GML, EDL has structs, etc.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
time-killer-games
|
|
Reply #6 Posted on: September 12, 2013, 06:48:57 am |
|
|
"Guest"
|
@ssss- Thanks for the info ssss I'm still reading your comment but I found it a little nessisary to bring to your attention that even the GMZ are archivess generated by GMS's 7zip integration, they are are not icompressed inthe format you might think they are (*.7z, *.rar, etc) it is actually a regular *.zip folder. With the extension changed to GMA (but still the same format). I tried renaming the extension to zip and using Windows' default right click -> extract and it worked with having 7zip or any other 3rd party archive software installed. Also, though 7zip is primarily used for its ability to extract 7z and rar archives it does support plain old zips. I need to learn to stop being so wordy I just wrote a huge paragraph out of something that if it were more concise it would've been a couple sentences. O.o @Robert I don't mean EDL I mean GML because until pretty printers and more platforms for ENIGMA are released, I really want to stay away from using EDL functions and features (AKA functions and features that are not cross compatible with GM).Though I do intend to use the Wavefront model and multi texturing, that is the exception XD. But anyway back to what I was saying, The whole benefit of writing in GML instea d of EDL is the current support for more platforms (I bought master collection). I'all still use ENIGMA for the Linux export of this tool however, because GMS doesn't support non-Ubuntu Linux platforms. @ssss again, But I'm still a little torn because I trust your judgement and recommendations in learning these languages more in depth, and I know it would be very productive use of my time, but whether it would be worth the efforts ultimately I'm still thinking about that... What you said about decompilers, I should have made my OP more clear, when I mention binaries (such as exe) on the format conversion list, those are the only three formats that I would like to convert the other formats (the GMKs / source codes) into them and not the other way around, decompilers are never a good idea. I'll send you a PM for us to discuss this further
|
|
« Last Edit: September 12, 2013, 07:10:02 am by time-killer-games »
|
Logged
|
|
|
|
TheExDeus
|
|
Reply #7 Posted on: September 12, 2013, 09:37:36 am |
|
|
Joined: Apr 2008
Posts: 1860
|
Your idea is really great but it will be really difficult because GML is a toy language written by yoyo just to waste your time. You are way way better off learning any other langauge. Not much less of a "toy language" than python. GML can do anything you need and while it lacks some low-level functions (unlike EDL), it still extremely powerful. I have yet to see a project I couldn't do in GML. The whole benefit of writing in GML instead of EDL is the current support for more platforms (I bought master collection). But isn't this project just a converter? For example, why would you need a gmk to gm6 converter for Android or iOS? This seems like very much a desktop program and we do support all desktop platforms in this regard. Pretty printer will not make Android or iOS support come any faster though, as we don't need to convert EDL to another language than C++ for them. What we lack is motivation. I still can't finish messing with GL3 and because of rapid commits it also breaks my pull all the time which is inconvenient.
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #8 Posted on: September 12, 2013, 01:10:16 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
@TKG that is not what I mean, I do not mean functions, I mean EDL is like full C++, you can use data types such as integer, boolean, have you tried using int bool float or double in an ENIGMA project? Because they definitely work... for (int i = 0; i < 5; i += 1) {
}
You can also do i++ if you go to Build->Settings and switch over to C++. Josh also plans on letting you use structs and C++ classes, meaning scripts could return an object. It is described better on the Wiki... http://enigma-dev.org/docs/Wiki/ENIGMA:Specificationstruct circle { var x = 0, y = 0; double radius; double get_area() { return pi * radius * radius; } // Simple method circle(double r = 1) { radius = r }; // Optimizing this falls on the language plugin ~circle() { destroy_radius(x,y,radius); } }
|
|
« Last Edit: September 12, 2013, 01:12:18 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
ssss
|
|
Reply #9 Posted on: September 14, 2013, 12:44:30 am |
|
|
Joined: Jun 2013
Posts: 24
|
Not much less of a "toy language" than python. GML can do anything you need and while it lacks some low-level functions (unlike EDL), it still extremely powerful. I have yet to see a project I couldn't do in GML. GML has lambdas? GML has OOP with multiple inheritance? GML has dictionary (ds_map) and list literals? GML has function pointers or functions as first class objects? I'm sorry that I missed all those features in the manual You can do anything in a turing complete langauge and so I guess you could write your code in brainfuck if you really like to waste time. Nobody said that complex projects can't be done in brainfuck GML, all I said was that its a shitty language. Maybe you're not making progress on GL3 because you're writing it in C++ when you could be 1000 times more productive writing it in GML I want to know is there anything that isn't shitty about GML?
|
|
|
Logged
|
|
|
|
ssss
|
|
Reply #10 Posted on: September 14, 2013, 12:52:23 am |
|
|
Joined: Jun 2013
Posts: 24
|
@ssss- Thanks for the info ssss I'm still reading your comment but I found it a little nessisary to bring to your attention that even the GMZ are archivess generated by GMS's 7zip integration, they are are not icompressed inthe format you might think they are (*.7z, *.rar, etc) it is actually a regular *.zip folder. With the extension changed to GMA (but still the same format). I tried renaming the extension to zip and using Windows' default right click -> extract and it worked with having 7zip or any other 3rd party archive software installed. Also, though 7zip is primarily used for its ability to extract 7z and rar archives it does support plain old zips.
I just tested some gmz from GMS and they are 7z archives not ZIP archives. unzip doesn't recognize them. If you try to open a 7z with a zip only program like maybe winzip it wont work. If you rename a .gmz to .zip and open it with 7z or winrar it just ignores the extension and sees that its really a 7z archive and opens it. I didn't think that windows explorer extract supported anything besides zip but maybe in Win 7 they support 7z too? Are you sure you didnt have 7z installed? What version of windows was it? I have no idea why they didn't choose zip because its a pain in the ass having to support 7z since zip is a more standard format, java uses it.
|
|
|
Logged
|
|
|
|
ssss
|
|
Reply #11 Posted on: September 14, 2013, 02:25:11 am |
|
|
Joined: Jun 2013
Posts: 24
|
I have to reply to time-killer-games PM here because the PM system wasnt working: She is trying to explain every format in one file. What you have to do is work step by step through a GMK file. I only have support in my code for 800 and 810 files so thats what I know about. GM7 had simple obfuscation encryption but I haven't added support for that yet so I can't really tell you how it works. Get a gm81 file. Open the file and the first DWORD (4 byte integer) is a magic number that tells you that you really have a GMK file. The value is 1234321 in decimal or 0x12d591 in hex so in hex editor it will be 91 d5 12 00. Then the next DWORD will be the format version like 701 or 800 decimal. Every number you read from a GMK is a DWORD (4 byte int). Even boolean values are DWORDS. The next thing is Game ID as a DWORD, and then 16 bytes for the game GUID, then another DWORD for the version of Game Settings resource. If the file is a version 800 file then the resources will probably be version 800 too. It's really confusing but you just have to work through until you can parse the entire file. Actually there aren't any random values with no meaning. The only thing that you dont care about are the timestamps. The zlib compression is easy, most resources are compressed and so the entire resource structure itself is compressed with zlib. You read a DWORD that is the length of the compressed data and then the compressed data. You use zlib's decompress function on the data and then you parse the data in that resource. the real issue is Ism's terrible description.
If there is any GMK format I'd most prefer to learn, it is the most recent one with built-in PNG transparency/alpha support, GM81. Sprite subimages and backgrounds in version 800+ are in a binary BGRA format so you have to convert them to whatever format you need. The sound data is just the sound file data, same as the original file WAV or MP3. I don't think there's anything obfuscated, its just a confusing format. I don't think there is any gmk format that stores images as png. And the only gmk formats that store the lower left transparent pixel flag are versions 400-542. But I'm not sure if image data was always stored with alpha channel. Ism's description only says BGRA for 800+ version and I don't know what image data format is used for the older versions. Its really badly written. Events and actions are confusing but all the information is there. Actions have an argument kind list and argument list. Arguments are always text so if its a number its really just the number as text. If you are going to parse GMK in GML you have to find a zlib implementation for GML. I used python's zlib library or a c++ zlib library. We should write a better description of GMK on the wiki.
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #12 Posted on: September 14, 2013, 04:26:24 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
@canthelp, please see my topic bitching about 820 http://enigma-dev.org/forums/index.php?topic=1444.0She is trying to explain every format in one file. She who?
|
|
« Last Edit: September 14, 2013, 04:41:15 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #13 Posted on: September 14, 2013, 01:21:00 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
GML has lambdas? GML has OOP with multiple inheritance? GML has dictionary (ds_map) and list literals? GML has function pointers or functions as first class objects? I'm sorry that I missed all those features in the manual C++ pre 11 didn't have lamdas either, it made it shitty? Multiple inheritance also doesn't make it shitty as most people almost never use it (and a lot of people actually discourage that), but GM does allow single inheritance (parenting). If I understand what you think with "literals", then C++ doesn't have them either, still doesn't make it shitty. Python doesn't have pointers either, but it returns references everywhere. So it is in no way different then GML returning int's (object id's, sprite id's and so on). So all of the things you mentioned not only doesn't make it a shitty language, but some things make it a good language. For example, the lack of pointers is actually the best thing in GM I know, as it doesn't actually hinder you, but you don't have to waste time with useless errors. Maybe you're not making progress on GL3 because you're writing it in C++ when you could be 1000 times more productive writing it in GML I probably would be, but this is just because of lacking time. I want to know is there anything that isn't shitty about GML? You can make a game in 100 lines. Something you could do with python as well, but there it would actually take longer (because GM is not only GML, but the whole IDE). In the past 5 or so years I have studied C, C++, Python, PHP, Assembler (micro-controller programming), Java (thought barely), Javascript and have touched a few others (even specific languages not for programming like Verilog) and I can tell you that of all of those, I still prefer GML/EDL. They allow the fastest prototyping and feature implementation I have ever seen. And the lacking "features" you mentioned doesn't slow that down at all. There are very few changes I would want for GML/EDL (like returning multiple values from functions/scripts, but I see GM:S supports that as returning arrays). She who? Some people say tkg is a girl, but that marshmallow picture didn't convince me of that.
|
|
|
Logged
|
|
|
|
|
|