• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Compiled game runs much shower

Raoul

Member
Hi,
I have been working on a remake of the original Donkey Kong and after 3 months of develoment I decided to consider it completed.

The game runs perfectly under GM 1.4 interpreter but the compiled version runs extremely slow even on modern computers.

I enabled "show_debug_overlay" and it shows same values both in interpreted and compiled mode, on a few systems I tested it I got above 2000/3000 fps.

Also, I made sure cache was cleared before compiling, disabled Vsync.

The game is very light, and as I said it plays without glitches when run within the editor.

I run out of ideas, but I can't imagine that I did all this work for nothing.

I really hope some expert coder can help me with this, I am open to any suggestion.

The compiled version can be downloaded via the link in my signature but I guess it will run slow for you as well, so I think I might need to paste here portions of the source code, general settings?

Please please, don't let my project die in this way :-(
 

JackTurbo

Member
Runs fine for me on my desktop (Win7 64, 4ghz i5 GTX780)

Have you tried it on multiple machines? What is your sleep margin set to? Does the game use v-synch?
 

Raoul

Member
Runs fine for me on my desktop (Win7 64, 4ghz i5 GTX780)

Have you tried it on multiple machines? What is your sleep margin set to? Does the game use v-synch?
Thanks for your feedback!

I have tried it on 3 systems, plus some friends on their own PCs (but I didn't see them while playing)

Apart from one system on all others the game plays slow.
V-sync is disabled from global game settings.

Not sure about the sleep margin question, can u elaborate it further?

One other thing, on the systems where the game plays slow also the audio is behaving funny, some times playing effects twice, some others just with audio glitches :(

The most weird thing is that the compiled game runs slow also on the system where GM 1.4 is installed and from where I coded it, while it runs extremely fluent on interpreter.

P.S.
Seen the videos from your game, it looks really cool, is there a longer video showing more of the gameplay?
 

JackTurbo

Member
In your game settings somewhere there should be a setting called sleep margin. If it's less than 10 try setting it to that and testing. If that doesn't work try 15. Don't go higher than that though.

You can look up sleep margin on here or the manual for a detailed explanation, but it has to do with the idle time between steps. Having it low uses less power, but can have weird frame issues on certain systems.

Thanks for the kind words about AADay In Valhalla. No more footage at the minute but work will resume on it soon :)
 

Raoul

Member
Hi again,
when you wrote about the sleep margin I was very confident it was going to be it but unfortunately it didn't work neither, I had it to 1, went to 10,15 but no luck.
I read an interesting post about what that parameter does but unfortunately doesn't apply to my case.

However I did try using the 'fps' command into the draw event of my main object and things got even more confused now but at least I have a starting point.

On the same Win 10 system, when I run the game, sometimes it will show 50 fps (all the time, any room), some other times it will correctly show 60 fps.

I know it sounds impossible but this is what I am experiencing, a non predictive behaviour with fps?

I just compiled and uploaded a new version which shows fps on screen.

if it shows 50 then something is wrong and I don't know yet what.

I hope a few can try it and post here the value they get, it should be 60 stable in every condition, if it shows 50 or less fps then I have really no idea of what is going on
(I checked video settings but everythng looks ok, but again why should it run at 50 fps and some other times at 60?
 
I

immortalx

Guest
Just tried it and I get a constant 50 fps. There's also something wrong with the full screen mode on my machine. I only get a white screen.
 

Raoul

Member
Back again, sorry for the flooding but I feel like I want to cry :(

I run it multiple times and noticed the following:
When it starts at 60 fps it will always play at 60 fps.
When it starts at 50 fps, it will never go above 50 but sometimes it will go down to 30, 24, even just 1 fps for a fraction of time.
I can't think of anything wrong with the code as this has never happened when running the game from the GML 1.4 enviroment without compiling it.

Adding a few screens showing this weird behaviour, I feel like something is wrong with the compiler?

30fps.png

50fps.png


60fps.png
 

Raoul

Member
Just tried it and I get a constant 50 fps. There's also something wrong with the full screen mode on my machine. I only get a white screen.
Thanks for your feedback immortalx, this confirms the weird behaviour with the framerate.
Unless your screen has a refresh ratio of 50 Hz than I have really no idea why the games does like this.

I am curious to know if for you it will always start at 50 fps or sometimes it starts at 60.

Does it shows correctly when not in full screen? (Key F will switch from full screen to window mode, or I guess you can just do a ALT+Enter)



I am now cheking line by line of code to se if I see something wrong but I think this has more to do with DirectX or the compiler than the code itself :(
 
I

immortalx

Guest
My monitor is a 60hz one and the game shows correctly on windowed mode.
Is there a profiler in 1.4? If there is, maybe it can help you track the problem.
 

Raoul

Member
I will give a try to the profiler, I abrely used it in the past but this time it seems much needed, thanks for the advice
 
I

immortalx

Guest
If you do any test versions, please feel free to ask and I'll test it in my machine.
 

Raoul

Member
If you do any test versions, please feel free to ask and I'll test it in my machine.
Man thanks for your help here, I have also some friend doing the same, I will remember to mention your name/nick in the game credits if you wish ;)

I spent the last hours searching in the blog and I found others reporting similar problems with their projects, in example:

https://forum.yoyogames.com/index.p...te-synchronization-method-come-to-gms2.22440/

https://forum.yoyogames.com/index.php?threads/alternate-synchronization-method.34805/

I have just recompiled the game with this alternate sync method, so if you want to give it a try I hope it will make the game run at 60 fps on your system too.

Thanks in advance!
 
I

immortalx

Guest
I just tried it in another, much slower and older PC (core2 duo 6400, 4GB RAM, Nvidia GTX 260) and it runs at 60, sometimes going up to 64. It worked in full screen too, no white-screen this time.
When I get back home I'll try it in the PC in which I run it first time and will report back.
 

Raoul

Member
I just tried it in another, much slower and older PC (core2 duo 6400, 4GB RAM, Nvidia GTX 260) and it runs at 60, sometimes going up to 64. It worked in full screen too, no white-screen this time.
When I get back home I'll try it in the PC in which I run it first time and will report back.
Great, did you try version 98m that I posted last night? I enabled the alternative sync method and it seems to have fixed the problem for many.
I guess it will also show 60 fps on the first system you tested the game on (the one showing 50 fps)

I tested it on a very old pc and it was showing 700 fps! enabling Vsyng (key D) fixed it to 60 fps.
 
I

immortalx

Guest
OK, I tried it on my home PC and it seems it's fixed. Runs at 60.
I experimented a bit with the full screen mode, which wasn't working previously and here's what I found: I have a 3-screen setup (2 monitors + TV). The full screen mode works fine on my secondary monitor and on TV, but shows a white-screen on my primary monitor. I don't have a clue what would be causing that.
 
S

Sam (Deleted User)

Guest
Do yourself a huge favor an remake the entire game, as apposed to random slight variations of the first level like most people do...

(Sorry for being off topic but this is just my personal advice)
 
L

Lonewolff

Guest
You could try the old 'application_surface_enable(false)' free boost, provided your game doesn't specifically rely upon it.
 

Raoul

Member
Do yourself a huge favor an remake the entire game, as apposed to random slight variations of the first level like most people do...

(Sorry for being off topic but this is just my personal advice)
Not sure what you mean, I remade all of the 4 original levels trying to be as much accurate as possible, not just the first one.
When you complete the 4th level the game starts over again from level 1 with increased difficulty.

This is how the orignal game (Jap version) works and what I am trying to replicate.

I am however considering to create one (or more) brand new level, mantaining the original style of the game.
Given that the engine and all objects are the most of the work and it is already done, I must only spend some time on level design ;-)

Also, many friends have asked to add the online scores saving which I think it's easy to implsment via PHP/SQL, will have a look at it in the weekend.
 
Last edited:
Top