#GrubStomper29's Project Thread
3400 messages ยท Page 4 of 4 (latest)
that would not matter at all
unless your resolution algorithm is extremely, extremely fragile
which is a bigger issue
okay
here it is
if (displacement.x > 0.0f)
{
fixX = pos.x + hitbox.max.x - tilePos.x;
return true;
}
else if (displacement.x < 0.0f)
{
fixX = (pos.x + hitbox.min.x - (tilePos.x + 1.0f));
return true;
}
you need to combine your resolution and do it via vector math
generally speaking in a physics engine you find the resolution vector between a pair of contacts and apply them, with the vector being the shortest direction + distance required to move them apart
so you need to do some logic to choose the minimum direction and then calculate the distance from there, then apply that vector
what's sat?
separating axis theorem, you can find tons of info on it if you search, it's pretty much the most popular algorithm/approach for finding intersections between physics objects
the theorem itself just dictates that you can have a specific set of axes upon which you check intersection independently, and two shapes intersect if and only if they intersect when projected onto every axis
and the convenient thing is that the algorithm inherently is set up to give you the framework for finding the minimum axis of penetration, plus it's very simple for AABB vs. AABB like you have
okay
or...
while (pos.y + hitbox.max.y == std::ceil(pos.y + hitbox.max.y))
{
pos.y = std::nextafter(pos.y, std::numeric_limits<float>::min());
}```
we are hacking it
don't be the guy that makes a 2d sidescrolling indie game with bad collision
you have the power...
bad collision code*
you're right
@hushed crescent what about swept, have you heard of that?
it doesn't look too hard
actually the AABB vs AABB (non-swept) section seems to be exactly what you're talking about
glorious richter was right
swept is for doing continuous collision detection, you basically smudge the AABBs along over time so you can catch if they met somewhere between frames
generally only necessary if you have stuff moving very fast, so fast that they might phase past each other in a single frame
right
i think im already seeing some issues like that
not fast enough to phase through but fast enough for the penetration vector to be nonsensical
๐ฅ ๐ฅ๐ฅ
nice, you got built in spoodermain capabilities too
Getting closer
yeah i think i just need to write my own slab method and swept functionality
the functions I'm finding on google arent working out too well
you can probably extend it via convex polygon SAT, I don't know anything about CCD resolution
since a swept AABB is a sort of extended hexagon if you look at it
you can do some fancy minkowski thing to turn it into ray vs aabb
perhaps my linux needs a minecraft world
gp does feel like playing Ludo
im using swept aabb vs aabb to get a more accurate resolution vector
and that's working, im not really teleporting around anymore
but I still get stuck on floors/walls because the resolution vector fails to full push the player out
i imagine its due to float precision again
are you just altering the position?
as opposed to
afaik there's a few ways to go about it, but the most common one I know of (sequential impulse) is just to apply a single frame impulse of velocity
so if you know you have a resolution vector r that encodes a certain direction/magnitude, you can apply an impulse of r / dt to resolve the collision
this works out well for a lot of reasons, particularly because you might have multiple objects you're intersecting at once, and in a physics engine you usually have multiple collision resolution sub-steps in a single frame
so usually your frame looks like
integrate_acceleration();
for (int i = 0; i < substepCount; ++i) {
find_and_resolve_collisions();
integrate_velocity();
}
it's also more temporally stable so if you're still stuck across frames you'll still have impulses applied proportional to how much you're still stuck
2.00001383
yeah there's literally always gonna be floating point error
but if you use sequential impulse it should be more manageable
oh yeah, one more thing you can do if you use sequential impulse is apply Baumgarte stabilization
idk the fancy mathematical rigor behind it, but basically you have 2 error factors: an allowable penetration depth and a damping factor on the impulses
so instead of resolving with a pulse of r / dt, you resolve with (r / dt) * 0.999 or something, and allow 0.0001 units of allowable intersection (or whatever you find via tuning that works for both those factors)
but before you add that, just try simple sequential impulse with r / dt
vel += r / dt? Does that replace all other resolution?
yeah
and of course in intergrate_velocity in the loop above, you just do pos += vel * dt, then reset vel to 0
im probably misunderstanding something because resetting vel to zero seems like vel will become useless
since no velocity would persist across frames
wait...i'm goated
you don't have to reset your velocity, you just have to make sure that you calculate a net velocity for each sub-step and make sure it doesn't run away on you
i think i got it fixed
rn I'm not doing swept and just adding the resolution vector to the player pos
bruh it rained a little and now theres a layer of ice covering all the snow
Dont even start. We had this for week covering the snow and basically everything. The first day when I stepped out of my house I started sliding into incoming traffic 
Once I managed to slide my way into tram stop. I saw a guy sliding 100 metre slope downwards with his ass
We have like a 3 cm permanent layer of ice on every road. It's been going for a month probably. I gave up going outside
I believe Iโve set a world record for the deepest recursive function call: over 17 trillion nested invocations. Itโs literally the most profound thing I've ever done with a computer.
05:06 The stack grows up, not down!
10:52 FUSE
15:41 NULL pointer? No problem!
20:54 Kernel patching
21:22 Far call to 32-bit mode
26:28 Ideas for how to recu...
primary inspiration for my physics engine
Metal Gear Solid is a metroidvania
Provided to YouTube by Universal Music Group
King Kong ยท Jeff Lorber Fusion ยท Jean-Luc Ponty
Hacienda
โ 2013 Heads Up International, a division of Concord Music Group, Inc.
Released on: 2013-01-01
Composer Lyricist: Frank Zappa
Auto-generated by YouTube.
jazz with xylophone and electric fiddle?!
whenever i see the red square jump, i make a :boing.flac: noise
very cool seeing others making progress in their prijects
sometimes the player gets caught on that little corner when going up a left facing slope
it doesn't happen on right facing slopes so I believe this has to do with the order of collision resolution
which is done left to right, bottom to top
production of this game must halt momentarily
I have come across a 39 hour youtube video
nvm, its metal gear and i havent yet played 4 so I'm avoiding spoilers
New Acerola video mentions Cave Story many times ๐
been real busy
i believe the next step is to give our guy a gun
ah only after i fix slope physics
i think theres a lot of value in games that can be played through in one sitting
those vs longer games are like movies vs series, both good for unique reasons
Can you give me some examples? I'd be interested in trying them
Squirrel stapler
ive heard a lot of good stuff about squirrel stapler
ddlc unironically
a long sitting (~5 hr) but still feasible
It's just a bizarre experience that can be had in one or two sittings, it's a perfect example of the kind of thing an indie game can do that a big commercial game can't
There's also that Miziziziz game Wrought Flesh that is similar although it's a bit longer now I think
I'm aiming for ASO to be around 10 hours, so like 3-4 sittings
I think that's a good length
I finished Return of the Obra Dinn in around 3 sittings, that was fun
i hate online classes bro
interpersonality is being replaced and sanity is the tuition
The only online class I took ruined my gpa
I got a 68 in statistics, the rest of my classes are like 80+ lol
they were classes i had to take and the only offerings were online
I only ever took one online class in my day, & it sucked. I can imagine they are more common now
thankfully its not online math, that sounds like the ninth circle
It's OK nobody actually cares about you GPA
It literally never came up once since I graduated
yeah maybe im putting too much effort into these classes
Nobody is gonna ask you what your GPA was. Try hard people just put it on their resume if it was really high
doesnt sound worth maintaining straight As
which ive been doing ever since i got a B in an AP class in freshman high school
time to throw in the towel methinks
Yes lol never take an online math class
well I think I'll have to do online physics over the summer
hopefully itll be using math i already know
somewhat related, I need to write an essay for a college application of which I'm already guaranteed admission
i guess i should still tryhard a little in case the essay is also considered for scholarships
the best thing about taking a break from this is that main.cpp isnt 1000 lines long
so when i do come back I'll actually understand my own code
history class is very hard
Good
I've heard unfortunate stories about humanities classes getting easier because people come into college barely knowing how to read and write lol
So I'm glad to hear they are trying to maintain their standards lol
What kind of history? Any particular specialization? I love history
US History of course
i think ancient to civil war
i don't find the surface level post US civil war stuff interesting
ancient to civil war sounds pretty neat to me
Rhodesian history wasn't offered ๐ฅ
Don't forget the part where ya'll lose the war of 1812 ๐จ๐ฆ๐ฅ
Could take anthropology
One of my favourite courses back in high school was "History of the world: 1453-Present"
A good film is also "History of the world: Part I" 
iirc we also went on some sidequests during the revolution and invaded Canada (failed)
by the way, i still have all those reference pictures of the southern leopard frog
I'll dm them to anyone who wants
i think this is the last remaining slope bug
meaning i can do this
i guess i can determine this order depending on displacement direction but thats a huge hack
i like these little clips of progess a lot
thanks, ill keep spamming them
maybe I record each hit resolution in an array then undo whatever is invalidated by slope physics
i feel an urge to buy a monitor and gpu despite not playing anything demanding in months
maybe a monitor makes sense since mine is small and 60hz
So is mine lol it doesn't bother me
ive heard praise and glory for 120hz
Don't buy a GPU lol, you will never financially recover 
120hz is amazing but you will not be experiencing it unless you are playing older games or have an insane GPU
tax returns baby, immeaserable wealth and fortune unto me
a large monitor makes programming on it a sexy time
i could also convert my pc to sff, but thatd require a new mobo and psu
and likely all new cooling
the worst thing about my current monitor is that it only has 1 hdmi port
i have a shitty samsung neo g7, its a 43", 4k, 144hz with some pseudo hdr
its shitty because its not oled hehe, but large fonts in 4k look neat in the IDE
or even kmscon on lunix when ze puter is booting
satisfactory looks great on it (probably because you do get some hdrisms, and you usually dont really have dark spots in that game)
check rtings.com and or hardware (or now monitor) unboxed on youtube
before that one i had a 32" 1440p monitor that was a nice upgrade already, i would never go below 32" again, ever .... if you have space
ive never seen it in person but its supposedly like once you have it you dont want to go back ๐
i have a 9060 xt, which is kinda midrange, and i can get 120 fps in most things
like half the time in ff7 rebirth if im not in an area with dense foliage, ez 120fps
I assume you are using FSR to do that
oled is probably out of the budget
No the game just has a lot of foliage
Usually get 70-100 fps, dips into 60 sometimes
At 1440p
maybe i live up to my word and start recursionmaxxing
- Detect collision
- Apply resolution
- Repeat 1&2 until no collision is detected
ofc getting stuck inside a block will crash the game
or i try resolving collision starting with tiles closest to the center
I don't understand exactly how, but I think I fixed this
the way I did it at first was accumulate a resolution vector for all regular tiles, but if the player collided with a slope tile, the resolution would immediately apply directly to the position
now its consistent in that slope resolution is added to the accumulation res vector
well I can't complain
if (hit.intersection && (hit.delta.x > 0.0f || hit.delta.y < 0.0f || pos.y < tilePos.y))
{
delta += hit.delta;
return false;
}
else if (hit.intersection && relativePos.y < relativePos.x + hitbox.max.x)
{
if (hit.delta != glm::vec2{ 0.0f, 0.0f })
{
float desiredY = std::min(tilePos.y + std::max(relativePos.x + hitbox.max.x, 0.0f),
tilePos.y + 1.0f);
delta.y += desiredY - pos.y;
}
return false;
}
else
{
return false;
}
this is the resolution code for a left-facing slope tile (i.e., y = x). Read and weep serfs
i should add more comments to my code methinks
unfortunately its not a magic bullet
aaannnd messing with reaper broke sdl3, so now my crap doesnt compile
easy fixz
so the final remaining physics bug is as follows:
collision resolution from slopes is always vertical so theres no horizontal push to prevent this
so the reason this is fixed is a serendipitous else in my code
if (thereWasVerticalCol)
{
vel.y = 0.0f;
}
else if (thereWasHorizcol)
{
vel.x = 0.0f;
}
since the slope is a vertical col, any subsequent horiz col wont reset the horiz vel
so that buggy collision detection still occurs but doesnt do anything perceivable due to this cursed thing
so...recursionmaxxing is still on the table
betteryet, if downwards resolution is applied when theres already upwards, then -displacement.x should be applied to horizontal res
i dont even care about half life. i just see the hope gifs and my day gets a little brighter
Hope is a nice thing to have, the gif is very well done
HL1 > HL2
i disagree, but ^ this ^ a funny response
theyre both cool peices of history but not very good games
gaming got much better in 2004 when fun was imvented
roblox/wow fanboy spotted
yeah well i take it back, i forgot about mgs2
but cavestory, mgs3, and the NDS in 2004
then all the wii stuff in 2006
i finished better call saul season 1, the colors were very vibrant
a few shots gave me that exact vibe lol
this was shot in 2015? i couldve sworn we had lost color tv by that time
Original: Deleted from YouTube
Quark Doge, others "FlexAir" is here: https://www.youtube.com/channel/UCyCIAdr6o-_8P3EsdrV830w
flexair,flexair 5,flex air 5,flex air,flex air 5 reupload,quark doge,quark done flex air 5,flexair 4,quark doge flex air
rediscovery of the century
well driving in this blizzard tonight i became a sailor
i have begun the joys of html and css webdev
you react with the bleakekw but i am having fun
I've just heard things
The only web dev I've done was writing HTML by hand which is quite ok and results in positively based looking sites
Neat
internet archive?...
Lmao
incoming crunch
big annotated bib for english and huge project for history due within 1.5 weeks
mostly my neck
i have a puppy german shepherd i need to watch, so i cant really sit in a small room with my desk
I'm mostly hunched over on a couch with a laptop in my lap
~~He's ~~ She's so cute 
The ear ratio is out of control
I'm all ears
great find https://youtu.be/520wYjCrTvs
Provided to YouTube by Bama Rags Recordings, LLC
Sugar Will (Live at Golden Gate Park, San Francisco, CA, 09.12.04) ยท Dave Matthews Band
Live Trax Vol. 2: Golden Gate Park
โ 2004 Bama Rags Recordings
Released on: 2004-12-19
Main Artist: Dave Matthews Band
Auto-generated by YouTube.
- the guitar riff in the verse is great, and so is the harmonization
- Carlos Santana intro
- conveys an emotion I've never gotten from a song before
Follow @devhumour.ai for daily corporate and tech memes!
#programmingmemes #techmemes #memes #codinghumor #software
12713
i dont like gen ed chemistry class
the stereotypes are true, theres no learning the how or why, just memorizing rules and letters
fortunately there shouldnt be anymore of this or english to complete my degree
i think itll just be compsci, circuitry, physics, and math stuff which should be good fun
That's just how chem is
It's practical
It gets easier
There isn't really any way to derive it from first principles, at some point you're always going to just have to remember the priorities of the periodic table
metric system is pretty dope
i like that when you convert between units, "1" is a pretty solid guess
He's seen the light
it blew my mind to learn cm^3 is a mL
Guess how much 1L of water weighs
if you guessed 0.157 stone, you are right
Which stone
that one
I imagine that's how empirical system was made
The only thing I don't use the metric system for is the temperature of the weather and aircraft altitude
Oh and human weights and heights
Just don't have an intuition for the metric versions of those
i think the school work load will subside a bit so hopefully i can get back to this
i want to do the physics in substeps, maybe 8, so i dont need to rely on my perfect collision res as much
then ill give our little red box a remington 870 or something
scratch does a lot of really weird stuff but ngl i miss /0 returning infinity
i know its not technically correct but i think it makes a lot more sense in practice than return nan
but i suppose we do want to keep c++ consistent with accepted math
I mean also the hardware will generate a NaN so it's best to just what the hardware does
It's not even really a C++ thing
Until c++20 I think the standard allowed floating point math to be entirely implementation defined
But they changed it to follow the IEEE standard
Which in practice is what the hardware does anyway
added substeps and with only 4 the physics is already smooth as butter ๐ฉ
i spoke too soon
i call this the gauntlet
call my physics theoretical the way it guesses where the player should be
i am once again splitting collision across the axises because any viable combined solution i dabbled in, like sequential impulse, is overkill
who in the world need sequential impulse for a metroidvania? anyways, I now solve the slope collision in the vertical half, which is done before the horizontal half
but since horizontal movement, which is done later, contributes to where the player is on the slope, there would be issues where he isn't pushed up enough and you end up with this dreaded issue again
the solution? temporarily apply the horizontal displacement for that frame to calculate how high up the slope to go
pretty much just guessing where the player will be, and it works wonders. The gauntlet is passed flawlessly
the only glaring issue remaining is that slopes can push the player into a block above his head, and im dreaming up a hack to fix it
Dope Rhymes: Lee=Emceeยฒ
Sick Beats: "Caged Bird (Instr.)" by RJD2
I wake up and take a look around me, astounding,
I'm stranded in strange and cavernous surroundings,
Robot built with scientific efficiency, but
Who I am and how I got here is a mystery
To find out, I'ma have to explore,
My adventure started when I walked through the door,
It's ...
reposting, if you want the direct 4ching link just let me know
@hushed crescent the Cave Story Lyrical Walkthrough has inspired me, i will now be attempting to beat the Sacred Grounds with minimal HP
words cannot express the difficulty of this challenge
gun
alright guys
struct Scene
{
Level level = {};
LevelEditor levelEditor = {};
};```
or
```c++
struct Scene
{
Level* level = {};
LevelEditor* levelEditor = {};
};```
well the editor is more of a system so ig that shouldnt be in there
i think direct ownership will make the most sense
so the question now is what does and doesnt belong in the scene struct
i.e. whats part of the scene and whats not
ig the player is part of the scene, so he can go in it
level is, level editor is not since its a system
(level refers to the tiles)
then there will need to be entities and enemies
pretty easy right
Sounds like bikeshed, it doesn't really matter, just pick one and do it
also sooner than later i should give bullet better collision detection
since they move fast, i should give them longer hitboxes or something
ah yeah raycasting!
I forget are you doing this project ECS-style
nah
there arent too many entities to worry about yet anyways
just the player and his bullets
so my scene update looks like this ```c++
void Scene::update(float deltaTime, std::unordered_map<SDL_Keycode, bool> keyStates,
bool updatePlayer)
{
if (updatePlayer)
{
player.update(deltaTime, keyStates, level, bullets);
}
updateBullets(deltaTime);
camera.pos += (player.pos - camera.pos) / 100.0f;
}
eventually player update will include stuff like walking thru doors, dying, etc that will necessitate scene change
so at the very least, some way for the player update to send data back to the scene. ig thats more feedback than events
ill probably just return something like vector<Event> from Whatever::update()
anyways heres entities
i gotta give them guns too
I don't think scene changes and stuff necessarily need events
Personally I think I'd just set a flag in the game state that a global game system then reads at the end
oh yeah flags
maybe i keep those flags in a 64 bit enum and return state changes from a function
sfx? maybe i just let anything anywhere make a sound effect
demon synthesize me some sounds man
I would just fill your struct full of bools
Don't worry about packing them unless you need them to be sent over the network or something
You can find free sfx I can try to help you make some later
I shed a tear for each of those 7 of 8 wasted bits...
sometimes your RAM needs rest, thats what bools are for
anyways i have the little guys physics
@keen forge youll love this one
im hundreds of attempts in, most of them end like this
i did not enjoy inception
if you take away the novelty of shared dreams, its just a bad action movie
there were also no moments of silence, there was some royalty free esque orchestra track playing throughout the entire movie
this is the same guy that made inception? wow
Rip
clangd broke and all my code has the red underline ๐
that usually fixes itself when you restart the ide
i have clangd crash more than once today too for some reason
Anyone dabbled with sdl's text rendering? Is it any good?
i have not, or not that i remember
I use an atlas of msdfs
its always a great pleasure when an NVidia driver update on linux REDUCES the opengl version
i dont really play demanding games anymore so im considering yeeting my 3050 in favor of some cheap amd card
especially if it will let me use wayland and hdr
AMD is pretty good on linux
But I can use wayland on Nvidia it works great
As for HDR...
I wouldn't count on it lol
darn
psa
do not update to nvidia driver 595
it, at least on my system, did not include 32 bit drivers
stay on 580
What are you using that is 32 bit?
Unless you mean windows
But i thought you were on linux
steam seems to want a 32 bit driver
