Git Product home page Git Product logo

2pew's People

Contributors

andrewrk avatar kubkon avatar masonremaley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kubkon

2pew's Issues

LLVM bug with LTO, x86_64-windows, and release mode

[nix-shell:~/dev/2Pew]$ zig-dev build -p win32-release -Dtarget=x86_64-windows  -Doptimize=ReleaseFast
zig build-exe pew ReleaseFast x86_64-windows: error: error(link): /home/andy/dev/zig/build-release/stage3/bin/zig terminated with stderr:
zig: /home/andy/Downloads/llvm-project-16/llvm/lib/LTO/LTO.cpp:557: void llvm::lto::LTO::addModuleToGlobalRes(llvm::ArrayRef<llvm::lto::InputFile::Symbol>, llvm::ArrayRef<llvm::lto::SymbolResolution>, unsigned int, bool): Assertion `!GlobalRes.Prevailing && "Multiple prevailing defs are not allowed"' failed.

Should be reported to zig, then reported to llvm

Zig build error

System: MacOS latest, arm
Zig: both 0.11 and master

Fetch Packages [1/1] zig_sdl [5MiB] /Users/gloop/home/download.zig.2Pew/build.zig.zon:7:21: error: hash mismatch: expected: 122006f1d25dd112605ad00929f05e05da844decd4bc25996998814704344be87a09, found: 1220442ff114c3cc00800d2c23a576aafcda813f08b7baa64b2884ba7148f7857582
            .hash = "122006f1d25dd112605ad00929f05e05da844decd4bc25996998814704344be87a09",

After trying to swap hashes, it crashes with

/Users/gloop/.cache/zig/p/1220442ff114c3cc00800d2c23a576aafcda813f08b7baa64b2884ba7148f7857582/build.zig:15:8: error: member function expected 2 argument(s), found 1
    lib.addCSourceFiles(.{ .files = &generic_src_files });
    ~~~^~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/zig/0.11.0/lib/zig/std/Build/Step/Compile.zig:891:5: note: function declared here
pub fn addCSourceFiles(self: *Compile, files: []const []const u8, flags: []const []const u8) void {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    runBuild__anon_46464: /opt/homebrew/Cellar/zig/0.11.0/lib/zig/std/Build.zig:1638:27
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

Visuals (Somtimes) Not Centered

A fresh check out of the game ran uncentered in a debug build on my Razer laptop, no external monitor. I ran a release build and the same thing happened but the window also wasn't fullscreen. Running the release build again "fixed" it.

6b0d90e
zig version 0.11.0-dev.3291+724cee37e
(mild changes to std that shouldn't affect this, though I did build zig in debug mode I believe. that wasn't true when I first saw this problem way back.)

Display settings:
1920x1080
125%
60hz

issue building

I'm trying to learn zig, so I thought this might be a fun project to look at. :)

I installed zig master (I use ASDF).
I installed SDL

#install sdl2
sudo apt install libsdl2-dev libsdl2-2.0-0 -y;

#install sdl image  - if you want to display images
sudo apt install libjpeg-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;

#install sdl mixer  - if you want sound
sudo apt install libmikmod-dev libfishsound1-dev libsmpeg-dev liboggz2-dev libflac-dev libfluidsynth-dev libsdl2-mixer-dev libsdl2-mixer-2.0-0 -y;

Then I tried building...

 -> zig build run
thread 536547 panic: integer overflow
/home/nigel/code/2Pew/src/main.zig:2674:33: 0x255400 in spriteFromBytes (pew)
            const pitch = width * channel_count;
                                ^
/home/nigel/code/2Pew/src/main.zig:2573:56: 0x2565d4 in loadSprite (pew)
        try a.sprites.append(a.gpa, try spriteFromBytes(allocator, diffuse_png, recolor, a.renderer,
tints));                                                                                                                                                    ^
/home/nigel/code/2Pew/src/main.zig:1923:46: 0x257065 in init (pew)
        const ring_bg = try assets.loadSprite(allocator, "img/ring.png", null, no_tint);
                                             ^
/home/nigel/code/2Pew/src/main.zig:112:29: 0x25bfea in main (pew)
    var game = try Game.init(gpa, &assets);
                            ^
/home/nigel/.asdf/installs/zig/master/lib/std/start.zig:585:37: 0x264c56 in main (pew)
            const result = root.main() catch |err| {
                                    ^
../sysdeps/nptl/libc_start_call_main.h:58:16: 0x7f11e6423a8f in __libc_start_call_main (../sysdeps/x8
6/libc-start.c)                                                                                      ../csu/libc-start.c:360:3: 0x7f11e6423b48 in __libc_start_main_impl (../sysdeps/x86/libc-start.c)
???:?:?: 0x2325e4 in ??? (???)
???:?:?: 0x0 in ??? (???)
run pew: error: the following command terminated unexpectedly:
/home/nigel/code/2Pew/zig-out/pew
Build Summary: 4/6 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run pew failure
error: the following build command failed with exit code 1:
/home/nigel/code/2Pew/zig-cache/o/6595f80b5b21a433cd1959d07eec3eaf/build /home/nigel/.asdf/installs/z
ig/master/zig /home/nigel/code/2Pew /home/nigel/code/2Pew/zig-cache /home/nigel/.cache/zig --seed 0xc8c86ffa run

Duplicate ship bug

When playtesting with Rob, Andy's ship got duplicated unexpectedly. Both ships were controlled by the same inputs. Eventually, the game crashes, and unfortunately I don't know exactly why since I haven't implemented logging yet.

We were running a build of 6b0d90e for Windows, likely cross compiled from Linux.

While tracking this down I should also introduce some basic logging so future bugs of this kind are easy to fix!

panic: failed to remove entity ecs.EntityHandle: error.BadGeneration

thread 2893834 panic: failed to remove entity ecs.EntityHandle{ .index = 41, .generation = 17 }: error.BadGeneration
/home/andy/Downloads/zig/lib/std/debug.zig:312:22: 0x2a7fee in panicExtra__anon_25365 (pew)
    std.builtin.panic(msg, trace, ret_addr);
                     ^
/home/andy/Downloads/zig/lib/std/debug.zig:287:15: 0x28bb56 in panic__anon_22554 (pew)
    panicExtra(null, null, format, args);
              ^
/home/andy/dev/2Pew/src/ecs.zig:384:32: 0x254fb0 in remove (pew)
                std.debug.panic("failed to remove entity {}: {}", .{ entity, err });
                               ^
/home/andy/dev/2Pew/src/main.zig:526:54: 0x241d8c in update (pew)
                        entities.remove(damage_entity.handle);
                                                     ^
/home/andy/dev/2Pew/src/main.zig:219:15: 0x23f181 in main (pew)
        update(&entities, &game, delta_s);
              ^
/home/andy/Downloads/zig/lib/std/start.zig:617:37: 0x24455c in main (pew)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x7f858d22424d in ??? (???)
???:?:?: 0x0 in ??? (???)

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.