#Saurian Sorcery

1 messages Β· Page 4 of 1

obsidian wolf
#

fair

main cosmos
#

because all the non-blue wavelengths will be extinct as the rays travel far through the water

obsidian wolf
#

i want to be here

main cosmos
#

and I guess beaches look greener because the light can reflect off the sand before all the green/red is absorbed or scattered

#

and some beaches look greener in particular because the sand is lighter

#

or because there's algae in the water 😳

obsidian wolf
#

yeah

#

btw do you think i should look into any other noises? i'm just using perlin with a power right now

main cosmos
#

maybe fbm to add layers of detail

obsidian wolf
#

it is fbm i think

#

isn't fbm just fractal perlin

main cosmos
#

o

#

yeah just repeated perlin with different frequencies

obsidian wolf
#

yeap then

#

but i wonder about like

#

voronoi for one

#

it probably doesn't matter

#

the one nice thing about voronoi is that it doesn't tile at all unlike perlin

main cosmos
#

you might want to look at simplex noise too

#

it's like perlin but upgraded

obsidian wolf
#

true

main cosmos
#

there's a person in the libnoise server (k.jpg) who seems to do a lot of research into noise algorithms

#

I can gib server invite if you desire

obsidian wolf
#

eh

#

joining a server is too much work dogekek

main cosmos
#

it's the discord server for the FastNoise lib in case you are ever interested

obsidian wolf
#

i could also use some sort of distorted noise

main cosmos
#

mayhaps you want domain warping

obsidian wolf
#

i might look into it in the future

#

yeah that's what i meant

main cosmos
#

the fastnoise lib has a tool for quickly iterating noise combinations

obsidian wolf
#

a tool as in online, or in lib?

main cosmos
#

it's a standalone exe

#

called NoiseTool

obsidian wolf
#

ah i'll definitely try that then

main cosmos
#

it's pretty cool

#

the tool can export base64 strings that you can use directly from the API to generate noise

obsidian wolf
#

if only substance wasnt' fucked!

cedar rune
#

To #showcase with this!

obsidian wolf
#

simplex doesn't really perceivably though, so that'd be another alternative

#

i didn't mean seamless tiling, i just meant it doesn't have those artifacts that i want to avoid

dry monolith
#

ic

main cosmos
obsidian wolf
main cosmos
#

le mao

obsidian wolf
#

hey also my pfp is kind of from that game

main cosmos
#

ye

obsidian wolf
#

thinking about using a bit of inheritence as an april fools joke

#

currently the only bit i use is to iterate on my editor scene types

#

it's kind of wacky, i haven't even consciously avoided inheritence, i just haven't ever thought to use it

cedar rune
#

theres definitely valid use cases for inheritance imo

#

one good example is some sort of logging interface you let users of your lib supply

obsidian wolf
#

any case where i've thought to use inheritence for this project has been better solved by lambdas, because it allows for composition

#

if there are multiple lambdas, mixing and matching

cedar rune
#

Yeah thats definitely fair, I do tend to avoid it if possible

#

Sometimes it's just the cleanest solution though

obsidian wolf
#

probably true

cedar rune
#

It's a bit weird in Rust though, there's no inheritance, just dyn Trait objects that are kind of like polymorphic classes but not really

obsidian wolf
cedar rune
obsidian wolf
#

one of the harder parts of the game logic for this game is targeting code, so i'm trying to share more of it

obsidian wolf
#

well

#

i'm stupid

#

using ECS to store ptrs is very dumb

obsidian wolf
#

so a big part of me getting 20 fps is the transform code i do

#

when there are like 2000 models for the level, the loop takes a good bit of time to even get the right memory

#

because my model structs aren't very lightweight, and none of it is cache coherent

#

so my choices are to either rework the models and by extension their transforms to be less dumb

#

or to just specialize the level assets to not use the main transformation system

grave nacelle
obsidian wolf
#

nah, can't imagine culling ECS though

grave nacelle
#

I dont know what ecs does but i think you Need some sort of culling

#

Dont render outside of a casting sphere

spring sentinel
#

You absolutely can cull

obsidian wolf
#

monkaHmm i made a mistake

#

this is stupid, checking if transforms need to be updated is not something that could be culled regardless of whether or not ECS is being used

obsidian wolf
#

as a response to the problem i actually had anyways

obsidian wolf
#

and with that i get the final word in

#

therefore i am correct!

obsidian wolf
#

currently on vacation, been thinking

#

i think the fruits are dead,,,

#

i do enjoy some level of coherence

#

also a lot of the art ive seen i do not think i can make fruits look as good as they should

#

instead i want to do a little spider robot that has a space for something on their back

#

and so theyll spawn in with a weapon, then go to an objective and drop the weapon to pick up a currency and try to bring it back

main cosmos
#

banana with a sword

obsidian wolf
#

i also wrote out a bunch of ability ideas that have me excited πŸ™‚

obsidian wolf
obsidian wolf
#

i got covid or something similar, teehee

#

sick programming (at work) has been kinda fun, i can only stay focused for like an hour, which is interesting because it's like the "see a bug? go on a walk to fix it" meme but constantly

#

i feel enlightened despite going at a snails pace πŸ‘΄

main cosmos
#

do you feel, in this moment, euphoric?

obsidian wolf
#

nah man i feel like sweat and sleep

dry monolith
#

if your clothes don't feel like sandpaper and the food tastes like nothing or something disgusting you aren't getting the full covid experience

obsidian wolf
#

yeah idk if its actually covid and im too lazy to get tests

#

im also like extra vaxxed up so

#

i just have ye old bad fever & throat pain & cough

obsidian wolf
obsidian wolf
#

whoopsies, i forgot to commit for a while πŸ™‚

cedar rune
#

He’s alive!

obsidian wolf
#

ya weekend project moment PepeHands

obsidian wolf
#

i wonder how hard it would be to make something in this style

#

wonder if there's anything out there for converting simple depth based outlines into actual strokes/curves

#

i'm sure there is, pencil sketch shaders have gotta be pretty explored

obsidian wolf
#

looking at this again, i think the low contrast is very nice

#

i should try it

obsidian wolf
#

random bikeshed thought

#

i wish transform wasn't a relatively long word

#

i would use xform but i really don't like shortenings like that

#

i.e. it feels like there's no "pos" equivalent , sad!

dusky field
#

xform is a term used in some software, like 3DS Max, if that can reassure you a bit

obsidian wolf
#

yeah we use it at work too, just feels wrong to me for inexplainable reasons :)

dusky field
#

I find it ugly too :p

obsidian wolf
#

going to invent a new word

#

going to get rid of scale and call it pose (i was on the phone forgive me for my math dictionary mistakes)

cedar rune
#

trfm

#

In c api style :)

obsidian wolf
#

t

#

damn if only time didn't exist, then that might actually work

severe spruce
#

frame?

#

its overloaded, but short

obsidian wolf
#

i get it on a technical level and only a technical level

obsidian wolf
#

tf is the final answer

#

i will save so much time with this

dusky field
#

"the fuck"

obsidian wolf
#

yeah it's funny as a bonus

obsidian wolf
#

pretty similar to my levels, just done better

main cosmos
#

MONKE

obsidian wolf
#

opening my models in windows model viewer is a bit funny

#

its a bit buggy, but i have finally implemented both abilities of a character

#

and it forced me to fix the pathing so stuff no longer goes into the ramps

main cosmos
#

comfy aesthetic

obsidian wolf
#

yo the trap is so effective it stuns my whole game instead of just the enemy

obsidian wolf
#

tryin out some stuff

cedar rune
#

I think the flying thingy looks a bit weird but the others are cool

obsidian wolf
#

it was very temp made

cedar rune
#

Especially with some spider leg animations the last one could be really fun

