#Foundations - Learning Graphics Programming with the Zig Programming language

1 messages · Page 2 of 1

queen hinge
#

too sharp

#

why would I want this KEKW

ivory verge
#

hehe

delicate delta
#

oh I see, well I can just add a .c file and include it

#

if it can be done with C it can be done in zig

queen hinge
#

gimme those nice, slightly blurry edges frogapprove

ivory verge
#

cheater 🙂

delicate delta
#

because zig ships with a C and C++ compiler

ivory verge
#

ill tell the zig police

delicate delta
#

that's how I am linking cimgui

#

you could actually compile your C++ projects with zig

#

:\

#

as long as you're not using gcc

#

idk people have trouble with the nonstandard gnu C stuff

#

I'm talking out of turn because I don't know anything about that

queen hinge
#

I WISH there was a language with syntax like java or C# that had support for embedded C/C++

shy cosmos
#

the two most useful features in all of C++'s history is only compatible with clang and gcc

ivory verge
#

gcc is my goto compiler : (

delicate delta
#

do you use gnu c extensions?

shy cosmos
#

yes

shy cosmos
#

thankfully clang on windows support those extensions too

delicate delta
#

oh then maybe it's not a problem

#

zig compiles with clang

#

I am speaking beyond my depth though I really never delve into this, anything C I've tried to compile with the zig compiler has just worked

queen hinge
delicate delta
#

you can literally write zero zig, and use the zig compiler

shy cosmos
#

based

queen hinge
#

half of that language looks nice half of it doesn't

#

from a glance at least

ivory verge
queen hinge
#

yea I was just on that page

ivory verge
#

ah 🙂

shy cosmos
#

I want rust without the borrow checker and with templates, what are my options

queen hinge
#

nim

ivory verge
#

the only big downside with this language is you need to use their custom IDE :C

shy cosmos
#

nim doesn't have templates (C++ style ones at least)

shy cosmos
#

nope

ivory verge
#

Odin receives alot of hate from GPers, for no reason

queen hinge
#

nim feels to me like if rust and python were merged together

ivory verge
#

LVSTRI, what about zig?

queen hinge
delicate delta
#

zig is not like rust

#

zig is like C

queen hinge
delicate delta
shy cosmos
queen hinge
#

x: int = 123
oh.

shy cosmos
#

alright that was a trick question I'll admit

delicate delta
#

but it's not OO

shy cosmos
ivory verge
queen hinge
#

I feel like at that point I'd go use go

shy cosmos
delicate delta
#

compile time snake?

#

what does that mean?

#

you can do a lot with comptime

shy cosmos
delicate delta
#

debugging a fully compile time game is gonna be not fun

shy cosmos
#

but I want to point out that unfortunately there are zero languages (with the exception of C++) that have actual fully fledged "templates"

shy cosmos
#

but that's the beauty of templates

#

you can express anything (and crash the compiler)

delicate delta
#

hrm I see

shy cosmos
#

it's really a double edged sword because if you implement a template system in your language

#

then making libraries is going to be a nightmare, due to the typesystem being utterly fucked

#

(just look at C++'s boost)

#

if you don't make templates then your type system is more elegant and simple, but it's inherently limited in expressibility

delicate delta
#

I'm totally fine with just a fully imperative, simple language like zig personally

queen hinge
#

me too, considering I'm used to java
I've got none of this comptime stuff

#

I mean I could make a gradle plugin but that's, not really comptime either

shy cosmos
#

one day I'll get over templates and use a sane language like everyone else

#

alas until then I shall keep suffering with sad ceepeepee

queen hinge
#

ah yes sane language
because being addicted to java is sane

shy cosmos
#

it's better than C++ addiction at the very least

delicate delta
#

the sane thing is to not program at all tbh

shy cosmos
#

trust me on that one kekkedsadge

delicate delta
queen hinge
#

Triangles, waaa

#

What if you make a tangent for a tangent

delicate delta
#

that's not how hermite works, as far as I understand it, you just have two tangents per pairs of points

#

when there's not a tangent there I use a zero vector

shy cosmos
#

I love splines

delicate delta
#

it's really cool, math is cool

ivory verge
#

hermione spline

delicate delta
#

math is kind of wizardry

delicate delta
#

I guess it's back to reading now

#

going to do a quaternion slerp thing at the end of this chapter, then it's just barreling down until I finally get to projections

queen hinge
#

Projections as in..?

delicate delta
#

as in projecting 3D to 2D

queen hinge
#

Wait

#

Idea for coordinate system

#

X up right, right handed

#

As in the coordinate system is rotated 45 degrees

delicate delta
#

I have an X up left handed coordinate system

#

I was going to do X positive points down, but I literally do the pointing thing all the time, and it's painful to do it X down

queen hinge
#

… wait

#

why isn’t my code upsidedown

#

Right, because vulkan is weird

delicate delta
#

nah vulkan is how glfw window works

queen hinge
#

(weird in a good way)

delicate delta
#

that picture is also incorrect, the origin is in the center

#

for gl

#

(-1, -1) is not P₀

queen hinge
#

that is true

#

it's also true of vulkan

delicate delta
#

RadDebugger has saved me so much time recently

#

any crash that I don't immediately know the cause I just immediately run my app in RadDebugger and replicate the crash, it's much better than the the cppvsdbg debugger in vs code imo

#

I kind of also like that it doesn't debug in the editor

#

I can debug in vs code now though if I wanted that

queen hinge
#

As a jetbrains enthusiast addict
I’m surprised you’re not using intellij idea

delicate delta
#

nah I don't like intellij, I used to

#

I think Jetbrains is not good at writing software

#

they have attempted three or four different strategies for achieving remote server editing, and they are all awful and do not work

#

they tried integrating rsync, which is awful because you need to keep a client side copy of the code

#

they've tried a projection of an editor running on a remote machine, like you know, like attempting to paint a 2D framebuffer as if it was intellij for an intellij running remotely

#

they've tried a remote jira agent, that thing doesn't work either

#

they've tried creating an entirely new editor, distinct from intellij, it's been in alpha for years now

#

vs code solved this problem like 8 years ago, with no issue

#

even TUI editors like neovim can do it

#

The IDE backend is the full-blown JetBrains IDE

#

mind boggling how bad they are at this

ivory verge
#

why do you need remote editing?

delicate delta
#

all my code is on a remote server at work

ivory verge
#

are you some php webdev person? 😛

delicate delta
#

I'm a fullstack go dev :P

ivory verge
#

i mean dont you usually edit locally, commit, push, and have some CI/CD deploy your shit somewhere

#

what about sshfs?

delicate delta
#

sshfs is not good, it's very bad

ivory verge
#

how come? (i have my media and storage connected via sshfs and occasionally develop c#/c++ stuff over it)

delicate delta
#

well, to get it to work on a mac you need a kernel extension for one

queen hinge
ivory verge
#

macos doesnt count

delicate delta
#

a buggy one that's badly supported and requires disabling security features in the OS

#

I am forced to use macos at work

ivory verge
#

shit

#

and if you boot into a linux vm?

#

and sshfs to your destination?

delicate delta
#

then I'm working in a slow VM with an even slower filesystem, so I can run a slow IDE, when I don't need any of those things with vs code remote editing

ivory verge
#

give it all the cores and memory 😛 and put storage on the fast nvme

#

i understand

#

thats a bummer

queen hinge
#

use the RAM as your disk and the disk as your RAM /s

delicate delta
#

I think jetbrains made really good tech once, and are now just coasting on that aging technology

#

and are unable to make it any better or do anything new with it

ivory verge
#

i only have 2 beefs with jetbrains

queen hinge
#

my main beef with jetbrains is the pricing plan

ivory verge
#

because you are still a kid without a job

queen hinge
#

<- actively plans to not get a job as a developer

ivory verge
#

: D

delicate delta
#

I respect that

ivory verge
#

pricing is actually quite reasonable

queen hinge
#

I would die on burnout if I had to write code for a job

ivory verge
#

not much more than your netflix subscription

queen hinge
#

<- has no subscriptions KEKW

ivory verge
#

heh

#

in rider attaching the debugger takes "long" (too long for my taste, although its just something like 3 or 4s) when you hit f5 to start debugging

#

and when you want to make files to be copied to output there is a little dialog to set the specifics... that dialog doesnt remember the size from previous times and you have to enlarge it a little bit to get to that one option i need

#

those 2 things annoy me, for now

delicate delta
#

3 or 4 seconds is a really long time

queen hinge
#

this dialog?

ivory verge
#

yep 🙂

#

no

queen hinge
#

I didn't even know that dialog could be resized

ivory verge
#

this one

#

and here you can see the dropdiown underneath "None" is the one i want 😄

queen hinge
#

don't think I've ever seen that one

ivory verge
queen hinge
#

how do you open that

#

or is that exclusive to rider or what

ivory verge
#

rightclick onto a file -> properties

#

yep thats rider

queen hinge
#

does not exist for IDEA

ivory verge
#

yeah

#

its a c# build system thing

#

to embedd files as resources or to copy them to the out dir or whatever

delicate delta
#

do your C# engine run in mono on linux?

queen hinge
#

probably

ivory verge
#

no

#

its all dotnet

#

and yes, lunix and windows

#

mac would work too if i targeted a supported opengl version 😛

queen hinge
#

just port directx drivers to linux and mac and use that

#

very simple solution

ivory verge
#

nah thats stupid

#

you can just run dx9/dx10 and most dx11 stuff natively, on wine

#

or apples stolen counterpart

queen hinge
#

d3d12, specifically

ivory verge
#

some d3d12 probably works too on dxvk

delicate delta
#

yeah with crossover

ivory verge
#

ah was that the wine-fork name?

delicate delta
#

yeah looks like it is a wine fork

ivory verge
#

yeah, name rings a bell now

delicate delta
#

looks like they help with proton too

ivory verge
#

yeah

#

im glad i am not on a mac 😛

delicate delta
#

I legit asked for a linux laptop last week and was told no :/

#

it's ok, it's a job

ivory verge
#

fair

queen hinge
#

I kinda wanna get a mac at some point so I can test my code on one KEKW

delicate delta
#

mac mini is the cheapest way to do that

queen hinge
#

does it have apples proprietary gpu

delicate delta
#

yes

#

it's a mac

#

it's just a little box, you have to attach all your stuff to it

ivory verge
#

if you do opengl, its really really not worth it, if you do native metal, or webgpu, then yes, good idea

queen hinge
#

vulkan

#

and some funky glsl stuff

queen hinge
#

expensive for a mini

#

I think
I have no frame of reference KEKW

ivory verge
#

vulkan doesnt run natively either

queen hinge
#

I also do have some native code

#

which, I don't explicitly need
but I'd like to have it

ivory verge
#

: )

queen hinge
#

I am also considering doing proprietary api impls

delicate delta
#

The chapters in these books usually take me 1 or 2 days, the interpolation chapter took me two weeks. Honestly it was mostly something I'm going to have to reference if I want to do half the things it discusses, finding arc lengths, constant rate of movement along a curve, sampling points, maintaining camera orientation along curves, etc

#

Glad it's done. I'll implement some lerp/slerp methods in my math, animate my cubes finally and then move on

delicate delta
#

It's probably months before I get to projections

#

ridiculous to think you can just follow LOGL, copy and paste the code, install renderdoc and think you can do graphics programming tbfh

ivory verge
#

you wrote a mc clone already

delicate delta
#

You know I didn’t even know about renderdoc for the longest time while writing blockens, I wrote my own cli vao debugger

#

I printed my vao description and then wrote out the bits in the buffer in a way I could see what they were per vertex

#

I spent a long time looking at bits in my terminal

#

idk I was really ignorant

#

Still am

#

Also the only matrix multiplication I had in blockens was the final model view projection transformation in the shader

#

It was all vectors everywhere

#

You can get away with a lot of dumb code when everything in your game is perfectly parallel and perpendicular to a coordinate axis tbfh

#

I actually had to do a months long rewrite to get my character and third person camera working

#

It was when I had to use matrix math elsewhere, to do culling when I realized how much trouble I was in because I didn’t understand basic stuff

#

Blockens uses fill lighting, I send a per vertex light value

queen hinge
#

I learned graphics programming through modding MC for like 2-4 years

#

Rarely used learning resources except for when I wasn’t working in MC

delicate delta
#

I am just coming to terms with unrealistic expectations, ignore me

ivory verge
#

theres no raisin to ignore you

queen hinge
#

Error: unable to ignore

delicate delta
wild ember
#

He's mastered the slerp

delicate delta
#
pub fn slerp(p: rotation.Quat, q: rotation.Quat, u: f32) rotation.Quat {
    const pn = vector.normalize(p);
    const qn = vector.normalize(q);

    const angle: f32 = std.math.acos(vector.dotProduct(pn, qn));
    const denominator: f32 = @sin(angle);

    const pt: f32 = (1.0 - u) * angle;
    const spt: f32 = @sin(pt);
    const sptp: rotation.Quat = vector.mul(spt, pn);

    const sqt: f32 = @sin(u * angle);
    const sqtq: rotation.Quat = vector.mul(sqt, qn);

    const numerator: rotation.Quat = vector.add(sptp, sqtq);

    return vector.normalize(vector.mul(1.0 / denominator, numerator));
}

https://github.com/btipling/foundations/blob/main/src/foundations/math/interpolation.zig#L59C1-L76C2

#

I should check for @cos(angle) near 1 and lerp

#

and negate p if p is negative

delicate delta
#

if cosine is negative actually

#

that changed the animation I had

#

that's much better now

#

it was taking the long way around before I checked for a negative cosine

#

my slerp is now:

pub fn slerp(p: rotation.Quat, q: rotation.Quat, u: f32) rotation.Quat {
    var pn = vector.normalize(p);
    const qn = vector.normalize(q);

    const angle: f32 = std.math.acos(vector.dotProduct(pn, qn));
    const cs = @cos(angle);
    if (float.equal(cs, 1.0, 0.001)) return lerp(pn, qn, u);
    if (cs <= 0) pn = vector.normalize(vector.negate(pn));
    const denominator: f32 = @sin(angle);

    const pt: f32 = (1.0 - u) * angle;
    const spt: f32 = @sin(pt);
    const sptp: rotation.Quat = vector.mul(spt, pn);

    const sqt: f32 = @sin(u * angle);
    const sqtq: rotation.Quat = vector.mul(sqt, qn);

    const numerator: rotation.Quat = vector.add(sptp, sqtq);

    return vector.normalize(vector.mul(1.0 / denominator, numerator));
}
#

this line right here did the thing if (cs <= 0) pn = vector.normalize(vector.negate(pn));

wild ember
#

I don't think you need const cs = @cos(angle);

#

you should already have the cosine of that angle as the result of the dot product

#
    inline quat slerp(quat x, quat y, float a)
    {
        quat z = y;

        float cos_theta = dot(x, y);

        if (cos_theta < 0.0f)
        {
            z = -z;
            cos_theta = -cos_theta;
        }

        if (cos_theta > 1.0f - std::numeric_limits<float>::epsilon())
        {
            return mix(x, y, a).normalized();
        }
        else
        {
            const float angle = acos(cos_theta);
            return (sin((1.0f - a) * angle) * x + sin(a * angle) * z) / sin(angle);
        }
    }```
#

heres mine

#

also whats the deal with @ in zig?

delicate delta
#

the @ means it's a built in function, it's not something in the standard library, it means it's doing something very specific based on the target at compile time, like @memcpy trig functions are all built ins

#

the language reference says:

Builtin functions are provided by the compiler and are prefixed with @. The comptime keyword on a parameter means that the parameter must be known at compile time.

#

you're right about the dot product, those vectors are normalized so it is just the cosine of the angle

#

thank you

#

do you normalize your quaternions prior to slerp?

#

I probably don't need to normalize after my negation either

#

I think I should assume the quats are normalized prior to slerp tbh, because they are key frames and I can normalize them when defining them, and not per slerp call

#

I'm going to clean this function up

wild ember
delicate delta
#

that is correct thing to do I think, normalizing per slerp is not good

#

appreciate you sharing your code!

wild ember
#

you should normalize after the lerp though

delicate delta
#

yep

#

the lerp function normalizes in my code

wild ember
#

ooh

#

thats kinda wierd

delicate delta
#

why

#

my quats are for orientation only

wild ember
#

because you might wanna lerp between vectors that arent normalized

delicate delta
#

hrm

#

so lerp for non quaternions

wild ember
#

eg lerp(point0, point1, 0.5) gives you a point halfway

delicate delta
#

those are points

#

I have linear interpolation for points that's defined seperately

wild ember
#

oh ok

delicate delta
#

it's the same equation actually

#

it just doesn't normalize lol

#

let me look

wild ember
#

Also I don't use the code I posted for animation, its not neccessary to be that accurate usually

#

I use this

#
    inline quat slerp_approx(quat x, quat y, float a) 
    {
        float ca = dot(x, y);

        float d = fabsf(ca);
        float A = 1.0904f + d * (-3.2452f + d * (3.55645f - d * 1.43519f));
        float B = 0.848013f + d * (-1.06021f + d * 0.215638f);
        float k = A * (a - 0.5f) * (a - 0.5f) + B;
        float ot = a + a * (a - 0.5f) * (a - 1) * k;

        return (x * (1.0f - ot) + y * (ca > 0.0f ? ot : -ot)).normalized();
    }```
delicate delta
#

oh ok

wild ember
#

no trig

delicate delta
#

so my linear interpolation is always a piecewise interpolation, but it's doing the same math otherwise

#

oh interesting

#

yeah I saw a no-trig solution in one of my books

wild ember
#

the full slerp is resevered for aiming and camera math

delicate delta
#

my book was saying that under 90 deg lerp is fine, and if you want to blend animation you kind of always have to use lerp

#

because slerp is order dependent

#

thank you

#

and you inline your slerp too hrm

#

I inline most of my math functions, I didn't in this case

#

not for any specific reason, makes sense to, I guess if you wanted to build something for web and didn't want a big binary

#

which is not something I want to do

wild ember
#

inline in c++ doesn't neccesarly mean the function will be inlined

delicate delta
#

ah what does it mean?

#

that's what it means in zig I think

#

Adding the inline keyword to a function definition makes that function become semantically inlined at the callsite. This is not a hint to be possibly observed by optimization passes, but has implications on the types and values involved in the function call.
hrm

#

that's zig

#

I think that means a small release will still inline it

#

in zig anyway

wild ember
#

Basically inline in C++ just means you can put the code in a header file lol

delicate delta
#

oh

#

zig doesn't have header files

wild ember
#

it used to be a hint, but afaik it does basically nothing on modern compilers

delicate delta
#

inline is really a comptime thing in zig

wild ember
#

I'm actually gonna replace it with constexpr once I replace the fabs call

delicate delta
#

comptime is zig's version of macros

wild ember
#

yeah in C++ we have constexpr

mighty vessel
#

Zig on GP. I approve 👌

delicate delta
#

I'm not the only one lol froge

#

we get one or two more ziguana and maybe we can get a zig emoji, jk

ivory verge
delicate delta
#

right right

#

that's when we know zig has made it, once there's strong opposition

ivory verge
#

#1027528776717975592 is open 25/8

delicate delta
#

I'm just kidding I have a lot of zig emoji at my disposal already, more than enough, but I am looking forward to more active people here who also write zig

ivory verge
#

which one would you like to add the most?

delicate delta
#

zig probably as that's the official logo

#

I don't know if there's critical mass to warrant it though

#

maybe it's just bias on my part but it seems like most people on the zig server are doing something graphics related if they're not part of the core compiler team

#

it's just like every time I go into someone's bio and github or they talk about something in #zig the non game dev channel they're doing something related to game development and GPUs

#

so I think if zig keeps growing it will be big in this space, but we'll see

ivory verge
delicate delta
#

woah cool! :D

#

thanks zig

ivory verge
delicate delta
#

lol, I saw that movie when it came out and forgot about it

#

2000 hrm

ivory verge
#

yeah its quite old and didnt age well 😄

#

"dude where is my car"

delicate delta
#

I can't remember anything about the movie tbh

#

2000 was a strange year for me anyway

#

I had just finished my tour in the USMC and was starting community college, so big adjustment

ivory verge
#

theres nothing rememberable of that movie besides Zig 😛

#

24 years ago already, again

delicate delta
#

I think zig is named after that all your base meme

#

take every zig

glossy forge
#

i heard about zig in december because my CS teacher in uni told me about it, and it's been my goto since, even if i did some C/C++ I used it for the build system

delicate delta
granite bolt
glossy forge
granite bolt
#

Lmfao

glossy forge
delicate delta
glossy forge
#

sure, i'll make sure to post here

delicate delta
#

just doing math things as they come up in the books, like 4 more chapters to go before I get to any 3D perspective stuff ...

delicate delta
#

I guess I'll have to improve that hover after I have perspective

#

you may have noticed my square window, it's that way for a reason lol

delicate delta
#

I have this for a sphere but like all my plane math it's pointless to do anything with it that's interesting until I have perspective

#

I could make a cool 2d game

#

I don't want to make a 2d game but I could

#

actually I can't, because I don't even have orthographic yet, I just have a fucking square

#

#

also made these take a center and radius for arbitrary boundary detection

delicate delta
#

reading about AABB is making me facepalm when thinking about how I did collisions in blockens

delicate delta
#

you know I should fix my drag and drop from the lines scene to use this code now, because that was hacky and this is the right way to do it

glossy forge
#

looks great

delicate delta
#

Thanks! Just some math stuff I am doing right now

delicate delta
ivory verge
#

thats neat

delicate delta
#

Thanks, just some triangle math stuff I guess, 3 more chapters until perspective

ivory verge
#

its a cool visualization

delicate delta
#

Thanks, it’s also converting 3D cartesian coordinates from the mouse position to barycentric coordinates in the plane of the triangle

#

That’s being shown in the little info box

#

It’s a 2D visualization but the math is 3D

delicate delta
#

The stack is growing lol

#

that's a lot of 3D for no 3D so far

ivory verge
delicate delta
#

Looks like @timber berry has also been spamming this server with their zig unfortunately they are not working on a game engine rip

timber berry
#

trying to find what I said in here
search is being useless

delicate delta
#

not in here

#

but in #software-rasterization

timber berry
#

you just pointing me to how to do graphics in Zig?

delicate delta
#

no you just replied to me on the zig game dev channel

#

then I saw you were also on this server

#

@timber berry I'm just glad there are other people here representing zig :D

#

maybe that didn't come across in my message lol

#

sorry

#

you started it though, by replying to a months old message :P

timber berry
#

oh ok. Whenever I try to do game dev I get bored.

delicate delta
#

no worries, good luck on your browser project

queen hinge
#

lol

delicate delta
#

I'm real good at making new friends

ivory verge
#

i kind of dont like deinit

#

i would prefer destroy

#

or dispose

#

i keep seeing it as defer foo.deinit in all those weird zig projects on ze zig zerver

delicate delta
#

you can call it whatever you want

ivory verge
#

yeah i thought so, and thats "bad" too

#

bad is a too strong word here

#

all the kids tho make zig packages name stuff like they want and you get the spaghetti monster 🙂

delicate delta
#

well let me explain why it's called deinit

ivory verge
delicate delta
#

in zig you want to do more than just free memory

#

you also at the very least want to assign undefined to any pointer props

ivory verge
#

you want to do a FreeAndNil kind of thing?

delicate delta
#

yeah

#

you want to use undefined though

#

because in safe releases and in debug mode

ivory verge
#

yeah FreeAndNil is pascal's counterpart

delicate delta
#

if you try to reference the thing it will panic

#

and there's probably more you will do in other deinit methods

#

so it's not just freeing memory

#

if it is just freeing memory you don't need a deinit at all

#

you can just destroy the thing directly from whatever calling code

#

that would call the deinit

ivory verge
#

thats stuff you would do in a dtor (or free floating Free/Delete/DestroyXXX function) too, free unmanaged resources and reset fields or set them to some undefined state

delicate delta
#

yeah the init deinit are basically constructors and destructors, but the thing about zig is if you don't have any extra work do do, if all you do in your init and deinit is things you clould just do directly, then do them directly there's no need for these pass through functions

ivory verge
#

i see

delicate delta
#

like if you are passing in all the args for the struct as part of the init parameters there's not much you're gaining there

ivory verge
#

but you are saying i can call that function whatever i want if there is a need for such a function

delicate delta
#

there's no lint for it

ivory verge
#

i am just saying that this name should be standardized somehow, so that when i read code, i know immediately..... hmm i understand

delicate delta
#

there may be a proposal for that

ivory verge
#

yeah actually need to take a serious peek still 🙂

delicate delta
ivory verge
#

oi

delicate delta
#

not exactly

#

but it's obvious deinit is a convention

#

it's just not enforced by the compiler

#

you can call it whatever you want, but you probably shouldn't

ivory verge
#

its a little sad that every language has to reinvent naming for those things

delicate delta
ivory verge
#

when it worked for other languages before 🙂

delicate delta
#

These coding conventions are not enforced by the compiler, but they are shipped in this documentation along with the compiler in order to provide a point of reference

#

seems intentional to not enforce by the compiler

#

the reason why

#

Zig will not enforce identifier naming conventions according to any style. The "style guide" will always be merely offered as a point of commonality for different groups to standardize on, but will not be any kind of rules or enforcement from the language or tooling.

ivory verge
#

hmm

#

i see

#

zorg people will still come up with a naming scheme of sorts over time and then eventually turns into some unspoken rules

delicate delta
#

yes I think so

#

I came into zig bringing in my own baggage and over time have just slowly adapted to the convention and the style guide

#

and then I find myself wanting to use that style in Go at work, because it's not bad tbh

#

but gofmt then breaks the build :(

ivory verge
#

hehe

delicate delta
#

I bought more vulkan books I think I'm team Khronos (GL/Vk) for the long haul

ivory verge
#

🖖

queen hinge
#

Java has a standardized naming convention
But you’re not forced to use it
The IDE you choose may or may not assume you do use it though

delicate delta
#

Yep, zig is still going through lots of changes still also

granite bolt
queen hinge
#

How many GP books do you have? KEKW

delicate delta
#

I know :( I have a problem

#

but I am actually reading them

#

I actually have a lot

#

I have 8 physical books and 2 more on the way and then I also have about 6 in digital form but not physical form

#

game math is the only one of the digital ones I'm currently reading

#

I actually don't like the red and blue opengl books, they're not very good

#

well they'll be useful in the future now that I understand things better, but for a beginner they weren't good

mighty vessel
#

@delicate delta remember to not fall into book-tutorial-knowledge-study purgatory ✍️

delicate delta
#

yes I have goals!

#

the books are the means to the end they are not the end

#

thank you

#

the goal being like, an actual game 😅

delicate delta
#

I'm building a visualization that determines the distance between a point and a line, and I haven't finished yet, but I'm using Plücker coordinates, and I'm using them to extend the line in a way that visually makes them infinite and so I'm picking an extra point to extend my line and I picked just a third point just to see how it worked, and it's kind of interesting

#

it's like a trombone or something lol

#

it works by finding the point on the line closest to the origin and then I pass in a float and it picks a point some value in the direction of the Plücker coordinate direction

delicate delta
#

the drag behavior lags a little

ivory verge
#

Trombone and Guitarstring Simulator 2024

#

Visualizing these things is pretty cool

#

Perhaps those things come in handy for debug views of sorts later down the road

delicate delta
#

bam

delicate delta
#

it's like 2:28 am and I have to read about wedge products tomorrow I better get to bed

delicate delta
#

kind of cool, I put my point directly on the origin and now the line is always connected to the point on the line the Plücker coordinate math says is the closest point on the line to the origin

#

math works

ivory verge
#

this is really cool

#

3blue1brown-esque

delicate delta
#

that's a cool youtube channel thanks

ivory verge
#

: )

delicate delta
#

grassman algebra seems to add a lot of complexity to graphics programming and offer few benefits, the most touted being that is makes the cross product, determinant math and quaternion rotations seem hacky versions of more elegant math, but I can't imagine trying to explain someone something on this server the context of antiwedge bivectors

#

I can't even easily write notes on it because of all the new symbols it adds

#

looking at volume 2 of FGED, there's one problem in the entire book that references the wedge product, and there are no references to bi or trivectors or antiwedges or any of the stuff, so doesn't seem really worthwhile to uh spend a lot of time on this, but it sounds like he's going to use more of this math in his volume 3 physics book

#

having finally read though this math I think I'm in alignment with what @verbal mason had said about it too

verbal mason
delicate delta
#

what sorts of applications?

#

looking at his code his implementations seem very similar to other linear algebra code

#

it looks like linear combinations and cross product operations

delicate delta
#

idk, I'm gonna move on for now

#

if this helps me solve something later I can come back to it

delicate delta
#

holy shit I'm 20 pages away from perspective math, I think I'll be 3D by the end of next weekend

#

06/07/2024 is when I created this thread, end of next weekend will be 08/04/2024, two months of non-stop math reading

#

I did the math, it is 972 pages

delicate delta
#

I think based on my current progress I will probably be done with this project and all the books I have bought probably end of year or early next year. I think I can commit to starting a new game March 1st 2025

#

I will time box this effort to March 1 2025

#

Assuming life allows for it

verbal mason
#

I set a deadline of January 2025 to finish my engine. Not sleeping for 6 months is on the table.

delicate delta
#

Your engine is already very impressive

verbal mason
#

Thanks. You gotta be in it to win it.

delicate delta
#

Yes

ivory verge
#

what happened to the 2 games you wanted to finish in march 2024? 🙂

timber berry
#

I'd like to have new and free but Zig would think that's hidden memory allocations or something stupid

ivory verge
#

hehe

#

Turbo Pascal had Init; and Done;

#

Delphi Create; and Destroy;

#

i guess either works and every language wants to be a bit different so all good

delicate delta
#

Delphi sounds cool

#

I like the full UI experience of the visual development environment you were sharing in a screenshot, reminds me of visual basic

ivory verge
#

i think that was Lazarus (Free Pascal's IDE)

#

which is inspired of Delphi 4

delicate delta
#

it's just mostly nostalgia, the box set with the visual editor and a cd rom and some books, I'm not sure I actually want it now I don't like use intellij or visual studio

ivory verge
#

Delphi 8 turned into Visual Studio clone

#

yeah i miss those times too 🙂

#

you can whip up fully fledged master detail database programs within a few clicks, including databinding, database connections and whatnot

delicate delta
#

I just see that and want to build something cool though

ivory verge
#

hehe

delicate delta
#

I look at visual studio and I want to close it

ivory verge
#

xD

#

I abandoned Delphi for good in 2010

#

the company behind it just didnt give a fuck about fixing bugs, for years

delicate delta
#

aw that sucks

ivory verge
#

it went downhill when they sold all the borland stuff to codegear and later to embarcadero

#

Borland, the Sun Microsystems of Programming Languages

#

i still remember compiling GLScene (had 330k loc at that time) in 2s from 0 to written binary on disk on an athlon xp2200

#

ah thats GLScene in Lazarus

#

i made the orange icons : ) and they keep using it

#

ok i stop hehe

delicate delta
ivory verge
#

this is just shit i found on google images

delicate delta
#

oh

ivory verge
#

but i did a bit of stuff, but i dont have any records of it anymore : (

#

that was 1998-2007ish or so

delicate delta
#

I don't have any of my pre-github stuff anymore either

#

but ever since github it's like permanent

ivory verge
#

i do have some silly "car driving in a city" thing lying somewhere

#

which still runs on todays windows

#

not sure where it sits though

delicate delta
#

it's basically a d3.js globe and I made a game with it

#

prior to that I made my own IRC client, I had a color picker website that got popular on digg, I had a browser game, I made an iphone app, I had mac app, I had a bunch of python stuff I did, I built an Adobe Flex app, a PHP based blog, all gone now, it was probably all terrible code though so good riddance

ivory verge
#

php 🙂

#

i touched that last time when the file extension was called .php3

delicate delta
#

I was writing PHP in 2020 at imgur :P

#

the imgur secret santa website was php

ivory verge
#

: )

#

i wont tell anyone

delicate delta
#

it wasn't bad tbh

#

php has like a package manager now and is more strongly typed and such

ivory verge
#

so i heard

verbal mason
#

I managed to find the first game I made from 1998. Can't get it compiled, sadly, need to spin up an old VM. But here is one of the backgrounds (cyberpunk RPG).

#

On a floppy disk in my mom's garage. Uses some ancient version of Java and a web applet, no way to play it today.

#

Almost all my old stuff is gone. Saved a couple of my better Flash games, but the emulators can't really play them.

delicate delta
#

java web applet wow

#

that's like some 1990's tech

#

all I remember about java web applets were was water reflections on websites

#

and the java download tool itself was a java webapplet iirc

verbal mason
#

lol ya

delicate delta
#

Lol I just opened this vulkan book I bought found a familiar name as the reviewer @wise imp

delicate delta
#

I have completed all the chapters that preceded perspective math finally. Each next chapter in my math books is perspective, basically out of the kiddie pool now yay

wise imp
#

its a great book that one. im checking a few of them right now to implement them in my engine

delicate delta
#

c.glClipControl(c.GL_LOWER_LEFT, c.GL_ZERO_TO_ONE);

#

doing that this time around

granite bolt
#

We are in 3d now, frogapprove

wise imp
#

the fancypants volumetrics ive implemented on my project ive gotten from the book

#

that book really shines if you are actually implementing a real engine

#

having code + detailed explanations of how it works is super handy for complicated effects like this

delicate delta
#

And build an engine

delicate delta
#

starting to think about the next game I want to build

#

couple ideas, a cooking game with a mystery story, a construction vehicles simulator game, or a small space station repair tech simulator, not voxel, but like a tiny space station that is a sum of parts that can be fully disassembled, really want an achievable small scope, 3D, single player. Kind of leaning into the small space station repair one since it's probably the smallest in scope in terms of art needed

#

I'm going to keep thinking about it and write down ideas as I work though the books and keep making progress

delicate delta
#

I kind of like the construction simulator too, I think I can make that scope small

#

kind of like command and conquer RTS but just the construction part

#

I love both ideas tbh

#

the space station one has a subnautica feel the more I think about it

ivory verge
#

oh

#

there is one category missing

#

the best one

delicate delta
#

which one

ivory verge
#

these mfs

#

oh

#

uploading pics doesnt work?

delicate delta
#

wow what's that

ivory verge
#

auto cranes

#

Liebherr LTM 1500

#

German ofc 😛

delicate delta
#

look at all those wheels

#

amazing vehicle

ivory verge
#

there are smoller variants as well

#

and whenever i see one on the road and i happen to walk by, i stop and look at it like a little boy

#

i used to build those massive ones out of legos when i was 13, 14, 15 or so 🙂

#

double steering in the front and back and neatly tucked away thingies you put out to stabilize the crane when it gets deployed

wise imp
#

a friend of mine bought a 400 euro chinesium lego set of that specific crane in the pic

#

absolute monstruosity

ivory verge
#

yeah

#

(thats just a MOC)

wise imp
#

might actually be that model

#

the chinese grab stuff from moc to sell in boxes

ivory verge
#

yeah

#

and their "lego" material is also better than original lego these days

#

man i love cranes 🙂

#

or otherwise complex machinery on the roads, like those pump wagons which come for cleaning the sewage

#

all sorts of levers and switches and pipes and hoses attached to those big tanks, quite cool to watch them in action

delicate delta
#

I could look at these all day tbh

#

I was actually inspired by my childhood memories of Playmobil, but Legos too

#

I love fire engines too

#

sometimes the city brings them to the park for kids to climb on

#

I don't climb on them but I do admire them

#

I don't have the living space to do any legos

#

maybe that's why I love minecraft and voxel games so much

#

the name foundations actually might make sense for this game :P

#

maybe I just transition it to a game

wise imp
#

Foundations as title for a architectural game is a perfect fit

delicate delta
#

right?

ivory verge
#

People i know who played with Playmobil instead of Legos were always a little weird 🙂

wise imp
#

also remember that getting "legit" chinese not-legos is morally right

#

their fault for cheaping out

delicate delta
#

Playmobil was big in germany for kids back in the 80s, I had legos too

#

the thing about Playmobil is that it's the kind of toy kids love but as you get older they lose their appeal whereas Legos are always fun

#

but they were really exciting as a kid

ivory verge
#

I will allow it

#

as long as legos were involved, but if you were a playmobil kid only, id end the friendship right now lol

verbal mason
delicate delta
#

I had a legos moon base, that was the fanciest toy I had besides my playmobil pirate ship, most of my toys were preowned

#

excited about a construction game I'm going to keep thinking about it, it involves world changes

#

I want to avoid voxel engine stuff tbh

#

maybe it's just a regular mesh tree

#

for a construction area

verbal mason
#

In my neighborhood growing up there was a bootleg toy store, think the guy was Chinese, and had imported stuff like the Japanese Voltron and stuff like that, probably why I'm a huge anime nerd

delicate delta
#

so now that I have a projection I'm going to do all the plane math I've gone over and couldn't do visualizations with and I'm going to extract the projection planes and demonstrate culling that way, which is the thing that led me to abandon blockens because I couldn't understand how to get that working

#

then I'll go back to reading more

wild ember
#

Losing my fucking mind at the pluralization of lego here

ivory verge
#

legos my frog

#

bjorn probably wanted to say Lego's moon base 😛

delicate delta
#

sorry

ivory verge
#

dont be 🙂

wild ember
#

Im just being a pedant

delicate delta
#

It is, however, wrong to say “LEGOs”, if you are referring to the brand/company.

#

I was incorrect

#

it was a fun moon base

wild ember
#

Yeh I love lego

delicate delta
#

I think it was that

ivory verge
#

man i remember that

#

it was still before my time, but i remember seeing it in catalogs

delicate delta
#

the most memorable christmas gift of my childhood

#

I was like 6

ivory verge
#

my first legos frogpolice i got 1987 when i was 4, 2 Lego TECHNIC things, a forklift and a little buggy with 2 of those lego technic people

ivory verge
verbal mason
delicate delta
#

most of my toys were used, this one was one of the ones that wasn't

verbal mason
ivory verge
#

i had that space stuff from the 90s, that black red destroyer ship and a lot of the white/neongreen ground stuff

delicate delta
ivory verge
delicate delta
#

clear legos blew my mind

ivory verge
#

fuck me, i forgot about the space rail shit

#

that was also peak 80s

#

i want that kind of lego back 😦

#

i dont need marvel themed shit

verbal mason
ivory verge
#

or lego city where you have only 1 piece of something which used to be 10 pieces

delicate delta
#

I don't mind the harry potter legos

ivory verge
#

yeah, the star wars stuff is neat too

delicate delta
#

lego

#

sorry

#

:P

ivory verge
#

hehe

#

this shit with actual doors and you could put people IN the cockpit

#

was cool, i think i even had this one too, and the bigger ambulance with lights and a sirene thingy

delicate delta
#

working on a config file so I can set view options, so I don't have to look at a square anymore, creating my own file format :O

#

because I want zero zig dependencies and don't want to add a c dependency build for a config file that I'm storing basic stuff in

#

I don't like hard coded view options

delicate delta
#

heh I didn't know my video was recording sound

#

that's unfortunate

#

anyway

#

that was a lot of work to write a config file parser and make it work, I didn't add the ui settings and I have to fix all my visualizations now to work with perspective

#

it is saving settings now though to a file and loading them

#

just no UI to set it, have to open the file

verbal mason
delicate delta
#

I'll use an orthographic projection for all my 2D visualizations and I guess I will have to application side transform the drag handle positions so they'll match what's on the screen

#

with that same projection

#

that sphere looks garbage in 3D because I wrote it to use the colors from 2D positions

#

and the wireframe doesn't look great either anymore, lost all that beautiful symmetry due to perspective

delicate delta
#

I've been migrating my 2D visualizations that just had a hard depedency on a square window to orthographic projections, it's been kind of fun. The projection is easy, it was figuring out the hover and drag interaction that was a fun problem to solve. I basically had to do some transforms aligning window coordinates and the orthographic projected coordinates of my vertices

#

just messing around with the orthopgraphic projections is kind of fun, I actually hadn't used them before

#

nearly done with this, I have a lot of scenes I've written that I have to migrate each manually, I'm going to work on display setting UI and then start working on a new scene that is just a demonstration of how look ats are just the inverse camera matrix, then I'll do all the plane stuff before going back to reading

#

unfortunately my job isnt going to well right now so have to work through this weekend though :<

ivory verge
#

"Since the downfall of zig..."

#

that made me laugh out loud

delicate delta
#

RIP Zig :(

#

let me find the video where they spoke about zig

ivory verge
#

yeah i know that one too 🙂

#

tsoding is a cool frog, also funny

delicate delta
#

oh they are on this server?

ivory verge
#

they have been iirc

#

but i like his videos, is what i meant

delicate delta
#

seems like reasonable opinions

#

idk

#

yeah I like these videos

#

neat

#

good videos ya

ivory verge
#

: D

#

i think he mostly jokes around and is actually very reasonable

delicate delta
#

yeah I was disappointed was trying to find a good zig trolling, but he's just making good videos

ivory verge
#

heh

delicate delta
#

c3 looks cool

ivory verge
#

i also like when he says shit in German

#

it do be

delicate delta
#

too bad for them that zig already won though :(

#

actually

#

what I like about c3 is better macro support

#

c3 probably works seamlessly with flecs

#

also c3 has header files

#

Volatile and const have no representation in C3.
that seems bad

#

yeah also cool

#

if I wasn't writing zig I probably would be just writing C++

#

idk why I like zig, I just do, but I would go to C++ if I ever got tired of it

ivory verge
#

i have not tried c3 yet

delicate delta
#

yeah idk zig is working for me, I have spent a lot of time becoming more and more competent in it

#

c3 seems cool though

ivory verge
#

i dont mean to convince you to drop zig btw 🙂

delicate delta
#

I know

#

:P

#

it just looks like a cool language

#

c3

ivory verge
#

heh

#

it looks like it has a more tame syntax too

delicate delta
#

I actually want to build a game at some point I can't be language hopping

ivory verge
#

haha

delicate delta
#

yeah, and the macros are nice in c3 too

#

translate-c stuff in zig works ok but sometimes it doesn't

#

this tscoding video is hilarious

#

I just have it on in the background

#

ok I finished migration my visualizations, it's "ok"

#

idk

ivory verge
#

he also does some cool beatboksing in between hehe

delicate delta
#

the splines are so much nicer in a big window

#

the hover targeting isn't precise on that one

#

anyway, it's all migrated

delicate delta
delicate delta
#

BTW

#

like BTW

#

I made those grid lines there 3D

#

because in that screenshot they are 2D and I had to rotate them and they would only look right from that perspective

#

so

#

I made paralelelpoops

#

fully 3D

#

worked first try

#

those are generated parallelolols

#

I sketched that out

#

wrote the code

#

and replaced my lines with the pralellelepipeds without any changes of the scene data other than replacing "quad" with "parallelepiped" and it just worked

#

it's all still instanced

delicate delta
#

that other cube is going to be the camera

#

it's all quaternions all the way down

#

I need to fix directional movement to use the orientation still

#

looks cool though broken like that

#

you can't find this kind of camera orientation on LOGL

#

it's basically 4D rotation in a hyperplane smart

#

this turned out so much better, and easier than I imagined

#

it's so much easier to understand code to than that LOGL camera control garbage

#

I just copied and pasted it and it wasn't even the right coordinate system, and I had no clue how it worked

delicate delta
#

it does have some roll to it though

verbal mason
#

nice

#

LOGL is good cause it has most of the things you need in one place

#

however, I've found errors in almost all the tutorials (some small, some large)

delicate delta
#

LOGL is great, what's bad was just how I didn't understand it

#

I shoudn't call it garbage, and anyway my thing has a roll I have to fix

#

so it's not as good

#

this is so much fun

#

it just works by multiplying two quaternions by the camera orientation, which is also a quaternion

#

I take the right and up from mouse coordinates, turn them into axis angle -> quat -> multiply both by orientation

#

then the perspective from the camera is literally just the inverse of the camera's translation and the camera orientation quaternion to matrix form

delicate delta
#

I got some work do make the key handling and the grid and stuff better

#

but lots of progress

delicate delta
#

was able to get rid of the roll by using 2 separate quaternions to store orientation and update them independently

#

I think that could be a mode though

ivory verge
#

this is neat

delicate delta
#

like use one quaternion and then A and D roll or use two quaternions and then A and D go left or right

ivory verge
#

your camera needs a bit lower sensitivivititiy

delicate delta
#

yeah

ivory verge
#

to make the moving around a little less jerky

delicate delta
#

it's not even using timestep atm

ivory verge
#

ah

delicate delta
#

need to fix all that

#

also the grid there is enormous

#

the scale of everything is way off

ivory verge
#

there is a blog about grids 🙂

delicate delta
#

nice, it's been fun figuring it out

#

oh that's a shader

#

I literally have geometry

#

lol

#

those are actually vertices

#

in mine

#

yeah I was thinking, hrm this could just be a plane

#

it's been really cool building my own camera and look at though

#

my own mouse rotation

#

nothing is copy pasted, it's all my code, just feels great

ivory verge
#

: >

verbal mason
ivory verge
#

i still have it on me todo list

delicate delta
#

I didn't even think to use a shader for this, I don't have any blending or transparency set up right now

#

I have written very little GLSL tbh, my voxel game shader code was pretty simple, all the lighting was fill lighting. I had some complex GLSL for texture mapping and that was it

#

my shaders were all generated by zig

ivory verge
#

: )

delicate delta
#

well I did have some animation interpolation

#

it was pretty basic

ivory verge
#

i rember the cool endermen 🙂

delicate delta
#

I haven't fixed the sensitivity yet

#

I could do some glftfs, add a space station, some fighters and have a game lol

#

and some particles

#

gamepad controls

delicate delta
#

I don't think the mouse is a good fly mode input for turning tbh, probably want key controls for right hand for that

verbal mason
# delicate delta I don't think the mouse is a good fly mode input for turning tbh, probably want ...

you'd need a 3D mouse for this: https://www.youtube.com/watch?v=n3NK-WCAoFI

Plug-in to add support for 3Dconnexion Space Mouse and Space Navigator 3D mice input devices. Control the Godot Engine editor viewport camera with 6DOF (6 degrees of freedom). Freely translate the camera position and also rotate along the yaw, pitch, and roll axes. Available as a free open source plugin for the Godot Engine. Download today.
http...

▶ Play video
delicate delta
#

proper fly controls

delicate delta
#

I'm going to add time step and call it on this one, start the plane math stuff so I can go back to reading

#

just going to do distance to plane and plane extraction and culling, probably be reading again by monday I hope

#

actually want to do some normal stuff with the grid too

delicate delta
#

these normals are correct, but I think I have some bad fp precision in far, I think I know how to to fix it, I read about this. This looks terrible. Also good I added normals because the parallelopoops I was creating were totally broken. Thank god for renderdoc for helping me fix my bad vector math and indices. It's correct now though.

#

I don't care about the z fighting at the junctions

#

looks fucking terrible

#

I'm pro graphics

#

lol

#

I guess I'll fix this tomorrow

verbal mason
#

hmm.. that's a lot of geometry. a plane looks okay

delicate delta
#

Yes I am just experimenting

#

A plane with a shader is the better approach

delicate delta
#

I'm going to try the infinite projection matrix with the reverse distance components to get better precision in far

verbal mason
delicate delta
#

OpenGL

#

I plan on migrating to Vulkan end of year

#

if it doesn't work I'll just reduce my far so it doesn'tn look so broken :(

verbal mason
#

You can try it, I opened a bug report on GitHub. it seems fixed on my side but I don't think anyone verified it

delicate delta
#

I will test it out, thank you!

verbal mason
delicate delta
#

-1, 1 is DOA

delicate delta
#

oh I have to attach a framebuffer with a different depth buffer

verbal mason
delicate delta
#

yes

#

that's really helpful thank you

#

it actually doesn't look better

#

because the grid just turns into an ocean

#

I think I will just reduce the size for now and eventually work on a plane shader grid

verbal mason
#

no, it's not going to make a difference unless you are rendering like an open world game

delicate delta
#

yeah

verbal mason
#

I think I need it for my AO stuff, tho, since I'm trying to put it in a 16-bit buffer cause 32-bit doesn't work on web

delicate delta
#

I'm currently working on adding a time step

#

my job is kind of in a critcal place and I am having to work nights and weekends, so only getting a little bit of time in

#

but

#

I did buy some more books

#

I think I will add flecs in too

#

then I'll work on plane math and then go back to reading

#

I think after getting through all the perspective chapters and finishing the basic math I'll add a glft importer

verbal mason
#

nice

delicate delta
#

adding flecs in zig was so easy since it's just C

#

just works

delicate delta
#

I know I'm going to end up using flecs anyway so since I'm adding timestep might as well as add the components now that will represent all the game objects and have the components for position and orientation

verbal mason
# delicate delta I know I'm going to end up using flecs anyway so since I'm adding timestep might...
delicate delta
#

yes I'm doing that and the RK4 method along with the subsequent post on there too

#

it's in progress

#

it's not done yet

delicate delta
# verbal mason RK4?

It's a physics integrator discussed in an artcle on gaffer on games that's linked to at the top of the time step https://gafferongames.com/post/integration_basics/

#

I wan to try it out

#

it creates 4 differentials to calculate changes in position and velocity in that article instead of the euler approach

verbal mason
#

oh, Runge Kutta yeah. I've done that for physics before. What are you using it for?

delicate delta
#

Just trying it out with moving around

#

I have no idea just learning

verbal mason
#

got it

delicate delta
#

flecs did not work out for me

#

would be too much work to make it work

#

I don't want to spend a week or two building zig bindings for flecs and I don't want to use zig libraries

#

I'm just going to do array of structs or some awful thing

#

just not doable

#

I looked at zig-gamedev's flecs and they did a lot of work

#

and it's just not what I want right now

#

my little scenes don't need this

#

I'm not building an ecs either

#

I learned a lot from using flecs in blockens

#

that code I had before I did flecs was really bad

#

I learned a lot from flecs though

#

fuck

ivory verge
#

ze flecs man is on ze serveur

delicate delta
#

I need to stop reading websites and go back to reading my expensive books and worry about it when they cover it

ivory verge
#

ah i didnt read

delicate delta
#

flecs does some fancy macro stuff to do overloading in C

ivory verge
#

i see

delicate delta
#

And zig isn’t having any of it

#

It also does some meta type stuff

#

Idk no biggie

#

ecs is cool but doesn’t work for my situation atm

#

It is cool sanders is on the server though

ivory verge
#

there are no existing flecs ports you could try? or where people perhaps did some workarounds to the problems you mentioend?

delicate delta
#

There are

#

The issue is the speed at which zig updates

ivory verge
#

ah

delicate delta
#

I pull in a new version of zig every day

#

There are “stable” versions of zig that are released and some libraries stick to those

#

The problem is those stable versions get no bug fixes and editor extensions updates

verbal mason
wise imp
#

entt is cpp20 template metafuckery, 0 chance that worsk with zig

#

can zig even bind to cpp?

ivory verge
#

i just got learned that zig has a weird file naming convention

#

random screenshot from a random zig project

#

i noticed that and got told thats how zig convents this convention

#

naturally i dont like it heh

delicate delta
delicate delta
# ivory verge

So, I was fully unaware that file structs were supposed to have different naming conventions

#

I just read the game dev discussion

#

File names fall into two categories: types and namespaces. If the file (implicitly a struct) has top level fields, it should be named like any other struct with fields using TitleCase. Otherwise, it should use snake_case. Directory names should be snake_case.

ivory verge
#

ye thats ultra stupid, that alone makes zig lose 100 cool points

delicate delta
#

I never got that far in the styleguide

#

But

verbal mason
#

how is a file implicitly a struct?

delicate delta
#

This sort of thing doesn’t matter if you’re not writing a library

delicate delta
ivory verge
#

but i might write a library, put my renderer in it so that i can reuse it in all my cool games kekkedsadge

delicate delta
ivory verge
#

you omit stuff like other languages have export(s)

delicate delta
#

for example

ivory verge
#

but then relying on the naming convention of the file is mega weird, im not buying it (yet)

delicate delta
#
x: f32,
y: f32,

const point = @This();

pub fn getXPosition(p: *point) f32 {
    return p.x;
}

in another place:

const Point = @import("Point.zig");

const p: Point = .{.x = 1.0, .y = 0.0 };
std.debug.log("xpos: {d}\n", .{p.getXPosition()});
verbal mason
#

okay, I'm not familiar with zig, tbh

delicate delta
#

a contrived example ^^

verbal mason
#

this makes sense to me, I guess

delicate delta
#

I love file structs

#

I didn't know they needed to be camel case to follow the convention

#

I hate that

#

because file systems aren't case sensitive

#

I guess I will follow the convention though and reread the style guide because I didn't know that and I thought I knew the style guide

delicate delta
#

nah

#

camel cased file names are not my thing

#

I don't care

#

the zig police can come and arrest me

delicate delta
#

used the spring accelerator with Runge Kutta from the website for fun, works great. with a time step. I'm only doing time step on the forward movement not the reorientation

#

it's a UAP

#

alright I'm done with this one, time for plane stuff

delicate delta
#

actually I have to make this camera code reusable for my next scenes