Author Topic: This would fix PB lag forever... A compiler  (Read 550 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
This would fix PB lag forever... A compiler
« on: February 22, 2022, 05:25:57 PM »
You feel PB is laggy? Well, that has a reason.
Command Prompt language is interpreted, and not compiled. Making this ingame would be a pain I think, but when making executables, that would be incredible.

Basically PB reads your game's code while in-game and that's consuming for the pc, however, if you compile the code into machine language, that would make the thing go a lot better.

I know TT may see this so hard to do, but I think finding someone that could do it and keep it would worth it.
Sorry because my English is not very good because I'm Spanish ;) :P

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 806
    • View Profile
Re: This would fix PB lag forever... A compiler
« Reply #1 on: February 23, 2022, 07:25:33 PM »
I know you use a ton of custom enemies and commands. I played Mortal Theater many moons ago and it ran well... but it was an older version which you optimised heavily. I can only imagine the game got fatter and harder to 'smooth out'.

saying that, I've never had a PB game lag on me, not even when I was messing about and spamming looping commands everywhere.. I have a decent rig tho, so that helps. users with older hardware, I don't know

I have no idea how hard it would be to implement or even if it were effective, but I suppose it's something to look into  ??? O:-)
« Last Edit: February 23, 2022, 07:26:00 PM by Gizgord »

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: This would fix PB lag forever... A compiler
« Reply #2 on: February 25, 2022, 04:25:54 PM »
I know you use a ton of custom enemies and commands. I played Mortal Theater many moons ago and it ran well... but it was an older version which you optimised heavily. I can only imagine the game got fatter and harder to 'smooth out'.

saying that, I've never had a PB game lag on me, not even when I was messing about and spamming looping commands everywhere.. I have a decent rig tho, so that helps. users with older hardware, I don't know

I have no idea how hard it would be to implement or even if it were effective, but I suppose it's something to look into  ??? O:-)
It's something quite hard maybe, but it will be very effective, all other engines actually compile games. (GameMaker Studio does when running and making executable, Unity does when making the exe but the normal preview is interpreted, goes well enough though)

In fact, PB games when compiled should work as fast as the may be expected to, my game would run even 120 fps without hassle (but the actual code should be good too)
Sorry because my English is not very good because I'm Spanish ;) :P

MagnaDev

  • Level 0: Bipi
  • *
  • Posts: 2
    • View Profile
Re: This would fix PB lag forever... A compiler
« Reply #3 on: February 26, 2022, 10:02:41 PM »
I figured I'd hop in a give my thoughts on this. I've been on the forums for a while but only made an account now.

The main issue isn't that the commands are interpreted rather than compiled. But that PB is an engine inside another engine, Game Maker Studio 2 (GMS2). That is totally fine but essentially increases the performance overhead. I work with GMS2, and it does give you an option to produce compiled executables. PB is probably using that option too. But as for the commands you type in PB, they have to be interpreted so that the underlying GMS2 engine can then read them. It may be possible for TingThing to add an external .dll that reads through the commands and converts them, but honestly, I don't know.


It's something quite hard maybe, but it will be very effective, all other engines actually compile games. (GameMaker Studio does when running and making executable, Unity does when making the exe but the normal preview is interpreted, goes well enough though)

Yeah, they both do. But the difference is that the GMS2 and Unity engines are written in C++. Whereas PB is written in Gamemaker Language (GMS2 compiles this down into C++ if you choose the YCC option when exporting). Working inside an engine always adds a performance hit, but working inside two engines adds even more.

So what's my point?
I'm not trying to downplay PB. It achieves its goal of allowing people to make platformers easily and have fun. But I don't think adding a compiler is possible, nor will it increase performance. The FPS gain is hardly measurable when choosing between interpreted vs. compiled with my personal GMS2 projects. To improve performance, you can likely look for ways to optimize your own project. Or wait and see if PB gets a performance update.

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 806
    • View Profile
Re: This would fix PB lag forever... A compiler
« Reply #4 on: February 26, 2022, 10:28:04 PM »
hello MagnaDev, I'm happy to see you here! how long have you been lurking for, if you don't mind me asking?  ^-^
your take is interesting. take it from someone who doesn't know much about programming. I know that PB is written in GM Studio, I know what .dll's are (I think). I didn't connect the dots.
there is one option we haven't considered. I keep forgetting about Ultimate Platformer Engine. it's a modified 'raw' PB engine, with all of included assets (that they could, it's a legal thing), you just modify it to your needs. rewritten to be easier to edit and filled with comments. so it's not an engine, inside of an engine, inside of an engine; it's just a GMS2 engine. I think it's like 18 bucks, and obviously GMS2 is required... however, it's been years since UPE has seen much/any attention. it's probably stuck at version 8.0 or even 7.0.
« Last Edit: February 26, 2022, 10:42:03 PM by Gizgord »

MagnaDev

  • Level 0: Bipi
  • *
  • Posts: 2
    • View Profile
Re: This would fix PB lag forever... A compiler
« Reply #5 on: February 26, 2022, 11:25:30 PM »
About a month ago steam recommended PB to me and I eventually found these forums.

The .dll thing is something you can do with GameMaker to add extra features that may or may not be possible to do inside the engine itself. They’re sort of like external plugins, or extras. I’ve never used them with GameMaker before so I’m not entirely sure if one could be used as a compiler for PB.

And yeah I have seen the ultimate platform engine. If you took that and made your game in it then it should run better than PB. Especially since you have greater control to improve performance manually. But yeah, it is a shame that it remains outdated for now. Since GameMaker added a permanent free version with few restrictions that means all you really have to pay for is UPE though.

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: This would fix PB lag forever... A compiler
« Reply #6 on: February 27, 2022, 10:21:16 AM »
Yeah, the thing of PB made on GMS2 could be the main issue but I think a compiler would fix a lot of things, an external program that reads a PB slot directory and converts it into a real exe, that would be amazing imo.

Still, that's not reason for simple games to work like uuuuuuh xd

Btw, hello MagnaDev, it's been awhile since a non-bot joins here XD

« Last Edit: February 27, 2022, 10:23:23 AM by Antikore »
Sorry because my English is not very good because I'm Spanish ;) :P