obsidian wolf
#

i mostly considered the drone idea because it wouldn't need IK or even animations really

cedar rune
#

Yeah

#

A drone would be good to have too though

#

You can balance it around stuff that is better at dealing with flying units

#

And some things being unable to target them

obsidian wolf
#

the right side of the first image and the 2nd use the same base, so the idea with that would be to make 2 or 3 bases and swap out their weapon or what they're holding

cedar rune
#

Yeah that’s smart

obsidian wolf
#

wraps up the protagonists vs antagonists in a clean little package, you control lizards, and you are defending dragons against guy with robots who want the dragon eggs

#

would imply a bunch of work with regards to the dragons though, so it's an idea, not a plan right now

cedar rune
#

Cool beans

#

I like how you have an actual working game

obsidian wolf
#

yeah hoping for a countable amount of seconds of gameplay by end of year

obsidian wolf
#

sad discovery, gltf doesn't support bone IK constraints by default

#

granted, that'd be super specific, but still it means i will probably end up hard coding the IK with the code that loads models

#

i know the intent of gltf is to format data in a way that's easily uploadable essentially straight to gpu, but i wish it was just made relatively similarly with some slight tweaks to be an actual interchange format instead

#

my feeling is that any program which cares enough about the upload efficiency should be making their own format regardless

obsidian wolf
#

sugcon deez

main cosmos
#

lol

obsidian wolf
#

only took me 5 months to come up with that one

obsidian wolf
#

damn

#

algorithms are a lot easier to implement from a desmos graph than they are from a 42 page math paper

#

is FABRIK ik from anon/void's desmos graph, need to do constraints still tho

obsidian wolf
#

surely i wouldn't hard code only one type of constraint that just happens to be the only one i need for this model Clueless

obsidian wolf
#

i think conceptually it works better(not really?), so i might as well, just makes it more clamplicated

obsidian wolf
#

i see, so i'm locking yaw for certain joints, when i evaluate them forwards, i use (first - prev) instead of (second - first) as the line to move along for the x,y coordinates, and when i evauate backwards, i evaluate two forward instead of one forward, e.g. (third - first) for the x,y coordinates

#

evaluate z as normal, normalize the combined coordinates, i think that's all good

#

actually, i guess it's just look forward until there's not a yaw locked joint and use that as the target for the x,y coordinates

dry monolith
#

you need to apply two-way constraining, that's why it's called forwards AND backwards

#

though I think this is only for constraining the length, for rotations it's one way

obsidian wolf
#

this is technically a plane constraint so basically a rotation constraint

#

i think i should be able to implement it (with two way pitch exclusive or yaw exclusive constraint), just haven't had the time today yet to try beyond that desmos graph

#

i don't need to match this behavior exactly (it seems to roll a bit), just looking for the base hip joint to be the only one that changes the yaw of the leg

dry monolith
#

to make a hinge joint you need a function which would snap point B to the plane around A within min and max angles, so you actually need to define a 2d space within that plane for that you need a 3d basis, you find the projection onto the plane (like XY or XZ or YZ) within that basis and then convert position to polar coordinates, constrain the angle phi and convert back to the cartesian plane

obsidian wolf
#

i think this checks out

#

make a basis from the previous bone as forward, z in my case as up, can rotate the up vector by roll around the forward vector optionally (i wont), should work

dry monolith
obsidian wolf
#

i didn't have a meaningful constraint to test that wasn't completely locking it, that wouldn't add unneeded complexity

#

downside of 2d

#

it's not very odd because it's completely ignored in the formulas, but it's not in my actual code because my actual code looks more like

