Sonic and Sega Retro Message Board: GML vs. C++ - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

GML vs. C++ After 11 years of GML, Should I make the jump?

#1 User is offline KingofHarts 

Posted 29 March 2013 - 02:49 AM

  • WHY CANT I EDIT THE WIKIIII????
  • Posts: 1543
  • Joined: 07-August 10
  • Gender:Male
  • Project:Sonic 1 Complete (SHC 2016 Entry)
  • Wiki edits:1
Pretty much complications with Triad are the reason why I am asking the question. Triad can run well enough on Game Maker, and I think that one of the things that makes Triad stand out is that its a multi-purpose editor (which in its final form WILL be Open Source) written in GML.

However, I find GM to be primitive and restricting in some respects. One glaring example is its capabilities with using .DLLs. These problems tend to hold back Triad's capabilities a little bit. I've recently picked up a free copy of the new GM: Studio MIPS and tried porting everything to Studio, ONLY to find myself with MORE problems... and this is the permanent direction they are going in with Game Maker. So... seeing as how I'm not liking Game Maker Studio (and am NOT paying hundreds of dollars to upgrade it...) Should I stick with using GameMaker 8.1 for Triad? (And other projects???) Or should I make the heavily considered jump to C++?

I have almost 11 years of experience with using GML, and know it very well, and there are some similarities with C++... and I feel very confident I can pick up and learn C++ without too much trouble...
What does the community think? (I can only imagine that I will get a shitstream of GML sucks... so lets try to give productive, well thought out answers, with concrete reasoning, shall we?)

#2 User is offline winterhell 

Posted 29 March 2013 - 03:59 AM

  • Posts: 1037
  • Joined: 16-October 10
  • Gender:Male
First I'm going to say that I haven't used GML. However I've heard that in order to save render time on objects that are outside the screen you have to constantly destroy them and create them. I've seen some horrors with the Dash Engine in higher resolutions like 720p where the fps was literally a 5th of what you'd have if you are normally sending sprite calls with a "real" language like C++. That was on GeForce 8400GS and Radeon 4350 so it might not be an issue if the video card is stronger like 9600GT or having an SD resolution. Now, the problem might be with the programmers behind the game, but I've seen lower fps on other non-Sonc 720p games..
Also the texture loading takes forever(20 times slower than XNA/C#(single threaded) in the case I was comparing with). Probably Mercury would be able to tell you more if and how you can speed up those things.

As for C++, its great. You'll have to pick up a framework or an API with which to do the rendering, like Allegro/SDL or DirectX/OpenGL.

Bottom line- if you feel restricted by GML itself or the fact Game Maker is hiding things from you like the game loop, move away. Performance reasons would probably be overrated unless you are targeting really old hardware.

Edit: I'd suggest that you try making a simple game in C++ like Pong and render the paddles as sprites. It may take you like an hour or less but you'll be able to decide much easily if C++ is for you.
This post has been edited by winterhell: 29 March 2013 - 04:14 AM

#3 User is offline Black Squirrel 

Posted 29 March 2013 - 05:54 AM

  • wikiman
  • Posts: 3626
  • Joined: 27-December 03
  • Gender:Male
  • Location:Northumberland, England
  • Project:thinking of a better member title
  • Wiki edits:20,569
Don't underestimate the amount of stuff Game Maker will be doing for you - stuff you'll have to implement from scratch in C++.

I don't really know what 11 years of GML experience looks like so I couldn't really tell you if the jump will be easy, but there'll be lots of things to read up on, such as static/strong typing, passing by value/reference/pointer, garbage collection, fun times with classes, finding and working with APIs etc.


I've been working with Python recently (which I imagine, along with Pygame, isn't too dissimilar from GML (ignoring the differing ideas on syntax)) - scripting languages like these are a dramatic simplification of what you'd need to do in C++ to achieve similar results (or even things like Java/C#). You'll probably find yourself re-learning things and it would be foolish to assume this stuff will be cracked instantly... but the rewards can be significant
This post has been edited by Black Squirrel: 29 March 2013 - 05:55 AM

#4 User is offline Metal Man88 

Posted 29 March 2013 - 06:28 AM

  • Time Traveller
  • Posts: 2138
  • Joined: 06-March 06
  • Gender:Male
  • Wiki edits:46
Use Python to learn, C++ to implement final product. C++ can completely mop the floor with GML, but requires so much more knowledge that unless you're in it all the way, you'll never get anywhere.

