#Galaga clone (with multiplayer)
1840 messages · Page 2 of 2 (latest)
GL_RED_INTEGER
Try this
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
hold on I gotta write the code
currently it's all going through my wrapper which doesn't have these bs _INTEGER formats
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
yeah it works now 
I don't get why the _INTEGER ones need to exist though
the type is literally the next argument in the call
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
ok so you could use GL_RED + GL_BYTE if you want to upload snorm pixels yeah (if the internal format is snorm)
yeah
assuming that's how it's interpreted
If you were doing like a normal monochrome texture
the texture format/internalformat mess is literally GL's worst feature imo
It trips me up nearly every time
it's down there
I've just cut myself on it so many times that I actually generally remember how it works now
it helps a lot to have my own wrapper that makes it impossible to use the wrong enum type
Yeah I rename one of those inputs to something else in mine as well
where UploadFormat and UploadType are two different types
I just gotta add the integer formats to UploadFormat now
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
you can see it quite clearly in this beautiful code
https://github.com/JuanDiegoMontoya/Fwog/blob/main/src/detail/ApiToEnum.cpp#L61
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
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
You're not using like persistently-mapped buffers or anything?
no
hm
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
the minimal set of things I need for it to work
glEnable(GL_DEBUG_OUTPUT);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
Doesn't synchronous just force it to invoke the debug message callback in the main thread or something
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
ye
I like having a nice call stack
but man I didn't know it could change the API's behavior
I didn't either tbh
well it's probably still UB on my part
It was just a guess based on the fact that it seems like a sync issue/race condition and the name says SYNCHRONOUS 
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
That's the spirit lol
hmm now I don't know how to use visual studio's "open local folder" mode in projects with multiple CMakeLists.txts
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?
it's a shame because opening the folder is way better
no
That's how it typically does for me, idk
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
I just add_subdirectory() everything and it just kinda works, like if you have 3rd party libraries as submodules with their own CMakeLists
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
ah I see yeah not sure about that setup
My actual understanding of Cmake is tenuous at best
when I open the root one with VS I can't figure out how to run the example exes
I basically duplicate the one I used in my last project and tweak it a bit to make it work
which is why you dont
VS supports cmake
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
i have the same, i get the executable targets
hmm
can you show your cmakelists
can you show where these appear
that's when I open the root dir (the one with the cmakelists.txt I showed you) in VS
make sure you actually do run the add_subdir
perhaps temporarily move it out of your conditional
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)
i think unless it is already in the cache, ye
you fixed this, ye?
oh lmao
also you don't need to interpolate in ifs
I see the typo
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
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?
yeah it's just simple addition with imageAtomicAdd
any multi-part blend function would require a CAS loop most likely
you need a commutative blending operator, otherwise the order matters
that's a given with compoot shaders
cum poop shaders
someone made a video of playing my game
https://youtu.be/pPciGag2OeQ
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
oh lol
I must be tripping
my monitor shows a much lighter color when nothing is in motion
must be ghosts
ghosts of pixels past
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
might be caused by the large change of particle count at the same location
I think it's just a monitor artifact
what i am saying is that it is a dn problem
due to the pixels rapidly shifting from bright to pitch black
yeah
so
when does galaga development continues
after you implemented the tiled volume renderer in fwog?
kekekekeke
: )
maybe after I do some fwog cleanup
oki
game jams make me burnt out for a couple weeks
understandable
@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
xd
ok I'll use that instead
those are YAML sections
for example you can use the three dashes to define multiple sections for different languages individually
I see
out of 2400 entries btw
lol I actually don't think it was that innovative. I swear I've seen the idea somewhere
I'll take it though
gotta wrangle up that netcode
looking forward to it 🙂 and we need to talk anyway, it doesnt run on linux atm
uwu what is this (again)
basically nonexistent
Somehow glitched to the first message, dunno how to force that
I'm basically trying to make something that works at all
Which means having an extremely simple networking model
Yeah I've been doing other stuff
How many players at once
My requirements are to support 2 players
I assume you want to support many 2p games simultaneously?
From a single server
2p is pretty simple to support
powered by enet, not some raw socketisms
“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.
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
What tick rate do you want to use?
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
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?
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
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
that's a separate project
ah the shooting range simulator 2026, ill take it
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
i understood what you said
It might have helicopters at some point, not sure about fast jets
ground vehicles are higher priority than either though
what's беги mean
my russian vocabulary sucks
Run
ah haha
i like helicopters more anyway
yea they're cool
and saying that reminds me of how much i liked bf1942 desert combat
flying the helicopter 1mm above ground through the valleys and whatnot
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
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
je visually
Simulating every little thing like that is the whole point of the game
yeah visually
ah
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
if you just simulate the tracers it should be fine
clients just render the other 5999s with random spread
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
are they not usually close together?
The server can then be responsible for passing down the effects to the users
are what
Like if someone is just firing one round at you or something ultimately your client needs to know to play the bullet-passing sound
they all more or less hit around the same location
and/or spawn dust where the round lands
For the autocannons maybe there are optimizations to be had yeah
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
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
ah yep
i was referring to phalanx
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
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
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
thats a very interesting thing to think about
But the backpack full of gear doesn't (until you open the top)
You have to break it down into "observables" sort of
like those big ass people simulation games
1 bullfrog vs 100k spartans
10k big ass hornets vs 500k american soldiers
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)
where each individual is simulated
and their shit in the backpacks
so actually you are working on ArmA5?
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
i love these videos 🙂
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
looking at guysitsonwingjiff.gif, you better hehe
lmao
@molten night I recall you saying something about the project not working on linux
what issues were you having?
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
my code that uses entt::continuous_loader compiles when I include entt.hpp, but not snapshot.hpp, which is supposedly where it's defined
https://skypjack.github.io/entt/classentt_1_1basic__continuous__loader.html
they forgor the registry header
smh godbolt somehow has entt version 3.12.0 but that's not even on here
https://github.com/skypjack/entt/tags
mfw the entire problem was using unique_ptr with an incomplete type, as usual
Is that not allowed? I would think that if you supply a custom deleter that could be possible
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
this basically illustrates the issue
https://godbolt.org/z/dhsra4cbY
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
I can hardly remember what I was doing last time I worked on this 😩
something something hooking up the netcode
Yeah that's gotta be a tough kind of project to pick up haha
give me an hour, then ill be able to tell you what wasnt werkink
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
yeah I don't get why sometimes GIT_SHALLOW or git tags makes fetching fail
Like it'll complain that a commit doesn't exist when it clearly does
Anyways, I gotta fix that g_assism
I knew I'd be forced to use semantic versioning at some point
hehe
beware of the pipeline
the plopline 
the popeloine?
I may or may not have discord on my work pc
Discord yeah but projects too haha
I say this while on a spontaneous walk while WFH
I'm waiting for the rest of my food to cook right now
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
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)
learning to avoid work that is
i have a separate room for workisms
I don't have such a luxury 😦
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
i also strictly dont install or use any private shizzlisms on my work hardware
I have to install my personal projects on my work machine to test driverisms
can you not ask demongods girlfriend to send over some test projects
Lmao
The nice thing about my projects is that they have a simple build process and I know my way around them
heh i couldnt resist
Ya like how my single source ISPC file lets me avoid setting up a make file 🙂
ever since i somehwat understood cmake, i have 0 qualms with it anymore
and i somewhat appreciate it acchually, its still a shit scriptlanguage
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
thats total cool
And headers would serve the same purpose anyway
if you have something working, why change it
Ya
@hushed scaffold shall we tackle compilation on linux? 🙂
or are you busy with some important(tm) thing atm
good morning sir
Going to bed 
My weekends are being consumed
no worries, good night purple orange
@molten night are you on the networking branch
or main
because the "latest" stuff is on networking
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
this fetching shit i get quite regular
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
yeah for some reason i also had to delete build completely
classic
delete cache and reconficture didnt do the job
nope, but its fwog now
yeah
remove GIT_SHALLOW and maybe the GIT_TAG
git_shallow should just be something like --depth=1
that's what it's supposed to be iirc
or whatever shallow limit is set
ye
now i feel like looking into cmake's sources if its open source 🤮
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 😳
doesn't make sense to me, but ok
it kinda makes sense 😄
I don't get it 😭
if you checkout a specific tag/commit
why can't you checkout a tag shallowly
you have no depth > 1
no wait
im dumb you are right it makes no sense
commits have history too
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
but does it build? 
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
yes
nice, I couldn't rember if I pushed that
and the bullets fly in an arc-fashion
that means the ecs is working
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
hmm did you see this one yet? https://github.com/zpl-c/librg
That looks quite neat
ye some proximity list shinanigans
might be useful for networked multiplayer and many things flying around
they also forked enet somehow
3000 enet forks of Allah
Lol
Lmao
A server full of Europeans sending each other eid mubarak and saying alhamdulillah
and Americans
jaker tell demon what happened
I mean most of us celebrate christmas despite not being religious, so why not celebrate ramadan as well, for 2x the gifts 🙂
Haha
@plush furnace someone DM'd me "ramadan mubarak" because I said inshallah or mashallah in one of the channels
Hahaha
I had no clue
reading this, i have a specific song in my head playing now
;C
sawarim djihad

