#Galaga clone (with multiplayer)

1840 messages · Page 2 of 2 (latest)

hushed scaffold
#

I checked and glClearTex{Sub}Image uses the same parameters as glTexImage3D

plush furnace
#

GL_RED_INTEGER

plush furnace
hushed scaffold
#

wat da hek

#

ok one sec

#

format
Specifies the format of the pixel data. The following symbolic values are accepted: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_RED_INTEGER, GL_RG_INTEGER, GL_RGB_INTEGER, GL_BGR_INTEGER, GL_RGBA_INTEGER, GL_BGRA_INTEGER, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL.

#

ok that's just messed up

plush furnace
#

:^)

#

does it work though

hushed scaffold
#

hold on I gotta write the code

#

currently it's all going through my wrapper which doesn't have these bs _INTEGER formats

plush furnace
#

It kinda makes sense though because for an integer texture you also need a special integer sampler

#

I mostly remember this stuff because at one point I spent a bunch of time messing around with image load/store which is even more of a PITA than normal textures when it comes to this stuff

hushed scaffold
#

yeah it works now frogapprove

#

I don't get why the _INTEGER ones need to exist though

#

the type is literally the next argument in the call

plush furnace
#

It could be 32-bit unorms or something though

#

It needs to know not only the data format you're feeding it but also how you want to interpret it GPU-side

#

GL_BYTE is also an integer type but you're usually interpreting it as 8-bit normalized ints rather than actual 8-bit ints

hushed scaffold
#

ok so you could use GL_RED + GL_BYTE if you want to upload snorm pixels yeah (if the internal format is snorm)

plush furnace
#

yeah

hushed scaffold
#

assuming that's how it's interpreted

plush furnace
#

If you were doing like a normal monochrome texture

hushed scaffold
#

I guess I have been doing it this whole time without realizing

#

lol

plush furnace
#

the texture format/internalformat mess is literally GL's worst feature imo

#

It trips me up nearly every time

hushed scaffold
#

it's down there

plush furnace
#

I've just cut myself on it so many times that I actually generally remember how it works now

hushed scaffold
#

it helps a lot to have my own wrapper that makes it impossible to use the wrong enum type

plush furnace
#

Yeah I rename one of those inputs to something else in mine as well

hushed scaffold
#

where UploadFormat and UploadType are two different types

#

I just gotta add the integer formats to UploadFormat now

plush furnace
#

I call them Format and SourceFormat/SourceType in my wrapper

#

but yeah same idea

hushed scaffold
#

opengl also has a cool feature where unorm formats are not given any special suffix

#

so it's just GL_RGBA8 and the fact that it's unorm is implied

#

but GL_RGBA8_SNORM exists too

#

also I have another fun thing happening in my code

#

my particles flicker unless I add glFinish()

#

somehow glMemoryBarrier(GL_ALL_BARRIER_BITS) doesn't fix it

plush furnace
#

interesting lol

#

The wonders of breaking the implicit sync lol

hushed scaffold
#

and I should add that all this bs only happens in release mode

#

and I have 0 multithreading in this program

#

99% sure I have UB somewhere, but I cannot find it

plush furnace
#

You're not using like persistently-mapped buffers or anything?

hushed scaffold
#

no

plush furnace
#

hm

hushed scaffold
#

I am using compute shaders, buffer writes, and image loads though

#

but I spammed glFinish() and glMemoryBarrier(GL_ALL_BARRIER_BITS) everywhere else already

#

I am pretty sure the problem is not in my GL code, since none of its optimization should depend on release mode or not

#

oh shit maybe not

#

commenting out the #ifndef made it work in release mode 😳

//#ifndef NDEBUG
  glEnable(GL_DEBUG_OUTPUT);
  glDebugMessageCallback(glErrorCallback, nullptr);
  glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
  glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, nullptr, GL_TRUE);
//#endif
plush furnace
#

tf

#

Isn't that just because it's forcing some sort of sync though

hushed scaffold
#

the minimal set of things I need for it to work

  glEnable(GL_DEBUG_OUTPUT);
  glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
plush furnace
#

Doesn't synchronous just force it to invoke the debug message callback in the main thread or something

hushed scaffold
#

yeah so I guess that do be forcing some sync

#

idk

plush furnace
#

If you don't use that it will invoke it from another thread and you have to switch back to the main thread and figure out what was likely the recently-called function that tripped it

#

I know because I never use the synchronous output lol and just live with the slight ambiguity

#

Because I didn't know about it for a while and got used to this way

hushed scaffold
#

I guess I actually have UB in my GL code then?

#

or maybe a driver bug

hushed scaffold
#

I like having a nice call stack

#

but man I didn't know it could change the API's behavior

plush furnace
#

I didn't either tbh

hushed scaffold
#

well it's probably still UB on my part

plush furnace
#

It was just a guess based on the fact that it seems like a sync issue/race condition and the name says SYNCHRONOUS froge

hushed scaffold
#

yeah it seems like a sync issue but idk how I messed it up

#

like I said, I have glFinish() and memory barriers after every important thing

#

whatever, now that it "works" I'm going to remove the unnecessary ones and ship it

plush furnace
#

That's the spirit lol

hushed scaffold
#

hmm now I don't know how to use visual studio's "open local folder" mode in projects with multiple CMakeLists.txts

plush furnace
#

Me neither

#

I just use CMake to generate the sln file and then use it as normal

#

Usually CMake generates a project for each CMakeLists does it not?

hushed scaffold
#

it's a shame because opening the folder is way better

plush furnace
#

That's how it typically does for me, idk

hushed scaffold
#

it generates a project for each project in all the CMakeLists that are included

#

a typical way is to have one project with several executables

#

for a library, anyways, which Fwog is

plush furnace
#

I just add_subdirectory() everything and it just kinda works, like if you have 3rd party libraries as submodules with their own CMakeLists

hushed scaffold
#

what I have is a library defined in the root CMakeLists.txt, then a bunch of examples defined in another CMakeLists.txt which is included in the root one via add_subdirectory

plush furnace
#

ah I see yeah not sure about that setup

#

My actual understanding of Cmake is tenuous at best

hushed scaffold
#

when I open the root one with VS I can't figure out how to run the example exes

plush furnace
#

I basically duplicate the one I used in my last project and tweak it a bit to make it work

hushed scaffold
#

lel

#

relatable

#

learning CMake is not my passion

hushed palm
#

VS supports cmake

hushed scaffold
#

what

#

it works fine when I generate a VS solution, but I'm having trouble with the "open local folder" thing where VS just reads the CMakeLists.txt in the directory

haughty bloom
hushed scaffold
#

hmm

haughty bloom
#

can you show your cmakelists

haughty bloom
hushed scaffold
#

teehee

#

yeah I'm cloning fresh to see

#

I'm still having issues

hushed scaffold
haughty bloom
#

btw msvc has colored build output now as well

#

if you fancy

hushed scaffold
#

that's when I open the root dir (the one with the cmakelists.txt I showed you) in VS

haughty bloom
#

make sure you actually do run the add_subdir

#

perhaps temporarily move it out of your conditional

hushed scaffold
#

ye did

#

ah wtf now it works

#

but shouldn't this set the conditional to true on the first run?
option (FWOG_BUILD_EXAMPLES "Build the example projects for Fwog." TRUE)

haughty bloom
#

i think unless it is already in the cache, ye

haughty bloom
hushed scaffold
#

oh lmao

haughty bloom
#

also you don't need to interpolate in ifs

hushed scaffold
#

I see the typo

haughty bloom
#

smh

#

then what was teehee my man KEKW

hushed scaffold
#

I thought you were just pointing out the fact that there is a conditional

#

I thought maybe the cache had the option set to false or something

#

welp, it works now after fixing the typo

#

ty for the help

haughty bloom
#

btw you can look at cmakecache.txt

#

if unsure

chrome sable
#

how do you blend particles in compute?
I tried to emulate

GL.BlendEquation(BlendEquationMode.FuncAdd);
GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);

once but as far as I understood it requires certain ordering I cant really do in compute. Or do you simply add to existing colors with atomicAdd?

hushed scaffold
#

yeah it's just simple addition with imageAtomicAdd

#

any multi-part blend function would require a CAS loop most likely

chrome sable
#

yeah ok

#

well this gets me excited about particle sim again

haughty bloom
#

you need a commutative blending operator, otherwise the order matters

hushed scaffold
#

that's a given with compoot shaders

chrome sable
#

cum poop shaders

hushed scaffold
haughty bloom
#

very nice!

#

congrats Jaker

plush furnace
#

Very neat

#

That shaped up into a pretty decent game quite quickly

#

It's like the opposite of a bullet hell haha

#

I assume the name was a spin on frogger lol

hushed scaffold
#

oh lol

hushed scaffold
#

I must be tripping

#

my monitor shows a much lighter color when nothing is in motion

#

must be ghosts

haughty bloom
#

ghosts of pixels past

hushed scaffold
#

it almost looks like the difference between a tonemapped and non-tonemapped image

#

I guess that's what I deserve for having ultra high frequency image detail, both spatially and temporally

haughty bloom
#

might be caused by the large change of particle count at the same location

hushed scaffold
#

I think it's just a monitor artifact

haughty bloom
#

what i am saying is that it is a dn problem

hushed scaffold
#

due to the pixels rapidly shifting from bright to pitch black

molten night
#

really cool 🙂

#

too bad it doesnt run on this potato here

hushed scaffold
molten night
#

whats your profile picture?

#

same as here?

hushed scaffold
#

yeah

molten night
#

so

#

when does galaga development continues

#

after you implemented the tiled volume renderer in fwog?

hushed scaffold
#

kekekekeke

molten night
#

: )

hushed scaffold
#

maybe after I do some fwog cleanup

molten night
#

oki

hushed scaffold
#

game jams make me burnt out for a couple weeks

molten night
#

understandable

hushed scaffold
#

@haughty bloom are the --- and ... at the top and bottom of a .clang-format file necessary for something?

#

ping'd because I was looking at the one in vuk

haughty bloom
#

i generated it with that site

#

so no idea

hushed scaffold
#

what site 👀

haughty bloom
hushed scaffold
#

xd

haughty bloom
#

not that one

#

the one i sent

#

fool of a took

hushed scaffold
#

ok I'll use that instead

hushed palm
#

for example you can use the three dashes to define multiple sections for different languages individually

hushed scaffold
#

I see

hushed scaffold
#

out of 2400 entries btw

plush furnace
#

Damn not bad at all

#

Especially on innovation

hushed scaffold
#

lol I actually don't think it was that innovative. I swear I've seen the idea somewhere

#

I'll take it though

hushed scaffold
#

gotta wrangle up that netcode

molten night
#

looking forward to it 🙂 and we need to talk anyway, it doesnt run on linux atm

haughty bloom
#

uwu what is this (again)

hushed scaffold
#

Galaga clone (with multiplayer)

#

Mostly for learning purposes

cold ember
#

What does your netcode look like right now

#

Oh I got to the top somehow

hushed scaffold
#

basically nonexistent

cold ember
#

Somehow glitched to the first message, dunno how to force that

hushed scaffold
#

I'm basically trying to make something that works at all

#

Which means having an extremely simple networking model

cold ember
#

No commits in 7 months

#

What are your requirements

hushed scaffold
#

Yeah I've been doing other stuff

cold ember
#

How many players at once

hushed scaffold
#

My requirements are to support 2 players

cold ember
#

Is it many small games

#

Oh

#

Just two players on one game?

#

Peer to Peer?

hushed scaffold
#

I'm doing client & server

#

Consider it a learning project

cold ember
#