static v3 constr_lock_xy(v3 x, v3 y, float length, v3 prev) {
    return x + math::normalize(v3(prev.xy - x.xy, y.z - x.z)) * length;
}```
#

i.e. y is used for the z coordinate, but it's unused in constr2 (from desmos)

dry monolith
#

I have no idea what was the purpose of constr2 and other functions

obsidian wolf
#

constr2 was locked to the previous angle

#

so i'm locking yaw for certain joints
key message, i could've annotated better tho

dry monolith
#

sounds like you might be doing something nonsensical but I'm not gonna try to dig into it

obsidian wolf
#

the desmos graph looked dumb

#

i don't believe what i'm doing is actually dumb though, i think i understand fabrik well enough now

obsidian wolf
#

hm i see

#

i didn't have exactly the same thing in mind as you, my planar projection idea was a lot more complicated

#

i'm going to do what i believe you're suggesting

obsidian wolf
#

i probably don't even need to add angle constraints, but i do need to convert these back to rotations

obsidian wolf
obsidian wolf
#

hmmm

#

nothing super simple comes to mind for how to improve the steps here

#

if i overshoot the step locations, i can fix the issue where the legs lag behind a little bit

#

but then i need some timer for non-moving so that i can adjust the step locations to nice resting positions if the IK is otherwise idle

#

that should be easy enough, maybe, but i also want to offset the legs so they don't move all at once

#

and if i just make it so only 2 legs can be in the air (i.e. moving to a new ik target) at the same time, i'm fairly certain that'll only result in more lag

#

it feels like i need to add in a concept of velocity perhaps

#

i bet this is something that has a couple of blog posts written about it but i'm not sure what to look for

dry monolith
#

you need to generate new positions for the feet once old one is out of optimal reach or too close to the body, and then animate it to quickly jump from old position to new while IK follows it

#

then if the body doesn't move for some time reset all positions to rest pose in random sequence one after another

obsidian wolf
dry monolith
#

make stepping quicker

#

you can't have the quadruped move like a spider anyways

#

it will have to gallop or jump or step really quickly before it loses the balance and with really short steps

obsidian wolf
#

it's not about speed

#

it's about average location

#

if the four half-capsule shaped regions are the allowed IK region, and the dots in the center are optimal IK position, the legs only use the pink regions while moving up

#

the diagram clearly presents the solution as moving to the other side

#

but the legs moving offset from each other also needs to work within those constraints

#

i think i can implement the opposite leg lockout and just see what happens before i think too much about it though

#

the speed of the legs isn't up to me anyways

#

it's just a function of allowed IK positions, scale, and speed of whatever is moving

obsidian wolf
#

when it changes directions, taking the offset of the pink line in the above diagram doesn't move in the direction it's going, so it crosses and does some zigzagging crap

dry monolith
#

what is "taking the offset of the pink like"?

obsidian wolf
#

new_ik_target = desired_ik_target + step_ahead_dist * normalize(desired_ik_target - current_ik_target)

obsidian wolf
cedar rune
#

why does discord keep unfollowing threads for me even if they stay active

obsidian wolf
#

it hasn't done that for me with tear's πŸ™‚

#

maybe following is different than ones you just sent a message in? that'd be dumb though

cedar rune
#

it just did for me with this one

#

idk

obsidian wolf
#

actually it might have done that to me

#

reminds me of how my starred conversations in slack dissapear after like a week

#

like... i starred it...

cedar rune
#

slack doesnt even keep a full message history with their free plan iirc

obsidian wolf
#

oh they don't with the paid version either

cedar rune
#

wtf

obsidian wolf
#

it's like 3 months for DMs

cedar rune
#

what about public channels

obsidian wolf
#

those are permanent

cedar rune
#

at least thats good

obsidian wolf
#

wow

#

who knew visualizing what was happening would help debug things

#

i need to start telling people about this

#

since i think syncing the legs to have symmetrical movement is important visually

dry monolith
#

when you move forward one leg should go forward one stay

obsidian wolf
#

they do that but because they don't fill the entire cycle, it can be very

#

gallopy i guess? which isn't intended

dry monolith
#

which one should be chosen based on how close the current leg position is to the direction it would step to or at random if they have same distance

obsidian wolf
#

i just alternate, which is probably fine

#

this is a bit ranty, but also another reason i probably need to predict with velocity is because legs spend the majority in the back half of their available region, because the available region moves during the interpolation, so they could target a region ahead of what they actually have avialable at time of step location selection

#

e.g.

dry monolith
#

basically take dot product to tell which leg should reach forward first, then you could alternate them, but idk how exactly, I'd need to make a sim to design motion for a quadruped

obsidian wolf
dry monolith
#

I think they should alternate naturally because position is regenerated once a leg reaches the circle border and it is placed at the circle in the direction of movement

#

so it reaches for the new position instead of being placed at the center of the circle

#

and the other one is dragged until it gets to the border, then it steps on the circle border again in the direction of movement

dry monolith
#

lol

obsidian wolf
#

it's mostly fixed with velocity prediction, outside of corners, where i need to correct movement πŸ’€

dry monolith
#

finished?

obsidian wolf
#

i need to fix it around corners, calculate the step duration, and make the code not a wreck, but proof of concept seems to be πŸ™‚

dry monolith
#

it's using delay to alternate legs?

obsidian wolf
#

legs 0 and 2 can't move while legs 1 and 3 are moving, and vice versa

#

i.e. no airtime is allowed

#

currently it's this shit ass block

obsidian wolf
#

ahahahahaha

main cosmos
# obsidian wolf

This reminds me of something
https://youtu.be/mP4_uzb6M64

It has been 497 days since the last video on this channel. Anyway, this is just a higher quality mirror of this tweet. https://twitter.com/MaxLebled/status/1294300124441710597

... and if you don't know about the meme, this is where it originated from: https://twitter.com/pentaerythrit0l/status/1289820490312200192

Gman stick bug? Gman stick bug.

β–Ά Play video
#

I love your little bug though

obsidian wolf
#

main thing i have left with regards to this is figuring out how to do height

#

i might just render512x512 or 1024x1024 and copy to CPU

dry monolith
#

height? render?

obsidian wolf
#

yeah

dry monolith
#

I don't get it

obsidian wolf
#

for IK?

dry monolith
#

is this in context of teh creature?

obsidian wolf
#

stepping locations?

#

sorry

dry monolith
#

wait but render what exactly

obsidian wolf
#

the scene

#

at game start

dry monolith
#

ah you mean you want legs to actually step on the world

obsidian wolf
#

yeap thinkin ahead

dry monolith
#

why couldn't you just use raycast?

obsidian wolf
#

i don't have any physics

#

the most i have is a binary map of solid tiles so i can place objects on tiles without manually selecting height

dry monolith
#

can't you raycast graphical meshes in unity?

#

like without physics

#

bc pretty sure physics is usually done with proxy geometry anyways so having functionality to trace graphics is completely different use case

obsidian wolf
#

i have pixel picking but that's only because i'm already building a perspective render, i could technically CPU rasterize but that's a lot more work than just doing a transfer

dry monolith
#

wait this isn't unity right

obsidian wolf
#

it's all NIH

#

asides from imgui

dry monolith
#

I'm mixing things up real bad lmao

obsidian wolf
#

i see hehe

#

actually there will be a bit more struggle after figuring out step height values, because i wanna do some aligning to normal stuff too πŸ’€

#

so when they walk at a 45 degree angle they don't look like shit

dry monolith
#

I guess you need raycast then /shrug

#

actually

#

if you do it like you said with a top down render, you could capture normals too

obsidian wolf
#

oh shit actually nah

#

no by the normal thing i just mean like... the plane from the four step locations

#

but it's pain because my IK math sucks

#

but actually i can't do the top down because i really want to be able to do overhangs

#

so imma just make a simple physics mesh then

dry monolith
#

but this approach with getting things from GPU to CPU sounds like asking for performance drop

obsidian wolf
#

aka add ramps to my voxels

dry monolith
#

how did you make IK if your IK math sucks

#

and what is IK math anyways

obsidian wolf
#

true, i should trust it slightly more

#

but also

#

transformations are weird

dry monolith
#

like how

#

they are pretty straightforward to me

obsidian wolf
#

i have a game transform that have a system that updates model transforms

#

there is an optional component called transform links that offset the model transform when it's set from the game transform

#

so when i consider setting normals, i can consider setting the game transform, or the model transform, or the link, and i'm not sure which i want to do yet

dry monolith
#

so like

#

you're saying that you aren't working in world space

obsidian wolf
#

i'm saying that it's more of a gameplay implication question and i hadn't really thought about why it was confusing

obsidian wolf
#

les go

#

love breaking me transforms

main cosmos
#

Looks like abstract art

#

Btw, I found yet another random video that reminded me of your game πŸ˜„

dry monolith
#

but why

obsidian wolf
#

tbh there is a decent chance the first IK iteration of enemies could've looked like that

main cosmos
obsidian wolf
#

speaking of IK

#

now its time to put a cannon on it

main cosmos
#

Hmm what is the theme of the enemies now

#

Robot insects?

obsidian wolf
#

#1019758048912359525 message
#1019758048912359525 message
these two messages summarize it i think

#

i don't have any plans to make more bases for enemies, just this spider one

#

the variance in enemies will be entirely what is placed onto them

dry monolith
#

place fruits on them

obsidian wolf
#

i did consider that

#

unfortunately i have been distracted by trying to fix my outlining shader math

main cosmos
obsidian wolf
#

the whole spider robot idea started with me thinking about adding robot leges to the fruits

#

i have an issue

#

with overly academic resources

#

they make me too annoyed to put in the effort of understanding them

#

it feels like there's an incentive to make things sound more complicated than they actually are and obfuscate what is actually of interest

#

but i'm also not super sure of this take because it's not one i hear reasonable people complain about enough

dry monolith
#

maybe you just lack the assumed background

#

papers skip a lot of that

obsidian wolf
#

here's an example, finding the actual formula that you can use to generate b splines with

#

is not easy, even though the formula is super easy, and how it's derived is actually relatively easy to understand as a followup too

#

i think the problem in this case is that b-splines are generalized to be n-order, even though that's not really a relevant generalization to me

#

i think most of what eric heitz does is communicated well

obsidian wolf
#

and it's not even the resources fault, because they're not necessarily trying to appeal to me or people like me

#

they're trying to appeal to people like them

#

which is fair, but it's also what i wish was different

obsidian wolf
#

cleaned up the outline effect a bit

#

the normals didn't get too much of a change, mostly just tuning and being a bit smarter how things are added together

#

the depth outline uses the classic (1+a^x)^-1 where x is the depth delta, and sums everything together

#

which works really nicely and is insanely simple

#

the spiders being really ugly prompted me to fix it, since they're like 60% outline, 40% mesh

#

i'm also gonna beef the spiders up some to help with that too though

obsidian wolf
#

more thoughts

#

i'm also considering writing some mesh combiner for my levels

#

currently adding tiles is relatively expensive to the frame cost, since each adds ~8 meshes

#

the cost of it is relatively flat since they're at least instanced, but i don't have MDI or anything

#

but i'm not a huge fan of the "single island" sort of look, i want to have a more complete and enclosed level, something more layed out like these

cedar rune
#

holy shit i remember that first one

#

i played that so much lmao

obsidian wolf
#

i don't ahaha, i got it off google images

cedar rune
obsidian wolf
#

web browser game?

cedar rune
#

yeah lol

severe spruce
#

if cpu, maybe i could take a look

obsidian wolf
#

i haven't profiled it enough, i'm pretty sure i'm entirely cpu bottlenecked

#

could also be my code, let me see how much of an issue it actually is

#

spamming blocks KEKW

#

i wonder how realistic it is to tolerate 5-10 FPS on debug builds with full maps

#

cause the usual case would be release build with full maps, and debug build with test maps

severe spruce
#

depends on why it is so slow πŸ˜„

#

if it is vuk, then I'd take a stab at improving it

obsidian wolf
#

if it's the usual case, it's painful

jaunty thorn
#

why would vuk cause you to be CPU bound to begin with

severe spruce
#

bugs?

cedar rune
#

impossible

#

vuk does not have bugs

obsidian wolf
#

oopsies i built without tracy symbols, silly me >w<

#

am i dumb, why do i have stats but it doesn't show the zones in the main view

#

@severe spruce i'll spend one of these upcoming weekends trying to make a level that tests perf properly and profile it then, if i see time spent in vuk code i'll let you know

severe spruce
#

thanks!

#

having a nice profile to weed out stuff would be nice

obsidian wolf
#

i'm still not super happy with the type of dwelling it is either, feels like lizard homes should be more swiss-cheesy and underground, or hut-like

#

so i might restart again

obsidian wolf
#

silly game idea

#

it's like what an auto-battler is for tactics games, but for a city builder instead

#

and auto city builder, where the only inputs you have are like... terraforming or something

#

u terraform a nice little planet and little guys come and populate it

cedar rune
#

That sounds pretty fun

obsidian wolf
cedar rune
#

ok sir SChide2

obsidian wolf
#

i expect to see it on steam four years from now

cedar rune
#

try 40

obsidian wolf
#

reproduced some concept art i ofund

#

i like it a lot, gonna see how i can slot it into the space i have

cedar rune
#

oooh

#

thats cool

obsidian wolf
#

it is some of the more lizard-plausible architecture i've seen

#

can't say why though

#

unfortunately it's quite big, like 8x8 tiles

#

which is like... most of this map

cedar rune
#

that is really big

#

would go nice on the top left tho

obsidian wolf
#

yeah would have to be off-map

obsidian wolf
#

egg cup building

#

also another building, me finks im gonna go with this

#

egg cup building is a little weird because you can't see it from top down perspective, but meh

obsidian wolf
#

i am doing dumb, irresponsible things

#

started by refactoring the way that enemies move to their targets so that it'd work better with attachments on the spider bases

#

which is reasonable

#

but then i started fucking around with my ability system code, and now i'm fucking around with my timer code

#

what could go wrong with this relatively large scale code cleanup Clueless

obsidian wolf
#

for context of old version

obsidian wolf
#

rubber ducking

#

entt lets you connect signals for construction/destruction of components

#

the signals have to take the form of void(entt::registry&, entt::entity), but can be member functions if an instance of the class is passed on connection of the signal

#

so if you need your game scene struct, you can for example

// my system file
void on_my_component_destruction(GameScene* scene, entt::entity) {
  MyComponent& my_component = scene->registry.get<MyComponent>(entity);
  cout << fmt::format("{} is being deleted", my_component) << endl;
}

// my game scene file
GameScene::GameScene() {
  registry.on_destroy<MyComponent>().connect(&GameScene::on_my_component_destruction_forwarder)(*this);
}

void GameScene::on_my_component_destruction_forwarder(entt::registry& registry, entt::entity) {
  on_my_component_destruction(this, entity);
}```
#

