May 27, 2024, 11:15:55 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: [1] 2

Author Topic: Constant tickrate with interpolated FPS: proof-of-concept in GameMaker 8.1.141  (Read 10145 times)

BlackDoomer

  • Junior Member
  • **
  • Karma: 3
  • Offline Offline
  • Posts: 79
  • *batteries not included
    • Doom2D.org

welp I've succeed to fool GameMaker again
here it comes



a green circle stands for a simple tick-bound object, a cyan is the same but also with the motion interpolation between ticks

arrow keys - move both circles
"systimer" indicates to use WinAPI's GetTickCount(), which is much more accurate, instead of GM's current_time
UPS stands for tickrate ("updates-per-second")

this consumes false 100% of the processor core on which it working, I know how to fix that and will do that later

sources (very bad tho, need to be cleaned up) are included too

https://yadi.sk/d/1-C2LTABe9DQyg - download

any tests / reports / comments / feedback will be very appreciated :)
« Last Edit: October 24, 2018, 09:39:22 am by Black Doomer »
Logged
Oh my God, who touch Sasha?! (c) Heavy
www.doom2d.org - Doom 2D, one of the best 2D-games in the world

LOL U MAD

bullets (obviously)

  • Seasoned Member
  • *****
  • Karma: 40
  • Offline Offline
  • Posts: 1955

what the everloving fuck are you doing on this dead game
Logged

BlackDoomer

  • Junior Member
  • **
  • Karma: 3
  • Offline Offline
  • Posts: 79
  • *batteries not included
    • Doom2D.org

what the everloving fuck are you doing on this dead game
I find pleasure in
Logged
Oh my God, who touch Sasha?! (c) Heavy
www.doom2d.org - Doom 2D, one of the best 2D-games in the world

LOL U MAD

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12206

what the everloving fuck are you doing on this dead game
A lot of people like to horse around with GM8.1 in spite of it being a deprecated engine and this is the place to do it.
Logged
Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  :nah:
Oh, well, you might as well pack up and stop now, because he doesn't like it
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

BlackDoomer

  • Junior Member
  • **
  • Karma: 3
  • Offline Offline
  • Posts: 79
  • *batteries not included
    • Doom2D.org

A lot of people like to horse around with GM8.1 in spite of it being a deprecated engine and this is the place to do it.
I just believe that it would be much easier to port GG2 onto GM 8.1, in contrast with Studio, so I proposed that example.
Also 60 fps in GG2 is pretty dumbfucked, interpolation is much reliable and maybe even faster.
Logged
Oh my God, who touch Sasha?! (c) Heavy
www.doom2d.org - Doom 2D, one of the best 2D-games in the world

LOL U MAD

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 596
  • Sometimes a dev. Only sometimes

A lot of people like to horse around with GM8.1 in spite of it being a deprecated engine and this is the place to do it.
I just believe that it would be much easier to port GG2 onto GM 8.1, in contrast with Studio, so I proposed that example.
Also 60 fps in GG2 is pretty dumbfucked, interpolation is much reliable and maybe even faster.
It is, by a lot, but the main devs havre repeatedly said that there are various issues and that the bugs outweigh the benefits. One bug I discovered is that the registry functions often fail
Also deltatime is a thing that works quite well
Logged

MedO

  • Owns this place
  • *****
  • Karma: 151
  • Offline Offline
  • Posts: 1752

I think one of the big issues was the new handling of strings, where string functions depend on the currently selected font. Since some GM 8 stuff we used depends on using strings as byte arrays, this would cause a lot of trouble. That said, it's certainly not insurmountable.
Logged
Quote from: Alfred North Whitehead
It is the business of the future to be dangerous; and it is among the merits of science that it equips the future for its duties.

Quote from: John Carmack
[...] if you have a large enough codebase, any class of error that is syntactically legal probably exists there.

BlackDoomer

  • Junior Member
  • **
  • Karma: 3
  • Offline Offline
  • Posts: 79
  • *batteries not included
    • Doom2D.org

I think one of the big issues was the new handling of strings, where string functions depend on the currently selected font. Since some GM 8 stuff we used depends on using strings as byte arrays, this would cause a lot of trouble. That said, it's certainly not insurmountable.
Could you please tell more about that and maybe provide some examples? I've worked with GM 8.1.141 bugs and managed to get around some of them.

