Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix long startup time #5

Closed
t-karcher opened this issue Jan 20, 2018 · 5 comments
Closed

Fix long startup time #5

t-karcher opened this issue Jan 20, 2018 · 5 comments

Comments

@t-karcher
Copy link
Owner

I stopped the Godot process twice because I thought it crashed before I analyzed the code and realized what happened: Precalculating and placing 52.000 collision objects at startup takes approximately 70 seconds on my machine, without any visual clue of what's happening. 😲

I see two possible improvements for this:

  1. Dynamically add new lines as needed during the game instead of placing all tiles in advance.
  2. Use tiles with collision detection for the coastline only; draw the rest of the scene using larger shapes without any collision detection instead of using tiles 0 and 15.
@ChrisOKay
Copy link
Collaborator

70 seconds?! instant start on my macbook? Is that bug on windows side? will check with my windows laptop...

@ChrisOKay
Copy link
Collaborator

please check whether his happens as well if you replace the whole map by blank tiles, i.e. replace
if (float(x)/columns > riverCentre[y]-riverWidth[y]/2) && (float(x)/columns < riverCentre[y]+riverWidth[y]/2): grid_map[x].append(0) else: grid_map[x].append(1)
in scene1 by
grid_map[x].append(0)

@ChrisOKay
Copy link
Collaborator

peculiar.... this seems to be an issue connected to the windows version of godot? I can reprocuce the long loading time, but this does not change if everything is replaced by collision-free tiles, so it is not connected to collision.

@t-karcher
Copy link
Owner Author

Good news: Updating from Godot 2.1.3 to 2.1.4 reduced the load time from 70 to 12 seconds (same code as before, I didn't fetch the repo since yesterday). Will try again with Godot 3 RC2 later today.

@t-karcher
Copy link
Owner Author

As discussed: Removing the debugger output reduced the total load time to <3 seconds. So: Fixed. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants