#GrubStomper29's Project Thread

1 messages ยท Page 3 of 1

prisma otter
#

find a game you like and almost copy it

worldly acorn
#

Cave story

prisma otter
#

True he does bring that one up every 5 seconds KEKW

raven halo
#

Cave Story

#

maybe i should have a playthru to refresh my mind

#

i never did complete the no health upgrade run

#

probably because the latter half of the game becomes a one-shot bullet hell without health upgrades

raven halo
#

i got to the final phase of the final boss though

raven halo
#

GrubStomper29's Project Thread

#

so we dont have to continuously hop threads

prisma otter
#

Cave Story clone then?

#

Obviously with your own story & style

#

Will you use OpenGL? The best API as always

raven halo
#

actually considering sdl

#

is not also good for 2d?

#

if not, then gl

hushed crescent
#

with 2D it's hard to go wrong, just use what you like/what seems interesting to you

raven halo
#

i thought sdl gpu was meant to be sort of like a simpler vulkan clone

hushed crescent
#

idk if that'd necessarily be wrong

raven halo
#

but probably wrong for my use case

#

I was more referring to the more basic sdl 2d functionality

hushed crescent
#

oh, I don't know what they have

raven halo
#

but since I'm most familiar with gl, i'll probably use that

hushed crescent
#

do they have a library for GDI/canvas esque 2D painting

raven halo
#

interesting

hushed crescent
#

no I'm asking, I don't know

#

that might be something you want for 2D potentially

raven halo
#

idk

#

actually i wouldnt mind trying out some digital painting program to see if i can make "hand painted" backgrounds

hushed crescent
#

do you have an idea for what kind of 2D you're going for

#

what you might need

raven halo
#

probably sidescrolling if thats what youre asking

#

so id likely be starting out with a tile engine

hushed crescent
#

I mean like pixel art, live2D/spine, baked renders, some other thing

raven halo
#

no clue there

#

for characters, maybe hand drawn

hushed crescent
#

that would motivate your rendering stack more than anything

raven halo
#

i have an artstyle, see my pfp

#

check the hand on that last one, unironically good

prisma otter
#

Is it all gonna be monochrome?

raven halo
#

no idea

prisma otter
#

I mean thats probably something to think about before you start

#

since if you need to colour in these drawings its gonna change everything

hushed crescent
#

greyscale can look really good

#

tho it seems you mainly draw with pencil so you're gonna have issues with contrast and touching up your scans

worldly acorn
#

Pencil line drawing and then overpaint/watercolor in krita

raven halo
#

pencil draw, light, capture with 12mm film

prisma otter
#

12mm film? do you mean 16mm?

raven halo
#

probably

#

idk anything about that stuff

prisma otter
#

12mm doesn't exist to my knowledge

#

the is 8mm, 16mm, 35mm or 70mm

#

It would have looked better if the lighting was more even

#

do you have a flatbed scanner?

raven halo
raven halo
prisma otter
#

Basically just adjusting contrast in gimp and cleaning up some lines

#

Also trying to compensate for the perspective

raven halo
#

dmb's crash might be about the 5 stages of grief

#

more on this theory later

prisma otter
#

Ok so cave story clone with soundtrack by DMB

raven halo
raven halo
#

just a meme but also I think its a pretty nicely designed boss fight

#

pretty fun when I made it 4 years ago

#

heres a comment someone left on the original

raven halo
#

big things are brewing

raven halo
#

does anyone have any experience with geany?

winged ruin
#

please dont

raven halo
#

well

winged ruin
#

just use vscode or clion

raven halo
#

vscode is a no

winged ruin
#

how is it a no?

raven halo
#

its ms

winged ruin
#

vscodium then

raven halo
#

i dont wanna download it bc i dont agree with the download page's privacy policy

winged ruin
#

you can use zed

raven halo
#

I'll give that a look

#

but yeah, whats wrong with geany?

winged ruin
#

geany or qt creator is brain damage. Its just bad

#

you dont have many options if you dont want vs, vscode. Only clion, vscodium, zed, neovim, emacs are left

raven halo
#

alright

#

youd think out of all the foss out there, one of them would be a decent code editor

winged ruin
#

brain damage

hushed crescent
#

devcpp

raven halo
#

isnt that also brain damage

dry basalt
#

kdevelop is not brain damage if you use c++ and cmake

raven halo
#

-- SDL_OPENGL (Wanted: on): OFF

#

hmm

#

alright i deleted all the cmake stuff then restarted and that's fixed

#

Could not create GL context: GLXBadFBConfig

#

oh

#

only gl 4.5 on linux? what?

#

alright so i updated my graphics driver to the recommended and now my keyboard and wifi dont work

#

lsusb shows both keyboard and dongle, so what gives?

#

fortunately i had a system restore point

#

@prisma otter make sure you set these up to restore very often

#

yeah for some reason, installing the nvidia driver reliably breaks my keyboard and wifi

#

wack

dry basalt
raven halo
#

alright i got the driver updated successfully

#

but I still only have gl 4.5 compatibility

#

maybe that's why ASO wouldn't work? Do you require a core profile? @prisma otter

prisma otter
#

I do ask for core

#

Dunno why your driver is so borked

raven halo
#

I think I figured it out?

#

Despite all my installs, the reported driver is some mesa device

#

so I used driver auto update via the terminal and now I have the proper nvidia driver with gl 4.6

#

ill check if aso works

raven halo
raven halo
#

hellotriangle time

#

looking at debug vs release builds with cmake and if I understand correctly, cmake handles that automatically right?

#

the end user will just specify debug or release when calling the cmake command

prisma otter
dry basalt
#

And the different types of builds it offers, ex. Optimizing code size (minsizerel)

#

Or release with debug info (relwithdebinfo)

#

You can define custom ones but those should cover most scenarios

raven halo
#

ig since I'm using cmake's fetch content for the larger libraries i dont need to include their licenses since I'm not really distributing their code?

#

gpt says otherwise and brings up the fair point that the build process still requires downloading those libraries

#

wouldnt hurt to include the licenses then

dry basalt
prisma otter
#

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

#

That's what MIT says

raven halo
#

which means i should probably go and tweak Green Hour lol

dry basalt
#

If your pulling down mit libraries at compile time/you dont distribute them it's fine to leave it out

#

Like cmake fetchcontent will have the person who clones the repo get the code, you aren't distributing it

#

So if it's MIT licensed, you dont need to distribute the mit license

#

But if you distribute binaries, your distributing that code that was pulled from cmake fetch content now and you have the include the mit license

#

Idk what licenses your dependencies have, I typically stick to mit licensed stuff so thats just what I know

hushed crescent
#

if/when you ever distribute something you can probably just write a little cmake routine to grab and concat all the license files and dump them in your binary

#

or alternatively just point to the license in the github repo in some links thing somewhere

raven halo
#

the readme maybe?

raven halo
#

yk i had a weird dream

#

4 "people" like 9 feet tall killed some people, took their guns, and occupied some warehouse esque building

#

and the local townspeople found out and tried killing them but couldnt win the ensuing battle

#

and more and more people joined the mob eventually comprising of 2.2 million armed citizens trying to kill the 4 hyperboreans or wtv they were

#

1.2 million of those were killed in the battle and 4 didnt lose a single one

worldly acorn
#

Agartha: the last stand lmao

raven halo
#

demongod been watching insta reels

#

Merry Christmas

raven halo
#

@prisma otter

#

look at what i got

#

+a huge arduino kit

prisma otter
worldly acorn
raven halo
# prisma otter Nice kalimba

Obviously I could use it to record or compose quick stuff but I wonder what the point of the instrument is besides novelty

#

imo it sounds the same as a xylophone but cant play sharps or flats without specific tuning

#

ig it is very portable

worldly acorn
#

I'm sure there's some genre of music that it's made to play specifically

raven halo
#

yeah its called Cmaj KEKW

#

not complaining tho, handheld xylohpone is still dope

worldly acorn
#

It probably has limited utility overall but it might be good for a little game soundtrack or something here or there

raven halo
#

absolutely

raven halo
#

I'm still a little peeved at that driver error

#

updating a graphics driver from the gui should not have different results from updating from terminal

raven halo
#

wow make sure to enable LDAC if you can

raven halo
#

I have obtained the Crash flacs

#

BTCS is next

raven halo
#

well I just beat cave story with no health upgrades

#

that puts me in the top 1% of players

#

pretty cool

#

theres some extra really hard stuff I can do without the health upgrades that would put me in the top 0.02% that i might get started on shortly

#

hopefully i wont go insane trying to do it

prisma otter
raven halo
#

i gotta make a tile engine

#

ig I'm start with the easiest tileset texture: one tile

#

how about this lol

#

nah lets avoid copyright infringement

raven halo
#

@prisma otter are you aware of flams

prisma otter
#

Like on a drum?

raven halo
#

yeah

prisma otter
#

what about them

raven halo
#

just if you were aware

#

they're useful

worldly acorn
#

I forget what they even are lol, two nearly simultaneous hits?

#

I haven't done rudiments since I first started learning drums

raven halo
#

thats like the first one lol surely you used it enough to remember the name

worldly acorn
#

Not really the single paradiddle is like the quintessential warm up rudiment

#

Flams aren't all that frequently used ime

#

I guess maybe in concert band they were used a bit

#

Not in my set playing though

raven halo
#

interesting

worldly acorn
#

But I haven't really done that structured stuff in ages I just pick up the sticks and play

raven halo
#

i hear it a lot in set playing

worldly acorn
#

maybe in the kind of music you listen to more

raven halo
#

perhaps

#

litterally the first thing you hear in the BTCS album is a snare rimshot lol

#

but Im certain i could find other tracks in other genres

#

there a bunch in aqualung

#

which is british prog rock lol

#

one in the first 30 sec of Any Colour You Like by Pink Floyd

#

There's one near 0:59 of Chop Suey by System Of A Down

#

(idk why they capitalize Of A)

raven halo
#

oh i guess i should remove my vulkan role

#

It's nice to be back

prisma otter
raven halo
#

in 10 years all our gl code will probably have to run on a vulkan translation layer

raven halo
#

alright the

[save all]
make
../2D_Game

is getting old

#

vscode really needs a save all button or shortcut

#

and maybe i can streamlike the build and run with an extension or script

worldly acorn
#

You can script the make/run part

#

Idk about the saving

#

I use vim so I sort of always have files saved

prisma otter
winged ruin
#

it will make your life easier

raven halo
#

dont wanna jinx it but this is the first in a long time where ive coded a lot today and still want to do more

worldly acorn
#

What are you working on again

prisma otter
worldly acorn
#

Unironically can't tell if joking or not but cool if so lol

raven halo
#

not a clone and idk how the music will be

#

but a 2d game

#

making a tile engine right now

prisma otter
#

Will it be a metroidvania though?

raven halo
#

itll be what i make of it

#

bc i honestly dont know what metroidvania really means lol

worldly acorn
#

It basically means you have a game progression that consists of a process of exploration by which you unlock a sequence of tools or weapons that give you access to later parts of the game

#

Like in Metroid Prime you're running around and there might be some hole in the wall that you can't fit through, but eventually you find the morph ball upgrade and suddenly have the ability to bypass a barrier to the next area

#

In a basically open world

prisma otter
#

I would say interconnected rather than open but yeah

worldly acorn
#

Open in the sense that you roam it freely not in being like a big open flat terrain

raven halo
#

yeah that sounds vaguely along the lines of what im thinking

prisma otter
#

Well you need the upgrades to access large portions of the map so it's not really open is what I mean

worldly acorn
#

Ah I see

#

Yeah I guess so

prisma otter
#

Castlevania sotn my beloved is another great example

raven halo
#

I'm thinking a bit far ahead, in terms of story maybe a city like Austin is completely quarantined due to a lethal airborne disease and you're sent in with some cbrn guys to investigate that

#

because otherwise the gov will napalm and raze the city

worldly acorn
#

Tangential but every gamedev should play Metroid Prime at least once in their life

#

Masterpiece

raven halo
#

Thanks, a valid excuse to buy a gamecube

#

nvm my wii can play gc games ๐Ÿ˜ž

worldly acorn
#

You'd want to do it with a gc controller though

raven halo
worldly acorn
#

Lmao

#

Maybe you noticed this since you're younger but I remember going back and watching that music video in like 2016 and being blown away to see that some of the gangsters are Key & Peele

#

I first saw the video in like 2008 or something before they were famous

raven halo
#

Yeah LOL

#

i havent seen the video in a long long time and rewatched it today and thought "hey its that comedian"

worldly acorn
#

And then another weird thing I didn't notice until years later was that one of the guys in the original riding dirty music video also plays the president in The Fifth Element

raven halo
#

Happy new year guys

raven halo
raven halo
#

I wish there was a way to publish my stuff without AI training on it while still being FOSS for humans

#

maybe I can append something to MIT license or something

prisma otter
#

They blatantly violate copyright all over the place

raven halo
#

yeah I'm cooked either way

#

the real solution is to not upload to github but im too lazy for that

#

to the public domain it is

worldly acorn
#

If it's a private repo they claim to not train on it I think

#

Whether or not that's true is another matter

prisma otter
#

It's only for open source though

#

otherwise I would be using it

#

ASO is hosted on sourcehut

#

which is not free, but extremely cheap

raven halo
raven halo
#

dont I need a separate license for media/data files? gnu seems to only cover source code

prisma otter
#

GPL is a bit of a sticky licence I'm not sure I would use it

#

But it is your code its up to you

raven halo
#

forcing derivatives to also use gpl? I'm fine with that

