Closed stefanpartheym closed 1 year ago
Ok, after reading the Language changes in release v0.10.0 I was able to fix a couple of compilation errors, see commit 73d190f of my fork.
However, after running example "simple" I realized, there's still a lot of work to do. For me, it currently prints the following (obviously changed print format string to satisfy zig v0.10.0 compiler):
entity: 1, pos: (x = 10, y = 10), vel: (x = 15, y = 17)
---- resetting iter
I think the output should be something like this:
entity: 1, pos: Position{ .x = 1.0e+01, .y = 1.0e+01 }, vel: Velocity{ .x = 1.5e+01, .y = 1.7e+01 }
entity: 0, pos: Position{ .x = 0.0e+00, .y = 0.0e+00 }, vel: Velocity{ .x = 5.0e+00, .y = 7.0e+00 }
---- resetting iter
entity: 1, pos: Position{ .x = 2.5e+01, .y = 2.7e+01 }, vel: Velocity{ .x = 1.5e+01, .y = 1.7e+01 }
entity: 0, pos: Position{ .x = 5.0e+00, .y = 7.0e+00 }, vel: Velocity{ .x = 5.0e+00, .y = 7.0e+00 }
Hi! I haven't actually updated to v0.10 for many of my libs. There was quite a storm of changes with functions all needing to be * const
and a slew of other changes. I was holding out until perhaps zig fmt
could do some of the fixing and I also feared that there were still a lot more breaking changes coming (local functions are on their way amongst other things).
That being said, it sounds like you are pretty close. If you do want to send in a PR I'll for sure pull it in. Looking at your fork nothing specifically stands out. It seems you got the * const
for all the fn
s and the unused vars. I'll give it a read after work fully and see if something pops out.
Hey @prime31,
Hi! I haven't actually updated to v0.10 for many of my libs. There was quite a storm of changes with functions all needing to be * const and a slew of other changes. I was holding out until perhaps zig fmt could do some of the fixing and I also feared that there were still a lot more breaking changes coming (local functions are on their way amongst other things).
Yes you are right, there have been a ton of changes. The release notes for v0.10.0 are lengthy :sweat_smile:
That being said, it sounds like you are pretty close. If you do want to send in a PR I'll for sure pull it in. Looking at your fork nothing specifically stands out. It seems you got the * const for all the fns and the unused vars. I'll give it a read after work fully and see if something pops out.
To be honest, I don't think I'm that close yet. There is still a lot of stuff broken (like Iterators). Also there are one or two compilation errors, that cause building the tests to fail. Unfortunately, mit zig knowledge isn't really worth mentioning, so it could take some time to figure out what needs to be done :sweat_smile:
Best regards Stefan
Hey @prime31,
I managed to fix a couple of errors. Also the Iterator
implementation in MultiView
should work now.
All tests seem to run successfully. And at least the simple
example now shows expected output:
entity: 1, pos: (x = 10, y = 10), vel: (x = 15, y = 17)
entity: 0, pos: (x = 0, y = 0), vel: (x = 5, y = 7)
---- resetting iter
entity: 1, pos: (x = 25, y = 27), vel: (x = 15, y = 17)
entity: 0, pos: (x = 5, y = 7), vel: (x = 5, y = 7)
If you could review my latest commits, I'd be more than happy :)
EDIT: Latest fixes also work for zig compiler v0.10.1
. I think upgrading to zig compiler v0.11.0-dev
is only a matter of updating the build.zig
.
Best regards Stefan
Ok, I upgraded to zig v0.11.0-dev.1580+a5b34a61a
and fixed some compilation errors in this commit.
So it is now compatible with zig v0.11.0
.
Best regards Stefan
That all looks good to me!
Great! I'll create a PR for this ;)
Hey @prime31, thanks for the merge. This issue resolved now :)
First of all, thanks for the effort. I tried this library with zig
v0.9.1
and I got started very fast.However, one thing that would be nice is to use
zig-ecs
with the currentv0.11.0
version of the zig compiler. Currently, if I try to build a simple project (or the examples) using zigv0.11.0-dev.1571+c1f71963a
I receive a quite generic error:If I then try to execute the actual command line run by
zig build
:... the process segfaults.
I suspect, this is may be due to some very complex comptime syntax in
src/ecs/component_storage.zig
, which might be deprecated in current compiler versions: In line 186 of component_storage.zig there ispub usingnamespace if (is_empty_struct)
. Which, if I remove like follows, reveals a different error (but at least not a segfault):Using this patch will result in the following compilation error:
Finally, as reference, the
build.zig
andsrc/main.zig
files I used:build.zig:
src/main.zig
Thanks and best regards Stefan