I have been using Godot for 10 months (2D).

I created a level using TILED. All works fine except that the movement along the level is laggy.

No need to discuss my code. Tileset has less then 10 tiles of 16x6 each, player only moves, jump and shoot. Level is quite small, no vsync, no animations etc etc etc.

Let us be honest, there are people reporting this on the internet. Camera laggy, level laggy, player movemet laggy...

Goody team seems to be focused on 3D, visual scripts and C# so it gives me the impression that the laggy issue on 2D is not priority (right?).

I am about to quit godot because I am fighting with this laggy issue. It gives me the impression that godot team is putting their strength on 3D and new features (nothing wrong, it is just not what I need).

I got 2 important questions:

Is there anybody out there building a 2D game without experiencing this?

Does Godot team have plans to improve this?

Thanks

I am currently building a 2D game without any issues here, and I am using several KinematicBodies to control things and still get a solid 60FPS.

If you try exporting your project to a standalone executable, you will see how well the game truly runs - if you are running it through the editor it will be laggy because the engine is running itself and your game, so it takes up more resources.

What are your system specs? If you are using old hardware (10+ years old), then that is likely your issue, and you will get the same result in any other engine.

I tried this and no lucky.

I will give it a try again of course I dont want to quit :)

My pc is windows 10 pro, ssd, i5 4th generation quadcore 2.2x, 1gb video card integrated to motherboard.

I already tried running on a pc with 4gb GtX gforce and same issue.

That is why I am frustrated.

Thanks for your reply. I will get back and post the final test results.

Thanks

Have you looked in the camera options? I know there is Smoothing (not smoothed...that is different). Is it set to on or off? In the Project Settings...check Rendering>Quality. Is the framebuffer allocation set to 2D? (I think it defaults to 3D).

Might check/try those settings.

-emo

@leonardon said: I tried this and no lucky.

I will give it a try again of course I dont want to quit :)

My pc is windows 10 pro, ssd, i5 4th generation quadcore 2.2x, 1gb video card integrated to motherboard.

I already tried running on a pc with 4gb GtX gforce and same issue.

That is why I am frustrated.

Thanks for your reply. I will get back and post the final test results.

Thanks

Integrated 3D cards are not great most of the time, what Geforce series was the other 3D card ?

@leonardon said: I have been using Godot for 10 months (2D).

I created a level using TILED. All works fine except that the movement along the level is laggy.

No need to discuss my code. Tileset has less then 10 tiles of 16x6 each, player only moves, jump and shoot. Level is quite small, no vsync, no animations etc etc etc.

Let us be honest, there are people reporting this on the internet. Camera laggy, level laggy, player movemet laggy...

Goody team seems to be focused on 3D, visual scripts and C# so it gives me the impression that the laggy issue on 2D is not priority (right?).

I am about to quit godot because I am fighting with this laggy issue. It gives me the impression that godot team is putting their strength on 3D and new features (nothing wrong, it is just not what I need).

I got 2 important questions:

Is there anybody out there building a 2D game without experiencing this?

Does Godot team have plans to improve this?

Thanks

Can you provide some small game demo ? Or some example scene ? We can test it ourselves this way.

@leonardon said: My pc is windows 10 pro, ssd, i5 4th generation quadcore 2.2x, 1gb video card integrated to motherboard.

I already tried running on a pc with 4gb GtX gforce and same issue.

A 4th Gen core i5 is pretty old, in terms of CPU time, and it wasn't the most powerful CPU when it came out in the first place. This combined with your integrated graphics is not an ideal development environment in the slightest.

As for the PC with a 4GB GTX card, what was the CPU? CPUs still play a huge factor in game performance, it isn't always about the GPU. You could have the world's best GPU and the cheapest CPU you can find, and everything will run horribly.

@leonardon said: No need to discuss my code.

Well, there might be a reason to discuss it, are you doing things in loops that are unnecessary? Doing collision checks every single frame for every single object at once?

I really think this comes down to hardware, though. I think if you tried any other engine you'd likely have the same results.

@BinaryOrange said: A 4th Gen core i5 is pretty old, in terms of CPU time, and it wasn't the most powerful CPU when it came out in the first place.