prisma otter
#

Also things that link with it

#

but I suppose you aren't making a lib

#

so that part doesn't matter

raven halo
#

Actually, you have a point Jake

#

my own derivatives might be required to be gpl3

prisma otter
#

You can tack stuff on to the MIT or BSD if you want

#

all of these licences are legally tenous anyways

raven halo
#

yeah i think mit was what i mostly used previously

#

that still leaves the media question

#

i probably have to include a separate license file for that like cc

prisma otter
#

Creative commons is probably what you want yea

worldly acorn
#

CC-BY-SA if you don't mind people using them

prisma otter
worldly acorn
#

Also technically not consumable by AI

#

But I'm sure they would anyways

prisma otter
#

Yeah they don't care if they break the law

worldly acorn
#

It's the BY part specifically since the models are unable to perform attribution

#

So unless it were ruled that listing every single author whose work ended up in the corpus in one big blob of attribution were legal, it's probably not

#

But nothing will happen

prisma otter
#

Oh its definetly illegal

raven halo
#

shhhh i dont like mods in my thread

#

critters

worldly acorn
#

Lmao sorry

raven halo
#

youre good lol

#

kinda weird that im bound by the licenses of my own work even though i own the ip

worldly acorn
#

I'm not sure that you are

#

If you own the original copy in private on your computer, all rights are reserved

prisma otter
#

Yeah I think people change licences pretty frequently

#

SDL used to be GPL iirc

worldly acorn
#

You can release a new version with whatever license you want since it's your own property

raven halo
#

okay

worldly acorn
#

It's only the end user whose rights are granted by the license who is subject to it afaik

#

But I'm not a lawyer

#

So idk what I'm talking about

raven halo
#

cc by sa looks good

prisma otter
#

Are you going to try codeberg?

raven halo
#

i think I'll look into it

raven halo
#

btw @prisma otter ive been very happy with bluetooth audio over the LDAC codec

#

I'm using technics az80 and imo it sounds as good as or better than sennheiser hd 280 pros

#

oh the buds are twice the price that makes sense

#

still its a shame apple doesnt seem to support ldac. I'm very fortunate to have an android

prisma otter
#

I'll stick with my wired headphones

#

I don't trust bluetooth

raven halo
#

wired headphones in the gym?

#

or what if you get in a swordfight? itll be a liability

worldly acorn
#

I just don't listen to music in the gym personally

#

I leave my phone in a locker so I don't get distracted

raven halo
#

doing that is awesome especially in a home gym

worldly acorn
#

When I work out at home I get endlessly distracted by my phone lol

raven halo
#

but i just ripped these CDs and got these earbuds so i gotta put em to work lol

hushed crescent
#

not full headphones tho

prisma otter
#

Yeah I don't listen to music outside of my house most of the time

#

I prefer to be able to hear things when I'm outside

hushed crescent
#

more and more these days I just wear earbuds while working out so people don't talk to me

#

not always in the mood for music

raven halo
#

sometimes i do it because im doing some chore while my parents are watching tv

#

if I'm going to hear something distracting, id like it to be on my own terms

hushed crescent
#

yeah vacuuming is also a great time to listen to music

#

having a loudness war with your vacuum is probably not great for your ears but whatever

raven halo
#

noise canceling baby

#

I'll have to test these buds for lawnmowing and potentially buy foam tips for that

raven halo
#

I'm having trouble with reading files in binary

#

the file is .bin and in hex reads 00 00 00 05

worldly acorn
#

Are you explicitly opening them in binary mode

raven halo
#

yes

worldly acorn
#

Hm

raven halo
#

i use fstream::read((char*)&uint32Var, 4);

#

and i get some nonsense like 50000

#

which i believe is a result of the data being read/interpeted with some offset i never asked for

worldly acorn
#

Endianness issue mayhaps

raven halo
#

so should i try 50 00 00 00

worldly acorn
#

Yes that would be the number 0x50

raven halo
#

now it reads 80

#

before, it read 83886080

#

when it's 00 00 00 00, it reads correctly as zero

#

when its FF FF FF FF it reads 4294967295

#

which seems correct

#

so I'm thinking the bytes are reversed but not the byte order

#

which is weird. how do i make it not do that

#

so 01 00 00 00 appears as 1

#

oh well I think I can work with it

#

alright guys here's what I have so far

#

I drew the tile in gimp. The tiles are rendered stupidly but it works for now. The level is stored in a .bin file and ghex is my level editor

#

now to add a guy who can move, then i think I'll work on engine structure

worldly acorn
raven halo
#

yeah i got that fixed

#

this has been fun so far

raven halo
#

man i forgot about this track

#

this is the band that invented death jazz

raven halo
#

I just realized my entire rendering code was inside the SDL_PollEvent() loop bleaker_kekw

raven halo
#

alright guys we have collisions now

prisma otter
#

Just need some gravity now froge_love

raven halo
#

i wonder how tile positions should work

#

imo it makes the most sense for a tile's origin to be its center and not one of its corners

#

idk about the player though, I'm torn between his center or at his feet

prisma otter
#

I did this when I was doing 2D as well

#

so like between their feet

#

it is up to you however

worldly acorn
#

Just try it one way and decide

#

Placing tile origins at the center is going to make for a lot of ยฑh/2 factors in your codebase

raven halo
prisma otter
#

Either way will make some calculation simpler but others more complicated

#

So just do whatever seems most intuitive

raven halo
#

anyways yeah, but for some reason if its a corner i always spend a while looking at a coordinate and wondering "is it this tile or that tile?"

#

so I'll go with center for now

#

and for entities, bottom center

raven halo
worldly acorn
#

Personally I would just standardize on the origins being the bottom left corner of the tile but up to you

#

Because then the fractional part of the position like 3.2 also tells you that you're 0.2 of the way across the tile which has useful implications

#

You can just fract/floor/ceil your way back and forth between coordinates and stuff

raven halo
#

yeah

#

i think the pixel art will be temporary

#

i do wanna explore other means

raven halo
raven halo
#

time for engine structure

raven halo
#

i should probably implement a garbage collector or deletion queue a la vkguide

#

im too lazy for RAII and i always forget to manually delete gl objects

#

well, I probably wont need to manually keep track of that much stuff since most things should hopefully be an unordererd_map

prisma otter
#

Its good for laziness

#

it cleans things up almost automagically

#

without the need of GC

worldly acorn
#

I don't delete anything lol

prisma otter
#

I don't call delete either froge_love , I use RAII instead

worldly acorn
#

I just don't really consciously delete resources lol I do have some RAII for some things but I generally just load everything I need at startup and it stays loaded until the program dies

prisma otter
#

Yeah problem is when the program dies you have no idea what order things get cleaned up in which can be a problem

#

Also you may find that you need to load and unload things in the middle of the program, which is what I realized when I implemented save files

worldly acorn
#