Indeed. It can take many years before you can learn the ins and outs of building a software application. If this sounds too daunting to you... stick with GML.

#5 User is offline Caitlin 

Posted 29 March 2013 - 07:13 AM

  • Burning with revenge
  • Posts: 4406
  • Joined: 07-May 05
  • Gender:Female
  • Wiki edits:35

View Postwinterhell, on 29 March 2013 - 03:59 AM, said:

First I'm going to say that I haven't used GML. However I've heard that in order to save render time on objects that are outside the screen you have to constantly destroy them and create them.

Not really, you just need to pull a few rabbits out of the hat in order to save on processing power.

I was trying to create a Terraria-esque 2D sandbox kinda thing, where each block was individually drawn. When I had more than one 128x128 chunk (built from 16x16 tiles) on screen, my framerate crashed using GML's default rendering methods. So a friend of mine pulled a rabbit out of the hat and cooked up some very weird rendering method that blanked the screen and redrew the chunk every time it was updated rather than every frame. FPS went from 3 to the 60 cap I had set.

As far as switching to C++... I can't really offer that advice. I've tried C++ but couldn't get anywhere with it aside from a trip to the hospital when I banged my head on my desk in frustration. GML can teach you the basics of C++ code structure, but... ugh, C++ feels so needlessly complex compared to GML.

Keep going with GML, I'd say, since you've already got it established. If you run into a brick wall, think and think hard about what weird tricks you can use to get around that wall. You'd be surprised what a little ingenuity can do with such a limited engine.

#6 User is offline GerbilSoft 

Posted 29 March 2013 - 10:38 AM

  • RickRotate'd.
  • Posts: 2685
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:5,000 + one spin
For GUI-based applications in C++, I highly recommend the Qt toolkit: http://qt-project.org/

It's cross-platform and has lots of nice functionality, including signals/slots, QActions, the Qt Designer for designing windows, and other stuff. I'm currently still using Qt 4.8, but will probably be trying out Qt 5.x sometime in the near future.

EDIT: Not just C++ - There's Qt bindings for Java, Lisp, Lua, Perl, PHP, Python, Ruby, and other languages.
This post has been edited by GerbilSoft: 29 March 2013 - 10:39 AM
Reason for edit: Not just C++.

#7 User is offline Hinchy 

Posted 29 March 2013 - 11:38 AM

  • Up And Down And All Around
  • Posts: 1778
  • Joined: 04-September 08
  • Gender:Not Telling
  • Location:Apartment 0xFF
  • Project:Sonic Melponterations
  • Wiki edits:32
I actually have an exactly pertinent scenario. About a year and a half ago, after several years of using Game Maker entirely for making games, I've gone full-on C++.

I'll be honest, it's been a rough road. While initial progress was surprisingly quick, my lack of experience with C++ made me make a horrible nightmare polyglot of a codebase because I didn't know how to organize C++ code, I didn't know good C++ practices, I didn't know how to take advantage of the C++ features (classes, pointers, STL... the list goes on)... and I've had to basically drop it all and re-code from scratch.

Now, I probably wouldn't have learned anything otherwise, and the performance issues and other things wrong with Game Maker mean that as someone trying to produce a relatively professional video game that is not freeware that it's really not a good idea, despite what they'd like to have you think with the GM:Studio stuff.

I'm just saying if you make the decision to start trying to make a game in C++, know that you're going to spend a large chunk of time at first being not so productive. And remember, you have to basically do EVERYTHING from scratch. It's daunting, for good reason, even with 11 years of GML experience. The syntax is the easy part, that's what prior programming/scripting experience is good for. But actually using it productively is another beast. Take learning C++ very seriously, if you go that route.

But it's rewarding when you get it right. Unlike GM:Studio, what you make in C++ is YOUR engine. You can fucking do whatever with it! I don't need to pay $100 for a proprietary Ubuntu exporter, I can compile directly to Linux. In a month's time or so, I'll have one codebase that compiles to 5 platforms at once, without any of GM:S's proprietary bullshit.

#8 User is offline KingofHarts 

Posted 09 April 2013 - 12:20 AM

  • WHY CANT I EDIT THE WIKIIII????
  • Posts: 1543
  • Joined: 07-August 10
  • Gender:Male
  • Project:Sonic 1 Complete (SHC 2016 Entry)
  • Wiki edits:1

View PostHinchy, on 29 March 2013 - 11:38 AM, said:

