• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Opinion nGML: A 3rd party GameMaker language [WIP]

C

CedSharp

Guest
Yea that is why it surprised me nobody mentioned the Processing language.
Not only is this exactly what OP wants to make but all nGML code I've seen in this thread has turned to be perfectly valid Processing code as well!
They have even made the "notepad" OP was talking about.



Deja Vu huh?

I don't want to abandon the idea of a minimalist game making language though. That's I think it's better to make game engine for Processing (inspired by Game Maker) because Processing is a general purpose language.

Or if we still want to create a new language we need to consider its advantages.
Know that maintaining a compiler is a nightmare compared to maintaining a library.
The only big issue here is that I don't think that Processing let's me create a deviation of their compiler to compile ( or translate should I say ) into valid GML.
My language is inspired of many language that I've used in the past, and the goal was, for me at least, to create a language that feels more like
those languages and take what I considered being the best of each and mix them together.

The second big point of my language is that because I'm the one parsing and compiling your code, I have full control over how your language is translated in gml.
The compiler is the one to handle the errors such as public/private property access, checking if a class is available or not, checking if variables exists or not, etc.
The resulting gml is not intended to be Human modifyable ( but I'm trying to make it so you can read it without problems ) and will not check for errors.

For instance, some of the generated scripts by the compiler are as follow:
Code:
ngml_new_class( ngmlClasses.Player, 16, 256 ); // new Player( 16, 256 )
var player_name = ngml_prop_get( ngmlClasses.Player, ngmlPlayerProps.name ); // String player_name = player.name;
ngml_method( ngmlClasses.Player, ngmlPlayerMethods.move, 32, 32 ); // player.move( 32, 32 )
As you can see, it's very verbose. But there is no error handling in the gml.
So if you were to write code yourself directly in the generated gml, you could... sorry about my terms, but f*ck it up :)

I'll look into Processing.
But again, the only problem I have is that I didn't intend to make a new game engine, just have a "code only" alternative to gml :)
 

Ihato

Member
CedSharp said:
The only big issue here is that I don't think that Processing let's me create a deviation of their compiler to compile ( or translate should I say ) into valid GML.
This is called source-to-source compilation. Processing is free and open source so you can probably hack it to add GML compiling ability.
That way you don't have to write most of the code - the downside is that you have to figure your way around Processing internals.
Hacking or contributing to open source projects like this is a pretty good experience in itself though.

But of course you can start from scratch too.
I never said you shouldn't make it yourself but I saw Processing to be something very similar to what you wanted.
If anything, you could draw inspiration from it ;)
 
C

CedSharp

Guest
This is called source-to-source compilation. Processing is free and open source so you can probably hack it to add GML compiling ability.
That way you don't have to write most of the code - the downside is that you have to figure your way around Processing internals.
Hacking or contributing to open source projects like this is a pretty good experience in and of itself.

But of course you can start from scratch too.
I never said you shouldn't make it yourself but I saw Processing to be something very similar to what you wanted.
If anything, you could draw inspiration from it ;)
Being open source, I've never contributed to a big project before, so I'll definitly look into it.
Writing my own compiler is an "you-gotta-do-it-at-least-once" experience haha, but it is way above me,
so my progress is very slow.

Having an editor that supports the Processing language is already a big plus tho, I'll look into it, definitly.

-- EDIT --
There we go, I asked the comunity of processing for tips, and if I'm allowed to do such thing.
Post of the Processing forum

I wanted to make my compiler using javascript...
Seems I'll be using java instead. At least both are cross-platform :)
 
Last edited:

Ihato

Member
Being open source, I've never contributed to a big project before, so I'll definitly look into it.
Writing my own compiler is an "you-gotta-do-it-at-least-once" experience haha, but it is way above me,
so my progress is very slow.

Having an editor that supports the Processing language is already a big plus tho, I'll look into it, definitly.
You could do both! :p
There's no redundancy in the name of learning.
It just depends which way you'll go first.

Also if you're lost and you asked the devs on how they did thing I'm pretty sure they would walk you through it.
Nobody writes open source projects to hide how they did it.

EDIT:
CedSharp said:
I wanted to make my compiler using javascript...
If you wanted to use Javascript then you might also look into ProcessingJS (github)
It's a smaller project (~20.000 lines) but it still works like the original Processing (even 3d)
And it looks like they need a hand.
 
Last edited:
L

Lycanphoenix

Guest
This looks pretty neat at a glance, but jeeze, it's a lot to read X.x

Has there been any progress on this since the last few posts? I'd be interested in seeing how it's playing out.
 
C

CedSharp

Guest
This looks pretty neat at a glance, but jeeze, it's a lot to read X.x

Has there been any progress on this since the last few posts? I'd be interested in seeing how it's playing out.
nGML is currently on hold.

The processing compiler isn't what I wanted at all, so I dropped that idea.
The compiler is now completed, it converts into a valid GameMaker project.
I'm trying to find the best editor to write the syntax coloring, intellisense and error reporting plugins.

Right now, I might go with the following popular open source advanced text editors

- Visual Studio Code ( note, that is not the IDE Visual Studio, but really more like a notepad++ )
- Atom
- Brackets
- Notepad++

I don't want to create plugins for paid editors, but I might make an exception for sublime text 3, which has a trial that lasts forever.
( but if you use it to make comercial games, you'd be breaching the license... )

Anyways, that's the point of nGML right now. Parser and Compiler are completed, I just need "something" to use it. ( aka the editor )
 

GMWolf

aka fel666
This is very interesting, and looks very promising. I'll have to give it a go soon, and leave feedback.

I have also been planning something similar, but rather than building a language around which the entire game would be built, I was thinking of building a language to make libraries, with external functions normal GML could call.

Very interested to see where this goes! And sincerely hope this gains traction so YYG do something about GML sooner rather than later. (On that point, they are better off ditching GML and introducing something new).
 
D

DarthTenebris

Guest
@CedSharp This seems like a very interesting project you have there. I read all posts from top to bottom yet I couldn't find a download link. Or is it not ready yet?
Like I said, seems very interesting project there. Would definitely give it a try when I can find a download button :p
 

Fern

Member
The only major downside to this is that you are still compiling a Game Maker game in GML. This at best will provide equivalent code with equal control over the game itself. At worst (and likely the outcome) is a different language that gives you less control, possibly worsened performance, and another step between the developer and quick test runs.
 

GMWolf

aka fel666
The only major downside to this is that you are still compiling a Game Maker game in GML. This at best will provide equivalent code with equal control over the game itself. At worst (and likely the outcome) is a different language that gives you less control, possibly worsened performance, and another step between the developer and quick test runs.
Thats simply untrue.

GML is Turing complete. So it means you can transpile any language into it and keep full control.

This is done a lot with JS. Java can transpile into it, as well as many languages made specifically to transpile to JS (like typescript and dart)

[Edit] yes the code will be "equivalent", the same way C++ and C can be equivalent. But c++ offers many programming aids like objects.

What's more, transpiling can be very, very fast. A tranpiler of mine written in java could parse and tranpile an small-medium size custom language program to java in a few milliseconds.
Another tool I wrote to preprocess GML before compilation could 'man in the middle' GMS compiler with only about 1/2 a second of added latency. This would probably be greatly reduces once/if GMS2 plugins are introduced.
 
Last edited:
Top