0 votes

The project I talk about in this post

So I'm making a game, I decide take a break and close the editor. I come back a few hours later, open my project and playtest it before making any changes, and somehow it's become completely unplayable. It slowly gets more and more laggy when you try and play it. I've looked over everything I was working on before closing the engine, I exported it, I sent it to a friend, turned off vsync, restarted my pc, nothing has any effect on it. Here's some things I found that might have something to do with the cause:

  • There were a few lines of code that I'd written not long before exiting the engine that hadn't saved. I rewrote them, checked other things I'd done around the same time, nothing.
  • When my friend tested it, they got an error that I wasn't getting. I'm not sure what it means:


They also told me that it got stuck on the loading screen for them, which I also haven't experienced.

I am completely lost as to what could be causing this. Nothing I do seems to change anything. It would also be ideal to get a quick solution, because I'm making this game for a game jam. No pressure :)

in Engine by (108 points)

Are you creating/writing files? If so, are you using the user:// prefix? Looks like your friend maybe installed the game in a write protected folder.

Are you using source control? If so, check out the latests diffs in the .project file and the .tscn files. I've had issues where somehow garbage values were stored there that weren't visible from the editor, and it was messing up my collision masks.

I've just noticed you included a link to your project. Unfortunately, I'm guessing you set it up as private since I get a 404.

No, nowhere in my code have I created or written files. I don't exactly know what source control is, so I'm probably not using it. And sorry, I'll set it to public

I assumed you knew what source control was since you're using github, also it l9oks like you just used it to dump your project in one big go. Usually, you keep a version of your project on github and push your changes to it gradually, allowing you to easily keep track of versions and go back to previous versions. I strongly suggest you take a tutorial on git, as it will save you lots of trouble going forward.

I'll try and download it later today. In the meantime, try the profiler to see where the delays are coming from:
https://docs.godotengine.org/en/stable/tutorials/debug/debugger_panel.html#profiler

Just wanted to add to the importance of using git for your projects: if you had used it properly, you could have easily gone back to the version without the lag and compared the changes you made to find the source of the issue. Instead, you have to go "oh no, what did I change" as you scour each file.

Lesson learned, I hope! :)

Yeah, definitely sounds like a good idea. I'm gonna do that for all my games in the future, because this is a total mess. You really don't learn the importance of backing up your files until something like this happens, haha

Yup, don't worry, I think every dev has got to learn that the hard way before they sit down and bother learning git. Even if they don't want to admit it :P

1 Answer

+1 vote

Lol do you think you've got enough cameras in your scene https://imgur.com/a/2YlgZAr

In many of your scripts, you're instantiating cameras in the _process function (i.e. every frame) and just adding them to the tree. In this case, the bullet.gd script is the culprit.

I suspected something like that (maybe because I once made a similar mistake, who knows ;) ), so I paused the game and opened the "remote" tab of the scene tree. That shows you the current tree of the game you're debugging.

by (1,094 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.