Closed jeffbdavenport closed 1 year ago
Hi! Thanks for checking it out and giving it a shot. I haven't fully updated is as nightly just got some changes that my dependencies haven't gotten yet. I have it currently running using zig 0.11.0-dev.3986+e05c242cd
if you can track it down, and as soon as zig-gamedev updates to latest I'll update this project. I don't have a Win10 machine to test right now but it runs fine for me on Windows 11.
if you can track it down, and as soon as zig-gamedev updates to latest I'll update this project. I don't have a Win10 machine to test right now but it runs fine for me on Windows 11.
Hi @foxnne! Zig-gamedev is now updated to work with zig 0.11.0-dev.4332. So you can probably update now.
Thanks guys! I will try this very soon
Just tried with the build 0.11.0-dev.3986+e05c242cd
and below is the result for me. Still just a blank white screen for a split second
$ ./zig-out/bin/Aftersun.exe
Warning: DiscoverDefaultPhysicalDevices is deprecated. Call EnumerateAdapters or RequestAdapter instead.
info: [zgpu] High-performance device has been selected:
info: [zgpu] Name: NVIDIA GeForce RTX 3080 Laptop GPU
info: [zgpu] Driver: D3D12 driver version 31.0.15.3623
info: [zgpu] Adapter type: discrete_gpu
info: [zgpu] Backend type: d3d12
error(gpa): memory address 0x1e141780000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5840f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf58ea2 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf59106 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35b91 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e141720000 leaked:
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:205:42: 0x7ff6cdf3451e in create (Aftersun.exe.obj)
const gctx = try allocator.create(GraphicsContext);
^
C:\projects\zig\aftersun\src\aftersun.zig:138:49: 0x7ff6cdf3a9e4 in init (Aftersun.exe.obj)
const gctx = try zgpu.GraphicsContext.create(allocator, window);
^
C:\projects\zig\aftersun\src\aftersun.zig:846:21: 0x7ff6cdf4964b in main (Aftersun.exe.obj)
state = try init(allocator, window);
^
C:\Users\Jeff\bin\lib\std\start.zig:507:101: 0x7ff6cdf4de44 in main (Aftersun.exe.obj)
return @call(.always_inline, callMainWithArgs, .{ @as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp });
^
error(gpa): memory address 0x1e141720800 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5cc0f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf5d6a2 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf5d906 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35fa1 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e141760000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5674f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf571e2 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf57446 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf359f1 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e141750000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5551f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf56382 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf565e6 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35921 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e14c540000 leaked:
C:\projects\zig\aftersun\src\gfx\batcher.zig:39:43: 0x7ff6cdf36194 in init (Aftersun.exe.obj)
var vertices = try allocator.alloc(gfx.Vertex, max_quads * 4);
^
C:\projects\zig\aftersun\src\aftersun.zig:147:41: 0x7ff6cdf3ab03 in init (Aftersun.exe.obj)
const batcher = try gfx.Batcher.init(allocator, gctx, settings.batcher_max_sprites);
^
C:\projects\zig\aftersun\src\aftersun.zig:846:21: 0x7ff6cdf4964b in main (Aftersun.exe.obj)
state = try init(allocator, window);
^
C:\Users\Jeff\bin\lib\std\start.zig:507:101: 0x7ff6cdf4de44 in main (Aftersun.exe.obj)
return @call(.always_inline, callMainWithArgs, .{ @as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp });
^
error(gpa): memory address 0x1e14c570000 leaked:
C:\projects\zig\aftersun\src\gfx\batcher.zig:40:42: 0x7ff6cdf36293 in init (Aftersun.exe.obj)
var indices = try allocator.alloc(u32, max_quads * 6);
^
C:\projects\zig\aftersun\src\aftersun.zig:147:41: 0x7ff6cdf3ab03 in init (Aftersun.exe.obj)
const batcher = try gfx.Batcher.init(allocator, gctx, settings.batcher_max_sprites);
^
C:\projects\zig\aftersun\src\aftersun.zig:846:21: 0x7ff6cdf4964b in main (Aftersun.exe.obj)
state = try init(allocator, window);
^
C:\Users\Jeff\bin\lib\std\start.zig:507:101: 0x7ff6cdf4de44 in main (Aftersun.exe.obj)
return @call(.always_inline, callMainWithArgs, .{ @as(usize, @intCast(c_argc)), @as([*][*:0]u8, @ptrCast(c_argv)), envp });
^
error(gpa): memory address 0x1e141770000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf575af in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf58042 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf582a6 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35ac1 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e141740000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5bd9f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf5c842 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf5caa6 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35ed1 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e14c510000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5a0cf in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf5ab62 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf5adc6 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35d31 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e14c520000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5af2f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf5b9d2 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf5bc36 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35e01 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error(gpa): memory address 0x1e14c500000 leaked:
C:\Users\Jeff\bin\lib\std\multi_array_list.zig:422:51: 0x7ff6cdf5926f in setCapacity (Aftersun.exe.obj)
const new_bytes = try gpa.alignedAlloc(
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:179:42: 0x7ff6cdf59d02 in reserve (Aftersun.exe.obj)
try self._storage.setCapacity(self._allocator, min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zpool\src\pool.zig:143:29: 0x7ff6cdf59f66 in initCapacity (Aftersun.exe.obj)
try self.reserve(min_capacity);
^
C:\projects\zig\aftersun\src\deps\zig-gamedev\zgpu\src\zgpu.zig:1373:43: 0x7ff6cdf35c61 in init (Aftersun.exe.obj)
const pool = Pool.initCapacity(allocator, capacity) catch unreachable;
^
error: FileNotFound
C:\Users\Jeff\bin\lib\std\os\windows.zig:132:39: 0x7ff6cdfb8c9a in OpenFile (Aftersun.exe.obj)
.OBJECT_PATH_NOT_FOUND => return error.FileNotFound,
^
C:\Users\Jeff\bin\lib\std\fs.zig:1241:23: 0x7ff6cdf60a69 in openFileW (Aftersun.exe.obj)
.handle = try w.OpenFile(sub_path_w, .{
^
C:\Users\Jeff\bin\lib\std\fs.zig:1120:13: 0x7ff6cdf379f6 in openFile (Aftersun.exe.obj)
return self.openFileW(path_w.span(), flags);
^
C:\projects\zig\aftersun\src\tools\fs.zig:5:18: 0x7ff6cdf374d6 in read (Aftersun.exe.obj)
const file = try std.fs.cwd().openFile(filename, .{});
^
C:\projects\zig\aftersun\src\gfx\atlas.zig:13:22: 0x7ff6cdf384e4 in initFromFile (Aftersun.exe.obj)
const read = try fs.read(allocator, file);
^
C:\projects\zig\aftersun\src\aftersun.zig:149:19: 0x7ff6cdf3ac1f in init (Aftersun.exe.obj)
const atlas = try gfx.Atlas.initFromFile(allocator, assets.aftersun_atlas.path);
^
C:\projects\zig\aftersun\src\aftersun.zig:846:13: 0x7ff6cdf49683 in main (Aftersun.exe.obj)
state = try init(allocator, window);
^
Thanks for the update!
When you cloned the project, did you clone with --recursive
? The assets folder is a submodule, and it looks like it's unable to find the atlas file. Please verify that the assets folder is present and has the files in it :) If not, run git submodule update --init
.
The assets folder also uses git LFS, I'm unsure if that's a requirement to clone the project correctly?
@foxnne, are the zig-gamedev libraries in src/deps updated to the latest? Some breaking zig changes were fixed as late as today.
@kamidev No, last update from zig-gamedev I pushed into this project was 5 days ago, however, I'm currently running the project just fine on the zig version mentioned above. I will update this project's dependencies and everything to latest soon, just was hoping to wait long enough for mach to catch up as my other project uses that and I didn't want to juggle versions.
But it looks like the issue here is FileNotFound
and the other errors are leaks reporting from gpa when the program crashed from not finding the atlas file.
I understand completely. Everything will probably be easier after the final zig 0.11 is released later this week.
Zig-gamedev builds and all tests pass using the latest zig as of today. And I know the Mach gang is working really hard to get on top of the latest zig, too. Perhaps the best thing to do is wait until this weekend?
That said, the reported issue with assets may be unrelated to zig version. I just tried building a fresh clone of aftersun recursively, with Git LFS installed. The build failed with errors in zig-gamedev libraries that were not updated - no surprise there. But fetching the assets worked just fine.
Thank you for the info! I'll let @jeffbdavenport confirm he has the assets folder, but hopefully its just a missing assets folder from not using --recursive
, I know I forget to use that all too often. As soon as I'm unblocked from updating zig I'll get both Pixi and Aftersun updated to latest, I just am still working on both projects and using Pixi to update artwork for Aftersun so it would be a pain to have them not in sync. Usually mach is pretty quick to update so I wouldn't be surprised if I get to update everything tonight.
Thank you! I am looking forward to play a little with both Aftersun and Pixi once things have settled down a bit. BTW - it's really cool to hear that you are using Pixi for Aftersun artwork.
@kamidev by the way, if you ever want to give Pixi a shot, Aftersun is a great example of the workflow. Just run Pixi and open the Aftersun/assets folder. You'll have access in src
to all the unpacked source art files. Then just navigate to the Packer tab and press Pack. You'll get a preview of the whole projects packed atlas, and can export it to the images asset folder.
If any of the packing changes the exported atlas data, there is a zig build option to "Process assets" which will update the generated zig code and get it all working in the game. It's a decently smooth workflow and I'd love to hear your opinion on Pixi's workflow and if anything would be better done another way :)
Thank you! I am looking forward to play a little with both Aftersun and Pixi once things have settled down a bit. BTW - it's really cool to hear that you are using Pixi for Aftersun artwork.
Thank you! I really started out building Pixi just to use for this project but I think it might end up being helpful for others so I'm trying to polish it as much as possible and use this project as a reference to make the workflow as easy as possible. Dealing with tons of sprites can be a real headache.
I tested it out, you were right, I just needed to clone the assets and everything works. This is well done so far! Personally I'm not a big fan of the camera movement, but everything else is great
Thanks! Glad it worked! I'm still trying to just get all the rendering pipelines right still. I do need to rework the camera movement.
I wanted to check this out, but doesn't run on windows 10.
I get closest with zig 0.11, when I build I get:
Declaration does not seem to have a field called is_pub, so if I comment out that line it builds, but when I run it I get a white screen for a millisecond and it crashes with this output:
How can I get it to run?