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

The game doesn't works #3

Open
Zylann opened this issue Apr 4, 2016 · 18 comments
Open

The game doesn't works #3

Zylann opened this issue Apr 4, 2016 · 18 comments

Comments

@Zylann
Copy link

Zylann commented Apr 4, 2016

I gave the game a try, but there are problems:

  • When Godot Editor opens, it has a lot of lag, but the scene looks empty.
  • When I run the game, I can't see anything but a blue square on a blue background

In the debugger are the following errors:
Failed loading resource: res://scripts/utils.gd
Can't autoload: res://scripts/utils.gd

I'm on Windows 7 64 bits with Godot 2.0.1

@toger5
Copy link
Owner

toger5 commented Apr 5, 2016

I'm currently not active on that project but... So I made a random git commit so you can check the current version. I forgot that i created a new file utils.gd some weeks before where i worked on the project. now i added it to the repo.
THANK you for that feedback.

It is intended that the scene is almost empty on startup (wold is generated n the fly, like in mc)
But i'm not shure why the editor should be laggy. The scene itself is extramly easy.

@toger5
Copy link
Owner

toger5 commented Apr 5, 2016

tell me if it works so i can close that issue

@Zylann
Copy link
Author

Zylann commented Apr 5, 2016

There is no utils.gd in the project, did you pushed the update?

@toger5
Copy link
Owner

toger5 commented Apr 5, 2016

I currently dont get it pushed. need to look into git (made some mess and needed to restore the file)

@toger5
Copy link
Owner

toger5 commented Apr 5, 2016

For now here is the data of the script (create it yourself in the scripts folder):
extends Node

func vec_to_int(v):
    return [int(v.x),int(v.y),int(v.z)]

func int_to_vec(i):
    return Vector3(i[0],i[1],i[2])

func get_chunc_by_coord(cd,pos):
    var correctChunkPos = Vector2(floor(pos.x/16.0)*16, floor(pos.z/16.0)*16)
    if correctChunkPos in cd:
        return cd[correctChunkPos]
    else:
        print("chunk ",pos," is not in chunk_dict")
    return 0

@Zylann
Copy link
Author

Zylann commented Apr 5, 2016

Ok, I added the script and there is no errors now.
But the editor is still laggy and nothing changes, all I see in the game is this:
Screenshot

@toger5
Copy link
Owner

toger5 commented Apr 6, 2016

I'm confused that there are no errors and nothing is showing up.
As I said I messed around with git and did override the utils.gd
Maybe I also made some other changes.
Currently I have very less time so I cant offer a good support.
I try to fix the gi problem and uplaod the version I'm running on my pc.
This version is running.
For now I just can ask you If you have the time to instert some print functions in the geometry for wg to check which part of the code gets executed.
And maybe you could double check if there are really no errors.

EDIT:
the most important line is 329 in chunk.gd
check if it gets executed. If search where it is called and check it that funtion gets executed and so on.
maybe you find the bug which would be great help.

@toger5
Copy link
Owner

toger5 commented Apr 6, 2016

also make shure to use the: newCollisionSystemAndBlockDestroying branch

@toger5
Copy link
Owner

toger5 commented Apr 6, 2016

I now did the upload and made master up to date. so you should be fine using master I guess.
I just tested it on my system and it works

@toger5
Copy link
Owner

toger5 commented Apr 6, 2016

Okay I now Finally fixed the last issues (I again lost something from one script) Hopefully I didn't destroyed any progress but it seems to work fine.
I know what the issue was. The uploaded branch was broken because of some mergers I did with the other branch. (wont go into too much detail but The collider.gd script would need to be innitialized from the player.gd script. This line of code was missing in the repo.)
So now you should be fine by just deleting the whole project on you pc and get the current master.
Pls give me feedback if it does work.

@Zylann
Copy link
Author

Zylann commented Apr 6, 2016

Yes, now it works! FPS is very low, but I can see the blocks appear.
I also figured out that turning off the DirectionalLight increases FPS a lot, I don't know why but it seems to be the origin of the lag.

@toger5
Copy link
Owner

toger5 commented Apr 7, 2016

If you use no directional light than you dont have to make shadow calculations -> higher fps.
For my system this works okay (30-50) so I leave it on. you also should be able to adjust the shadow detail in: Project_settings -> Rastarizes -> max_shadow_buffer_size
maybe you get a setting that is okay for you fps and still looks better than no shadows.

@Zylann
Copy link
Author

Zylann commented Apr 7, 2016

I see! in the project settings, max_shadow_buffer_size was set to 10240, which is HUGE :'D
I reduced to 2048, set shadow_filter to PCF13 and set the light's max_distance to 100 (instead of 0) and I get smooth 60 fps with reasonable shadow quality :)

@toger5
Copy link
Owner

toger5 commented Apr 7, 2016

nice!! sounds good

@toger5
Copy link
Owner

toger5 commented Apr 7, 2016

if you want to you can increse the render distance. Its this variable:var RANGE = 5 in line 24 of geometry_for_wg.gd
it is measured in chunks in every direction from the player. (so 5 means (5+5+1) * (5 + 5 + 1) = 121 chunks)

@toger5
Copy link
Owner

toger5 commented Apr 7, 2016

check how much you can render without having low fps

@Zylann
Copy link
Author

Zylann commented Apr 7, 2016

I tried 12, and dropped to 12 FPS while the 220th chunk was generated. Not sure if it's a culling problem or geometry count (I can render a LOT more in Unity, Minecraft itself or my own implementations without culling in C++). I wonder if Godot uses VBO?

@Zireael07
Copy link

@Zylann: based on a discussion in godotengine/godot #7844, I think the answer is no, it doesn't use VBO.

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

3 participants