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

82: Add a pure client build that leverages Nix #83

Merged
merged 5 commits into from
Jan 7, 2025
Merged

Conversation

schonfinkel
Copy link
Collaborator

@schonfinkel schonfinkel commented Dec 13, 2024

Summary

image

it almost works, I just need to add the assets to the build as well.

Testing

  1. nix build .#client
  2. ./result/bin/lyceum-client

@schonfinkel schonfinkel self-assigned this Dec 13, 2024
@schonfinkel schonfinkel added bug Something isn't working enhancement New feature or request client Client-related issues labels Dec 13, 2024
@schonfinkel schonfinkel modified the milestone: v0.2.0 Dec 13, 2024
@schonfinkel
Copy link
Collaborator Author

schonfinkel commented Dec 14, 2024

@z-silver @EduardoLR10 I'm putting the assets in same directory ($out) as the executable.

INFO: TIMER: Target time per frame: 16.667 milliseconds
WARNING: FILEIO: [./assets/menu/connection/not-connected.png] Failed to open file
WARNING: FILEIO: [./assets/menu/connection/connected.png] Failed to open file
WARNING: FILEIO: [./assets/menu/music/03-Linear-B.ogg] Music file could not be opened
WARNING: FILEIO: [./assets/menu/logo.png] Failed to open file
WARNING: FILEIO: [./assets/menu/backgrounds/main.png] Failed to open file
WARNING: FILEIO: [./assets/menu/backgrounds/character_selection.png] Failed to open file
WARNING: FILEIO: [./assets/menu/font.otf] Failed to open file
INFO: FONT: Data loaded successfully (32 pixel size | 95 glyphs)
WARNING: FILEIO: [./assets/menu/sounds/buttons/select.ogg] Failed to open file
WARNING: FILEIO: [./assets/menu/sounds/buttons/click.ogg] Failed to open file
WARNING: FILEIO: [./assets/menu/sounds/error.ogg] Failed to open file
INFO: TEXTURE: [ID 3] Texture loaded successfully (280x280 | R8G8B8A8 | 1 mipmaps)
WARNING: FILEIO: [./assets/game/world/tiles/water/water.obj] Failed to open text file
WARNING: MESH: [./assets/game/world/tiles/water/water.obj] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/tiles/water/water.obj] Failed to load model material data, default to white material
WARNING: FILEIO: [./assets/game/world/tiles/water/water.png] Failed to open file
WARNING: FILEIO: [./assets/game/world/tiles/grass/grass.obj] Failed to open text file
WARNING: MESH: [./assets/game/world/tiles/grass/grass.obj] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/tiles/grass/grass.obj] Failed to load model material data, default to white material
WARNING: FILEIO: [./assets/game/world/tiles/grass/grass.png] Failed to open file
WARNING: FILEIO: [./assets/game/world/tiles/sand/sand.obj] Failed to open text file
WARNING: MESH: [./assets/game/world/tiles/sand/sand.obj] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/tiles/sand/sand.obj] Failed to load model material dat
a, default to white material
WARNING: FILEIO: [./assets/game/world/tiles/sand/sand.png] Failed to open file
WARNING: FILEIO: [./assets/game/world/tiles/dirt/dirt.obj] Failed to open text file
WARNING: MESH: [./assets/game/world/tiles/dirt/dirt.obj] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/tiles/dirt/dirt.obj] Failed to load model material data, default to white material
WARNING: FILEIO: [./assets/game/world/tiles/dirt/dirt.png] Failed to open file
WARNING: FILEIO: [./assets/game/world/objects/bush/bush.obj] Failed to open text file
WARNING: MESH: [./assets/game/world/objects/bush/bush.obj] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/objects/bush/bush.obj] Failed to load model material data, default to white material
WARNING: FILEIO: [./assets/game/world/objects/tree/tree.glb] Failed to open file
WARNING: MESH: [./assets/game/world/objects/tree/tree.glb] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/objects/tree/tree.glb] Failed to load model material data, default to white material
WARNING: FILEIO: [./assets/game/world/objects/chest/chest.obj] Failed to open text file
WARNING: MESH: [./assets/game/world/objects/chest/chest.obj] Failed to load model mesh(es) data
WARNING: MATERIAL: [./assets/game/world/objects/chest/chest.obj] Failed to load model material data, default to white material

@schonfinkel schonfinkel force-pushed the fix-issue-82 branch 3 times, most recently from 69b7ca9 to eca2c01 Compare December 16, 2024 17:45
@schonfinkel
Copy link
Collaborator Author

schonfinkel commented Dec 16, 2024

@carlotm @ratsclub can you test this version later?

@carlotm
Copy link

carlotm commented Dec 17, 2024

@schonfinkel same crash. tried on two different laptops with Debian 12.

INFO: Initializing raylib 5.0
INFO: Platform backend: DESKTOP (GLFW)
INFO: Supported raylib modules:
INFO:     > rcore:..... loaded (mandatory)
INFO:     > rlgl:...... loaded (mandatory)
INFO:     > rshapes:... loaded (optional)
INFO:     > rtextures:. loaded (optional)
INFO:     > rtext:..... loaded (optional)
INFO:     > rmodels:... loaded (optional)
INFO:     > raudio:.... loaded (optional)
WARNING: GLFW: Error: 65542 Description: GLX: No GLXFBConfigs returned
WARNING: GLFW: Error: 65545 Description: GLX: Failed to find a suitable GLXFBConfig
WARNING: GLFW: Failed to initialize Window
Segmentation fault

@carlotm
Copy link

carlotm commented Dec 18, 2024

@schonfinkel Progress!

Run the client crashes as before, but I was able to run the client with this command:

nix run --impure github:nix-community/nixGL -- ./result/bin/lyceum-client

I have found out that OpenGL apps have issues on non-nixos OSes.
More info at https://github.com/nix-community/nixGL

However, I don't see the assets, same as the screenshot you posted

Cheers!

@schonfinkel
Copy link
Collaborator Author

schonfinkel commented Dec 18, 2024

@carlotm great to know! The missing assets are part of another bug when running a pure client build, it seems, but that's progress! 🚀

I'll see if it is possible to integrate nixGL into our flake, so it becomes part of the devenv.

@schonfinkel
Copy link
Collaborator Author

schonfinkel commented Jan 3, 2025

image

@carlotm Sorry for taking this long, I've tested the pure client build and it works now, may you try it? Depending on your answers I may be able to drop the wrapProgram altogether as well (also summoning @ratsclub to test this on debian as well).

@z-silver @EduardoLR10 please review these changes.

Commands

To reproduce my results in this branch:

  1. nix build .#client
  2. ./result/bin/lyceum-client or nix run --impure github:nix-community/nixGL -- ./result/bin/lyceum-client

@schonfinkel schonfinkel requested a review from z-silver January 3, 2025 21:14
@schonfinkel schonfinkel requested a review from MMagueta January 4, 2025 14:31
Copy link
Member

@EduardoLR10 EduardoLR10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@z-silver z-silver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the same result as @carlotm - just running the executable failed (with the same error that he got), but nix run --impure github:nix-community/nixGL -- ./result/bin/lyceum-client works for me.

@schonfinkel schonfinkel merged commit bc24e08 into master Jan 7, 2025
3 checks passed
@schonfinkel schonfinkel deleted the fix-issue-82 branch January 7, 2025 00:05
@carlotm
Copy link

carlotm commented Jan 7, 2025

I got the same result as @carlotm - just running the executable failed (with the same error that he got), but nix run --impure github:nix-community/nixGL -- ./result/bin/lyceum-client works for me.

I confirm, just FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client Client-related issues enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't start the demo client
4 participants