the question is how you can pollute your game scene class less, minimizing code change each time you want to add one of these signals monkaHmm

#

i do not know, so i am going to ask in entt discord

#

hidden entt features resolved this πŸ™‚

main cosmos
#

what feature πŸ‘€

obsidian wolf
#
void on_enemy_death(Scene& scene, entt::registry& registry, entt::entity entity);
#
    registry.on_destroy<Enemy>().connect<&on_enemy_death>(*this);
#
     * When used to connect a free function with payload, its signature must be
     * such that the instance is the first argument before the ones used to
     * define the signal itself.```
it's not in the documentation pages, but documented in the code itsself
main cosmos
#

I only used the construction/destruction callbacks to log messages lol

obsidian wolf
#

yeah they become important :)

#

spider bases + functional attachments are different entities right now, i have to disconnect the attachments when the base dies

obsidian wolf
#

What would that look like then? Do you mean the system you proposed where instead of child/parent you just have components or
just handling child/parent relationship

#

so having a component that's just something like

  entity_id parent;
  vector<entity_id> children;
};```
in rust, and managing that
#

or only having one relationship if it's easier

vital raptor
#

Oh I see

obsidian wolf
#

entt at least has signals for when a component is destroyed, so you can kill children or remove your entity from it's parent child list

vital raptor
#

Would it not need:

  entity_id parent;
  entity_id self;
  vector<entity_id> children;
};```
obsidian wolf
#

and when you're calculating your transform component's world transform, you check if it has a Relationship component and include it if so

#

you might, when you iterate with entt, the lib i'm used to, the system would look like this

#
for (auto [entity_id, relationship] : regsitry.view<Relationship>().each()) {
};```
#

so you always have access to it while iterating over those components

vital raptor
#

How do you spawn in β€œprefabs” then?

#

What do you do when you need prebuilt hierarchies?

obsidian wolf
#

so

#

if you have a node, and you have both it's children and it's parents, and it's serialized

#

you're deserializing it, and you're wondering how you do you make sure that once it's done deserializing, everything has the right references

#

keeping both the parent and the children lets you do that without any searching, because when you add a node, you check if it's parent already exists, or if it's children already exist, and if so, you update those entities

#

i.e.

void deserialize_node(Registry registry, Node node, EntityID this_id) {
  if (registry.exists(node.parent))
    registry.get<Relationship>(parent).AddChild(this_id);
  for (EntityID child : node.children)
    if (registry.exists(child))
      registry.get<Relationship>(child).AddParent(this_id);
}```
vital raptor
#

hmm ok i see now

obsidian wolf
#

if you're wondering how to serialize those entity handle's, you can store your own ids on disk, then when you're deserializing, just map id's to entity handles and convert as needed

#

it's kind of a pain, especially because a lot of this you need fully featured ECS to make reasonable

#

like if you're deleting a node, with entt you can use on_destroy signals to clean up the relationships

vital raptor
#

it's ok, with rust i will probably just surround everything with Arc<Mutex<...>> (i think Arc = shared_ptr in cpp?) and implement custom destructors

#

i am ok with heavy lock contention (there will not be more than 1000s of objects likely)

obsidian wolf
#

i could do this and fix the entities that reference the one being deleted

void on_relationship_destroy(Scene& scene, entt::registry& registry, entt::entity entity) {
  Relationship& relationship = registry.get<Relationship>(entity);
  cleanup_relationship(relationship);
}

void Scene::setup_registry() {
    registry.on_destroy<Relationship>().connect<&on_relationship_destroy>(*this);
}```
#

if destructors work, sweet

vital raptor
#

the destruction actually doesn't seem too difficult to solve tbh, i think what's more tricky is how graphics data should be deserialized

obsidian wolf
#

i think the main issue that signal stuff solves is needing extra data when you destroy

#

like if you need a reference to the entity registry, but idk how all that works in rust

vital raptor
#

i will probably just surround the entire transform registry with a mutex and call it a day πŸ˜†

vital raptor
#

you can't deserialize it 3 times, you actually deserialize it once (to not duplicate textures etc) and then spawn from this intermediate deserialized state

#

is this some kind of general problem as well or is it too niche to coment

obsidian wolf
#

this is detached from my ECS

#

i actually use file references lol

#

if you want to reference a texture in my engine, you reference it's file path, and it pulls it from cache or loads it if it needs to

vital raptor
#

ok that makes a lot of sense

#

so it's like lazy loading, that's smart

#

i kept thinking about loading everything into memory first, and then on spawn just ensuring it existed in memory already

obsidian wolf
#

yeah it's a bit weird for if you're avoiding hiccups

