-5
\$\begingroup\$

I'm toying around a lot with Game Maker. I really like it. GML is very simple and with its nearly object oriented design you could create anything in 2D you can think of. However there is a limit. And this limit astonishes me in comparison to modern AAA 3D games. How can't Game Maker handle (let's say) 3000 Sprites without dropping the frame rate but something like Crysis, Assasins Creed, Far Cry, Star Citizen which seems to be handling much more calculations at one frame works without problems.

I know that there is a performance difference between languages and that a lot of code can be optimized to get the best results. But is it just how the code is written that 3D engines are so powerful? Why do modern 3D games seem like doing much more but at the end present better results then 2D engines like Game Maker? And would for example something like Unity be faster that is using a real language like C#? Are there C++ engines or frameworks known for their performance? I'm not going to get away from Game Maker soon since my programming skills are not that great. I'm just trying to understand why modern games engines seem so powerful against Game Maker. Or did I get something wrong?

\$\endgroup\$

closed as too broad by MichaelHouse Dec 5 '15 at 2:30

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

2
\$\begingroup\$

The bottleneck for games is usually the bandwidth and latency between cpu and gpu, not the number of calculations you're doing.

Using your example of 3,000 sprites, the reason it's so slow is because Game Maker draws them all individually, which means 3,000 draw commands going from the cpu to the gpu. Even though each draw command is really simple, every new command has a slight delay to it as it works its way through the driver and then through the wires to the gpu.

Particle systems also draw sprites, but they can draw thousands or even millions of them without hurting your fps any. This is because the information for all those sprites is combined into one buffer and drawn with one command. It comes with some limitations, though, especially if you want each sprite to have a different texture or behave differently. It's hard for a game framework to generalize this technique, so it's usually limited to particles unless you can write your own shaders.

When it comes to 3D, drawing 10 boxes is pretty close to drawing 10 sprites. The calculations are a little more complicated, but you're still using a miniscule fraction of the gpu's power. The number of draw calls is the same, so you'll get about the same fps. Once you add lighting, shadows, anti-aliasing, and so on, then you might get closer to that computational limit, but since you're still using the same number of draw calls, you'll stay under the bandwidth limit, which lets you do a lot more.

\$\endgroup\$
  • \$\begingroup\$ Is there a way in Game Maker to draw the same objects through a single command? Is this also possible in Unity? Or would this require deeper access? \$\endgroup\$ – user148013 Dec 4 '15 at 22:59
  • \$\begingroup\$ It should be possible, yeah, but if the particle system doesn't work for your purpose then you'll probably have to write your own shader. That subject is way too complicated for a comment here, so you'll have to find some tutorials for it. Maybe search for info on tile systems and adapt code from that. \$\endgroup\$ – Icy Defiance Dec 4 '15 at 23:13
  • \$\begingroup\$ OK. Thank you very much for your fast and competent help! \$\endgroup\$ – user148013 Dec 4 '15 at 23:33
  • 1
    \$\begingroup\$ Note that also GameMaker uses batches. It does it's best to keep the number of draw calls low. When creating your game you have to optimise to not break the batch. These breaks are caused by, for example, switching textures or doing blends on a per-object basis. See yoyogames.com/blog/63 for more hints. \$\endgroup\$ – Felsir Jul 25 '16 at 11:54
0
\$\begingroup\$

seems to be handling much more calculations

Bad assumption. I have no idea abut the internal details of gamemaker, but in the worst case, it could be calculating 3000^2 2D collisions every game loop. Meanwhile, assassin's creed could be calculating a very small number (like less than 100) 3D collisions at any given time.

The fact that assassin's creed looks so much nicer is more due to the huge amount of work put into artwork, animation, and modeling than anything to do with 2D or 3D engines.

\$\endgroup\$
  • \$\begingroup\$ Well I once implemented a cell based water system. A spawner would create one water_object every frame which itself checks if the place below is free and if so then move down. If below is blocked, randomly choose a horizontal direction to go. I think Game Maker was able to present about 1500 of these "particles". Then the framerate dropped from 60 to something like 15. \$\endgroup\$ – user148013 Dec 4 '15 at 22:22
  • \$\begingroup\$ That doesn't prove the inefficiency of GameMaker. A lot of these things also come down to the experience of the programmer with the tools. For example: Years ago I made a platormer where drawing turned out hugely inefficient. Later when I learned more, all objects were in one spriteatlas and everything could be drawn in just one drawcall. This bumped the performance from just 150 entities to 5000 animated collidable objects easily. The rest of the code worked quite the same so, it all came down to being able to understand how to optimize things. \$\endgroup\$ – Felsir Jul 25 '16 at 13:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.