I assume you want to support many 2p games simultaneously?

#

From a single server

#

2p is pretty simple to support

molten night
#

powered by enet, not some raw socketisms

cold ember
#

“ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol).The primary feature it provides is optional reliable, in-order delivery of packets.

ENet omits certain higher level networking features such as authentication, lobbying, server discovery, encryption, or other similar tasks that are particularly application specific so that the library remains flexible, portable, and easily embeddable.”

#

Ya I forego reliability and just send the latest absolute state. Resending outdated state data isn’t as important.

hushed scaffold
#

The server should receive reliable data from the clients, but I suppose the clients can withstand missing some packets from the server

#

It shouldn't matter a lot for my purposes either way

cold ember
#

What tick rate do you want to use?

hushed scaffold
#

Something high since the game is fast paced. Maybe 50hz

#

The entire world state should be quite small, so the server could send it every tick while just receiving player inputs

cold ember
#

At such a high rate, you’ll have weird syncing issues

#

What’s drawn on each screen won’t fully match and will be more latency-dependent.

#

Are you processing all activity on the server?

hushed scaffold
#

that's the goal

#

I've also been considering doing limited client-side simulation (purely visual) to reduce apparent latency

#

but for starters I'll just do all simulation on the server

plush furnace
#

I'm looking forward to someday trying to kludge some rudimentary multiplayer into my FPS game lol

#

I'll bet it's going to be a nightmare

molten night
#

you better send us an invite for playtesting

#

its about time we fly dem jets

plush furnace
#

I will

#

it won't have jets unfortunately though

#

not for a while

plush furnace
#

that's a separate project

molten night
#

ah the shooting range simulator 2026, ill take it

plush furnace
#

By the time it has multiplayer it will be on a full size terrain of at least a couple km across

#

I already have that functionality implemented I just moved to the shooting range setting because I wanted to work on stuff that was more of a polished "vertical slice" of functionality

molten night
#

i understood what you said

plush furnace
#

It might have helicopters at some point, not sure about fast jets

plush furnace
#

ground vehicles are higher priority than either though

#

what's беги mean

#

my russian vocabulary sucks

molten night
#

Run

plush furnace
#

ah haha

molten night
#

i like helicopters more anyway

plush furnace
#

yea they're cool

molten night
#

and saying that reminds me of how much i liked bf1942 desert combat

#

flying the helicopter 1mm above ground through the valleys and whatnot

plush furnace
#

Although to be more on topic, they are a source of worry for me from a multiplayer perspective since their guns shoot at like 6000rpm, so I'm going to have to sync a hell of a lot of bullets across the various clients lol

#

Not sure who will be responsible for that

molten night
#

brrrrrrrrrrrrt

#

indeed

#

mayhaps just treat it as 1 bullet

plush furnace
#

It could either be the shooter, which would be more consistent from their perspective, or it could be the server

#

No it's definitely going to be a shitload of bullets

molten night
#

je visually

plush furnace
#

Simulating every little thing like that is the whole point of the game

#

yeah visually

molten night
#

ah

plush furnace
#

it only needs a tracer round ever so often, visually isn't as much of a worry

#

It's more like, who is going to be responsible for doing ballistics calculations and scene intersection queries for 500 bullets in flight

#

I'm not worried about cheating since it's meant to be a cooperative game (i.e. even if players are fighting players, they're doing so in private and not like public competitive multiplayer), it's mainly a question of graphics and calculating whether someone is hit

#

I guess client-side hit detection is generally the way this is done anyways?

#

Fortunately my ballistics model should be deterministic enough that the server should be able to simulate the visual effect of a bullet internally, without needing to sync their positions continuously as they go

#

the client just passes a "bullet fired at t=x" message across and the server does the rest

molten night
#

if you just simulate the tracers it should be fine

#

clients just render the other 5999s with random spread

plush furnace
#

Ultimately the clients need to know about where the bullets are for audio purposes and impact effects

#

so the server will still have to simulate them one way or another

molten night
#

are they not usually close together?

plush furnace
#

The server can then be responsible for passing down the effects to the users

#

are what

molten night
#

bullets

#

its not that all of them fly off to total random directions

plush furnace
#

Like if someone is just firing one round at you or something ultimately your client needs to know to play the bullet-passing sound

molten night
#

they all more or less hit around the same location

plush furnace
#

and/or spawn dust where the round lands

molten night
#

sure

#

that needs to be sent across too, what kind of weapon system was fired

plush furnace
#

For the autocannons maybe there are optimizations to be had yeah

molten night
#

a MANTIS or some equalizer from the land of the free

#

forgot the name of the american anti air cannon thingy which goes brrrrrrrt too

plush furnace
#

Like if you're spraying a shitload of bullets in an area, at first you might draw an effect for each impact, but after the dust starts rising and spreading out you might want to somehow turn that cloud of individual particles into one system and start pumping it with fewer, larger particles instead of more smaller ones

#

Phalanx CIWS probably

molten night
#

ah yep

plush furnace
#

or M163 VADS

#

those are the only two main US AA cannon platforms I'm aware of

molten night
#

i was referring to phalanx

plush furnace
#

Long before I have air vehicles in my game I want artillery, I <3 artillery

#

so I need large-ish maps for that

#

and I also want cruise missiles

molten night
#

: )

#

who doesnt

plush furnace
#

maybe the map won't be large enough to contain the entire missile trajectory, but they can come in from outside the map to impact you

#

and then you can shoot them down like the ukranians have been doing

#

yeah should be interesting to decide how to sync multiplayer in this game though

#

There's a lot of nitty-gritty state to keep track of

molten night
#

the devil is in the details

plush furnace
#

Like if each person is carrying several hundred random items (weapons, clothing, various pieces of kit, random supplies, magazines full of (individually tracked) bullets, etc.), how does that sync

#

I should probably have a very clear line that delineates things that are visible to other clients vs. invisible

#