I have an explicit order for my systems I just don't really pay attention to the graphics resources much

#

Yeah for sure if I needed that I'd need to

prisma otter
#

No save files in SRS I take it?

worldly acorn
#

No ofc not

prisma otter
#

lol

worldly acorn
#

But even if I did I think the resources would be the same regardless

#

The save file would be scene content

#

I just load everything rn

prisma otter
#

I guess you don't have alot of highres textures KEKW

#

so it works

worldly acorn
#

It's all terrain which needs to be loaded regardless

#

My terrain and foliage data is multiple gigabytes when loaded so 100MB of textures is basically irrelevant

#

My cooked Jolt terrain collider cache is nearly a GB on its own

prisma otter
#

Why did you design this monstrosity KEKW

worldly acorn
#

Mental illness

prisma otter
#

the terrain data in ASO is < 100 MB

mystic kettle
worldly acorn
#

The foliage data doesn't exist on disc but once the instances are placed it adds up in vram

prisma otter
mystic kettle
#

Of course, but surely it's not couple gigs

worldly acorn
#

No that's everything in total

mystic kettle
#

Ah

worldly acorn
#

Foliage data is probably a couple hundred MB but it all adds up

raven halo
worldly acorn
#

Why would I delete anything, I loaded it for a reason

raven halo
#

do you leave it to the os garbage collector?

worldly acorn
#

When the process dies the graphics context and all resources die with it

raven halo
#

intresting

worldly acorn
#

I have shutdown routines for most of my systems and some of them probably do clean up graphics resources explicitly or implicitly idk I just never really thought carefully about it

raven halo
#

fair point lol

prisma otter
worldly acorn
#

So far lol

#

I haven't had more than one map at a time since I switched to the new terrain system

#

Since making terrains is a bit laborious

#

But in principle it wouldn't be hard to do since all systems just start up and shut down with a function call so in principle I could destroy most of the game and rebuild it without restarting the program

#

I'm sure it wouldn't work out of the box but wouldn't take more than a few hours to get working I'm sure

#

There's always some gotchas in that stuff, like there's a big difference between making your system parameters work for everything you'd generally enter manually, vs be robust enough that you can plumb it into an imgui menu and arbitrarily twiddle the values and create/destroy stuff and have it work seamlessly

raven halo
#

alright so this is what I have in my readme

#
License
This project's source code is distributed under the terms of the MIT license. The licenses for this project's various included libraries can be found in the third_party folder. This project's data and media files, which can be found in the assets folder, are distributed under the terms of the CC BY 4.0 license.
#

i chose a weird thing to bikeshed

raven halo
#

alright so

#

i have a cpp file that corresponds to a .hpp file

#

and it sorta goes like

namespace Graphics
{
  aBunchOfHelperFunctions();
  //...
  implementationsOfHeaderFunctions();
}
#

im not terribly thrilled with that, it's a little messy imo. I'm thinking of having a helper cpp and hpp file for all the helper functions. What do yall think?

prisma otter
#

get your boi jumping

#

you can refactor it later

raven halo
#

alright

#

something i dont like about linux is how involved it is to install an app

#

if sudo apt-get install doesnt work you gotta download it, stick everything in the right dir, setup a .desktop file, and in a lot of cases, extract the icon file

#

ig thats more the distro's fault

prisma otter
#

Its the fact that on linux binaries are not neccesarily compatible across distros

#

so it makes it impossible to provide a package that works across distros

#

Well not impossible, since valve figured out a way to handle it

#

Also the situation on arch is a bit better since alot of things are available on AUR

#

I use arch btw

raven halo
#

i still am not 100% sure of the correct place to put .appimages

#

i keep mine in ~/.local/bin

dry basalt
prisma otter
#

Yeah I'm aware

dry basalt
#

ok seems like its just a sandboxed ubuntu lts

#

interesting

worldly acorn
#

Why do you need to define functions in the header

#

Oh this is the cpp

#

Nah just do it like that

#

I recommend changing your IDE formatting to not indent the content of namespaces

#

Most everything will be in a namespace which results in basically wasting the entire first indent worth of columns on the screen

raven halo
#

THE DRUMS ARE ANIMATED ACCURATELY TOO ๐Ÿ’€ @worldly acorn

worldly acorn
#

Lmao

#

A little mechanical looking but definitely accurate

raven halo
#

i think i should make a level editor next

#

which means i probably need imgui

prisma otter
raven halo
#

wordington

raven halo
#

level saving works

#

though it feels like im doing some incredibly dangerous stuff here ```c++
std::ofstream oStream{ fileName, std::ios_base::binary };
oStream.seekp(0);

std::filesystem::resize_file(fileName, fileSize);

raven halo
#

alright im switching to copy initialization for basic types

#

and should probably do the same for all types really

raven halo
#

i am not casting from unsigned long to unsigned int bruh

raven halo
#

boy do i hate cmake

#

"Let's make a build generator. Give it the worst syntax possible, make it useless, and ensure it has no mildly popular competitors."

raven halo
#

beginning to write the level editor

#

anyways glad.c is so large that github thinks my project is primarily written in C

prisma otter
worldly acorn
mystic kettle
#

There are also git submodules if you don't like fetchcontent

hushed crescent
#

I think deccer has a sample on how to do it, I remember it being surprisingly annoying because only one branch of glad had convenient cmake integration

raven halo
#

absolutely not

#

i wanna stay away from cmake for the time being

worldly acorn
#
# GLAD Configuration
FetchContent_Declare(
    glad
    GIT_REPOSITORY https://github.com/Dav1dde/glad.git
    GIT_SHALLOW TRUE
    GIT_PROGRESS TRUE
)

MESSAGE(STATUS "Fetching glad...")
SET(GLAD_PROFILE "core" CACHE STRING "OpenGL Profile")
SET(GLAD_API "gl=4.6" CACHE STRING "API Version")
SET(GLAD_GENERATOR "c" CACHE STRING "API Binding Language")
FetchContent_MakeAvailable(glad)
#

and then just target_link_libraries(project PRIVATE glad)

prisma otter
#

Also CPM (cmake package manager) is worth looking into

hushed crescent
#

I need to give it a quick look over but I'm pretty confident submodules and/or fetchcontent can give you everything you need

#

they've made good strides

keen forge
# worldly acorn ```cmake # GLAD Configuration FetchContent_Declare( glad GIT_REPOSITORY ...
CPMAddPackage(
    NAME            glad
    GIT_REPOSITORY  https://github.com/Dav1dde/glad
    GIT_TAG         v2.0.6
    GIT_SHALLOW     TRUE
    GIT_PROGRESS    TRUE
    SYSTEM          TRUE
)
if(glad_ADDED)
    add_subdirectory("${glad_SOURCE_DIR}/cmake" glad_cmake SYSTEM)
    glad_add_library(glad STATIC REPRODUCIBLE EXCLUDE_FROM_ALL LOADER API gl:core=4.6)