vital raptor
#

that's actually a really simple solution though, you can just force the load somehow at start maybe and that solves it (?)

#

maybe some kind of "dummy" spawn at map/level load time could fix it

obsidian wolf
#

my code for a tower defense spawner lol

entt::entity instance_prefab(Scene* scene, const SpawnerPrefab& spawner_prefab, v3i location) {
    static int i = 0;

    auto entity = scene->registry.create();
    scene->registry.emplace<Name>(entity, fmt_("{}_{}", "spawner", i++));
    scene->registry.emplace<LogicTransform>(entity, v3(location));

    scene->registry.emplace<Spawner>(entity, spawner_prefab.level_spawn_info, SpawnStateInfo{}, scene->spawn_state_info);
    scene->registry.emplace<FloorOccupier>(entity);
    // Preload all of the enemies
    for (auto& enemy_info : spawner_prefab.enemies) {
        load_asset<ModelCPU>(load_asset<EnemyPrefab>(enemy_info->enemy_prefab_path).base_model_path);
    }

    return entity;
}```
vital raptor
#

a little hacky but it would work

obsidian wolf
#

specifically the "Preload all of the enemies" part

vital raptor
#

actually it seems to fix a lot of issues, though

obsidian wolf
#

i could abstract this a lot, but it's all i need for now

vital raptor
#

i kind of shoehorned myself into thinking i needed an "intermediate struct" that i could call .spawn() on or something

#

but lazy loading is actually kind of perfect, ty for inspiration 🧠

obsidian wolf
#

unordered map elmosworld

#

actually i can commit teehee

obsidian wolf
#

ok i'm gonna go play diablo 4 lmao

vital raptor
#

hahaha alright, ty for the file path lazy loading idea though ^_^

#

that's actually extremely clever never thought about it

obsidian wolf
#

i stole it but can't say from where 😈

vital raptor
#

it's not "lazy" at all πŸ˜›

obsidian wolf
#

my scheduled progress point for this weekend is adding the objective for the enemies

#

i.e. dragon egg, and having them pick it up and turn around

severe spruce
#

where is my profiling scene frog_bath

obsidian wolf
#

oh true i did make it

#

i mostly stopped with it because more of it was gameplay code than i realized and there was less perf problem than i realized

#

but i will try to get it set up anyways

obsidian wolf
#

no promises though because i might just spend 30 hours playing d4

obsidian wolf
#

@severe spruce you should be able to run the small level and the large level with this

#

though tracy indicates that a good portion of the frame is my responsibility

#

ah no apologies it's missing something

obsidian wolf
#

do you need anything else from me monkaHmm

severe spruce
#

nevertheless, this looks good, i'll let you know if i manage to get it going

obsidian wolf
#

πŸ‘

#

the only problem i'd suspect you might run into would be on startup, but might just need to delete or edit the stuff in /user/

severe spruce
#

wait so i got a resources.zip

#

what else do i need

#

is there a specific branch or commit

obsidian wolf
#

just latest

#

i commit once every 6 weeks apparently so it should be fine for a while dogekek

obsidian wolf
obsidian wolf
#

unfortunately, hard problems arose

#

not like super hard, but mostly figuring out how to handle enemies while the egg is being carried (i'm assuming they'll switch into heavy aggro mode)

#

basically...
if egg is not being carried, move to egg and try to pick it up, attack lizards on the way
if i am carrying egg, move to exit
if egg is being carried, either move to carrier or attack lizard (depending on weapon?)

#

need to do step 3

obsidian wolf
#

shrine looks way better

obsidian wolf
#

that i barely remember adding

#

have no clue how i activated it

#

and can't get out of it

#

this is funny to me

#

apparently it's F

#

why would i do that

main cosmos
#

F for phirst-person

#

Hehe it'd be funny if you made it so you could have a FPP view of enemies and towers

obsidian wolf
#

fly i guess

#

would need a bone πŸ’€

#

i have eye bones for the lizards so i could just average them

obsidian wolf
#

ummmm

#

i think my game somehow supports running 2 instances at once?

#

or something?

#

i have no fucking clue what's going on

#

the entity viewer legit has a 1 and 2 overlayed

#

i accidentally double clicked play

#

and it looks like the time is jumping back and fourth every frame

#

KEKW what the fuck

#

the camera is also choppy like that even out of gif

#

actual progress update also contains bugs, but less catastrophic ones

#

i think instead of fixing the bugs though, i'm just gonna add another enemy type

#

though i will rant about something quick

#

because i added enemies colliding with each other so they wouldn't stack up, there's a non-bug isuse that happens where if two entities have the same target, and are approximately the same distance from it, they push each other away at the same rate and prevent each other from reaching it

#

that's what happens at the end of the gif (even though one of them is invisible)

#

i spent a while thinking about this a long time ago on an RTS i worked on for a while

#

and i think i was trying to be too smart about it

#

the way that it works now is the enemies have a list of waypoints, and they try to reach them one at a time by calculating the vector to them and moving in that direction, moving on to the next waypoint when they're within some threshold

#

instead of that, i think i'll just calculate their desired path every single frame, and move in the direction of a waypoint like 0.5 units ahead of the first grid aligned waypint

#

i was way too scared of recalculating the path, and i was also way too stuck on always moving to the nearest waypoint

#

so the old way is if i'm the green dot, green would be desired path

#

and it can lead to the weird scenario where it gets pushed to here

#

hmmm it can't be 0.5 units ahead of the nearest, it has to be in relation to the current position

#

maybe projection + x units ahead depending on config for how tight it should stick to the path

severe spruce
obsidian wolf
#

i wonder if i could look ahead by however far i have to project to the path

#

funny thing is, realistically this case doesn't even fix the problem

#

since this is what the actual pathfinding would look like

#

maybe keeping the original path with the projection shit would actually work though

#

that RTS game had the problem that you could fully push things with units, so it had to handle cases where things got very far away, but i don't here

obsidian wolf
obsidian wolf
#

cool, </rubberducky> i think

obsidian wolf
#

added 2 new enemy attachments, the first is the middle thing in the first wave which increases the armor of nearby bots

#

the second is the one that i manually spawn which is a mortar, and gives you some time to move your unit out of the way of it

#

one of the things i actually need to do relatively soon is preload a list of dependencies

#

i'm not sure how i want to do that yet

obsidian wolf
#

i'll probably just do it manually

#

so files can list dependencies, then when you load the map it recursively preloads them, probably all i need

#

it sort of depends on things i haven't figured out yet, like what will be accessible in shops per level, so i can't be too clever with it, and i don't want to do async loading

main cosmos
#

are you talking about asset dependencies?

obsidian wolf
#

for preloading yeah

#

as in like

#

not loading during the game, loading everything when the map loads or at least before it's needed

#

notice during the bow shot the stutter, its cause i just load everythign on demand

main cosmos
#

the stutter gives it a AAA quality

obsidian wolf
#

with my 4mb in actual assets void

obsidian wolf
#

im assuming this works in triple A usually by forcing asset references in scripts to be exposed and selected through editor, or scanning the script for them

#

i dont think theres any better indie solution, i know godot you can preload resources when the script is loaded, and you can recurse that way

#

in both solutions i cant do them because i dont have scripts

main cosmos
#

can't you shrimply preload all assets in your assets folder

#

since they easily fit in memory

#

maybe it would help to have a manifest to mark assets, then you can just scan that at startup

obsidian wolf
#

yes and no

#

maps for example are actually kind of big

#

like they take a while to parse/deserialize

#

and i could just load the strings into ram but eh

#

but also i have a sponza asset just chillin

main cosmos
#

I have a new idea

#

kick off an async loading job for every single asset at startup

#

then wait on the future when the asset is needed

obsidian wolf
#

yeeeeahhhh

#

i mean i should keep the assets folder relatively organized

#

so its probably fine

obsidian wolf
#

but thats annoying to do

obsidian wolf
#

damn i've just been leakin memory for fun any time i make an emitter

#

payload is not used anywhere 🀑

#

damn, i'm also pretty close to having gameplay

obsidian wolf
#

the main thing stopping this from actually being gameplay is the bugs, but even with them this level is possible

#

if i moved him to one unit closer so that he could actually attack the start of the path, this wins

obsidian wolf
#

i have almost no clue where that one came from though, i guess i was using the emitters to test my timers

obsidian wolf
#

considering doing sound effects...

obsidian wolf
#

the level of sound effects i need was not at all difficult πŸ™‚

#

i now have a button that i can click that plys a sound

cedar rune
cursive chasm
#

Finally someone whose walls you can realistically live in

main cosmos
obsidian wolf
#

thas an old message

severe spruce
#

clep emerging from the mines

obsidian wolf
#

damn

#

having sounds makes things feel so weird

#

especially things not having sound

#

i have realized that i am certainly not a sound guy

#

when i look at things, it is easy for me to say "that looks good" or "that looks bad" and generally knowing how to fix it

#

but when i listen to things, i don't really have that same sense, it's kinda just all "eh?... it's okay i guess?"

#

not that i can't figure it out, just it's interestingly new

jaunty thorn
#

I kinda like it but perhaps because I like the shitty stock sfx in japanese games

obsidian wolf
#

#engine-dev message

#

well

#

turns out i wont care much about sound

#

cause this aint much fun

obsidian wolf
#

3d sound actually makes things sound a lot better

#

also whoopsies i just realized that the hit sound is in the wrong location, too much effort to remake a video though dogekek

obsidian wolf
main cosmos
#

entt::sigh

obsidian wolf
#

it is such a bad name πŸ’€

main cosmos
#

afaik this is basically a message bus

obsidian wolf
#

also using the term "signal" and "signal handler" interchangably

main cosmos
#

there is a "bus", on which signal handlers can be registered and signals can be sent (which the signal handlers receive)

obsidian wolf
#

skypjack does this thing in his entt docs where he brings up other sections of the library as if the user already knows all about them, but his library is a bit of an a la carte

obsidian wolf
#

i.e. is this a subscriber/notifier system or is this something that i haven't seen before

main cosmos
#

the sink is apparently the bus

main cosmos
#

the problem is that there are like 5 ways of referring to this stuff

obsidian wolf
#

yes and there are a shit ton of terms in this section πŸ’€

#

what is the point of the bus then

#

i.e. why not have two objects, the object that is essentially a list of functions, and the functions themselves

main cosmos
#

the "list of functions" is the bus/sink

#

signals seems to accumulate events, hence the collect thingy with the lambda

obsidian wolf
#

If a collector is supplied to the signal when something is published, all the values returned by its listeners are literally collected and used later by the caller. Otherwise, the class works just like a plain signal that emits events from time to time.
the collect thing is optional

obsidian wolf
main cosmos
#

I feel like I'm on the cusp of understanding why I would want a collector

#

oh, is that just deferring the handling of the signal?

obsidian wolf
#

i don't πŸ’€

main cosmos
#

If a collector is supplied to the signal when something is published, all the values returned by its listeners are literally collected and used later by the caller. Otherwise, the class works just like a plain signal that emits events from time to time.

obsidian wolf
#

wait okay so you'd like

#

i forgot that this shit supported returns

#

ok i think this is irrelevant because i never want to return things from signals, that sounds like a hellish mess of spaghetti

#

i do not have the IQ for it

#

i think theoretically you could have a signal in an RPG with a health damage event

main cosmos
#

I only barely comprehend it because I half-implemented my own event bus class at one point

obsidian wolf
#

where you emit the signal, and listeners can say "hey, take less or more damage"

#

and then back in the damage event, after emitting the signal, they collect, resolving how much damage is actually taken

main cosmos
#

interesting

#

wouldn't that rely on the events being processed in a specific order, if the final consumer of the damage event needed to go last

#

i.e., all the damage modifiers should be processed first

#

I wonder how RoR does it bleakekw

obsidian wolf
#

no

#

ROR bad code, do not consult

#

no i think it'd be more like

void damage(Scene* scene, entt::entity victim, float premit_amount) {
  // get stuff
  health.damage_taken_signal.publish(scene, victim, premit_amount);
  float modifier = 0;
  health.damage_taken_signal.collect([&modifier](float value) { modifier += value; });
  health.value -= premit_amount + modifier;
}```
main cosmos
#