Like, the grenade hanging on your vest is visible to everyone else so it needs to be sync'd

molten night
#

thats a very interesting thing to think about

plush furnace
#

But the backpack full of gear doesn't (until you open the top)

#

You have to break it down into "observables" sort of

molten night
#

like those big ass people simulation games

#

1 bullfrog vs 100k spartans

#

10k big ass hornets vs 500k american soldiers

plush furnace
#

Like, the contents of your backpack are irrelevant to other clients until they reach in to grab something for you (obvious example), but also if you e.g. jump in a vehicle whose handling is affected by the mass of its occupants (more subtle example)

molten night
#

where each individual is simulated

#

and their shit in the backpacks

#

so actually you are working on ArmA5?

plush furnace
#

yeah lol

#

but even more detailed

#

My goal is for someone to compare it to QWOP

#

I played Receiver (and Receiver 2) and decided I wanted to make a game that was like Arma in terms of gameplay, except with full fidelity equipment interaction like a flight sim

#

#engine-dev message

#

for some reason it seems discord has prevented you from linking directly to videos which is stupid but whatever

#

the 3rd one in this message with the demolition charge is the level of fidelity I'm going for in every pieces of equipment, if possible

#

At least where functionally important

molten night
#

i love these videos 🙂

plush furnace
#

Will be interesting to see how the game feels when there's actually some stuff to do and more equipment to manage

#

I'm just implementing stuff as I go without any plan for exactly how it will feel to play

#

Eventually there'll be a system to allow for hotkeying of actions so that it's not quite as fiddly in terms of using the mouse for everything

#

If I ever get multiplayer working I'll recruit you guys for testing purposes for sure

molten night
#

looking at guysitsonwingjiff.gif, you better hehe

plush furnace
#

lmao

hushed scaffold
#

@molten night I recall you saying something about the project not working on linux

#

what issues were you having?

hushed scaffold
#

oh boy I get a bunch of compile errors on my local copy

#

for some reason fetchcontent fails to checkout certain repos with GIT_SHALLOW enabled

#

they forgor the registry header

#

mfw the entire problem was using unique_ptr with an incomplete type, as usual

plush furnace
#

Is that not allowed? I would think that if you supply a custom deleter that could be possible

hushed scaffold
#

the problem was that the type was incomplete in places where it needed to be complete

#

well the loader itself was defined, but the registry that it references wasn't

#

I still blame entt for not including registry.hpp in snapshot.hpp

#

of course, the error I get in msvc is completely incoherent compared to gcc or clang's output

#

actually I'm just tarded, msvc shows the issue in the first line of the output

hushed scaffold
#

I can hardly remember what I was doing last time I worked on this 😩

#

something something hooking up the netcode

placid karma
#

no "//TODO: werk on dis" ?

#

no "//FIXME: I know this will kill us all eventually" ?

plush furnace
#

Yeah that's gotta be a tough kind of project to pick up haha

molten night
#

give me an hour, then ill be able to tell you what wasnt werkink

molten night
#

ok machine is in a usable state

#

removed glm's GIT_TAG

#

switched fwog to main and entt to master as well

#

lol building isso fast

hushed scaffold
#

yeah I don't get why sometimes GIT_SHALLOW or git tags makes fetching fail

molten night
#

G_ASSERT isms again

hushed scaffold
#

Like it'll complain that a commit doesn't exist when it clearly does

molten night
#

yeah

#

i dont get it either

hushed scaffold
#

Anyways, I gotta fix that g_assism

molten night
#

i used gcc, let me try clangerino

#

with clang

#

clang 15.0.7 | gcc 12.2.1

hushed scaffold
#

Oh I made breaking changes in Fwog

#

You don't want that to be the latest version

molten night
#

nuh uuh

#

can you create a tag then mayhaps?

hushed scaffold
#

I knew I'd be forced to use semantic versioning at some point

molten night
#

report

#

its been an hour

hushed scaffold
#

I'm off the toilet and am now eating

#

Those two events are unrelated

molten night
#

hehe

haughty bloom
#

beware of the pipeline

hushed scaffold
#

the plopline frogstare

molten night
#

the popeloine?

plush furnace
#

Lol don't you have actual work to do

#

It's 3pm

hushed scaffold
#

I may or may not have discord on my work pc

plush furnace
#

Discord yeah but projects too haha

#

I say this while on a spontaneous walk while WFH

hushed scaffold
#

I'm waiting for the rest of my food to cook right now

plush furnace
#

One of the reasons I avoid WFH most of the time is because I end up spending half the day working on my projects lol

hushed scaffold
#

I'm somehow really good at avoiding being on my home PC but really bad at avoiding discord

#

at least discord doesn't require a major context switch from the actual work I'm otherwise doing

#