I found jaker's linkedin and he doesn't look as Spanish as I expected
: )
someone's snooping
It was an accident
smh I can't even doxx demongod because he doesn't use his real name on discord
By design lol
you can find him in the burzum forums
Lmao
I wanna know how that happened lmao
he fell on the keyboard
I accidentally copied and pasted your name + "AMD" from your GitHub into google
accidentally 
my name isn't nearly polish enough for that to work
Lmao
hehe
maybe I should make it slightly harder to dox myself
Meh it's a light doxing only since it only leads to your professional profile, not like your street address or anything
TIL
... 6 months later... jaker showing us pics of how he visited all of them during a road trip through the americas
sallallahu alaihi wasallam
I don't know your arabic/persianisms 😭
"The Messenger of Allah"
It's the year 2035, and the entire GP server is now spoken 100% in Arabic for purely ironic purposes
inshallah
چرا در سال 2035. خیلی زودتر اتفاق می افتد قورباغه من
ealaa madar eamin 2035. sayahduth dhalik fi waqt 'aqrab bikathir min
do you actually know arabic or are you google translating those 
i only know a tiny bit actual arabic
ofc i cheated
the script was persian, not arabic btw
maybe you can teach me when I visit europe in 30 years
heh
I'm too illiterate to tell the difference, like japanese vs mandarin vs korean
you should be able to tell japanese apart from korean and chinese - its quite shrimple
I am able to identify a lot of written languages but definitely cannot distinguish between any Arabic languages
although you should, with the jets-flying-over-arabic-grounds-simulator-2035 going on
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
ah danish
funny how similar it is to englisch
Afrikaans is also almost intelligible
that's just danish 2
Yeah lol
i did speak a bit of afrikaans when i lived there
and you get laffed at when a dutch hears you talk
rip
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
groot just mean big 🙂
do you tell your dog "who's a groot boy"
i have no doggo 😦
gn
Idk why you need middleware to do interest management. It wasn’t that much effort to roll my own for JebScape. Might take just as long to learn their api, yet you get less control.
I forked their fork already, in fact
I just looked at it
sometimes other people are smarter than me and perhaps have cooked something up ready to use or shrimply to learn from
oui, i rember
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.
I discussed various approaches here in my video, as well as my own approach that forces it to be O(N), albeit with some significant tradeoffs not necessarily suitable for every project out there.
Player density in JebScape does not worsen performance. Here’s how we achieved that.
JebScape Announcement Video: https://youtu.be/ILR2Qg9PrNY
Email: [email protected]
Jaker what were your takeaways from using EnTT for a networked game
if that's what you ended up using
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)
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
if you add networking though, you should make a project thread and loop us in
yeah will do
I believe I promised deccer that the next major feature/branch I worked on, I would make a thread for
Link for top msg in case someone wants to pin it: #1019875576321945622 message
I'm thinking of reviving this
Doing ONLY graphics plumbing gets monotonous after a while
do some real plumbing
I'd love for you to SUBSCRIBE and be apart of this growing channel & community!
Find me on Tiktok - @draincleaningaustralia or Find me on Twitter - @DrainCleaningAU
If you love blocked drains and blocked kitchen sinks then you'll enjoy this one. A blocked kitchen grease trap. A very very messy job. Years worth of grease, fat and rubbish were c...
- I finally have the free time to work on multiple projects simultaneously