A 4th-generation Core i5 should not be too slow for any 2D game out there — it's also fast enough for the overwhelming majority of 3D games.

@Calinou said:

@BinaryOrange said: A 4th Gen core i5 is pretty old, in terms of CPU time, and it wasn't the most powerful CPU when it came out in the first place.

A 4th-generation Core i5 should not be too slow for any 2D game out there — it's also fast enough for the overwhelming majority of 3D games.

True, I think I thought it was older than it actually is... for some reason I was thinking 4th gen was almost 10 years ago and that isn't the case!

In fact, when compared to my CPU (FX-8350), it's actually... better. :open_mouth:

But perhaps it is the older GPU causing problems, then, or perhaps another problem altogether.

A thought just hit me, @leonardon, do you have any anti-virus software installed, and could it be slowing your computer down?

This is a very old issue with Godot and due to its inconsistencies, I'm inclined to believe it's related not to the program lagging or having the wrong PC specs, but due to how Godot renders with different drivers and desktop environments.

It's not a problem exclusive to Godot either, other engines have issues with visuals hitching (both in 2D and in 3D), and it's just as inconsistent there. Desktop is generally just not a very friendly place for smooth gameplay, you'd want a device that's specially built for that purpose.

There was a fix pushed in master that attempts to help solve hitching with physics bodies, just one of numerous causes of visual hitching. Supposedly there's another issue related with how Camera2D works, and so by manipulating the viewport yourself, you may be able to solve some hitching. I've personally noted that different compositors can cause different levels of hitching (with buttery smooth--albeit tearing--gameplay with no compositor at all.) Some say turning off vsync cures visual hitching, others say it doesn't.

Not only is the problem inconsistent for different machines (hence some saying it's a big problem, while others saying they just don't see it), it's inconsistent when it happens on those machines affected; it may not happen at all for a while, it may happen a lot for a while. You think it's fixed because you changed X or Y in your code, but it comes back eventually.

Anyway point is, don't bother wasting your time trying to find something wrong with your own setup. I made one game that was extremely jittery on my own machine, but everyone else who played it said it was very smooth on their end. If there's a solution, it's going to be in engine code I think, not on the game developer's end (nor should they be concerned about this; after all, the engine is meant to get this sort of stuff out of the way for developers.)

Thank you all for your inputs. I have been testing other project configurations but no lucky.

An i5 4th generation is not bad. My game is a test with 1 level just 1 tile of 16x16 pixel is being used to build the tilemap.

I have been testing this same code on other machines and the result is always the same.

For me it could be 2 things:

1.

The Camera2D under the player This camera seems to be causing this issue. I downloaded an open source code for Dolphin Island 2 and the Camera is on the level and controlled by code instead. dolphin Island 2 runs pretty smooth.

2.