at least I'm just on this server which is highly related to my work, so I can just say I'm learning (which isn't entirely false tbf)

haughty bloom
#

learning to avoid work that is

molten night
#

i have a separate room for workisms

hushed scaffold
#

I don't have such a luxury 😦

plush furnace
#

Yeah my hobby reading is full of math and code so when I'm slacking off at work while waiting for an experiment run to finish it looks like I'm being productive

molten night
#

i also strictly dont install or use any private shizzlisms on my work hardware

hushed scaffold
#

I have to install my personal projects on my work machine to test driverisms

molten night
#

can you not ask demongods girlfriend to send over some test projects

plush furnace
#

Lmao

hushed scaffold
#

The nice thing about my projects is that they have a simple build process and I know my way around them

molten night
#

heh i couldnt resist

cold ember
molten night
#

ever since i somehwat understood cmake, i have 0 qualms with it anymore

#

and i somewhat appreciate it acchually, its still a shit scriptlanguage

cold ember
#

Thing is, I have yet to come across a use case that demands I even have more than a single ISPC function

#

Maybe once I start multithreading this

molten night
#

thats total cool

cold ember
#

And headers would serve the same purpose anyway

molten night
#

if you have something working, why change it

cold ember
#

Ya

molten night
#

@hushed scaffold shall we tackle compilation on linux? 🙂

#

or are you busy with some important(tm) thing atm

hushed scaffold
#

Perhap

#

I just woke up

molten night
#

good morning sir

hushed scaffold
#

Going to bed cherno_bad

molten night
#

heh

#

ill allow it

hushed scaffold
#

My weekends are being consumed

molten night
#

no worries, good night purple orange

hushed scaffold
hushed scaffold
#

@molten night are you on the networking branch

#

or main

#

because the "latest" stuff is on networking

molten night
#

let me check

#

fucking glm cant be fetched

#

i did remove the GIT_TAG from it, which should just pull whatever default branch it has set

#

im on networking

#

maybe schwitching to submodules is a better idea in the long run

hushed scaffold
#

urgh I hate that error

#

no clue why that happens

molten night
#

this fetching shit i get quite regular

hushed scaffold
#

try commenting out the GIT_SHALLOW thing too

#

I find that causes issues

#

I was trying to make it quick to build, but inadvertently made it impossible to build

molten night
#

yeah for some reason i also had to delete build completely

hushed scaffold
#

classic

molten night
#

delete cache and reconficture didnt do the job

hushed scaffold
#

it's still complaining about glm?

#

can you show the fetchcontent thing for glm

molten night
#

nope, but its fwog now

hushed scaffold
#

ah

#

you need to do the same thing for that too

molten night
#

yeah

hushed scaffold
#

remove GIT_SHALLOW and maybe the GIT_TAG

molten night
#

git_shallow should just be something like --depth=1

hushed scaffold
#

that's what it's supposed to be iirc

molten night
#

or whatever shallow limit is set

#

ye

#

now i feel like looking into cmake's sources if its open source 🤮

hushed scaffold
#

oh jeez

#

hold up

GIT_SHALLOW 1
Tell Git to clone with --depth 1. Use when GIT_TAG is not specified or when it names a branch in order to download only the tip of the branch without the rest of its history.

#

ok so I guess they are mutually exclusive 😳

molten night
#

damn

#

i mean

hushed scaffold
#

doesn't make sense to me, but ok

molten night
#

it kinda makes sense 😄

hushed scaffold
#

I don't get it 😭

molten night
#

if you checkout a specific tag/commit

hushed scaffold
#

why can't you checkout a tag shallowly

molten night
#

you have no depth > 1

#

no wait

#

im dumb you are right it makes no sense

#

commits have history too

hushed scaffold
#

ye

#

exactamundo

molten night
#

hmm my vs plugin is also fucked somehow

#

it would auto rebuildthingy itself as soon as i mod a cmake file

#

but now it doesnt

#

hmm, is on

hushed scaffold
#

but does it build? frogstare

molten night
#

im trying

#

and that stupid lock icon in the cmake output keeps unlocking itself

#

i want it to scroll as it produces output

#

i have removed shallow from all fetchcontents where you checkout a specific commit

#

things like imgui works with it, since its an actual tag

#

[build] /usr/bin/ld: cannot find -ltbb: No such file or directory 😛

#

one sec

#

have to install it here kwikly

#

[build] Build finished with exit code 0

#

i am wondering why it builds now btw

#

i have not pulled any updates

hushed scaffold
#

cmake momentous

#

can you use wasd and space bar to shoot?

molten night
#

yes

hushed scaffold
#

nice, I couldn't rember if I pushed that

molten night
#

and the bullets fly in an arc-fashion

hushed scaffold
#

that means the ecs is working

molten night
#

oui

#

hmm after that building obs-studio from scratch bs

#

mayhaps i have installed some deps which made the error go away now

#

but that feels wonky

molten night
hushed scaffold
molten night
#

ye some proximity list shinanigans

#

might be useful for networked multiplayer and many things flying around

#

they also forked enet somehow

hushed scaffold
#

3000 enet forks of Allah

molten night
#

: >

#

eid mubarak my frog

#

i need to send this to cleppi as well

#

done 🙂

hushed scaffold
#

Lol

plush furnace
#

Lmao

#

A server full of Europeans sending each other eid mubarak and saying alhamdulillah

hushed scaffold
#

and Americans

molten night
#

jaker tell demon what happened

hushed scaffold
#

I mean most of us celebrate christmas despite not being religious, so why not celebrate ramadan as well, for 2x the gifts 🙂

plush furnace
#

Haha

molten night
#

there is also diwali around november

#

free times is the charm

hushed scaffold
plush furnace
#

Hahaha

hushed scaffold
#

I had no clue

molten night
#

reading this, i have a specific song in my head playing now

#

;C

#

sawarim djihad

plush furnace
#

I found jaker's linkedin and he doesn't look as Spanish as I expected

molten night
#

: )

hushed scaffold
#

someone's snooping

plush furnace
#

It was an accident

hushed scaffold
#

smh I can't even doxx demongod because he doesn't use his real name on discord

plush furnace
#

By design lol

molten night
#

you can find him in the burzum forums

plush furnace
#

Lmao

hushed scaffold
molten night
#

he fell on the keyboard

plush furnace
#

I accidentally copied and pasted your name + "AMD" from your GitHub into google

hushed scaffold
#

accidentally KEKW

hushed scaffold
plush furnace
#

Lmao

molten night
#

hehe

hushed scaffold
#

maybe I should make it slightly harder to dox myself

plush furnace
#

Meh it's a light doxing only since it only leads to your professional profile, not like your street address or anything

hushed scaffold
#

ye

#

professional stuff is cringe

molten night
#

Fwog Lane 69, Frogtown, FT

#

hmm there are 3 frogtowns in the us 🙂

#

at least

hushed scaffold
#

TIL

molten night
#

... 6 months later... jaker showing us pics of how he visited all of them during a road trip through the americas

#

sallallahu alaihi wasallam