this aussi thing sounds like an overlay and that would go anywhere too 😄 like those nigerian dubs over chinese clips
2 minute papers if he was Australian
are you rebooting the project or just massaging until it works again and continue
the latter
I mainly want to continue the networking stuff
networking architecture is still an enigma to me
just pulling your leg hehe
It came off
XD
trying to wrap my head around the networking bs I had in this
and redo
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
registry::patch:
@brief Patches the given component for an entity.
and you call it with calling the galadelegate
yeah but they have some other bs like a dispatcher that I didn't care to understand
thats probably just an outlet for the messenger itself, which handles multifred scenarios
so that you dont have to worry about syncing
ok so I think registry::patch is for updating a component via a callback so on_update gets notified
and its your generic messagebus where you .publish, without using the signal/delegate
yeah I understand the message bus stuff already
kkkk
anyway there was some other thing that seemed important to grok for networking
unrelated to this signal stuff
the patch stuff was also somewhat unrelated to the signal stuff lol
but dispatch is
I'm hogging the neuron atm
ah i didnt see anything about "patch" in the messaging wiki thingy
thought auto omlete fucked with you
ahah, it was this thingy I needed to understand
https://github.com/skypjack/entt/wiki/Crash-Course:-entity-component-system#snapshot-complete-vs-continuous
this seems kwite useful for networking at a glance
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?
Intuitively, the use cases are different. As an example, the first approach is suitable for local save/restore functionalities while the latter is suitable for creating client-server applications and for transferring somehow parts of the representation side to side.
uh
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
you have no lag with loopback/localhorst
sync in this case means taking whatever the server has (server authoritative)
yeah
making the client do no local simulation would be so much simpler lol
it would just render and send inputs to the server
but if you add networking from the start, then you can add whatever you want and have everything networkled
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
: )
probably won't happen, but one can dream
the journey... the journey, they say
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
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
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
not sure what you mean
I was thinking in terms of hiding latency
you need to add some client side prediction later
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
ye 🙂
the other thing is less complicated, spawning visual fx and stuff
that doesn't need to be replicated at all
because there will be lag between clients and server anyway and you cant get that to 0 ever
yeah
prediction sounds like a huge PITA 😄
like impact sparkles or something like that
I want at least a local server to not lag though
it shouldnt
if not init
return
if not load
return
while (true) {
handlenetwork
handlefisiks
handleinput
updategame
render
swap
}
unload
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
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"
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
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)
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 
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);
wyd
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)
networking
doing graphics alone isn't stimulating enough. the renderer is basically done for this project (2D sprites and debug shapes
)
you are gonna get jensen to play it, nice
ye
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
it's storing the game state I guess
here's my lit gameplay
there is collision detection btw, but it just spams the console when a hit is detected
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
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
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
understandable
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
a lot of stuff, but I'm just using the registry (it stores entities and associated components)
I write the communication stuff from scratch because I don't want to be tied to EnTT
I'm using entt's loader stuff to simplify things lel, but I could ignore it if I want
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
I'm using enet so I have some of this abstracted away already
I just send and receive data
if this convo doesn't successfully set Jaker back by 3 months, I'll be disappointed
My netcode is like 4000loc lol
actually it took me 6+ months
and about 8% of my soul
that makes me feel validated in my choice of using a library
Actually it's 5,600 
$ 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
I can afford to contemplate this because I can afford to not care if it turns out to be hard
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 
I'd need to study entt's continuous loader to understand how or if it could support such a use case
i messed up, i meant diff then quant ofc
The problem is, if I don't send a component over the network, the loader will just assume it was deleted rather than remaining unchanged
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)
This is an EnTT thing?
I just assume it stayed the same if no message is received
Yes
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
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
https://youtu.be/T1qzYsESDhc?si=JVSIsTsUHPkIsNHK to listen during impl
The fantastic song Map of the Problematique by Muse, from the album Black Holes and Revelations.
I claim ownership of nothing shown in this video.
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
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
I guess it’s for streaming from server? Like if you point the relative address at a network src?
mayhaps
my setup for loading images and using them for objects is horrible atm so I'll probably redo it sometime
this was because I sent the wrong data 💀
man it's so stuttery and shit though 
interpolating states should be easy at least
birthday paradox fun fact: you need about 20k random 32-bit numbers to have a 5% chance of a collision
time to make it so every client doesn't control the same player
actually I didn't work on it at all today 
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
bug showcase
actually I may just be dumb 
yeah I forgor a small detail
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 
first test with my brother (who's on the same network hehe)
who won? 🙂
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
how close are we for a public trial?
I still need to do this stuff so there's at least some objective