Coder Social home page Coder Social logo

matthewcpp / framework64 Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 0.0 3.15 MB

Asset pipeline and minimal framework for building N64 games with libultra

License: MIT License

C 83.85% C++ 8.92% CMake 0.75% GLSL 0.17% JavaScript 6.05% Assembly 0.12% Dockerfile 0.03% Makefile 0.04% Python 0.07%
libultra nintendo64

framework64's People

Contributors

kivan117 avatar matthewcpp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

framework64's Issues

No assets.h file is generated after running prepare-game-assets

I am attempting to build the simple_scene demo. I am building on Windows 11.

To do this I:

  1. Created a new game using the quickstart guide in the git repository "mygame".
  2. Followed the N64 VSCode build guide to get the dev container set up
  3. Copied all of the assets from the repo into my mygame/assets folder
  4. Copied the assets.json manifest file, source files, and CMakeLists.txt from the simple_scene demo into my mygame/assets folder
  5. Copied the "fire.c" and "fire.h" files from the billboard example into my src/ folder, and updated CMakeLists.txt accordingly.
  6. Ran the command "npm run prepare-game-assets n64" in mygame/
  7. Attempted to build the project.

I get the following output:

[main] Building folder: mygame 
[main] Configuring project: mygame 
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DFW64_PLATFORM_N64:STRING=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/workspaces/mygame -B/workspaces/mygame/build_n64 -G "Unix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] Configuring for Platform: N64-libultra
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /workspaces/mygame/build_n64
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /workspaces/mygame/build_n64 --config Release --target all -j 18 --
[build] [ 82%] Built target framework64
[build] [ 83%] Building C object src/CMakeFiles/simple_scene.dir/flame.c.obj
[build] [ 87%] Building C object src/CMakeFiles/simple_scene.dir/ui.c.obj
[build] [ 87%] Building C object src/CMakeFiles/simple_scene.dir/game.c.obj
[build] [ 89%] Building C object src/CMakeFiles/simple_scene.dir/__/lib/framework64/src/n64/main_n64.c.obj
[build] [ 91%] Building C object src/CMakeFiles/simple_scene.dir/asm/asset_data.s.obj
[build] /workspaces/mygame/build_n64/src/asm/asset_data.s: Assembler messages:
[build] /workspaces/mygame/build_n64/src/asm/asset_data.s:7: Error: file not found: /workspaces/mygame/build_n64/bin/simple_scene/assets/assets.dat
[build] make[2]: *** [src/CMakeFiles/simple_scene.dir/build.make:167: src/CMakeFiles/simple_scene.dir/asm/asset_data.s.obj] Error 1
[build] make[2]: *** Waiting for unfinished jobs....
[build] /workspaces/mygame/src/flame.c:4:10: fatal error: assets/assets.h: No such file or directory
[build]     4 | #include "assets/assets.h"
[build]       |          ^~~~~~~~~~~~~~~~~
[build] compilation terminated.
[build] make[2]: *** [src/CMakeFiles/simple_scene.dir/build.make:63: src/CMakeFiles/simple_scene.dir/flame.c.obj] Error 1
[build] /workspaces/mygame/src/ui.c:3:10: fatal error: assets/assets.h: No such file or directory
[build]     3 | #include "assets/assets.h"
[build]       |          ^~~~~~~~~~~~~~~~~
[build] compilation terminated.
[build] /workspaces/mygame/src/game.c:3:10: fatal error: assets/assets.h: No such file or directory
[build]     3 | #include "assets/assets.h"
[build]       |          ^~~~~~~~~~~~~~~~~
[build] make[2]: *** [src/CMakeFiles/simple_scene.dir/build.make:102: src/CMakeFiles/simple_scene.dir/ui.c.obj] Error 1
[build] compilation terminated.
[build] make[2]: *** [src/CMakeFiles/simple_scene.dir/build.make:115: src/CMakeFiles/simple_scene.dir/game.c.obj] Error 1
[build] /workspaces/mygame/lib/framework64/src/n64/main_n64.c:4:10: fatal error: assets/assets.h: No such file or directory
[build]     4 | #include "assets/assets.h"
[build]       |          ^~~~~~~~~~~~~~~~~
[build] compilation terminated.
[build] make[2]: *** [src/CMakeFiles/simple_scene.dir/build.make:128: src/CMakeFiles/simple_scene.dir/__/lib/framework64/src/n64/main_n64.c.obj] Error 1
[build] make[1]: *** [CMakeFiles/Makefile2:180: src/CMakeFiles/simple_scene.dir/all] Error 2
[build] make: *** [Makefile:84: all] Error 2
[proc] The command: /usr/bin/cmake --build /workspaces/mygame/build_n64 --config Release --target all -j 18 -- exited with code: 2
[driver] Build completed: 00:00:03.006
[build] Build finished with exit code 2