One bug I discovered is that the registry functions often fail
Same request. :)

Also deltatime is a thing that works quite well
True, but the disadvantage lies elsewhere: updating the game state 60 times per second is squander.
« Last Edit: October 27, 2018, 12:48:54 am by Black Doomer »
Logged
Oh my God, who touch Sasha?! (c) Heavy
www.doom2d.org - Doom 2D, one of the best 2D-games in the world

LOL U MAD

Heapons

  • Junior Member
  • **
  • Karma: 6
  • Offline Offline
  • Posts: 128
  • Just a guy wandering on the internet.

Maybe you can't port GG2 to GM8.1 or GMS 1.4/2 but how about rewriting the game from scratch then? I know that it's a lot of work and etc but looks like there's no other way.
Logged

MedO

  • Owns this place
  • *****
  • Karma: 151
  • Offline Offline
  • Posts: 1752

Maybe you can't port GG2 to GM8.1 or GMS 1.4/2 but how about rewriting the game from scratch then? I know that it's a lot of work and etc but looks like there's no other way.
While we do like to complain about some issues, porting the game to a new version of GM is still orders of magnitude less work than a rewrite ;)
Logged
Quote from: Alfred North Whitehead
It is the business of the future to be dangerous; and it is among the merits of science that it equips the future for its duties.

Quote from: John Carmack
[...] if you have a large enough codebase, any class of error that is syntactically legal probably exists there.

Heapons

  • Junior Member
  • **
  • Karma: 6
  • Offline Offline
  • Posts: 128
  • Just a guy wandering on the internet.

Maybe you can't port GG2 to GM8.1 or GMS 1.4/2 but how about rewriting the game from scratch then? I know that it's a lot of work and etc but looks like there's no other way.
While we do like to complain about some issues, porting the game to a new version of GM is still orders of magnitude less work than a rewrite ;)

As I said before...
Maybe you can't port GG2 to GM8.1 or GMS 1.4/2 but how about rewriting the game from scratch then? I know that it's a lot of work and etc but looks like there's no other way.
but alright! :z5:
« Last Edit: October 27, 2018, 03:58:43 am by Heapons »
Logged

BlackDoomer

  • Junior Member
  • **
  • Karma: 3
  • Offline Offline
  • Posts: 79
  • *batteries not included
    • Doom2D.org

MedO, I think you're a bit wrong about string functions. The only one that depends on selected font is chr(), but there's a nice replacement such as ansi_char(). Also please note that string_insert() is simply broken in the 8.1.141 (it's actually a "string_insert_byte()" since it doesn't support UTF-8 at all), so you need to write your replacement one using WinAPI's MultiByteToWideChar and WideCharToMultiByte to convert string into the fixed-size Unicode and backwards. And strings still can be used as byte arrays without any problems, AFAIK.

Welp, there's another GMO-free example. Now it's a videosystem concept that supports maintenance of ANY window parameter WITHOUT blurring up everything visible. This also supports FSAA (using my workaround that fixes problems with the related functions in 8.1.141) and optional game view scaling that never touches scale of the GUI.

Still hope that somebody is interested. :)

https://yadi.sk/d/1giw0jO1YCkYVA
« Last Edit: November 05, 2018, 11:43:59 pm by Black Doomer »
Logged
Oh my God, who touch Sasha?! (c) Heavy
www.doom2d.org - Doom 2D, one of the best 2D-games in the world

LOL U MAD

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 596
  • Sometimes a dev. Only sometimes

I'm still interested

As for 8.1 bugs, there's been a few discussion threads over the years, that mostly ended with "8.1 sucks, just move to PyGG2"
When I ported GG2 to 8.1 I didn't find the game broken, and it was very easy to port, but the registry functions either didn't work or returned something the existing code didn't use properly, so the audio fix that disabled more than 2 sounds at once was disabled on my Win 10 machine, when it should have been enabled. This eventually led to disabling the fix for W10 users in vanilla because we found out that the bug doesn't affect them

I haven't yet looked at your source files, but is there any reason why we wouldn't be able to port it to GM8?

Edit: don't answer that, apparently GM8 doesn't have lerp(), I'm trying to write an equivalent script in gm8
« Last Edit: October 28, 2018, 04:09:08 am by PrOF »
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 596
  • Sometimes a dev. Only sometimes