hushed scaffold
#

I don't know your arabic/persianisms 😭

molten night
#

"The Messenger of Allah"

plush furnace
#

It's the year 2035, and the entire GP server is now spoken 100% in Arabic for purely ironic purposes

hushed scaffold
#

inshallah

molten night
#

چرا در سال 2035. خیلی زودتر اتفاق می افتد قورباغه من

#

ealaa madar eamin 2035. sayahduth dhalik fi waqt 'aqrab bikathir min

hushed scaffold
#

do you actually know arabic or are you google translating those frogstare

molten night
#

i only know a tiny bit actual arabic

#

ofc i cheated

#

the script was persian, not arabic btw

hushed scaffold
#

maybe you can teach me when I visit europe in 30 years

molten night
#

heh

hushed scaffold
molten night
#

you should be able to tell japanese apart from korean and chinese - its quite shrimple

plush furnace
#

I am able to identify a lot of written languages but definitely cannot distinguish between any Arabic languages

molten night
#

although you should, with the jets-flying-over-arabic-grounds-simulator-2035 going on

hushed scaffold
#

I watched a danish frozen pizza commercial and I thought it was in english until I looked at the youtube comments, then I realized I couldn't tell what some of the words were not because of my poor hearing, but because I don't speak danish lol

molten night
#

ah danish

hushed scaffold
#

funny how similar it is to englisch

plush furnace
#

Afrikaans is also almost intelligible

hushed scaffold
#

that's just danish 2

plush furnace
#

Yeah lol

molten night
#

i did speak a bit of afrikaans when i lived there

#

and you get laffed at when a dutch hears you talk

hushed scaffold
#

rip

molten night
#

grys, grillerige goggatjies grawe graag geweldige groot gate

#

the g's are pronounced rrrrrrrrrrrr from your throat

#

one of their tongue twisters

#

or throat breakers

molten night
#

groot just mean big 🙂

hushed scaffold
#

do you tell your dog "who's a groot boy"

molten night
#

i have no doggo 😦

hushed scaffold
#

but you have a froggo

#

several, in fact

molten night
#

was about to say

#

papa frog goes to bed now

hushed scaffold
#

gn

cold ember
#

Speaking of Eid

#

That’s my last name

#

“Anglicized” or typo’d to Ead

cold ember
hushed scaffold
#

I just looked at it

molten night
molten night
cold ember
# molten night sometimes other people are smarter than me and perhaps have cooked something up ...

No they cooked up something that fit their set of requirements better. Interest management is one of the most important features driving the performance, hosting costs, and max number of concurrent active users you can have in a single world. It takes very careful consideration for which methods you should use and the tradeoffs you’ll want to pick. That’s not something that should be diverted to a third party to make on your behalf.

#

The reason is that most interest management implementations are O(N^2), where they try to shift O(N^2) from the network bandwidth used to O(N^2) on CPU resources, since the former is more constrained.

#

Also if the entire purpose of this is for it to be a learning experience in how to make an online game, the solution you go with is something important to think about.

plush furnace
#

Jaker what were your takeaways from using EnTT for a networked game

#

if that's what you ended up using

hushed scaffold
#

I uh

#

@plush furnace I only got like 25% of the way to having functional gameplay networking, if we're being generous

#

kinda got sidetracked with other things, but this is still on my todo list

#

event/message bus is a nice pattern though, and entt even comes with one built in (I think they call it signals)

plush furnace
#

Yeah for sure I was just curious

#

I'm contemplating taking the dive on networking my FPS game and it's looking like a lot more work than I though lol

hushed scaffold
#

if you add networking though, you should make a project thread and loop us in

plush furnace
#

yeah will do

#

I believe I promised deccer that the next major feature/branch I worked on, I would make a thread for

chilly stump
molten night
hushed scaffold
#

I'm thinking of reviving this

#

Doing ONLY graphics plumbing gets monotonous after a while

haughty bloom
#

do some real plumbing

molten night
#

lol

#

first 10s are groid alroidy

#

16mins well spent 😄

hushed scaffold
#
  • I finally have the free time to work on multiple projects simultaneously smart
molten night
#

this aussi thing sounds like an overlay and that would go anywhere too 😄 like those nigerian dubs over chinese clips

hushed scaffold
molten night
#

are you rebooting the project or just massaging until it works again and continue

hushed scaffold
#

the latter

#

I mainly want to continue the networking stuff

#

networking architecture is still an enigma to me

molten night
#

noice

#

would be cool if we can play it together : >

#

unlike certain milsim

plush furnace
#

Blame my ISP lol

#

It worked over a domestic connection

molten night
#

just pulling your leg hehe

plush furnace
#

It came off

molten night
#

XD

hushed scaffold
#

trying to wrap my head around the networking bs I had in this

molten night
#

frogdelet and redo

hushed scaffold
#

I'm trying to wrap my head around what entt provides first 😄

#

I'm not grokking its signal library entirely, so I think I'll ignore it (plus I have my homegrown event bus thingy)

#

the entt docs and wiki are kinda annoying because they assume you already know how to use the thing they're describing

molten night
#

it looks like a bog standard messaging thing

#

you subscribe with connect

hushed scaffold
#

registry::patch:
@brief Patches the given component for an entity.

molten night
#

and you call it with calling the galadelegate

hushed scaffold
molten night
#

thats probably just an outlet for the messenger itself, which handles multifred scenarios

#

so that you dont have to worry about syncing

hushed scaffold
#

ok so I think registry::patch is for updating a component via a callback so on_update gets notified

molten night
#

and its your generic messagebus where you .publish, without using the signal/delegate

hushed scaffold
#

yeah I understand the message bus stuff already

molten night
#

kkkk

hushed scaffold
#

anyway there was some other thing that seemed important to grok for networking

#

unrelated to this signal stuff

molten night
#

are you on your fone again

#

and you meant to write registry::dispatch?

