Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

Feature recommendation & tips for GMS2.3 users

A topic by Bulletproof Outlaws created Jul 20, 2020 Views: 868 Replies: 3
Viewing posts 1 to 2
(1 edit)

So psyched to see GMLive working on GMS2.3!  It's not flawless yet but I spent a few days compiling every time I wanted to test something and remembered how painful it was lol Good luck on updating everything!

One thing I've found is putting calls inside static functions blows things up pretty quickly.  When it was just one call per script file I was able to update every 200ms with no problems, but you get like a Button constructor going and then throw some live updates with various arg counts in some onMouseEnter, onMouseClick, draw, doAction etc functions and it crashes the entire app immediately lol

If I drop the update frequency down to like 10+ seconds it stays stable, but then you never knowing when exactly the bus is gonna arrive and you have unpredictable wait times to see the update.

So I tweaked this part:

if (live_request_time != undefined && l_now > live_request_time) {
    live_request_time = undefined;

...and set live_init to undefined in the Create event, then an "if F2's pressed, live_request_time = 200" and now it only updates when I alt-tab to my game and press F2 and get an immediate update.  No more crash worries.

Also no worries about saving as I code and accidentally throwing a million errors into my Output log & scrambling to comment what I wrote out and re-save to stop the madness lol

This would be great as a built-in feature!  Maybe a toggle for auto or manual updating because there are times where you're doing tiny GUI polish adjustments and don't want to have to press a button to update...


Also a tip for GMS2.3 users: With the automatic code-folding you can throw brackets anywhere you want and fold them up, so I just have this in a Snippet:

A - GMLive_args:live_name = "|constructor|:function"; {$    var _i = 0, _Args = array_create(argument_count);$    repeat(argument_count) {_Args[_i] = argument[_i]; _i++;}$    if (live_call_ext(_Args)) {return live_result;}$}
G - GMLive:if (live_call()) {return live_result;}

...which spits out:

live_name = "constructor:function"; {
    var _i = 0, _Args = array_create(argument_count);
    repeat(argument_count) {_Args[_i] = argument[_i]; _i++;}
    if (live_call_ext(_Args)) {return live_result;}
}

...which gives you a folding icon to the left and when you fold it you'll see the "live_name =" part before the bracket so you remember there's GMLive code there but the block doesn't look visually obnoxious lol

Developer

Hello!

One thing I've found is putting calls inside static functions blows things up pretty quickly.  When it was just one call per script file I was able to update every 200ms with no problems, but you get like a Button constructor going and then throw some live updates with various arg counts in some onMouseEnter, onMouseClick, draw, doAction etc functions and it crashes the entire app immediately lol

Please email me a sample project that reproduces the issue - any issue that ends up in "Runner exited with non-zero status" is a GameMaker bug and is best filed sooner than later.

This would be great as a built-in feature!  Maybe a toggle for auto or manual updating because there are times where you're doing tiny GUI polish adjustments and don't want to have to press a button to update...

Ctrl+S is intended as the update button, but I can look into adding an option that auto-disables the "live" version of function after it errors (so that you would edit it to not error and save to reload).

(1 edit)

Here's a project, there's barely anything in it and I'm not doing anything crazy code-wise and it's updating every 0.2s which is what I've used on huge projects with tons of stuff going on in pre-GMS2.3

<snip>

But if you run this with a GMLive server running and just kind of fiddle around with the code in the obj_main Draw event and the scr_gui functions...like making changes to a few different functions and the Draw event at once, or just commenting stuff out or un-commenting it back in, adding/removing random draw_texts or draw_rectangles or just typing in general sometimes, and hitting CTRL+S as you go (with properly written code that doesn't give errors, like it's not a big dump of errors causing it), the program seems to hang and crash within a few minutes .

Oddly it's not even right when you press Save or GMLive does something necessarily, like you can just be in the middle of typing and it crashes the game.  The IDE stays alive, just the Runner.exe crashes.  When it freezes up (game screen becomes translucent white), it shows the top and then the bottom error:


GMLive's server doesn't show any information, like it has no idea anything went wrong, and GM's Output window just says:

X://windows/Runner.exe exited with non-zero status (-1073741819)
FAILED: Run Program Complete. For the details of why this build failed, please review the whole log above and also see your Compile Errors window.

...with no detailed explanation or errors shown anywhere.

I'm assuming it's some kind of memory thing, but there doesn't seem to be any consistency of when it happens.   But if I turn GMLive off there's no crashing, or if I bump the live_init time up to like 10s, there's no crashing (I haven't had a single crash with my edit where I manually tell it when to update).

I have no idea if you'll be able to reproduce the bug or not...I can record my screen if that helps lol This has never been a problem before 2.3 and I've put GMLive through the grinder with way more complicated & memory intensive games than this little example file without crashing!

(2 edits)

Ctrl+S is intended as the update button

I wonder if I'm doing Ctrl+S too frequently or something?  I tried just typing "//" and then adding more slashes and pressing CTRL+S randomly and eventually it crashed again.  I'm not doing it any more than I've ever done while using GMLive before GMS2.3 (every 10-30 seconds depending on what I'm coding) but it definitely doesn't crash when I manually reload it (saving a bunch of times but not triggering GM to reload when I do)

but I can look into adding an option that auto-disables the "live" version of function after it errors (so that you would edit it to not error and save to reload).

That would be cool!  The downside to CTRL+S is that you often don't catch errors until they happen, and when they happen with GMLive during a Draw or Step event, the Output window spits a million errors (especially with struct stuff, I've seen some massive like 20 line warnings GMLive dumps in there every step) and then it's like a mad scramble to find the mistyped variable name or forgotten closing bracket or commenting out whatever you just wrote etc to get GMLive to chill so you can calmly look at what caused that madness lol

It feels kind of like working on the public version of a website where you forget a bracket and 500 users suddenly fill your inbox with complaints that the site is broken, VS being able to press a Publish button when you've fully reviewed the code you just wrote and want to publish it to see the result

P.S. I have nothing but love for GMLive's error descriptions btw, they're super informative and have helped me nail down mistakes quickly!  It's just when they're flying up my Output window because an entire stack of them are being spit out every frame that it's like "Ahhh!! Stop!! I gotta find the array that's out of bounds to fix it but now I gotta scroll up an Output window that's constantly filling up with errors like a 90s hacker movie!" lol