endif()

or

FetchContent_Declare(
    glad
    GIT_REPOSITORY https://github.com/Dav1dde/glad.git
    GIT_SHALLOW TRUE
    GIT_PROGRESS TRUE
)

MESSAGE(STATUS "Fetching glad...")
SET(GLAD_PROFILE "core" CACHE STRING "OpenGL Profile")
SET(GLAD_API "gl=4.6" CACHE STRING "API Version")
SET(GLAD_GENERATOR "c" CACHE STRING "API Binding Language")
FetchContent_MakeAvailable(glad)
add_subdirectory("${glad_SOURCE_DIR}/cmake" glad_cmake SYSTEM)
glad_add_library(glad STATIC REPRODUCIBLE EXCLUDE_FROM_ALL LOADER API gl:core=4.6)
raven halo
#

i should probably test a windows build soon

raven halo
#

i wish dear imgui had some better documentation

keen forge
mystic kettle
keen forge
#

indeed

#

RmlUi too

raven halo
#

I change my mind, im going with the tile's origin being its bottom left corner

#

here it is so far

dull osprey
#

noice

prisma otter
prisma otter
# raven halo

Honestly I can't wait to see some of your drawings in there now

raven halo
raven halo
#

Also in commemoration of Green Hour, i wanna name this game's engine after it

#

Green Hour Engine/GHX

#

the game itself is still, naturally, untitled

dull osprey
#

what is green hour?

raven halo
#

originally what this thread was for, a 3d game i lost interest in making because i dont like 3d modeling

raven halo
#

how do yall separate your level editor from production builds?

#

do you just leave it in hidden?

#

I'm considering making mine debug only and gone from release builds

prisma otter
#

I figured I would leave it in release builds in case people wanted to mess with it

#

No reason to remove it

worldly acorn
prisma otter
#

Also you may want to be using the editor in release mode, for performance reasons

#

Nothing more annoying than a slow editor

worldly acorn
#

If you're a mad scientist you can probably set your build up to compile core engine systems in release mode while leaving gameplay code in debug mode for development

raven halo
prisma otter
#

Up to you but that doesn't seem worth it to me

#

Just leave it in with a command line switch or something

raven halo
#

sure

raven halo
#

man I cannot get imgui menus to work

#
if (ImGui::BeginMenuBar())
        {
            if (ImGui::BeginMenu("File"))
            {
                if (ImGui::MenuItem("Open..."))
                {
                    std::cout << "0";
                }
                ImGui::Separator();
                ImGui::MenuItem("Save");
                ImGui::MenuItem("Save as...");
                ImGui::EndMenu();
            }
            ImGui::EndMenuBar();
        }
#

afaik something should be happening when I press that menu item but nothing is

#

actually it seems to print all the 0s when the program closes ๐Ÿค”

dull osprey
#

do you need to flush

#

is that actually stdout

#

try a new line

#

are you using SDL?

#

it has SDL_Log

raven halo
#

well ive also tried using imgui functonality in that if statement and nothing seems to happen

prisma otter
#

put a breakpoint in there and see if it gets hit

raven halo
#

breakpoint? ha ha

dull osprey
#

how are you opening windows?

raven halo
dull osprey
#

I don't know how to say that any different :/

#

on win32 you can use WinMain, with SDLyou create a window, you know

raven halo
#

I use ImGui::Begin()

dull osprey
#

no I don't mean imgui

#

I mean the application window

raven halo
#

ah yeah I use sdl

dull osprey
#

oh ok

#

so SDL_TriggerBreakPoint();

#

SDL_Log();

#

you get those

#

are you using SDL3?

raven halo
#

yeah

dull osprey
#

great

#

they handle all this stuff for you

raven halo
dull osprey
#

you don't have gdb?

#

maybe lldb?

#

sudo apt-get build-essentials or whatever that is for your distro will get you all that stuff

raven halo
#

gotta figure out how to use it

#

all this so I can show an imgui menu

raven halo
#

ah it appears the popup id is popped out of the stack along with the menu

#

I'll need an explicit id

prisma otter
raven halo
#

not having bugs

#

i should probably pimp my gui code out into functions before I spaghettiefy the editor

#

how cursed is using std::optional<std::filesystem::path> to represent the current file being edited

prisma otter
#

literally not cursed at all

keen forge
raven halo
#

which i dont want

keen forge
#

then you asked the wrong question again

#

but check demo.cpp anyway and be on the right branch docking

#

i believe multiwindow is merged into that one, if thats what you want to do?

raven halo
#

I'm not using any docking or multiviewport features at the moment

#

i only have one window with no desire for it to have a main menu bar

keen forge
#

then what are you actually trying to make

#

if you want a typical "File" "Edit" etc menu bar then you need that mainmenubar thing

#

like jake has in aso editor

raven halo
#

mainmanubar would put the menu bar on the sdl window

#

this crap is so precarious to word

prisma otter
#

I think the imgui part is working but grubbi doesn't have a debugger so is getting confused

#

Get your debugger working lmao

raven halo
#

any recommendations?

prisma otter
#

What ide are you using? It should just work

#

Like I assume you have lldb or gdb installed

raven halo
#

vsvodium

prisma otter
#

I assume you are using an extremely jank ide since that should work out of the box

#

Maybe you need some plugin?

raven halo
#

probably

#

i will say visual studio had great debugging

prisma otter
#

Yeah it was good

#

One thing I miss that it had was natvis files

#

Made it much nicer to look at stdlib types

raven halo
raven halo
#

this was the meme i saw several years ago that inspired me to create "Defend Your Home from the HOA" on roblox

#

and i think its a decent premise for this first game i make

#

remember your roots

raven halo
#

anyways heres a demo of the level editor thus far

#

i wonder if I should come up with an extension for level files since I use my own format

prisma otter
#

wait you place using the character?

#

why not place with the mouse?

raven halo
#

im lazy

prisma otter
#

The beauty of editor tools is that, the more effort you put in now, the lazier you can be in the future smart

raven halo
#

i definitely need to work on safety features first

#

problems ive identified so far:
-user is not notified if opening a file fails
-user is not notified if creating a file fails (due to existing file with same name)
-user is not warned of unsaved changes if opening a new file
-user is not warned of unsaved changes if closing the program

#

the last two I'll probably tackle while I implement editing history, which will also give me undo/redo powers

#

first two are fixed

#

oh, and it probably shouldn't segfault if i open a file

#

that'd be cool

raven halo
#

all fixed

raven halo
#

next I wanna add undo/redo

#

automatic backup creations like blender does

#

why the reactions

worldly acorn
#

Undo/redo is quite nontrivial

prisma otter
#

Undo and redo is a massive can of worms

raven halo
#

i already have a vector of edit history that will probably get several gigs long

#

i should put it to good use

prisma otter
#

It seems simple now

#

but as your editor gets more complicated there will be...