I'm just saying if you make the decision to start trying to make a game in C++, know that you're going to spend a large chunk of time at first being not so productive. And remember, you have to basically do EVERYTHING from scratch. It's daunting, for good reason, even with 11 years of GML experience. The syntax is the easy part, that's what prior programming/scripting experience is good for. But actually using it productively is another beast. Take learning C++ very seriously, if you go that route.


I thought about that a bit... I actually had a discussion with Mercury not too long ago regarding this similar topic of GML vs. C++. My takeaway from that discussion, and this reply (as well as the others above.) is that I will try to get as much as I can into Triad... (with as much of all of the planned editors & features as possible... yada yada yada) meanwhile learning the ropes of C++... baby steps. When I feel confident enough to make a start, I will port the Palette Editor from Triad over to C++ and see how it goes from there.

Thanks for the tips guys! :D

#9 User is offline Billy 

Posted 16 April 2013 - 12:17 PM

  • RIP Oderus Urungus
  • Posts: 1772
  • Joined: 24-June 05
  • Gender:Male
  • Location:Colorado, USA
  • Project:retrooftheweek.net - Give it a visit and tell me what you think!
  • Wiki edits:15
C++ is much more involved than GML, but it's definitely not impossible to learn. Once you've got a basic knowledge of C++ down, for gaming stuff I'd recommend you learn how to use SDL with it. Lazyfoo.net has some good tutorials for SDL, but there might be better ones out there. I mainly recommend SDL because it's multiplatform, but also not too complicated. (I've done some DirectX stuff, which is more difficult but not impossible)

C++ is a very powerful language, and I'd recommend learning it even if you have no real interest in using it; My PHP coding got much better once I learned my way around C++.

#10 User is offline Ultima 

Posted 16 April 2013 - 12:17 PM

  • Games Publisher
  • Posts: 2394
  • Joined: 26-January 03
  • Gender:Male
  • Location:London, England
  • Project:Publishing mobile games!
You could always consider AS3 or Haxe. Great for making web/mobile/desktop games easily.

#11 User is offline .Luke 

Posted 16 April 2013 - 03:22 PM

  • Posts: 1971
  • Joined: 30-March 12
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet fan art; Learning Music Theory
I don't know much about the latest version of Game Maker, but it was already getting more bloated than I would have liked around 7.0. (Either that, or I was jaded by the lack of even Win2k support, limiting how many machines I could target.) For 2D stuff I've pretty much stuck to my guns with Game Maker 5.3a; it's still very fast and doesn't require hardware acceleration; perfect for running the games in VMs or older video hardware/earlier versions of Windows. Game Maker's still not very optimal for targeting much older systems, though; I doubt the Sonic fan game engine I have now would run on any Intel CPU clocked below 700mhz, and if I don't optimize terrain building times for my external levels, loading stages will take so much longer than several seconds on weaker CPUs.

Regardless, I'm glad you already know what direction to take. Baby steps should be a nice way to transition to C++. ^^ Good luck, man.

View PostCaitlin, on 29 March 2013 - 07:13 AM, said:

I was trying to create a Terraria-esque 2D sandbox kinda thing, where each block was individually drawn. When I had more than one 128x128 chunk (built from 16x16 tiles) on screen, my framerate crashed using GML's default rendering methods. So a friend of mine pulled a rabbit out of the hat and cooked up some very weird rendering method that blanked the screen and redrew the chunk every time it was updated rather than every frame. FPS went from 3 to the 60 cap I had set


That's a really cool rendering method. I should probably take a crack at a similar approach, I'm always looking for new ways to speed things up.

Yeah, Game Maker out-of-the-box isn't very good at optimizing things; even the help manual tells you to keep tabs on that. I had to find ways of keeping my Sonic fan game engine running properly as well, disabling instances outside the view, and with the reversed method I implemented, it allowed that to work for split-screen as well. (Which runs a lot faster than I would have expected because of that.) It has a few weird drawbacks, but it's the fastest I can get an engine banged out in GML to run so far.

#12 User is offline Ultima 

Posted 17 April 2013 - 03:44 PM

  • Games Publisher
  • Posts: 2394
  • Joined: 26-January 03
  • Gender:Male
  • Location:London, England
  • Project:Publishing mobile games!

View Post.Luke, on 16 April 2013 - 03:22 PM, said:

I don't know much about the latest version of Game Maker, but it was already getting more bloated than I would have liked around 7.0. (Either that, or I was jaded by the lack of even Win2k support, limiting how many machines I could target.) For 2D stuff I've pretty much stuck to my guns with Game Maker 5.3a; it's still very fast and doesn't require hardware acceleration; perfect for running the games in VMs or older video hardware/earlier versions of Windows. Game Maker's still not very optimal for targeting much older systems, though; I doubt the Sonic fan game engine I have now would run on any Intel CPU clocked below 700mhz, and if I don't optimize terrain building times for my external levels, loading stages will take so much longer than several seconds on weaker CPUs


Most VMs these days support hardware acceleration. At least, Parallels and VMWare do (plus VMWare Player, which is free). Game Maker 6 was the best version I thought.

Also, optimising for systems that poor is not worth it these days. Even the casual player will almost certainly have a dual core 1.2ghz+ CPU and at least an Intel GMA with some hardware acceleration support - the demographic you'd be targeting at with sonic fangames is highly likely to be gamers with powerful PCs. Worth thinking about the fact that probably less than 1% of users of computers in general these days have a computer as slow as 700mhz... how likely are they to be in the crossover with your demographic?

It's no longer worth optimising for hardware that was uncommon 10 years ago and is now practically extinct.
This post has been edited by Ultima: 17 April 2013 - 03:47 PM

#13 User is offline .Luke 

Posted 18 April 2013 - 11:25 AM

  • Posts: 1971
  • Joined: 30-March 12
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet fan art; Learning Music Theory
Ah, yeah, Virtual Machines have been implementing hardware-acceleration for some time now, but it's been a while since I checked VirtualBox's progress, and support was a bit on the sketchy side. I'll have to check it out again, though, it's been a couple years. :specialed:

As for using a dated version of Game Maker, that's very true, so lately it's been more of a compatibility-related move. (Although if I can get it to run on slower machines, that'd just tickle the geek in me who loves dusting off that good ol' 40lb white tower every once and a while!) Game Maker 6 was the best, but it doesn't like Vista or Windows 7. (I know there is a program to patch games compiled with GM6 by Mark Overmars himself, but seeing as I'm dependent on versions of Windows beyond XP, I'd have to run the program every time I compile a test build.) And while Game Maker 7.0 was a step in the right direction, it axed support of Win2000 and all derivatives of Win98.

Game Maker 5.3a, however, is a great in-between for all of that. It's still very fast for something mostly software-based for rendering, (Much more so than GM5.0.) and will run on all versions of Windows from 98 to Win7, and maybe Win8 too. Since I don't need real-time sprite-rotation, (I have all the hand-rotated sprites properly organized without using too much memory.) or 3D effects for my project, I'm missing virtually nothing of importance from newer versions of the program, and syntax-wise it's almost the same. I'm continuing on GM5.3a without a problem, and I can literally guarantee it will run on Windows 98 and above, just like all those game commercials in the 90's. =P

So really, it's more of a "Do I actually need all of those extra bells and whistles from newer versions?" than "I want this game to run on that dirt old PC in my closet too!". Just cutting the bloat, pretty much, and hopefully that will make the game run more easily on newer computers too; I'm trying to optimize it as much as I can so split-screen multi-player will actually be viable for my game, and so far I'm getting a solid 60FPS on my machine in split-screen mode. (Which is much better than my last fan game!) Assuming GM5.3a's limitations become a problem in the future, I can always convert it over to GM7.0 and call it a day, no sweat.

#14 User is offline TheKazeblade 

Posted 14 June 2013 - 12:49 AM

  • "Our Life is More than a Side-Effect"
  • Posts: 2529
  • Joined: 05-April 10
  • Gender:Male
  • Location:West Coast, US
Sorry to resurrect this thread like this, but I also am looking into learning C++, and am looking for some good tutorials. I'm ordering an intro to C++ book next week, but I want to gain as much of a foot-hold as possible before-hand. I'm having a really hard time finding lengthy, informative tutorials, though, and even less so that utilizes the X Code (v. 3.1.4) compiler since that's what I'm stuck with until I have a better computer for this stuff. Anybody know of some strong online C++ tutorials I can get started with?

#15 User is offline Azu 

Posted 14 June 2013 - 09:00 AM

  • I must be stupid.
  • Posts: 1504
  • Joined: 23-February 08
  • Gender:Male
  • Location:Home
You could try these: http://www.youtube.c...E85DE8440AA6B83

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users