The other possibility is the TILED plugin I am using. [https://godotengine.org/asset-library/asset/edit/102](https://godotengine.org/asset-library/asset/edit/102 "https://godotengine.org/asset-library/asset/edit/102") TilemapsThis is a Godot asset (third party) My Tilemap is only 120x 30 Tiles (really small)

My player is controlled by same code provided by Godot GIT (Kinematic Character 2D) https://github.com/godotengine/godot-demo-projects/blob/master/2d/kinematic_character/player.gd

So that si why I mentioned no need to check the code. I am not calling a _process inside of another.

Well...

Thank you all for your assistance.

I will keep trying to solve this and keep you updated about any findings.

Thanks

I will say this much. I am working on a 2D game from the Gamedev.tv tutorials. I WAS using 3.0.2 to develop it, and it was working just fine. I noticed that the tutorial was using 3.0.4, so literally TODAY I decided to upgrade to 3.0.6. There is now a noticeable lag in the game. The lag was not there at all in 3.0.2. It is there now. All other settings are the same.

My Laptop is a fairly new (purchased March of 2017) Dell Inspiron 7000 series gaming laptop. Processor is 7th Generation Intel Core i7-7700HQ Quad Core (6MB Cache, up to 3.8 GHz). Video card is NVIDIA GeForce GTX 1050Ti with 4GB GDDR5. RAM is 16GB, 2400MHz, DDR4. Hard drive is a Samsung SSD. So I'm pretty sure it's not the machine.

I'm not using a TILED plugin...just straight Godot as is.... with GDScript...etc....etc...

To me, it very much seems like something changed either in 3.0.4 or 3.0.6.....

-emo

Could you test your projects with different versions between 3.0.2 and 3.0.6? Once you've tracked down which version was the first to show the performance regression file a bug report and link it here for the others too?

A list of builds can be found here: https://downloads.tuxfamily.org/godotengine/

@Megalomaniak said: Could you test your projects with different versions between 3.0.2 and 3.0.6? Once you've tracked down which version was the first to show the performance regression file a bug report and link it here for the others too?

A list of builds can be found here: https://downloads.tuxfamily.org/godotengine/

You bet. I actually posted on a similar thread on the Git bug section. They asked the same. Will do some testing today with all versions inbetween 3.0.2 adn 3.0.6.

-emo

I am glad to see this discussion moving on.

I have been trying a different set of project configurations and I managed to achieve one satisfactory.

Firstly:

I did set my camera2d to: SMOOTHED ON Smoothing OFF

Secondly:

On project settings: Bordeless ON (I noticed if this is OFF the lag on the camera is very noticeable) Always On Top ON (this also helped) vSync OFF Mode VIEWPORT (it was like this already) Aspect KEEP (it was like this already)

For me after turning ON the Bordeless and the Always on Top was the key.

Also exporting the game the performance looks a bit better as many have already mentioned.

Well. I hope that helps someone out there.

I will also do some test controlling the camera2d as a child of the level not the player.

I will post the results here.

I expected a complete demo i could download and run (i don't have any 2D projects or assets in Godot).

@leonardon said: I am glad to see this discussion moving on.

I have been trying a different set of project configurations and I managed to achieve one satisfactory.

Firstly:

I did set my camera2d to: SMOOTHED ON Smoothing OFF

Secondly:

On project settings: Bordeless ON (I noticed if this is OFF the lag on the camera is very noticeable) Always On Top ON (this also helped) vSync OFF Mode VIEWPORT (it was like this already) Aspect KEEP (it was like this already)

For me after turning ON the Bordeless and the Always on Top was the key.

Also exporting the game the performance looks a bit better as many have already mentioned.

Well. I hope that helps someone out there.

I will also do some test controlling the camera2d as a child of the level not the player.

I will post the results here.

I hope those issues will be resolved for people working on 2D games in Godot.

4 days later

Hello @MagicLord and everybody interested in this thread,

Please send me your email on private and I will send you the game executable (not the code).

You can test it and we can investigate this further.

thanks

I understand that time can be limited but if you can't share the project publicly maybe you can replicate the issue in a simple separate demo that you can share. Or since @emo10001 was able to identify similar issues perhaps he can share a simple demo for this.

Alright I like the idea.

I will prepare a demo and post it here so everybody can download it and take a look at the code.

The goal is to allow others to examine the project and identify what could be causing the lag.

So please after downloading it please post here your findings.

Thanks

Here is the link to download the project.

Remember I have changed the project settings and I am achieving something smoother but still lagging.

This is just a demo so most of features and sprites were removed.

https://drive.google.com/file/d/1xvjNdVjYa01xm7JGpSnrhY8lc4ON83Pe/view?usp=sharing

After downloading it please post here what your suggestions to make this smoother.

How to test it:

  1. go to NEW GAME
  2. move the character around the level
  3. grab the weapons if you want and press F to shoot
  4. hold SPACE to jump
  5. select weapon with 1, 2, 3 e 4

Ok, first try with godot 3.0.2, no noticeable lag on my system(FX 8300, 16GB DDR3@1866MHz/CL9, RX 470 8GB; Widows 7 64bit SP1) however the console output does claim there to be leaks:

! WARNING: ObjectDB::cleanup: ObjectDB Instances still exist! ! At: core\object.cpp:1989 ! Leaked Instance: Physics2DDirectSpaceStateSW:1011 ! Leaked Instance: Physics2DDirectSpaceStateSW:1029 ! Leaked Instance: Physics2DDirectSpaceStateSW:1014 ! Leaked Instance: Physics2DDirectSpaceStateSW:1025 ! Leaked Instance: Physics2DDirectSpaceStateSW:1042 ! Leaked Instance: Physics2DDirectSpaceStateSW:1038 ! Leaked Instance: Physics2DDirectSpaceStateSW:1043 ! Leaked Instance: Physics2DDirectSpaceStateSW:997 ! Leaked Instance: Physics2DDirectSpaceStateSW:993 ! Leaked Instance: Physics2DDirectSpaceStateSW:1028 ! Leaked Instance: Physics2DDirectSpaceStateSW:1021 ! Leaked Instance: Physics2DDirectSpaceStateSW:1000 ! Leaked Instance: Physics2DDirectSpaceStateSW:996 ! Leaked Instance: Physics2DDirectSpaceStateSW:1035 ! Leaked Instance: Physics2DDirectSpaceStateSW:1004 ! Leaked Instance: Physics2DDirectSpaceStateSW:1039 ! Leaked Instance: Physics2DDirectSpaceStateSW:1020 ! Leaked Instance: Physics2DDirectSpaceStateSW:991 ! Leaked Instance: Physics2DDirectSpaceStateSW:989 ! Leaked Instance: Physics2DDirectSpaceStateSW:1044 ! Leaked Instance: Physics2DDirectSpaceStateSW:992 ! Leaked Instance: Physics2DDirectSpaceStateSW:1024 ! Leaked Instance: Physics2DDirectSpaceStateSW:1015 ! Leaked Instance: Physics2DDirectSpaceStateSW:1026 ! Leaked Instance: Physics2DDirectSpaceStateSW:1018 ! Leaked Instance: Physics2DDirectSpaceStateSW:1017 ! Leaked Instance: Physics2DDirectSpaceStateSW:1045 ! Leaked Instance: Physics2DDirectSpaceStateSW:994 ! Leaked Instance: Physics2DDirectSpaceStateSW:990 ! Leaked Instance: Physics2DDirectSpaceStateSW:1041 ! Leaked Instance: Physics2DDirectSpaceStateSW:1013 ! Leaked Instance: Physics2DDirectSpaceStateSW:1022 ! Leaked Instance: Physics2DDirectSpaceStateSW:998 ! Leaked Instance: Physics2DDirectSpaceStateSW:1012 ! Leaked Instance: Physics2DDirectSpaceStateSW:1009 ! Leaked Instance: Physics2DDirectSpaceStateSW:1027 ! Leaked Instance: Physics2DDirectSpaceStateSW:1019 ! Leaked Instance: Physics2DDirectSpaceStateSW:1016 ! Leaked Instance: Physics2DDirectSpaceStateSW:1030 ! Leaked Instance: Physics2DDirectSpaceStateSW:988 ! Leaked Instance: Physics2DDirectSpaceStateSW:1005 ! Leaked Instance: Physics2DDirectSpaceStateSW:1023 ! Leaked Instance: Physics2DDirectSpaceStateSW:995 ! Leaked Instance: Physics2DDirectSpaceStateSW:1037 ! Leaked Instance: Physics2DDirectSpaceStateSW:1036 ! Leaked Instance: Physics2DDirectSpaceStateSW:1007 ! Leaked Instance: Physics2DDirectSpaceStateSW:1033 ! Leaked Instance: Physics2DDirectSpaceStateSW:1002 ! Leaked Instance: Physics2DDirectSpaceStateSW:1031 ! Leaked Instance: Physics2DDirectSpaceStateSW:1003 ! Leaked Instance: Physics2DDirectSpaceStateSW:1032 ! Leaked Instance: Physics2DDirectSpaceStateSW:1008 ! Leaked Instance: Physics2DDirectSpaceStateSW:999 ! Leaked Instance: Physics2DDirectSpaceStateSW:1010 ! Leaked Instance: Physics2DDirectSpaceStateSW:1040 ! Leaked Instance: Physics2DDirectSpaceStateSW:1001 ! Leaked Instance: Physics2DDirectSpaceStateSW:1006 ! Leaked Instance: Physics2DDirectSpaceStateSW:1034 ! Orphan StringName: #match_value ! Orphan StringName: Physics2DDirectSpaceStateSW ! StringName: 2 unclaimed string names at exit.

Possibly the result of me having to force close the game since there was no menu to exit from.