#

edge cases

raven halo
#

do you think undo only would be any simpler?

prisma otter
#

Undo is not easy

#

I'm just saying its something you could end up spending a long time on

raven halo
#

interesting

prisma otter
#

so be prepared and don't get discouraged

#

don't let it derail you

raven halo
#

maybe i wont then lol

#

im just trying to idiot proof this as much as possible

#

i think my level file format will be called ghxl

worldly acorn
#

The sanest way I've heard to do undo/redo is to have every control/UI interaction be represented by a command struct that can be rolled forward or back to reconstruct the world state at every point

#

But even then that's not easy if you do something like delete an entity that has a bunch of sub components and need to be able to roll it back

raven halo
#

lol

#

dont have super high expectations for this level editor btw

#

i just want something rudimentary

#

a step above level editing via a hex editor

prisma otter
#

I haven't implemented mine yet, but I decided to do it by just serializing the entire map after every operation KEKW

#

its dumb, but it should be pretty reliable

dry basalt
#

you could also maybe not reimplement a level editor - create a importer for tiled or ldtk

prisma otter
#

Has anyone actually made a game that uses tiled? everyone keeps talking about it but nobody seriously seems to use it

raven halo
prisma otter
#

I think a level editor is something you should really write yourself

#

Since you are writing the game you already have half of it already

raven halo
prisma otter
#

I mean my undo

#

I have an editor

#

you have seen it on stream

raven halo
#

oh okay

#

apparently Cave Story was made with no level editor

prisma otter
#

that sounds like pain

raven halo
#

i have no idea what hell that man put himself through because he didnt write an editor

prisma otter
#

like was he writing it in a hex editor?

raven halo
#

no clue

#

he DID make the music creation software he used for all his games

dry basalt
#

ldtk (from my experience at least) is very good tho, and comes from dead cells

raven halo
prisma otter
#

You could simply learn the theory

raven halo
#

i already have

prisma otter
#

Ok so you will be him

raven halo
#

perchance

dry basalt
raven halo
#

never played

raven halo
#

i wonder if i should add a basic compression algo or worry about it later

worldly acorn
#

Nah

#

You can always do it later

hushed crescent
#

very interesting phrasing

raven halo
#

yeah i have no clue what you mean lol

worldly acorn
#

Lol sorry I'm listening to something at the same time as texting

hushed crescent
#

I assume you mean you can always do it later

worldly acorn
#

Always*

hushed crescent
#

which is true

raven halo
#

hopefully some vibraphone jazz

worldly acorn
#

No Rupert Lowe interview

#

I can't type and listen to words at the same time

#

Autocorrect makes it worse

raven halo
#

ah yeah

#

no clue who that is

worldly acorn
#

dw about it

raven halo
#

im not lol

#

im worried about a visual error

hushed crescent
#

I don't think compression would help that

raven halo
#

no this is a separate topic

#

a line appears under the dude sometimes

hushed crescent
#

I think that's fp error with the UVs, give a little padding in the texture

raven halo
#

oh yeah absolutely

#

i was just about to say how I thought that was the case but setting clamp to edge didn't fix the issue

#

however, it doesn't look like I ever actually set clamp to edge?

#

oh I did but only in one function

#

i appear to have a createTexture() and loadTexture()

#

odd

#

fixed now

#

alright I want an automatic backup system

#

so I think ill have a ghxl1 (like blend1) that changes are automatically saved to every 10 or so edits

raven halo
#

done

#

hmm

#

i cant imagine naming both a struct and the namespace its in a is good idea

#
namespace Level
{

struct Level
{
  // ...
};

}
#

Maybe the namespace could be called LevelUtils? But imo that undersells its integrality and makes it sound optional

#

namespace YouNeedThisForLevels is a bit long

raven halo
#

thoughts?

prisma otter
#

You don't need the namespace

#

You can put static functions in the level struct

raven halo
#

anyways i got bored and wanted to install arch on my pi zero 2 but accidentally did this

dry basalt
raven halo
#

fortunately nothing important was on it

dry basalt
#

my pi 4 can do usb boot, could you do that with a zero 2?

raven halo
#

i think thats a lot to ask for considering the only io is a single micro usb

#

I'm sure i could get something working but ill just buy another card

raven halo
#

anyways funny story

#

i fell asleep listening to music last night and woke up at 5 or 6 am, and at that point autoplay had taken over

#

playing this absolute banger https://youtu.be/xz5sJbAhp0U

Reservoir Recordings is a label division under award-winning independent music company Reservoir. The division markets and distributes a variety of the Companyโ€™s recorded assets, including labels such as Philly Groove Records, Amherst Records, AVCO Records, Jamdown Records, and Easy Street Records, as well as recorded music from artists includ...

โ–ถ Play video
#

this is one of the best sounding snare drums ive heard in my life

worldly acorn
#

Neat album art

#

I woke up at 3am from a fever nightmare froge_love I would have preferred to wake up to this

raven halo
#

rip

raven halo
#

fever dreams are awesome but I'm terrified to imagine what a fever nightmare is like

worldly acorn
#

I dreamed that I had overheated and received brain damage from cooking my brain with the fever and was screaming for help but could barely hear myself or orient myself since my senses were all confused

raven halo
#

must be bc of the spinal injury

worldly acorn
#

I think it was because I fell asleep wearing the hood of my sweatshirt

raven halo
#

ah yeah

worldly acorn
#

The most exciting fever nightmares I've had preceded vomiting, when you're asleep and on the path towards vomiting your brain comes up with a post hoc explanation for the cause of your nausea

#

On 2 occasions I've dreamed of seeing eldritch horrors or looking into hell and the sight immediately causing me to wake up needing to vomit even though most likely I was going to be sick anyways and the dream was just back-explaining why

raven halo
#

i feel like mine are closer to this

worldly acorn
#

Lmao cruelty squad flavored fever dreams

raven halo
#

theres another video i could send but it contains clips of that russian severed dog head experiment which might break the rules

raven halo
#

I am proud to report that main.cpp has no raw gl calls

hushed crescent
#

only raw vulkan init calls, right?

prisma otter
#

Time for 800 lines of render.cpp froge_love

raven halo
prisma otter
#

For now

raven halo
#

this is an unoptimized tile renderer after all

#

the editor has all the features I want for now so I guess it's time to add another tile type

#

probably a sloped tile

raven halo
#

some weirdness