I have verified that no assets.h file gets created anywhere in the repository.

The following is the output to my "npm run prepare-game-assets n64", which completes without error:

PS C:\Users\Tim\mygame> npm run prepare-game-assets n64

> [email protected] prepare-game-assets
> node lib/framework64/scripts/PrepareGameAssets.js n64

No target specified. using default target: mygame
Processing Mesh: penguin/penguin.gltf
Processing Image Atlas: fire_sprite
Processing Font: Consolas.ttf
Processing Level: simple_scene/simple_scene.gltf

Here is my assets.json:

{
    "fonts": [
        {
            "src": "Consolas.ttf",
            "size": 12,
            "name": "Consolas12"
        }
    ],
    "images": [
        {
            "name": "fire_sprite",
            "frameDir": "fire_sprite",
            "hslices": 10,
            "vslices": 1,
            "frameSize": "128x128",
            "resize": "320x32",
            "format": "rgba32"
        }
    ],
    "levels": [
        {
            "src": "simple_scene/simple_scene.gltf",
            "typeMap": 0,
            "layerMap": 0
        }
    ],
    "meshes": [
        {
            "src": "penguin/penguin.gltf"
        }
    ],
    "layers": {
        "default": 1,
        "ground": 2,
        "wall": 4
    }
}

And finally, here is my src/CMakelists.txt

set(src_files
    flame.h flame.c
    chase_cam.h chase_cam.c
    player.h player.c
    ui.h ui.c
    game.h game.c )

    create_game(
        TARGET simple_scene
        SOURCES ${src_files})

Asset Pipeline dependency installation fails on Ubuntu 23.04

Following the quickstart guide, I complete all of the steps up until the call to "npm install" to install the asset pipeline dependencies. It fails at that point.

Below is my full terminal output as I attempt to follow all of the steps of the guide. You will notice that after the call to npm install, I run ls on the folder that it attempts to rename, and that folder does not exist.

I am not a web developer, and I am not familiar with node.js beyond the very basics, and so I'm not sure how to get you more useful information.

tim@tim-System-Product-Name:~$ git init mygame
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /home/tim/mygame/.git/
tim@tim-System-Product-Name:~$ cd mygame
tim@tim-System-Product-Name:~/mygame$ sudo npm install @matthewcpp/framework64-cli

added 126 packages in 11s

7 packages are looking for funding
  run `npm fund` for details
tim@tim-System-Product-Name:~/mygame$ npx framework64-cli create
Creating framework64 game: mygame
framework64 project directory: /home/tim/mygame
Check for git repository in /home/tim/mygame: OK
Add framework64 submodule
Add framework64 submodule: OK
Initialize framework64 submodule
Initialize framework64 submodule: OK
Create initial commit
Create initial commit: OK
Downloading and configuring starter project from: https://github.com/matthewcpp/framework64-starter/archive/refs/heads/main.zip
Downloading and configuring starter project from: https://github.com/matthewcpp/framework64-starter/archive/refs/heads/main.zip: OK
tim@tim-System-Product-Name:~/mygame$ npm run configure-environment-n64-modernsdk

> [email protected] configure-environment-n64-modernsdk
> node lib/framework64/scripts/ConfigureEnvironment.js n64-modernsdk

Configuring for: N64 Modern SDK
Copy: /home/tim/mygame/lib/framework64/config/n64.modernsdk/n64.modernsdk.devcontainer.json --> /home/tim/mygame/.devcontainer.json
tim@tim-System-Product-Name:~/mygame$ npm install
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /home/tim/mygame/node_modules/@matthewcpp/framework64-cli
npm ERR! dest /home/tim/mygame/node_modules/@matthewcpp/.framework64-cli-tUHhLoq2
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/home/tim/mygame/node_modules/@matthewcpp/framework64-cli' -> '/home/tim/mygame/node_modules/@matthewcpp/.framework64-cli-tUHhLoq2'
npm ERR!  [Error: EACCES: permission denied, rename '/home/tim/mygame/node_modules/@matthewcpp/framework64-cli' -> '/home/tim/mygame/node_modules/@matthewcpp/.framework64-cli-tUHhLoq2'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/home/tim/mygame/node_modules/@matthewcpp/framework64-cli',
npm ERR!   dest: '/home/tim/mygame/node_modules/@matthewcpp/.framework64-cli-tUHhLoq2'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/tim/.npm/_logs/2023-07-01T05_33_35_454Z-debug-0.log
tim@tim-System-Product-Name:~/mygame$ ls /home/tim/mygame/node_modules/@mathewcpp
ls: cannot access '/home/tim/mygame/node_modules/@mathewcpp': No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.