oh that's rather shrimple

obsidian wolf
#

i doubt ordering guarantees would be possible, you'd just use different signal handlers for different phases

#

maybe you could collect into a vector then sort it

#

but any sort of dependent ordering might require something a bit more bespoke

main cosmos
#

yeah

#

but you have shown that something along those lines is possibru

obsidian wolf
#
 * A sink is used to connect listeners to signals and to disconnect them.
 * The function type for a listener is the one of the signal to which it
 * belongs.
 *
 * The clear separation between a signal and a sink permits to store the former
 * as private data member without exposing the publish functionality to the
 * users of the class.```
btw it's literally only connecting/disconnecting
obsidian wolf
obsidian wolf
#

i sleep, hopefully tomorrow i get turtles ability working

main cosmos
#

πŸ‡¬πŸ‡³

obsidian wolf
#

even though the visuals need some work

obsidian wolf
#

putting my immediate todo list here for fun

  • update the healthbars
  • add "bench" tiles
  • add dependencies for preloading
  • turn the attachments
obsidian wolf
#

did some tech-debt type stuff and rewrote how my skeleton assets are stored, ~1500KB -> 500KB which is mostly relevant because it's a lot less json parsing

#

wouldn't have done it just for that alone, but skeletons changed a lot during development so they ended up messy

#

example of cleanup 🀠

obsidian wolf
severe spruce
#

clearing the skeletons out of the closet frogapprove

obsidian wolf
#

i think the funky shadows in the bottom left might be from a bug

#

unfortunately i remember the hqx reference being horrendous, and this code is not very readable monkaHmm

obsidian wolf
#

hmmm, not a bug

#

fixable artifact of hqx me thinks, basically the ambiguity in how to resolve a checkerboard favors changing the pixel,

#

shows up in other implementations as well

obsidian wolf
obsidian wolf
#

playable level πŸ™‚

severe spruce
#

amazing stuff!

cursive chasm
#

that's really dope

#

what do you plan on using for the UI?

obsidian wolf
#

not sure yet

#

it might be very hard coded, or i've seen one that i liked

#

it'll probably be the shop, basic UI for currency & stage, and a level select

cursive chasm
#

right yeah you might be able to homebrew it

obsidian wolf
#

i don't have any huge interest in UI programming

#

so it'll be as minimal as possible

cursive chasm
#

who does tbh bleakekw

obsidian wolf
#

nuklear is what i looked at

#

i really only need imgui with skinning

#

so it'll probably be that or just hardcoded

obsidian wolf
# obsidian wolf

the assassin character can't clear the test level because they have to be melee, but can't be tanky enough to just kill everything

#

thinking i might do something like not being targetable after getting hit for a couple seconds

#

everything else i can think of to help them possibly clear the level is basically just a tank in more steps

#

like reducing enemy damage dealt, not very assassin-y

#

these are their abilities for now

obsidian wolf
#

i liked this interface

#

i might try to do something similar this weekend, my entity inspection code is very messy

obsidian wolf
#

entt is fucking weird

#

there is so much strange shit in this library

main cosmos
#

lol

obsidian wolf
#

what is the point

main cosmos
#

new way to loop over an integer range just dropped

obsidian wolf
#

this one is also funny, but at least it claims to be for internal use, so it's ethically ignorable

main cosmos
#

why tf is this in entt

#

I've seen it elsewhere

obsidian wolf
#

entt in jack's own paraphrased words is a library full of things that he uses regularly

#

there are a lot of things that are just better implemented versions of things i've done, so like... fair to him i guess...

#

he also has a tag for enum classes that enables & | ^ operators

#

but not implicit conversion to bool or int

#

which like... i kind of get... but it feels unique to me

#

like this code

        enum class Directions {
            none  = 0,
            left  = 0b1 << 0,
            right = 0b1 << 1,
            up    = 0b1 << 2,
            down  = 0b1 << 3,
            _entt_enum_as_bitmask
        };

        Directions my_dir = Directions::up | Directions::right;
        if (bool(my_dir & Directions::down));
main cosmos
#

what is _entt_enum_as_bitmask

#

like how is it implemented

#

doesn't tell me what that thingy in the enum class is doing though

main cosmos
#

yeah I know what it does

#

how tf is it implemented

obsidian wolf
#

as to how it's implemented, you linked the source

#

that's all i know

#
template<typename Type>
struct enum_as_bitmask<Type, std::void_t<decltype(Type::_entt_enum_as_bitmask)>>: std::is_enum<Type> {};

this does it somehow

#

so usually you need to

template<>
struct entt::enum_as_bitmask<my_flag>
    : std::true_type
{};```
#