#
std::find_if(result.begin(), result.end(), 
    [](std::vector<int>& v){ return true; } )```
#

this doesn't compile. result is an std::vector<std::vector<int>> and for some reason the error is that the iterator type can't be converted to bool

#

oh nvm its talking about the function return in my if statement ๐Ÿ’€

mystic kettle
#

Bruh, I went to check cause it seemed completely right to me

raven halo
#

trying to find something in a 2d list kinda sucks

#

especially if you want indices over iterators

raven halo
#

windows is hell

#

spending the last hour installing updates on my nvme?

#

Just a moment...

#

Just a moment...

dry basalt
raven halo
#

i think i just accidentally bricked my windows install so I'm gonna delete the partition and install windows to my other tiny ssd

#

ill probably have to physically remove the main drive tho bc the windows installer cant seem to comprehend the existence of multiple drives

dry basalt
raven halo
#

doing all this wild stuff without making a single backup

#

oh its a glorious sight to see

#

kinda disturbing that grub still reports finding windows

dry basalt
#

If you run something along the lines of "grub-mkconfig -o /boot/grub/grub.cfg" it should remove the windows entry as it rescans the operating systems

raven halo
#

well, its finding the windows boot manager

dry basalt
#

You can probably just remove the /boot/efi/Microsoft folder?

#

And use efibootmgr to remove the entry from your bios

raven halo
#

this is the closest thing to a virus ive ever had

keen forge
#

that always reminds me when i update uefi keys, because those involved strings always have "KEK" (key exchange key) in it

#

uefi people know their memes

raven halo
#

right

#

i need an exorcist

raven halo
#

pain programming slopes

#

i think the problem is with the collision detection

#

yup\

#

for some reason my algo isn't detecting a tile unless the player's top is under the tile's bottom

#

and its somehow not an issue with the aabb vs aabb algo

#

well whenever im no longer too tired too look at code ill finally setup a debugger and figure out why

keen forge
#

i wonder if you could use box2d

raven halo
#

I'm terribly uninterested in using third party physics

prisma otter
#

probably not necessary unless you need full rigidbody physics

worldly acorn
#

yeah I was about to say for this kind of game you probably don't need full blown physics

keen forge
#

yes, yes

raven halo
#

welp i went thru the painful process of installing windows again

#

its now on my extra sata drive

keen forge
#

to be able to implement slopes? ๐Ÿ™‚

raven halo
#

no

raven halo
#

man gdb really giving it to me straight

raven halo
raven halo
raven halo
#

this code im writing sucks

#

horizontal collision spaghetti code

#

just to fix one bug

prisma otter
raven halo
#

deccer skincolor dox

raven halo
#

i have just seen 2001: A Space Odyssey

#

ridiculously ahead of its time

worldly acorn
#

Some people find it boring but I think it's great

#

Like yeah it's slow, but that's part of why it's cool

#

You don't need to be some 400IQ philosopher film critic to appreciate it, if anything it's tapping into very basic emotions

#

It just requires patience to pay attention to, it's not something you throw on for a quick movie night

#

The ending is weird I have zero idea what it means and I don't really care

#

When I watched it with my friend it didn't bother me that I didn't understand the ending, whereas it made him furious lmao

raven halo
#

i really love media with endings that are impossible to understand

#

like a plot twist but the twist is that you're stupid

worldly acorn
#

How would you end a movie like that anyways

#

I'm sure there are a variety of ways but endings are overrated

#

Requiring every story to have a concrete Hollywood ending is an unnecessary limitation

raven halo
#

yeah

#

i loved how the movie started with 2 minutes of a black screen too

#

apparently they predicted the neccesity of dopamine detoxes

#

and yeah i wholeheartedly agree that too many movies have far too much diologue, especially unnaturally sounding millenial slop diologue

#

games too by extension

raven halo
worldly acorn
#

Having no dialogue for the first 30 min is neat too

#

Like I wouldn't want every movie to be like this but as a novel experience it's excellent

prisma otter
#

The effects are so good

raven halo
#

yeah

#

I highly recommend 12 Angry Men

mystic kettle
#

Peak kino mentioned

raven halo
keen forge
#

kino is a cool russian band

raven halo
#

i know that, but when was it referenced lol

hushed crescent
#

it just means a really good/cinematic movie

raven halo
#

oh sick

mystic kettle
keen forge
prisma otter
#

Isn't Kino also Cinema in german?

#

@raven halo Have you seen Lawrence of Arabia?

#

Since you managed to sit through 2001, I think you can handle it now

worldly acorn
#

Also Ben Hur, must-see

raven halo
#

both added to the list

raven halo
#

except spanish unfortunately

#

i think ive said it before but Heat is a favorite of mine @worldly acorn @prisma otter

worldly acorn
#

I've only seen the bank scene I should watch the whole thing

worldly acorn
raven halo
raven halo
worldly acorn
#

59

dull osprey
#

Doctor Zhivago

#

since we're talking about classic cinema

#

that's one of my favorites

#

it's great if you've read tolstoy books like war & peace and anna karenina

raven halo
#

nah

#

the only books Im planning to read in the next half year are Three Felonies A Day and A Short Stay in Hell

dull osprey
#

well the movie is still very good in any case

#

it is very epic

#

just kind of movie you don't forget

raven halo
#

yeah its on the list now too

dull osprey
#

the books I mentioned are not necessary, they just add a ton of context to the history

#

they are also like 1K pages each

raven halo
#

idk if I said but I thought blade runner was very boring

dull osprey
#

I have never liked the original blade runner, besides the aesthetic

#

I love the aesthetic

mystic kettle
#

Going through Witcher rn. Pretty light books(300~ pages each) which was quite surprising for me. So far can recommend, ate through 3 of those in a couple of weeks

raven halo
#

I cannot take the postmodernist film wiki article serious when it calls star wars postmodern

#

anyways, I think for now I should make the player controller real good

#

since that's strongly linked to the player character animation, I should probably start drawing the dude

prisma otter
#

Bridge on the River Kwai was also him

dull osprey
#

that's another great one

#

movies that are about things

#

and tell a great story

raven halo
#

the real masterpiece:

prisma otter
#

To translate for the people in Europe. A blitz is a play in american football

raven halo
#

welp college begins again tmrw

raven halo
raven halo
#

hmm I think it would make more sense for shaders to be confined within the renderer

#

I don't see much use in exposing that to other systems for now

worldly acorn
#

That's how mine works

#

On the game side the entity basically just is given a string shader name that is used to bin it into the right stage in the renderer

#

Mine uses shader explicitly although you could also have a more abstract concept of a "material" too

#

Personally I do it explicitly with shaders because it makes it usable for arbitrary effects like fullscreen quads etc that aren't really a physical material per se

#

But the game doesn't need to know anything about the shader other than to have some way to identify it

raven halo
#

right

#

maybe some uniform stuff

prisma otter
#

For me the the shader selection is just exposed as a set of flags

#

the object specifies which features it wants and the renderer selects the shader

worldly acorn
#

Uniforms are consumed passively for me

#

That's more of the ECS way anyways

#

The entity just has whatever properties and the renderer knows which ones to harvest to fill the uniforms

#

If the entity doesn't have the right property the game crashes ๐Ÿ˜Š

prisma otter
#

I suppose you don't have different materials that could potentially use different shaders?

worldly acorn
#

You can put any shader on any entity as long as it has the right components

prisma otter
#

Ah I see

#

for me, you put a "mesh" component on the entity and that can reference a material

#

the material has a some flags

worldly acorn
#

You'd have to add the extra component

prisma otter
#

I see

#
enum flags {
    DOUBLE_SIDED = 1,
    ALPHA_TEST = 2,
    PARALLAX_MAPPED = 4,
    SHADOW_ALPHA_TEST = 8,
    NORMAL_MAP = 16,

    COLOR_FLAGS = DOUBLE_SIDED | PARALLAX_MAPPED | NORMAL_MAP,
    DEPTH_FLAGS = DOUBLE_SIDED | ALPHA_TEST,
    SHADOW_FLAGS = DOUBLE_SIDED | SHADOW_ALPHA_TEST,
    ALPHA_FLAGS = ALPHA_TEST | SHADOW_ALPHA_TEST
};```