2 replies in a small amount of time I know, but this now works in GM8

I still despise trigger events, but hey it works.
Some things very worth noting:
  • I had to write a lerp() script because GM8 does not have one by default, while GM 8.1 does
  • The max framerate is halved when using GM8. This could be either because GM8.1 is more optimised, or because the built-in lerp of GM8.1 is faster (Edit: yep, using the less precise lerp formula the fps are the same, so GM8.1 probably uses that)
  • I have used 8.1 in the past, the GUI feels more responsive

I used YellowAfterlife's Game Maker 8.1 to 8.0 Converter, because I didn't want to pirate GM 8.1
« Last Edit: October 28, 2018, 04:29:36 am by PrOF »
Logged

BlackDoomer

  • Junior Member
  • **
  • Karma: 3
  • Offline Offline
  • Posts: 79
  • *batteries not included
    • Doom2D.org

As for 8.1 bugs, there's been a few discussion threads over the years, that mostly ended with "8.1 sucks, just move to PyGG2"
I also thought so before (you can even find my answer in one of these topics :)), but then I got to know 8.1 better, and also learned Python Phytohn. And now I claim that Peeton is simply not suitable. It is a scripting language in the truest sense of the word. It is suitable for working with data, it is suitable for back-end web applications, it is suitable for renaming a handful of pictures in a folder, and so on. But this is a disaster for developing a desktop application. Piton turns even an average-sized codebase into a mess, simply because it is MISCONCEPTED. You will NEVER REWRITE GG2 on it only because of this, but also because GG2 is highly dependent on the GM 8.1 event model, just like any other GM program.

As for the 8.1, it's much less harmless than is commonly believed. For example, almost all display errors (except display_set_colordepth(), which is pretty useless though) could be fixed just by the next line of code placed at the very beginning of the program:
Code: [Select]
surface_free( surface_create(0, 0) );
And when working with the already mentioned strings, you need to remember only a few things:
  • they may contain ANY data, even with GM always expecting an UTF-8 stream in;
  • the only string functions that rely on a font currently selected are chr() (ansi_char() must be used instead), string_width(), string_height(), string_width_ext() and string_height_ext();
  • since strings are UTF-8 you can't use string functions to manipulate them as byte arrays, but you still able to write your own because even UTF-8 strings are just char*;
  • the only exceptions from previous are the 8.1 functions string_byte_at() and string_byte_length(), and the old one string_insert() that wasn't rewritten for UTF-8 support.
Of course, all of the above applies only to the latest version (8.1.141).

When I ported GG2 to 8.1 I didn't find the game broken, and it was very easy to port, but the registry functions either didn't work or returned something the existing code didn't use properly, so the audio fix that disabled more than 2 sounds at once was disabled on my Win 10 machine, when it should have been enabled.
Are you sure that you used the 8.1.141? This sounds rather strange, since I've never experienced such problem with the registry on it.

I haven't yet looked at your source files, but is there any reason why we wouldn't be able to port it to GM8?
Actually not, but GM 8.1 contains a crapload of bugfixes and optimisations, so I see no reason to avoid it.

I still despise trigger events, but hey it works.
Triggers are required to guarantee the order of execution of events. There must be ONLY ONE End Step event for a whole program in my concept, and it's must be responsible for updating the screen and the game state DIRECTLY before the Begin Step event. But since end step events are very useful for us too, we provide a replacement trigger that will be executed just before the actual event and should be used instead.

The max framerate is halved when using GM8. This could be either because GM8.1 is more optimised, or because the built-in lerp of GM8.1 is faster (Edit: yep, using the less precise lerp formula the fps are the same, so GM8.1 probably uses that)
Both things matter. At least, GM 8.1 introduced the hardware acceleration, though it can be turned off in Global Game Settings. And calculations in scripts are slower than in DLL functions, for example.
« Last Edit: October 28, 2018, 01:29:48 pm by Black Doomer »
Logged
Oh my God, who touch Sasha?! (c) Heavy
www.doom2d.org - Doom 2D, one of the best 2D-games in the world

LOL U MAD
Pages: [1] 2
 

Page created in 0.028 seconds with 35 queries.