hushed scaffold
#

the patch stuff was also somewhat unrelated to the signal stuff lol

#

but dispatch is

#

I'm hogging the neuron atm

molten night
#

ah i didnt see anything about "patch" in the messaging wiki thingy

#

thought auto omlete fucked with you

hushed scaffold
#

this seems kwite useful for networking at a glance

molten night
#

that patch thing reads like something you can use to temporarily add/remove components, like add remove tags so that you can react on it in 1 frame and then they are not valid anymore

#

like removing entities because you died, or for spawning things?

hushed scaffold
molten night
#

uh

hushed scaffold
#

I just want to replicate the game state with minimal ceremony

#

hmm I recall wanting to simulate the game locally for minimal lag, but periodically (perhaps every tick) sync with the server

molten night
#

you have no lag with loopback/localhorst

hushed scaffold
#

sync in this case means taking whatever the server has (server authoritative)

molten night
#

yeah

hushed scaffold
#

making the client do no local simulation would be so much simpler lol

#

it would just render and send inputs to the server

molten night
#

but if you add networking from the start, then you can add whatever you want and have everything networkled

hushed scaffold
#

yeah but I have to figure out how to optimally huff the glue to make everything work together

#

okay, let's discard optimality

#

I just want something that won't devolve to spaghetti instantly

molten night
#

: )

hushed scaffold
#

probably won't happen, but one can dream

molten night
#

the journey... the journey, they say

hushed scaffold
#

I can already think of a million edge cases that complicate local game simulation

#

like when the client shoots a (slow) moving bullet, you want that to be locally simulated so it appears immediately

#

but the input will go to the server, which will then spawn a bullet, and that bullet will be replicated by the client

#

so now it looks to the client like they just fired two bullets, slightly out of sync

molten night
#

you only need to emit "player1 shoots", server sees that, broadcasts it to the other clients, they see "player1 shoots" and then spawn a bullet which now lives in client space and is ticked there in the direction the shoots message provided

hushed scaffold
#

the client would have to somehow associate that fake-bullet with a particular event, and then acknowledge that the server's eventual update contained a response to that event

hushed scaffold
#

I was thinking in terms of hiding latency

molten night
#

you need to add some client side prediction later

hushed scaffold
#

i.e. the client creating a fake bullet to simulate until the server gives them the real bullet

#

alrighty

#

so "prediction" I guess is the golden word

molten night
#

ye 🙂

hushed scaffold
#

the other thing is less complicated, spawning visual fx and stuff

#

that doesn't need to be replicated at all

molten night
#

because there will be lag between clients and server anyway and you cant get that to 0 ever

#

yeah

hushed scaffold
#

prediction sounds like a huge PITA 😄

molten night
#

like impact sparkles or something like that

hushed scaffold
#

yeah that's fine and easy

#

I'll just ignore prediction for now lol

molten night
#

yeah

#

it will be choppy in le beginningue

hushed scaffold
#

I want at least a local server to not lag though

molten night
#

it shouldnt

#

if not init
return
if not load
return
while (true) {
handlenetwork
handlefisiks
handleinput
updategame
render
swap
}
unload

hushed scaffold
#

I was thinking of just running the server exe

#

or maybe spawning a thread

molten night
#

what do you mean just running server exe... isnt that how local networking works 🙂 run server.exe and client.exe and have it connect to localhorst

hushed scaffold
#

lol yeah but playing solo shouldn't require the user to launch another exe

#

anyway it's a pointless detail. I just want to make sure the client logic doesn't change significantly when playing "offline"

molten night
#

then spawn a thread for the server, yea 🙂

#

in game.exe and with a /server startup param you can turn it into a dedicated one later later

hushed scaffold
#

perhaps

#

I'll worry about it later since it seems easy

#

an idea is brewing. I'll sleep on it

#

I'll check if the continuous snapshot loader works with what I'm envisioning, which is basically slightly desync'ed registries on the server and client (to allow the client to spawn client-only stuff)

hushed scaffold
#

I already had a test of the continuous loader in the server main.cpp that answers all the questions I had 🙏

#
  • it shows interop with cereal with is EPIC
#

I can cerealize all the joes and mamas of entities in sourceReg with this

std::stringstream storage;
auto output = cereal::JSONOutputArchive(storage);
entt::snapshot(sourceReg).entities(output).component<joe, mama>(output);
#

*serialize bleakekw

#

then I can write the contents of storage to disk, a network stream, etc. and load it into destReg on the other side with this

auto input = cereal::JSONInputArchive(storage);
auto loader = entt::continuous_loader(destReg);
loader.entities(input).component<joe, mama>(input);
haughty bloom
#

wyd

hushed scaffold
#

for networking, I need to retain loader as it stores a mapping of entities in the source registry to the destination registry (so modifying or deleting it on the server also changes it on the client)

hushed scaffold
#

doing graphics alone isn't stimulating enough. the renderer is basically done for this project (2D sprites and debug shapes frognant)

haughty bloom
#

you are gonna get jensen to play it, nice

hushed scaffold
#

ye

haughty bloom
#

what is the strategy?

#

if you already wrote it down, i can scroll

hushed scaffold
#

eh it's in pieces, so I'll just write it

#
  • dedicated server
  • server authoritative
  • client only sends inputs to server, but can simulate (not predict) non-essential stuff locally, such as visual effects
  • no prediction because that breaks my mind
#

idk what else you wanna know

haughty bloom
#

i sort of see it

#

what the entt doin

hushed scaffold
#

it's storing the game state I guess

#

there is collision detection btw, but it just spams the console when a hit is detected

haughty bloom
#

no i get that, but why is it involved in the netborking

#

are the clients getting a copy of most of the ecs world each främe

hushed scaffold
#

yeah that's the goal

#

I guess I forgot to specify that

#

they aren't getting a complete copy though, because clients have some stuff they don't want overwritten by the server's state. the continuous loader (as opposed to snapshot loader) makes it trivial to support that