Its all in the mask for me
worldly acorn
#

That's all stuff I hide inside the renderer

#

But that's because my whole renderer is basically hard coded

#

There isn't really any user configurability

#

It's modular but to add a new rendering technique you need to modify the code it's not something you can set up through configuration alone

prisma otter
#

Well yeah you can't add a new technique without modifying my code either

#

you just get a couple options you can combine

raven halo
#

yk a few days ago I wrote an aabb vs level function that im now realizing is kinda useless

#

i spent an embarrassing amount of time on what amounts to a 2d array extractor

raven halo
#

it's always nice to delete half of main.cpp each time I add another file to my codebase though

prisma otter
#

That sounds about right

dull osprey
#

I like starting with a big main.cpp and then breaking it up as I go yeah, eventually it just becomes a tiny function

hushed crescent
#

it sometimes feels like my progress grinds to a halt as main shrinks

mystic kettle
#

How can you say you've progressed if you don't measure your main.cpp in mouse scrolls per hour

raven halo
#

main was over a thousand lines in my gl sandbox lol

dull osprey
#

if you unity build it still is a single main.cpp smart

raven halo
#

you gotta be kidding me

#

i was trying to figure out what gravity I would need to halve a jump height and ended up integrating the velocity equation in desmos just to find out all I need to do is double gravity

#

well to be fair the relationship isn't linear

#

it's 1/x

#

that was sad

#

i really gotta do my own math more

raven halo
#

i guess it's not visible in the video but for some reason if I press up against a tile to the right ill get stuck on it and have to hold the left key for a while to get unstuck

#

and this doesn't happen on tiles to the left

dull osprey
#

have you looked at box2d

raven halo
#

nope

#

im good off that

#

my collision resolution is kinda stupid because I just move the player the opposite of that frame's displacement

#

fixing that would probably resolve this

raven halo
#

took a few iterations

#

but it's beautiful

#
// Will return true if policy() ever returns true
bool aabbVsLevel3(const Aabb& aabb, const Level& level, 
    std::function<bool(const glm::ivec2&, int)> policy)
{
    glm::ivec2 lMin = glm::floor(aabb.min);
    glm::ivec2 lMax = glm::floor(aabb.max);

    int width = lMax.x - lMin.x;
    int height = lMax.y - lMin.y;

    for (int x = lMin.x; x <= lMax.x; ++x)
    {
        for (int y = lMin.y; y <= lMax.y; ++y)
        {
            if (!(x < 0 || x > level.tiles[0].size() - 1 || y < 0 || y > level.tiles.size() - 1))
            {
                if (policy({x, y}, level.tiles[y][x]))
                {
                    return true;
                }
            }
        }
    }

    return false;
}
keen forge
#

it should be called predicate

#

a policy is something you would apply

raven halo
#

player controller's starting to look real pretty

prisma otter
#

are you gonna have fancy stuff like wall jumps?

#

or maybe thats an ability you acquire later in the game

keen forge
#

i can see the little player throwing its arms around like a ragdoll when jumping and hopping and gliding around

raven halo
#

anyways existing bugs:

  1. slope doesnt carry the player high enough to clear adjescent full blocks
  2. a slope can push the player into blocks above it
  3. vertical collision uses legacy code and has no resolution for hitting the bottom of a slope block while going up
#

all very solvable, #2 might use recursion or not, who cares

#

afterwards i gotta animate the dude

raven halo
#

im having a few weird glitches when the player touches a tile to his right

#

i wonder if this could be due to floating point precision issues

raven halo
#

I understand now

#

if the right side of a hitbox is at x=16 and the left side of a tile is at x=16, the collision detection function assumes theyre touching

#

which is not consistent with the rest of the engine

#

well that's not necessarily true

#

its just that the left side correction seems to push the player out a tiny bit beyond flush with the tile

#

I'm struggling to understand why though

#

well i suppose it probably could be precision errors so i think what ill do is

  1. count AABBs as intersecting if the edges touch and
  2. add an epsilon to the collision resolution
raven halo
raven halo
#

bruh

#

im looking for std::nextafter, not epsilon

#

this is getting ridiculous

#

this code is munted

raven halo
worldly acorn
#

That seems like some other issue unless you're testing at enormous distances from the origin here

hushed crescent
#

yeah this looks like classic contact resolution trouble

#

fizzicks

raven halo
#

well it is contact resolution

#

problem is the resolution values are so small its not actually moving the player position

#

so he stays inside the block

prisma otter
#

what does the code look like?

raven halo
#

maybe I should just std::max(resolveX, 0.0001f) or something like that rather than messing with epsilonisms

prisma otter
#

it looks like you are snapping in the wrong direction in the video

hushed crescent
#

yeah it seems like the logic isn't stable when they're intersecting

prisma otter
#

are you sure its not some sign somewhere?

hushed crescent
#

it looks to me like generally it's not consistently finding the shortest path out of the block as the resolution vector

#

particularly when there's already some overlap involved

prisma otter
#

well shouldn't it come out the same direction that it came in?

#

like you could just back out in the reverse direction of the velocity vector

raven halo
#

vertical and horizontal collision are separated

prisma otter
#

but why?

raven halo
#

it made sense to write it that way

#

like so

#
pos.x += displacement.x;
doHorizCollisionRes();

pos.y += displacement.y;
doVertCollisionRes();
#

so by the looks of my gameplay (pre-video) and the values im reading off the debugger, vertical collision resolution is failing to push the player out of a block

#

so when it goes to horizontal collision in the next frame, the player is still inside the block below it causing any horizontal movement to push him out the opposite direction

#

the video was after I wrote in some epsilonisms, and that's the botched result

hushed crescent
#

you should resolve it as a vector

#

other games push out to a cardinal direction because usually they properly calculate the shortest distance out

#

which is off to one side

#

you can find it formally via SAT, but you can probably just find min(move out x, move out y, move out by the delta position vector) and get good enough results

#

though I'd recommend using SAT, read the slides erin catto hosts on box2d.org