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.
A lot of GM formats have been documented by Ism. She will probably give you the format documentation.
And I believe everything can be done in GML/EDL. Of course compiling will not probably be that easy, so converting a gmk to exe will not be an easy task (but you could do the <gm:s way and use a runner).
GMK
http://enigma-dev.org/docs/Wiki/GM_format
http://ismavatar.com/lgm/formats/gmformat8.txt
GMX
http://enigma-dev.org/docs/Wiki/GMX_Format
@Harri, that is an interesting idea to compile and runner in ENIGMA, stick in a parser and get back execute_string(); :P
Thanks guys. Those links are a big help! :D
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.txt
GMK 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.0
It 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/Gmk
https://github.com/RobertBColton/LateralGM/blob/master/org/lateralgm/file/GmFileReader.java
EGM 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.java
https://github.com/enigma-dev/enigma-dev/blob/master/pluginsource/org/enigma/file/ApngIO.java
For 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.
Technically, we use EDL, not GML, EDL has structs, etc.
@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 :D
QuoteYour 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.
QuoteThe 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.
@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:Specification
struct 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); }
}
QuoteNot 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?
Quote from: time-killer-games on September 12, 2013, 11:48:57 AM
@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.
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.
Quotethe 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.
@canthelp, please see my topic bitching about 820
http://enigma-dev.org/forums/index.php?topic=1444.0
QuoteShe is trying to explain every format in one file.
She who?
QuoteGML 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.
QuoteMaybe 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.
QuoteI 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).
QuoteShe who?
Some people say tkg is a girl, but that marshmallow picture didn't convince me of that.
QuoteSome people say tkg is a girl
I wish they were right :(
You were talking about python, not c++, so I mentioned lambdas. Multiple inheritance doesnt matter but classes with some kind of inheritance do. You are trying to say that objects in GM are classes and TBH I don't know how parenting works with them. Do GM objects have methods? Do they have inheritance of methods and virtual methods of the subclass can be called by the base class? I'm not really sure that objects are equivalent to classes in other languages. C++ does have literals like for an array {1,2,3,4}, but I don't think ds_map has anything like that. Python does have pointers if you use ctypes or other libraries. Almost everything is a reference in python. But it is different than GML returning ints because the ints in GML have no type information. You don't know if the int is an object or a ds_map. I don't see how no pointers makes a language the best. I assume brainfuck doesn't have pointers, but that doesn't make it a good langauge. You're saying that the biggest waste of time for a programmer is figuring out how pointers work?
Now you say that GML is faster because you have GM and the IDE with it, and in python you don't. I think the GM IDE is great for quick 2d games, and maybe there isnt anything like that in python. You win. But that has nothing at all to do with comparing GML and python as languages. GML is still a shittier langauge than python. If lacking those features doesn't slow you down its because you haven't learned how to program effecively in a real langauge.
I mean who wants to do
a=ds_map_create();
ds_map_add(a,"a","A");
ds_map_add(a,"b","B");
ds_map_add(a,"c","C");
when you could do
a={"a":"A","b":"B","c":"C"}
which language is shittier? when will yoyo add an easier way to initialize ds_maps and ds_lists?
TBH they need at least something like
a=ds_map_create("a","A","b","B","c","C");
Wait, can you initialize lists like that?
But you think that somehow lacking certain aspects makes a language worse. That is often times not the case. When you say things like objects not having methods, then you must understand that you don't need them (although you can call user defined events as well as run scripts in other objects and so on). GM is made in a way that all these features (including pointers) are unnecessary and having them would probably be worse. Like having special overload for bools in a vector is the bane of STL implementations and everyone who implemented it now knows that they shouldn't have. But they cannot remove that. The same is for language specific things as well. For example, Python doesn't allow you to use curly brackets and asks for tabbing to make it work (which is acceptable for writing good code, but lack of braces removes all improvements from that) - In my eyes (and a lot of other people) this creates the shitties looking code ever. This is of course subjective (as everything else we just posted here), but what I am trying to convey is that missing features != bad language. If you can do the same thing with the same (or less) lines of code, then it just shows how redundant that feature was. And in GML I can program VERY complex objects very quickly. Something that would require the same amount of time (or more) in Python.
QuoteNow you say that GML is faster because you have GM and the IDE with it, and in python you don't.
But there is no GML without GM. Yes, if I had to write all the code in notepad and then compile, then all the great features would of been for nothing really. The IDE is at least 50% to 70% of the whole thing.
QuoteIf lacking those features doesn't slow you down its because you haven't learned how to program effecively in a real langauge.
I am quite proficient in C++ and I don't see how knowing it any better would make me work any faster. Of course I would make less mistakes which would increase my time a little, but not some great "feature" that will somehow reduce 100 lines of code to 5.
Quotewhich language is shittier? when will yoyo add an easier way to initialize ds_maps and ds_lists?
It doesn't make any language shittier. The code does forbid curly braces, which makes that "feature" the biggest reason I hate Python. It does make GML more verbose, but that is very rarely a problem. Long functions names (especially for ds_) is sometimes a hassle, but that is not because of language itself.
QuoteTBH they need at least something like
We can add that.
Quotebut not some great "feature" that will somehow reduce 100 lines of code to 5.
But thats my point, how do you initialize a large ds_map without using like 100 lines? Tell me how I would quickly initialize a ds_map instead of doing:
a=ds_map_create();
ds_map_add(a,"a","A");
ds_map_add(a,"b","B");
ds_map_add(a,"c","C");
ds_map_add(a,"d","D");
ds_map_add(a,"e","E");
ds_map_add(a,"f","F");
ds_map_add(a,"g","G");
ds_map_add(a,"h","H");
ds_map_add(a,"i","I");
ds_map_add(a,"j","J");
ds_map_add(a,"k","K");
ds_map_add(a,"l","L");
ds_map_add(a,"m","M");
ds_map_add(a,"n","N");
ds_map_add(a,"o","O");
ds_map_add(a,"p","P");
ds_map_add(a,"q","Q");
ds_map_add(a,"r","R");
ds_map_add(a,"s","S");
ds_map_add(a,"t","T");
ds_map_add(a,"u","U");
ds_map_add(a,"v","V");
ds_map_add(a,"w","W");
ds_map_add(a,"x","X");
ds_map_add(a,"y","Y");
ds_map_add(a,"z","Z");QuoteLong functions names (especially for ds_) is sometimes a hassle, but that is not because of language itself.
Yes it is because of the language itself. If you didn't have to use ds_map_add to add every element of a ds_map then you wouldnt have to type it 100 times. If they let you do
ds_map_add_multiple(map,"a","A","b","B","c","C"); and that would still have nothing to do with the language but at least helps you write code faster. But they could add a ds_map literal like
{"a":"A","b":"B","c":"C"} to the
languageGML is an bad language until they add stuff like that. But yeah python is goddamn ugly too with requiring tabs.
Nobody answered my question? KTHX fags bai
One thing that I think would make ENIGMA easier to impliment as a compiler for virtually any IDE...
There should be a way to download binary console applications for Windows, Mac, and Linux that
convert EGM, GM81, GMK and GMX to whichever OS the end user is currently running. As for EGM
Support, sense all that format is, is basically a zip, maybe a parameter in the command line could
add support for password protected EGMs/ZIPs.
This is useful for getting other people to port or
test compilation on their platform without having to give them access to your source code that
they could steal. This is also a good idea for creating commercial game templates without giving
out the source, due to the password protection. CMD Example:
cmd.exe [input egm] [output exe] [password string <optional>]
Also note, this is something I'm say ENIGMA should really include, not written in GML,
but C++ Like the rest of the engine.