#

I don't understand the implication that entt shouldn't be involved in networking though. that's where the game state lives after all

haughty bloom
#

preface: i am spitballin'

#

never done networked gabes

#

but i would think that there is an intermediate representation

#

lets say you quantize, diff and compress

#

then undo those on the other size

hushed scaffold
#

hmm that would clamplicate things

#

but honestly I'm trying to keep it shrimple

haughty bloom
#

understandable

plush furnace
#

What does EnTT do under the hood

#

or are you just sending raw component state

hushed scaffold
#

I'm not sure where I would even want to put the networking compression stuff

#

I could put it in the serialization function, but that seems worng

#

worng

hushed scaffold
plush furnace
#

I write the communication stuff from scratch because I don't want to be tied to EnTT

hushed scaffold
#

I'm using entt's loader stuff to simplify things lel, but I could ignore it if I want

plush furnace
#

Essentially the server begins with a complex system that looks at the scene and some global server state and builds a list of the messages that need to be sent (mostly just entity+component data but sometimes meta stuff too) and then another step that goes through that list and just calls functions that build those messages from the scene state and writes it into an element of the packet (e.g. encode_position(reg_t reg, ent_t e, net::PositionUpdate&))

#

And the client receives those messages and puts them (raw) in a reorder buffer where they live until their dependencies are met (e.g. if a message about an ent comes in before its creation message) after which the client calls the decode_position(reg_t& reg, ent_t e, net::PositionUpdate const&) to apply the change to the scene

hushed scaffold
#

I'm using enet so I have some of this abstracted away already

#

I just send and receive data

haughty bloom
#

if this convo doesn't successfully set Jaker back by 3 months, I'll be disappointed

plush furnace
#

My netcode is like 4000loc lol

#

actually it took me 6+ months

#

and about 8% of my soul

hushed scaffold
#

that makes me feel validated in my choice of using a library

plush furnace
#

Actually it's 5,600 bleakekw

#
$ wc -l client.* net_protocol.h network_client_state.h network_linux.h network_windows.h network_serial.h server.h server.cpp
   852 client.cpp
    11 client.h
  1026 net_protocol.h
   253 network_client_state.h
   250 network_linux.h
   264 network_windows.h
   920 network_serial.h
    13 server.h
  2044 server.cpp
  5633 total
hushed scaffold
#

Actual compression should be trivial since the serialized data will just be binary or textual json. I'd use a library for this step and entt wouldn't have to get involved

#

Actually I think enet has built-in deflate or something similar for its packet abstraction

#

Diffing states seems hard on the other hand

#

Actually not if I use dirty flags

#

Or events rather frog_thinkk

#

I'd need to study entt's continuous loader to understand how or if it could support such a use case

haughty bloom
#

i messed up, i meant diff then quant ofc

hushed scaffold
#

Maybe I could deal with that in the serialization function with a dirty bit

#

Kinda stinky, but it is what it is

#

If I weren't using entt's loader it seems easier to handle stuff in a granular fashion (e.g. the server sending a granular diff of the game state), but that could be due to my lack of familiarity with it

#

But I won't abandon it yet because the simplicity outweighs the lack of le epic network compression (which is of DUBIOUS benefit in a game of this complexity)

plush furnace
#

I just assume it stayed the same if no message is received

hushed scaffold
#

If I do literally nothing then of course nothing changes, the issue is if I try to send an update to the world

#

Now that I had a chance to sleep on it, I realize this is really just a map and I could totally implement my own

#

I should be able to swap out the loader for my own in the future with few issues

plush furnace
#

Well for a simple game world maybe sending everything is fine

#

I'm kind of surprised though since it seems natural to me to let components trickle through as they come

haughty bloom
hushed scaffold
#

wow
_eventBus->Publish(shared::ecs::AddSprite{ .path = "assets/textures/spaceship.png" });

#

why is the AddSprite event in shared::ecs (shared is for code used by both the server and the client)

#

who is subscribed to that event

hushed scaffold
#

I had a bunch of source files in the server and client that were named identically and past me must've thought it wouldn't be a problem

crude tundra
#

I guess it’s for streaming from server? Like if you point the relative address at a network src?

hushed scaffold
#

mayhaps

#

my setup for loading images and using them for objects is horrible atm so I'll probably redo it sometime

hushed scaffold
#

man what the hek

#

the server sends this

#

but the client receives this

hushed scaffold
hushed scaffold
#

man it's so stuttery and shit though bleakekw

#

interpolating states should be easy at least

hushed scaffold
hushed scaffold
#

birthday paradox fun fact: you need about 20k random 32-bit numbers to have a 5% chance of a collision

hushed scaffold
#

time to make it so every client doesn't control the same player

hushed scaffold
#

actually I didn't work on it at all today KEKW

hushed scaffold
#

hmm it seems like enet doesn't disambiguate between peers on the same connection, so if I try to test multiplayer by launching the client twice, some funny bugs occur

#

so using the ENetPeer as a unique identifier may not be enough. the client may have to send additional identifying info

#

actually I may just be dumb frog_dum

#

works like a charm now

#

next order of business: make it smooth, then mayhamps add actual enemies to shoot at

#

then I can test it with you guys frogegreenexcited

hushed scaffold
#

first test with my brother (who's on the same network hehe)

molten night
#

who won? 🙂

hushed scaffold
#

we both did

#

btw I found that this function can serialize most, if not all glm types (despite the use of vec and v)

  template<class Archive, class vec>
  void serialize(Archive& ar, vec& v)
  {
    for (int i = 0; i < v.length(); i++)
    {
      ar(v[i]);
    }
  }
#

in conjunction with a suitable Archive type ofc, e.g. one provided by cereal

molten night
#

how close are we for a public trial?

hushed scaffold
#

well the code is on hitgub

#

but the "game" is pretty boring atm

hushed scaffold