dav

dav

0-day streak
Day 10 of #10-days-in-public github release First of all, I want people to be able to play to game on their sprig without having to compile everything, so I created a github workflow to automate compiling the UF2. This was my first time creating a github release too! Next, I optimized the web version of the game by throttling performance because the game runs way too fast. (Darn it why can't rust be less blazingly fast!) Specifically, I had the renderer secretly draw 200 extra cubes just to slow the game down. More importantly, I added a flashy menu screen followed by a camera panning animation similar to the one in the actual subway surfers. (It doesn't actually look that great but I love it). And that's it! That was 10 days! WOOHOO!
https://scrapbook-into-the-redwoods.s3.amazonaws.com/2057acf9-2d6f-4dff-9531-8f551c9c81a5-web.gifhttps://scrapbook-into-the-redwoods.s3.amazonaws.com/3a3c07e1-640f-4f9f-99cc-e4cb93d611ad-start.gifhttps://imgutil.s3.us-east-2.amazonaws.com/6b9497410588a12477eca893ce942b8a17bd4bfe49e2944b42def9cf53daa08d/9f7b8399-a43e-48ff-a118-98ea808c2772.png
10daysinpublic emoji
sprig-dino emoji
Day 9 of #10-days-in-public Loads of progress on the game today. Yesterday, I wanted to implement multicore rendering, but I was very disappointed to find that the sprig's rp2040 doesn't have an efficient way to pass messages between cores for rendering. Because of this, even if it was implemented, the performance improvement would probably be negligible. After cutting my losses, I actually began to play test my game (yay). I changed the colors of the game to make it less jarring to stare at and added some speed progression. Now, the game gradually increases in speed, and when you die, the game actually ends. I also spent an hour trying to get the web version of the game up. My highest score while was 12.5K. If you would like to attempt to beat my score, you can now play a web version <https://davnotdev.github.io/subwaysprigsters|here>, or if you have a sprig, you can install subway sprigsters from the github here._
https://scrapbook-into-the-redwoods.s3.amazonaws.com/7f81a75f-0e4e-4eb3-a211-76dfa5fc9e86-high_score.jpeghttps://scrapbook-into-the-redwoods.s3.amazonaws.com/bd3db5fd-cfa0-4f37-bfcb-3a5ca20ca17f-sprig.gifhttps://imgutil.s3.us-east-2.amazonaws.com/2a46e50133b96b45fa04ee060b7df508652612a555a0832df46104a719f8c136/50fd8535-f93f-412a-a7ca-0484f48cb28e.png
Day 8 of #10-days-in-public Today was all about setting up embassy.dev, a rust async executor for embedded systems. That was no fun, hadn't felt this much pain in quite a while. Just to get the thing to link, I had to copy paste some sketchy memory layout data from a random file I found in my build directory that also happens to not be documented anywhere on the internet. Next, I tried getting both cores to run, and now, I feel like I'm playing whac-a-mole -- adding one feature flag raises a "duplicate symbol" error, removing that same dependency causes an "undefined symbol" error. Like WTH??? That makes no sense. Still have a tad bit of hope though for tomorrow!
https://scrapbook-into-the-redwoods.s3.amazonaws.com/491d161e-7655-438c-842a-87043f7bf1ef-sss.pnghttps://imgutil.s3.us-east-2.amazonaws.com/6ad407809dc8e6d079dfbd21823508dffb897b97a27eb8ae43acbea1b7c8df0d/14df82e0-28cc-4db1-a46a-71768dbdf2f9.png
10daysinpublic emoji
Day 7 of #10-days-in-public Implemented all the fixes I mentioned yesterday. Unlike yesterday, the game is actually stable, so I can jump around like a monkey. Spent around 30 minutes wondering, "why does my variable keep magically changing." "Ah! It must be UB or a memory violation" (unspoken words of a rust programmer). Long story short, it was because I set a variable as true when it should have been false :peefest:.Tomorrow there are two big features I've been putting off since day 1. Sound: trowel doesn't support sound, and although I gave it a crack on day 4, I made no progress. Optimization (which will be my next main focus): I can jump around smoothly, but not on hardware. This will involve trimming out floating point numbers (which aren't natively supported on RP2040), caching/reusing rendering data, and some screen drawing optimizations suggested on the trowel github. Another black magic option is to try out unlocking the second RP2040 core, but I have no clue how to do that. EDIT: You can completely disregard my last sentence. embassy.dev is a rust async executor for embedded systems (meaning easy multithreading) and it has a module for RP2040 :tw_smile:, so excited to try it out. Long live the crab language.
https://scrapbook-into-the-redwoods.s3.amazonaws.com/0d426e67-1f8a-4af8-a83f-f59222eb47e1-bruh.pnghttps://scrapbook-into-the-redwoods.s3.amazonaws.com/538c18dc-ab39-45dc-a7c7-f8b87e087db4-game.gif
Day 6 of #10-days-in-public You know how subway surfers is about... like... subway surfing, well that's what I implemented today. Most of the logic fine, but there are a slew of bugs that come from the fact that I don't use AABB collision detection. For example, its trivially easy to clip through trains. Also, there's a strange bug now where *whenever the game feels like it, collisions for certain obstacles simply won't work. I've never missed Unity/Godot more😭 Anyway, I will be reworking the collision detection tomorrow, but here's some more sprig game footage for today. Shout out to my camera setup.
https://scrapbook-into-the-redwoods.s3.amazonaws.com/fe0abac6-395f-4a5d-8b36-99646dd0b45a-cam.jpeghttps://scrapbook-into-the-redwoods.s3.amazonaws.com/58049c0a-e251-4a70-ab66-482cda06ac1c-sprig.gif
Day 5 of #10-days-in-public A bit late tonight (shame), but got some good work done. First of all, I fixed the deterministic rng problem by having a seed screen that randomizes the seed using user inputs and time. I also implemented the obstacle rendering optimization I talked about on day 3. However, with all of this, there's one big problem! Text rendering and 3D rendering work separately. 3D rendering is done using a rasterizer that writes to a framebuffer. This framebuffer is then blit to the screen every frame. Text rendering is directly blitted to the screen directly using embedded_graphics . This causes major flickering when the framebuffer overlaps the text (only on hardware). The solution in my mind is to keep a small area of the screen for text and the rest for the framebuffer. In other words, I'm going to sweep this problem under the rug. Anyway, I'm very happy with how everything's turned out so far. Even with completely disregarding embedded performance, it runs just fine on hardware :tw_smile:
https://scrapbook-into-the-redwoods.s3.amazonaws.com/72cea67d-a4fc-4d66-b877-24af9adb761b-rng_screen.gifhttps://scrapbook-into-the-redwoods.s3.amazonaws.com/410c1f99-6c79-44ec-89d9-88a09af9b820-o.gif
wom emoji
10daysinpublic emoji
hardware emoji
sprig-dino emoji
Day 4 of #10-days-in-public Wanted to take a break from game programming, so I did research on outputting sound on sprig using I2s. (Trowel doesn't support sound yet.) Unfortunately, I couldn't find any good libraries for I2s audio written in 🦀, so I didn't get very far, got a black screen of death instead. I don't know all that much about embedded programming, so some pointers would be greatly appreciated! I also realized today that I've been spelling "obstacle" as "obsticle"... everywhere... since day 1. Talk about embarrassing, but nothing a little sed can't fix.
https://scrapbook-into-the-redwoods.s3.amazonaws.com/03d7504f-2701-4b04-a306-abcf6a9259dd-code.png
10daysinpublic emoji
Day 3 of #10-days-in-public Experimented w/ the obstacle spawning logic in a way that 1. makes sense and 2. doesn't make the game impossible. The result is worse than what I had yesterday, but hey its progress! Added trains as well, but currently each cube is drawn individually which terrible for performance. Unfortunately, the sprig can only handle ~18 cubes with my crappy rasterizer. Ideally, I should treat each train as its own cube rather than a serious of cubes like I do now. Not only would be it more performant but also easier to reason about when it comes to spawning logic. But anyway, don't feel like working anymore so that's for tomorrow me :p
https://scrapbook-into-the-redwoods.s3.amazonaws.com/6d35cf59-900b-485c-a235-3579a37556e1-trains.gif
Day 2 of #10-days-in-public Looks much more like a game now! Now, we have more colors, a beautiful ground, sliding under obstacles, jumping over obstacles, and more nice features that I'll have to cut when performance starts to dwindle. Unfortunately, RNG is currently deterministic (every game is exactly the same), and the game doesn't spawn things fairly, so that's what I'll be working on tomorrow. See ya then!
https://scrapbook-into-the-redwoods.s3.amazonaws.com/cf2eba3c-d328-4b85-8411-b66906d4f5c6-gameplay.gif
10daysinpublic emoji
wom emoji
Day 1 of #10-days-in-public! Hi! A while ago, I started a new #trowel sprig game -- subway sprigsters! Didn't make much progress though. Thank you procrastination, but I'm picking the project back up again bc I like free food. Some dependencies broke, so I spent today fixing those up (made PR to trowel as well) Here's what the game looks like right now! (I promise it runs on sprig, I'm just too lazy to record it, maybe I'll do so tomorrow)
https://scrapbook-into-the-redwoods.s3.amazonaws.com/0cdcf84d-520f-41a3-ba8f-490eed5c0364-bad_deps.pnghttps://scrapbook-into-the-redwoods.s3.amazonaws.com/d7c3c381-ab52-4fce-95fb-9adfc55ad92f-hello_world.gif