and i guess that's automatically implemented with the enum member

tardy sun
#

nm that's what already been linked

obsidian wolf
#

then it uses std::enable_if and checks whether that template has been instanced?

#

i think i vaguely understand it, the exact details i do not though

#

wait lol

#

std::true_type is literally just a type representing true

main cosmos
#

I tried searching the repo for a definition of _entt_enum_as_bitmask and found nothing

main cosmos
#

what is Type::

obsidian wolf
#

are you asking me or the world

main cosmos
#

that line doesn't look like it defines _entt_enum_as_bitmask though

obsidian wolf
#

Type is the enum class

main cosmos
#

ah

obsidian wolf
#

what happens if Type doesnt' have _entt_enum_as_bitmask

main cosmos
#

I see now

#

it's like crtp but not

obsidian wolf
#

well, i originally came into these entt examples thinking that i'd try to do an example for everything

#

but instead i think i'm just going to do examples for stuff that i have a nonzero chance of ever realistically using

main cosmos
#

entt do be a big library

#

I only use like a quarter of it (the entity stuff)

obsidian wolf
#

do you even?

main cosmos
#

no

obsidian wolf
#

i feel like it's really easy to just use the registry

#

like i have no clue what the storage shit is right now, but i know that's a big part of the lib

main cosmos
#

I mean yeah I'm just using the registry stuff since that's all I wanted

obsidian wolf
#

ye, i think that's like 10% now xD

#

45red

#

- my cat

#

WHAT DOES THIS MEAN

#

ok but without despair, what does this actually mean

#
  1. i don't get the point of the "external generator"
#
  1. wtf is a hash value associated with a type
obsidian wolf
# obsidian wolf

OH this is a header to the section i just linked, not a standalone section, ok fair

main cosmos
#
  1. it's useful for generic programming, when you want to identify a type at runtime
obsidian wolf
#

the first portion is, right?

#

oh

#

is the type_index not usable for that?

main cosmos
#

the standard library already has that so yeah idk

obsidian wolf
#

a lot of this

#

feels like it would only be useful to me if you were writing an ECS

#

it wouldn't surprise me if there were other use cases, but none that have ever come to me

#

this is cool though

entt::overloaded func{
    [](int value) { /* ... */ },
    [](char value) { /* ... */ }
};

func(42);
func('c');```
main cosmos
#

I've had one use case for this

#

well, one time where it would have been useful

obsidian wolf
#

ok im about to stop reading this

#

because i am nearing the end of my sanity

#

but i need to know if this is written coherently

#

or if my reading comprehension has just gone out the window

#

i swear to god this documentation in a nutshell is... instead of trying to explain the thing, it's trying to explain the underlying beauty of the thing

#

ok, groups take ownership from the registry's automatic per-type storage and organize multiple components sequentially, so if you iterate over two components frequently, you can make a group for them and get memory coherency

#

you can also do it without ownership, but i don't think it matters much and feels like it should have a different name

obsidian wolf
#

the assassin can now do the first level, but she dies in the process

#

which sounds bad, but actually, the lizards respawn... so is it really?... πŸ™‚

#

correction, they're meant to, i haven't implemented it yet

main cosmos
jaunty thorn
#

skypjack is italian so some of the phrasing is weird sometimes

obsidian wolf
#

#707607952592470058 message
NotLikeThis

#

oh right that's another discord

#

tl;dr, entt processes have a pause/unpause function

#

but processes really aren't meant to be interacted with, you really just add them to the scheduler and then let them run, ex: their create function does not return a reference

#

so i do not understand how you're meant to unpause a process once it's paused

obsidian wolf
#

teehee

#

143 files changed, 804 insertions(+), 8493 deletions(-)

#

(for context i just moved my general code into a submodule so i could use it with a test project i'm making)

obsidian wolf
#

@main cosmos do you have a suggestion on a cmake reference

main cosmos
#

wdym

obsidian wolf
#

i've got

  1. vuk (and the examples)
  2. fwogfood
  3. deccer's template
main cosmos
#

there's also #1026467818943807579

obsidian wolf
#

that i am going to pick one of and copy the bits as i try to understand them

main cosmos
#

ah

#

oh you already said deccer's template frog_dum

#

yeah they're all good options

obsidian wolf
#

kk i will prob yoink fwogofoods then, since it's the most similar in scope

obsidian wolf
#

damn

#

i am not a fan of this

obsidian wolf
#

ok so in the libraries folder... (submodule edition)

  • add_library with sources if there is no cmakelists
  • add_subdirectory if there is a cmakelists
  • target_include_directories for include paths, public if i'm trying to expose it to the main project, private if it's just an internal requirement
  • target_link_libraries for any dependencies of the libraries
#

manually needing to list source files seems like a major flaw of this...

main cosmos
#

you can glob as well but I don't like it

obsidian wolf
#

glob seems very discouraged

severe spruce
#

meh

#

i think its fine

obsidian wolf
#

Note: We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.
πŸ₯΄

severe spruce
#

its the same as forgetting to add the file to the list

obsidian wolf
#

remembering to resave?

#

or remembering to regenerate

severe spruce
#

yes, either

obsidian wolf
#

i don't really mind manually adding, i just would've thought avoiding that a major selling point of any potential build system

main cosmos
#

a good editor can automatically add files to the list btw

obsidian wolf
#

is this the right idea

obsidian wolf
main cosmos
#

note: my cmake knowledge is from copying other projects

obsidian wolf
#

as long as the errors it gives me when i eventually try to run it aren't a never-ending cycle of torment because i wrote a cmakelists file that isn't even close to correct

main cosmos
#

well

obsidian wolf
obsidian wolf
#

does it matter if things are in a subdirectory vs root folder

main cosmos
#

what are "things"?

obsidian wolf
#

like i have

add_subdirectory(libs)
add_subdirectory(src)

target_include_directories(academy_editor PUBLIC libs)
target_include_directories(academy_editor PUBLIC src)```
#

and i kind of want the include directories to be part of the subdirectory

#

actually this is a better example

target_link_libraries(academy_editor PRIVATE entt fmt magic_enum tinygltf vuk glfw imgui lz4 dtoa)
#

i feel like libs should link the libs it handles, and this shouldn't be in the root folder

main cosmos
#

you can put include directories in the root dir

#

everything is w.r.t. the location of the CMakeLists.txt afaik

