@
@lmcelroy and I are working on writing a fuzzer for sprig, so now you can play them from the command line ๐Ÿ˜‚
sprig-dino emoji
@
hardware emoji
sprig-dino emoji
@
got omay's 2D life game to run using AN ENTIRE ORDER OF MAGNITUDE less memory. the trick was representing the map as an array of chars (no Sprite objects!!!) and then simply using setMap to write to the screen. along the way I created a version of 2D life that performs better on the microcontroller JS impl than it did in the web browser. (leo allocates an entire grid for every getTile call, and then fills it up in an O(2n) way, so it's very slow, whereas my lookups are constant time (spatial hashmap)) the javascript driving my version is running on a non-JIT runtime optimized for memory, not speed. his is running on V8 in my web browser ... my version can easily go at 20 fps in spade, his is sub-10 in my web browser ....
@
trying to make @Omay's 2D life game run on the device. The problem is, it's using x2 as much memory as the pico even has. Yeah. right now, it uses getAll to find all of the tiles on the map that are "living" or "dead." however, Omay's map is 1028 tiles large. So there's 2056 tiles between the arrays and their clones. I'm going to rewrite it so that instead of using getAll, it loops over the map using for loops. I think this will use less memory because there won't be any arrays in JavaScript holding all of the tiles.
@
sprig-dino emoji
@
rpi pico being a turd
boogie-skeleton emoji
@
uh
@
@
i am currently NOT changing the audio text representation sprig uses
sprig-dino emoji
@
this is progress. imagine how bad it was before :threat:
sprig-dino emoji
@
i love a good audio_buffer->format->format.format EDIT: now format doesn't even look like a word. god help me
@
something is going on with our RGB565 16bit color heh, tryna sort it out :) but alas, RGB565 only has 0.39% (65k vs 16m) of the colours of RGB888 ... ๐Ÿค” probably should've asked for this to be considered while leo et. al. were creating the existing color palette :flushded: chrishewett.com/blog/true-rgb565-colour-picker
sprig-dino emoji
@
memory leak in my sprig firmware let's fucking goooo :weary-smile:
sprig-dino emoji
@
leo and i have been having an ongoing "vim macros vs. multiple cursor" tug of war, and im sorry, but when have you ever seen multiple cursors do this (context: all sprig assets (maps, sprites, songs) are stored as text, (the web editor just shows you a nice graphical editor for the text based formats) what's seen here is the text format for the songs problem: when the songs play in your web browser, they're parsed using regex on the device, we use jerryscript to run your javascript per my logging yesterday, something in jerryscript's regex implementation makes the device hang solution: to confirm that this is the case, I am rewriting the parser in C for my minimal repro of the parser, I want example song strings to test against just pasted into my C code they need to be multiline C strings, then. multiline C strings: multiline C strings are just single-line string literals with newlines between them (the preprocessor automatically concatenates strings with nothing but whitespace between them) e.g.
puts("this little spriggy"
     " goes to the"
     " market!");
// > "this little spriggy goes to the market"
this macro adds a " to the beginning of each line of a "block" of text (which in this case are discrete songs))
sprig-dino emoji
goose-honk-technologist emoji
js emoji
vim emoji
c emoji
pan_with_egg emoji
@
lol so the past few days have been a foggy haze of trying to get @Omay's hit sprig single, Sokoban+, running on the device and like it was kind of basically working the entire time (good) except kind of it would crash at the start (bad) but i can make it not do that by not doing a different other thing (the bootup screen) but WHYH!?!? why bootup screen make game crash later? and how to have both? HOW TO HAVE BOTH? HOWWWWWW
@
@
wip sprig bootup screen see #sprig for deets (wanna draw us a nicer sprite that everyone will see when they turn on the console?)
@
finally made the perfect bagel
summer-of-making emoji
@
im thinkin @lmcelroy should pursue a career in hand modeling, what do yall think? thanks @msw for laser cutting the case design! what am i looking at? this is the latest prototype of the sprig, a handheld console for running games made with #sprig (sprig is a lil tool for making games out of tiles) also the editor is named sprig. we mightve named too many things sprig
thinking emoji
monkey-laser emoji
@
long neck orpheus + trying to make sprig consoles that dont explode when you put batteries in them, featuring @lmcelroy
orpheus emoji
summer-of-making emoji
sprig-dino emoji
@
triaging sprig issues (pray for me)
@
paste.rs/mdc.js there's something really satisfying about this Sprig demo (ye dass what we're callin it now. Sprig Engine or something idk)
@
see how the pixels on the left are uh ... yeah, like not even uniform? does that scare you? send a chill down your spine? keep you awake at night? no? well, uh, it certainly made me feel that way. I woke up at 4:43 AM yesterday morning and drew myself up out of bed. I could sense that something in the world simply ... wasn't right. It turned out to be a message from the universe: Tom Preston-Werner was testing our game engine. and the renderer was broken. :tw_grimacing: I didn't even know, but in this case, ignorance was hardly bliss. rather, it was a vague sense of discomfort. a nagging at the edge of my consciousness that drew me into HQ ... after blasting Wild Nothings into the empty early morning office for ... however long it took, I came up with this PR and ... voila! github.com/hackclub/puzzlelab/pull/2 order has been returned to the universe, and our pixels are clean and tidy ... until you find a new way to break them :tw_sweat_smile:
@
Everything is Going Fineโ„ข๏ธ
good-line emoji
summer-of-making emoji
@
yall idk wtf im doin but im diggin it this all fits in <16kb, written in Zig, software rasterized ofc
spring-of-making emoji
@
learned enough to make me have to restart my software rasterizer
spring-of-making emoji
@
sound fx!!!
spring-of-making emoji
box_dino emoji
@
spring-of-making emoji
@
shaking my head while looking at a software rasterized quad in zig not following a tutorial or anything, just seeing how much I can do with the vector math I already know I think calling @sin or @cos means your executable gets linked to the CRT which adds 60kb to my executable; if I can find a pure zig implementation of cos/sin, I can knock the executable size back down to ~4kb I also think the quad grows in size a little bit when it's rotated because my tangent and normal aren't actually perpendicular ๐Ÿ˜ณ ideally instead of setting the entire tangent vector, I could just set the "angle" and have my quad be an axis + angle combo, but I'm not sure what the vector math looks like for that. I know if I have two perpendicular vectors I can get a third orthonormal basis using the cross product, but I'm not sure how to go from one perpendicular vector to 2 short of quaternions or rotation matrices (surely there's an easier way?)
@
finished writing some code to procedurally bevel an icosahedron (or really probably anything really) for ishan it was a fun way to flex my vector math skillz especially proud of how I filled in the little pentagons on the vertices, specifically how I figured out the order to have the GPU draw them so they would look correct you can read my code here. I started with the threejs.org/docs/#api/en/geometries/PolyhedronGeometry class, and then basically slowly deleted and replaced all of the code in there because they were doing subdivisions whereas I was doing bevels which are uh ... yeah p different paste.rs/OT8.html currently I generate some extra unnecessary geometry for the edges. there are plenty of clever ways not to, but meh
goose-honk-technologist emoji
spring-of-making emoji
@
procedurally rounding an icosahedron with some Hack Clubbers from #cdn on it for Ishan in #code
spring-of-making emoji
goose-honk-technologist emoji
@
i am THOROUGHLY over caffeinated this morning. i may have spent entirely too long indoors away from sunlight working on this watch the OBS recording first, then then you will understand why I am so excited in the phone video lol
spring-of-making emoji
lmao emoji
yay emoji
@
start of a "game select" screen
@
some covid goin' round HQ, so work on the Game Lab handheld console continues from home :salute: wired up those buttons yesterday :) I'm still not clearing the screen though :tw_sweat_smile: so it's also a drawing program for making abstract art! :mask-parrot:stay well hack clubbers, and join #nemea to help us get this console in the hands of any hack clubber who builds something cool with gamelab :)
@
@HenryBass-U02KEJ8T6D8 hung out with us at hq yesterday and helped us test a new way of making games in gamelab wouldn't it be epic to run this game on a hand-sized device you could only get by making a cool game of your own? that's being developed in #nemea if you'd like to follow along :)
@
normal people when they fix a bug: wow, I can't believe I just lost 6 hours of my life because a parameter was on the wrong side of a , me when I fix a bug: wow, I can't believe I got 6 hours of free entertainment because I had a parameter on the wrong side of a ,
@
I had an "oh. it's the endianness." moment. excellent. a lot of that felt like beating my head against a wall, but it uses sprdraw and it works, and it's fast. we already have a C implementation of a function exposed to javascript that could be used to clear the screen between draws. Now all that's left to do is start trying to port some games to it.
amaze emoji
c emoji
js emoji
spring-of-making emoji
@
ST7735 LCDs come with little colorful tabs on the sides of them. there are several different colors: red, green, blue, etc. the versions we got to use with the gamelab beaker are green. the javascript driver for this code only has the initialization sequence for the red version. the code split on the left is the source code for it. on the right, I have the source code for the python initialization code for the green version. right now, my colors are inexplicably scrambled, and the best guess I have is that I used the wrong initialization sequence.
python emoji
gamelab emoji
spring-of-making emoji
js emoji
goose-honk-technologist emoji
@
this is a simulation where 500 random pixels are generated, and then each of them is given an ideal proximity to each other pixel based on how similar the colors are. then, each of the pixels are placed in a simulation where they move towards or away from each pixel with an urgency dictated by how far their ideal proximity is from their actual proximity the first time it runs, dark colors are the most common, so they end up in the center. then green, etc. I wonder what it would look like if I used an actual image as the input, instead of randomly generated pixels?
spring-of-making emoji
@
imagine if you tried to run a gamelab game on a 2 core CPU -- a Raspberry Pi Pico -- using a software rasterizer written entirely in Python. the fps might be 5. yeah, the fps is 5. join #nemea to help us as we scramble to speed this up and get it in the hands of hack clubbers everywhere ๐Ÿ˜‰
@
now im just making something really weird
spring-of-making emoji
@
after going off of the deep end, blaming Set's hashing algorithms for the crazy art that I accidentally generated and then finally realizing it was my fault all along, I went ahead and made a visualization of why my "generate a big megahexagon out of 'lil hexes" algorithm was 1. grossly inefficent 2. produced the art that it did basically, it 1. visits hexes that it's already considered all of the neighbors of 2. does so in a consistent counter-clockwise pattern (starting at 90 degrees and going back) (on both the micro and macro level) the code for it was really cute though lol so can you really blame me? and look how much cool art I got out of it! ... talk about going off the deep end ... this also seems like one big metaphor for me being grossly inefficient at doing the things that I set out to do, but making lots of cool art along the way. also, the trajectory vaguely resembles being flushed down a toilet bowl, so there's that.
@
a continuation of something I originally dumped in #code (see thread) i sort-of-accidentally generated a cool looking pattern, to share with people what was going on I wanted to draw it gradually instead of showing the end product so what I did was I replaced
requestAnimationFrame(function frame(now) {
with
(async () => {
and added one line to the end of my tile rendering loop:
  for (const oh of sightGrid) {
    const { x, y } = hex.axialToOffset(v2.add(oh, ph));

    ctx.fillStyle = ['palegreen', 'green'][+(window.ohgod = !window.ohgod)];
    drawHex(x, y, vec(hex.GRID_SIZE));
    await new Promise(res => setTimeout(res, 100));
  }
and yeah now you can see it draw the cool pattern gradually so. yeah. that's a thing. > +(window.ohgod = !window.ohgod) i could have accomplished this by declaring a variable outside of my for loop but when this idea occurred to me I knew it would be useless and wanted to localize the code for this experiment onto a single line (that, and there is something horribly wrong with my brain and I think i am gradually descending into Terry Davis, please send elph)
spring-of-making emoji
goose-honk-technologist emoji
@
imagine you were making a multiplayer web game at regular intervals on the server, you want to tick your simulation. setInterval(() => { your players move forward, โžก๏ธ your enemies decide who to badger next, :threat: some of your projectiles are just barely dodged, :flug: and others smash satisfyingly into their targets :bonk: }, 1000 / 60); at each of these intervals, the server decides which of these occur, and which ... do not. the difference is quite literally life and death for the denizens of your online realm: if a player's input makes it to the server just after this update has occurred, they might just not move out of the way of the oncoming missile in time. after one of these updates when the server has just finished making these vital decisions, it blasts relevant portions of them out to everyone who's connected to your server. (there's no point in updating you about something if it's happening on the other side of the map!) meanwhile, in the player's web browser, these regular updates from the server are gradually applied, so the server's periodic contemplation is rendered as a seamless sequence of fluid movements... unless those updates aren't really so regular at all ... the contract that the server has with the client -- that the server will give the client evenly spaced out updates at regular-enough intervals so that the client can smoothly move between them -- isn't actually the same as the contract that setInterval provides. all setInterval(update, 1000) means is that there will be ABOUT one thousand milliseconds between each of your updates, usually more. so if the actual interval ends up being 1009ms one frame, the next update won't be about 991ms later so that updates happen at regular one second intervals, it will be more like 1007ms later, so that now you're a total of 16 ms away from the contract you had with the client. this is known as drift. at worst, this passes on all of the problems of using setInterval for animation onto your game. but what if you're doing something fancier than just moving between the updates you get from the server as you get them? there's always going to be a random delay between what the server sends and what you get, anyway. it might make more sense to push the updates you get from the server onto a stack, and exactly as often as the server updates, pop the next set of positions off of that stack. ... except that if you're popping using one setInterval on the client, and the server is pushing out those simulation ticks using a setInterval of its own ... and each has a different drift ... they're quickly going to fall out of sync. if the server is drifting a lot, your stack might gradually accumulate thousands of positions that you just can't keep up with ... and if the server is drifting less than you are, you might run out of positions to show the player! suffice it to say, it's super important to have a setInterval that updates without drift. I threw together an implementation of one this morning. I call it a `tick`, since it works well for those simulation ticks I was talking about before. To test it, I went ahead and also made a drift visualizer. Here's a screenshot of it! The grey lines are spaced out at 0.5s intervals, and the first row of blue marks is made by setInterval, while the other row of blue marks are made by my own tick function. as you can see, they stick to the "wall clock time" a lot better than Interval does, even when you leave it running for several minutes! here's a screenshot! I'll post the source in the thread :) fun fact: everything that moves is a CSS animation ๐Ÿ˜‚ I didn't want to pollute the JS event loop, although now that I think about it, it might've been better to so that I can see how well my ticker keeps itself together in the presence of some event loop pressure.
@
finally wrote the code to tint the wing sprite appropriately so worth (also spent wayyy too long on the wing flap)
        const tM = 0.5, vM = 0.75;
        if (t < tM) t = lerp(0, vM, invLerp(0, tM, t));
        else        t = lerp(vM, 1, invLerp(tM, 1, t));
remap is such a useful idea
@
procedurally generated some clouds for a gamelab "front page" code in the thread
gamelab emoji
cloud-thoughts-head-full emoji
goose-honk-technologist emoji
wom emoji
@
gamelab emoji
wom emoji
@
cartridge emoji
gamelab emoji
face-with-spiral-eyes emoji
wom emoji
@
@
miniondough: fun to play with, not to ... i mean, you can eat them if you want ig?
wom emoji
@
obedient? yes intelligent? wasn't in the job description (was no job description, our minions are spawned, not hired. comes with its own pitfalls)
@
@
@
got back to rpgc and finally finished the inventory ui, you can drag items around as well as the entire window. now I just need to make that actually change what your player is holding, and make it so that you can pick things up off of the ground ...
@
prying some code from out of hack club's site. have you read the code for it!? it's hilarious and this section of code was written by several Hack Clubbers, including matthew, caleb, and lachlan.
wom emoji
goose-honk-technologist emoji
eggsdee emoji
@
wom emoji
qr-code emoji
@
@
@
@
wom emoji
@
rip my scrappy history gamelab
wom emoji
@
again gamelab
wom emoji
@
why gamelab scrappy why
wom emoji
@
suffering gamelab suffering
wom emoji
@
gamelab
wom emoji
@
hi again lounge
wom emoji
@
scrappabotomy (n) making any minor change to scrappy's codebase; a portmanteau of scrappy + lobotomy
wom emoji
scrappy emoji
@
hi lounge
wom emoji
@
slightly unhinged ui its painful how much i can relate
@
slightly unhinged ui its painful how much i can relate
@
added hp instead of instadeath, damage labels, an alternative control scheme that lets you play with one hand instead of using the mouse (it's what the red cursor that temporarily appears is for), lots of tweaks to the AI, etc. next up, for feature parity ... bow & arrow? then inventory UI and quests? wow, this is speeding along hehe shout out to @ella for making such an awesome font, Wack Club Sans, which I will definitely use in all of my projects henceforth hehe
@
festpee emoji
wom emoji
@
I think the last time I posted here neither the physics nor the sword were a thing. well. they are now! I also wrote like a six paragraph summary in DMs with someone somewhere about what I'm doing differently this time 'round other than simply writing it in C. it's a neat overview of some of the things I've learned about making games in the past year+ since the Rust version. could probably turn that into a neat blog post at some point. I also got the game working on mac. still looking for someone to try it on Windows to see if DirectX has the rendering bug I think it might have. now all that's left to do for feature parity with the original version is um, I guess, physics for the sword, enemy AI, combat, then the bow and arrow, inventory ui, then quests. I want to add cool things you can interact with in the forest like pots you can break, grass you can cut, other assorted RPG tropes.
@
the C port is coming along nicely :) :c: ๐ŸŒณ ๐ŸŒณ ๐ŸŒณ it can render the same forest, but with much better fps than the Rust version because of a handful of graphics programming tricks I've picked up since then. similarly to @AakankshaRangdal-U02F16CHZA4's post, also made mostly with circles! (okay, nonagons, but still hehe) actually, on that note, I've attached a picture of the original version I made in Rust: do you prefer its circles to the nonagons? let me know by reacting with ๐ŸŸข or :stop-green: (technically an octogon, but close enough) repo here: :githubparrot: github.com/cedric-h/rpgc if anyone has a second and would like to try to build and test the native executable on windows, shoot me a DM. I suspect I might have some depth sorting issues on DirectX but want to make sure. ๐Ÿšง :blender: I've also attached a picture of what the map looks like in Blender, as well as a tiny glimpse of the script I wrote to export it. if you've played the Rust version then maybe you can guess what each line, diamond, square and circle means ๐Ÿ˜
@
as I port a game I wrote a while ago in Rust to C to try and see how much smaller I can get the WASM bundle size, I've found that what has the biggest impact is the "culture" of the languages. for example, the maps in the game I made are laid out in blender, and then exported to JSON with a custom python script I wrote using blender's API. it's easy to add a Rust dependency to parse the JSON for you, but that bites you in the ass later; serde can inflate your compile times AND your WASM bundle size. in C, however, package management looks different; there are single header libraries that are pretty easy to include, but using libraries isn't very C-like, and unlike Rust, C has a stable ABI. that means that if I change my python script to dump a bunch of floats into the file as binary, I can fread those directly into a bunch of C structs. (I do have to handle endianness for integers, though) in Rust, even if I used #[repr(C)] to force a stable ABI for those structs, I'd still have to jump through a bunch more hoops (unsafe) or pull in a dependency like bincode (which would in turn pull in serde ...). anyway, so I quickly wrote a python metaprogram to generate a C header that can fread (or just memcpy) in all of the binary data into the fields in the game map object that the first python script pulls out of blender
@
~today I uh, today I actually hacked my bank.~ wait, that sounds illegal. okay today someone you may or may not know may have hacked their bank and I am inexplicably aware of the situation. imagine, in this hypothetical scenario, someone wants to use "ced@misguided.enterprises" to receive all of their banking emails. but the bank webapp is trying, for some very stupid reason, to validate emails with a regex, and that regex is "^[A-Za-z0-9_]+[a-zA-Z0-9._%+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9]{2,3}$". notice that last part, which allows for 2 or 3 alphanumeric characters following the last .. you can imagine how that might clash with someone's email. now, you might be thinking, ced, i know it's tempting to just sidestep their clientside verification, but that's technically circumventing access protocols. that sounds really illegal! and you're totally right, which is why whoever did this probably has HORRIBLE impulse control ... the second image demonstrates someone putting a break point on the line that actually sends the request and at that point, n in the watch window should be the variable on the left, so that someone will be able to modify the new email to the unvalidated one ... whoever did this probably discovered a couple useful things about chrome devtools in the process that they weren't already aware of ...
hacker emoji
bank-hackclub emoji
aom-21 emoji
@
git commit -m "Abuse static typechecking to enforce consistently spelled shader inputs"
aom-21 emoji
@
dynamic libloading is great. if I don't post here again, assume it drove me to light myself on fire and Segmentation Fault (core dumped)
@
delete all of the code
@
playing with camera angles in the hackagotchi standalone client, which has a custom renderer written in Rust! ๐ŸŽ‰
@
woot I got billboarding 2d assets working in my custom 3d renderer written in Rust ๐ŸŽ‰ I have to say, for a bit there it had me stumped ๐Ÿ˜‚ excuse the grainyness, I really gotta implement mipmapping (and anisotropic filtering)
summer-of-making emoji
rustlang emoji
@
graphics programming, OwO written in Rust :dabbing: custom 3d renderer