obsidian wolf
#

the paths?

main cosmos
#

ye

obsidian wolf
#

heres a diff question

#

if i declare a project in the root dir, project a, and add subdirectory b

#

can i do the add executable for a in b

#

or do the commands involving a need to stay in the root dir and i can only e.g. add libraries in subdirectories

main cosmos
#

uh I think when you do add_subdirectory(...), all the targets declared in that subdir become visible after that line

#

but not variables unless they are declared with PARENT_SCOPE or something

obsidian wolf
#

i would hope its like including a file in c, with the exception of the working dir for file paths

main cosmos
#

yeah it's kinda like includes but different bleakekw

obsidian wolf
#

good enough

#

can move on with that info dogekek

halcyon spade
#

https://cppalliance.org/slack/ there is cmake channel that is pretty good

obsidian wolf
#

this stinks

#

i feel like i need a lobotomy

#

ok so if i have

libs
  libs/CMakeLists
src
  src/renderer
    src/renderer/CMakeLists
CMakeLists

i have two options i think?

  1. add the libraries in libs/CMakeLists then in renderer/CMakeLists, i can link to them
  2. i can make an interface library in libs/CMakeLists and in renderer/CMakeLists i can link to that interface
    what seems to not be an option is
  3. interface library in libs/CMakeLists, then link in ./CMakeLists, and expect that to recursively apply to renderer/CMakeLists
#

i.e. if i have a subdirectory that makes a library, i should not expect any libraries to be added from parent directories

obsidian wolf
#

onto runtime errors 😎

#

something i am actually familiar with

obsidian wolf
#

i'm using this project to fuck around with networking whenever i'm feeling numb from gameplay code since i have a lot of that to do

#

it's partially tempted me to properly set up cmake with saurian sorcery, not because it was at all a pleasant experience, just because build times are quicker

obsidian wolf
#

@main cosmos do you have any suggestion/resources for how i set up the server/client executables? just multiple add_executable(s?

main cosmos
#

I cannot stress enough how incomplete this is. The most networkingisms I got was sending strings back and forth between clients

#

but I did bikeshed the architecture a lot with deccer, so it's probably good KEKW

obsidian wolf
#

i'm not gonna reference code at all yet

#

i need to try shit before i understand what i'm trying to solve

main cosmos
#

good idea

#

my code isn't good to copy anyways

#

just some of the ideas may or may not be worth pursuing (like the shared library one)

obsidian wolf
#

mine is already set up like add_executable(academy_editor src/main.cpp) so it should be shrimple

main cosmos
#

what are you making btw

#

I don't want to assume

obsidian wolf
#

🀷

main cosmos
#

I was intentionally making a simple 2D game (Galaga) so I could focus on the networking stuff more

obsidian wolf
#

was thinking about doing something like this

#

p1 gets control over like 3 ducks that they can set the movement direction of, the other shoots them πŸ™‚

obsidian wolf
#

@main cosmos ok sorry one more thing

#

why did you need to fork enet? i'm having problems wit it

main cosmos
#

I forgor

#

I forked a fork of enet btw

obsidian wolf
main cosmos
#

said fork made it header-only iirc and also added ipv6 support and other thingies

#

and my fork fixed some warnings iirc

obsidian wolf
#

think using yours is a bad idea?

main cosmos
#

it's probably a good idea

#

does enet even use cmake? maybe that's another reason that I took a fork

obsidian wolf
#

it has a cmakelists

#

but i'm getting unresolved symbols

#

so i guess i am missing something with it

main cosmos
#

major bababooey moment

#

single header means it's probably impossible to screw up linking

obsidian wolf
#

hmmm

#

i have it running now

#

i wonder if i want to launch executables from an editor

#

especially when running from VS

#

cause like... i think i'd need multiple VS instances open otherwise?

obsidian wolf
#

interestingly

#

if i don't make a window, it shares terminals with the parent process

#

i should probably check how to force terminal creation, because i know msvc has that funkiness with project types

obsidian wolf
#

i will be gone a week, so no game progress

#

i am interested to see what my future self wants to work on 🀠

obsidian wolf
#

i am now a sheep

#

came back and set up cmake for saurian sorcery

obsidian wolf
#

also sittin on 85 fps now on this big scene in debug with the help of martty, still a couple more things to do but past the usable benchmark

#

coincidentally my 100th commit too

cedar rune
#

tbf, if performance is only bad in debug i personally dont worry about it too much

#

unless its completely unacceptable then theres probably something wrong

cedar rune
#

alright yeah thats annoying enough to fix :P

obsidian wolf
#

anything <30 feels really bad for me, and >60 just makes it feel nicer to be in πŸ™‚

obsidian wolf
#

it's probably not just me

#

i notice in the range of 0-20 fps, i don't perceive motion much (this is pretty well known)
but in the range of ~30-60 fps, my spatial perception is worse

#

things feel more 3d as you move a camera around when you go above that

#

which i haven't seen anyone talk about, only that tracking things is easier, which i guess this is a side effect of, but an unexpected one imo

cedar rune
#

this is definitely true yeah

#

30-60 is not comfortable

#

honestly even 60 feels off sometimes

#

depends on the context though

obsidian wolf
#

depends on the movement, unfortunately pivot cameras are very fps reliant

#

yeah

cedar rune
#

exactly yeah

obsidian wolf
#

i despise text editing in VS, and can't use rider with cmake, so i was setting up clion

#

which defaults the toolchain to x86 for some reason, with a drop down to change it

#

oddly, x64 was not in it, but there was an option to search

#

and i tried just typing x64 and pressing enter/apply

#

depsite nothing showing up, that worked?... i did not think there was a chance that would work

#

i don't think i've ever seen a drop down/text bar combo where you can actually enter things in the text bar that aren't in the drop down

cedar rune
#

huh, thats weird. ive never had that issue with clion

#

always worked out of the box for me

obsidian wolf
#

i am not the only one πŸ™‚

obsidian wolf
#

current thought, i am regretting not implementing a project-specific file path type earlier

#

i like type systems for ensuring that data that i'm managing is in a format i expect, which i was running into problems with from converting to cmake

#

since my working directory changed, and that should probably be supported anyways

#

i do things like hashing file paths, which means they always need to be in the same format (delimiters, absolute, no ..'s, etc.), and i always need to use relative paths when referencing assets

#

fixing up all instances of file path usage though is a lot, so it's one of the rare cases where i regret not doing something earlier, rather than just fixing it up when the problems arise

jaunty thorn
#

you mean a VFS? yeah I ❀️ my VFS, one of the first things I did on my project

obsidian wolf
#

a virtual file system i need to do, but that's not specifically what i'm talking about

#

i just have a type that wraps a string, and has constructors for strings/filesystem::paths that force convert it to be a relative path, with forward delimiters, and normalizes .. usages

#

so i can do

FilePath("C:/spellbook/resources/test/my_resource.sbgen")
FilePath("resources/test/my_resource.sbgen")
FilePath("resources\\test/my_resource.sbgen")

and they're all converted to just "resources/test/my_resource.sbgen"

#

it's not important to construct in code (since why would you use absolute paths in code), but in-editor when you are inputting file paths, it is important

obsidian wolf
#

already at 60+ files

main cosmos
#

smallest geryu commit

obsidian wolf
#

this one isn't even me being irresponsible DESPAIR

#

shrimply the consequences of changing what one of the core types of your engine is

obsidian wolf
#

i might become the joker before i finish this

halcyon spade
#

First message link for pinning: #1019758048912359525 message

obsidian wolf
#

it's working again 😩

obsidian wolf
#

thinking about status icons, particularly because i display health with a 3d element

#

theoretically i'd have to make models for the status symbols, which i don't hate, but i haven't ever seen before