Hacker News new | ask | show | jobs
by cedric-h 1328 days ago
Hey everyone, I'm Cedric and part of the Sprig team. I'm 19. I've been trying to make games since middle school.

Right now I'm working on getting Lingdong Huang's - who has made a bunch of really cool interactive experiences[0] (like a human face eating simulator) - he made a Sprig game for us[1], I'm trying to get it working on the physical device - but there's a problem, since the device is Raspberry Pi 2040 based and only has 256kb of available RAM (yet the games are written in JavaScript - we run them using our own little JerryScript based runtime[2]).

The runtime also runs on personal computers, not just arm-eabi-none, to help us test the games to get better error messages than the physical hardware can give (because no operating system). We call this our Sprig emulator, even though it's just the runtime compiled to a different architecture, hooked up to CoreAudio and a minifb window. Thanks to the emulator, we know Lingdong's game theoretically only uses 180kb of RAM, so we should be fine. And it actually works great in the emulator, but when I try to run it on the device it doesn't get past the startup screen ... which hurts because the entire reason we made the emulator was to get better error messages.

All I can do now is puts("") debug everything and figure out what code is reading or writing out of bounds and making the device freeze. I probably configured the heap to be too small again.

I have always loved finding excuses to figure out how things _actually work_, which is why every time I sit down to make a game, one thing leads to another and I'm making a game engine. Working on Sprig has taken this to a whole 'nother level because it's essentially our own operating system, too. Nobody tells you if you overflow the stack, the stack guard is only 32 bytes and disabled by default. It all started as a module for Kaluma, but we hit so many performance, RAM and flash constraints that we found it was better to write our own JS runtime. Apologies to Kaluma which is also trying to frontpage HN right now! We both use JerryScript heavily, but Kaluma connects you directly to the GPIOs and IRQs. We just connect you to the screen and the buttons through the same API as in the web browser, which is handy for making tile-based games.

[0] - https://lingdong.works/ [1] - Lingdong's game. Keep in mind the controls are all WASD and IJKL because the device only has 8 buttons. https://editor.sprig.hackclub.com/?file=https://raw.githubus... [2] - github.com/hackclub/spade

4 comments

https://imgur.com/VTXNCcS

got it working on the device!

the performance is quite horrible ... enough to make you question why running JS on embedded devices is a fad ... so it's time to start profiling.

Hey Ced!! Woahhh, I didn't know this project is sorta its own OS - that's epic

It's pretty cool to see projects like this, Sinerider, and the like being developed, even if I am on the sidelines haha

This looks pretty cool, and takes me back to my early programming days.

> by teenagers, for teenagers

> I'm 19.

Do you plan to continue contributing after you turn 20? I'm not familiar with the project, so I'm not sure what "by teenagers" means in practical terms (e.g. certain types of contributions no longer allowed?).

I started out as a member of Hack Club's online community -- I discovered them through the GitHub Newsletter, and then made a multiplayer game with its own economy playable through their Slack (github.com/hackagotchi/hackagotchi) -- and then graduated high school in the middle of Covid with no plans and ended up working here. The purpose of the Sprig project is to engage and energize our online community. While our mission is to support teenage hackers, there are no hard and fast rules about what it means to be one. While we're not sending out devices to people over 19, we still accept games from them and show them in our gallery. Does that answer your question?
Yep, thanks!
Focus on building things with Unity, Unreal & CUDA.

Now that you have hopefully read my one takeaway Cedric...

This is from the perspective of someone who has been in the games industry and entrepreneurship for a long time, long enough to become the villain.

You're clearly a very talented programmer.

In 2008, when I was at elite fancy school, an opportunity that is probably open to you, GPGPU programming had just begun.

The last decade of software innovation - machine learning, cryptocurrencies, immersive video games - owes its debts, fundamentally, to people who learned and authored GPU software all day. The ability to program GPUs, and nowadays to build infrastructure for distributed GPU computing, is the primary bottleneck to the greatest innovations in software.

If you love low level stuff, this is where you should go.

If this doesn't interest you, at least learn Unity and/or Unreal. No more custom game engines. There is a time limit. I know a lot of people in R&D across industry and academia, and the #2 bottleneck for innovation (after #1, GPGPUs, i.e., performance) is Unity and Unreal skills, i.e., presentation.

Why write here?

I've seen people in your situation, at 19 years too, capable of great things, attracted to scenes of other talented people like the Hack Club folks.

Every 5-10 years there are certain technologies on which all innovation is built. It isn't going to be Raspberry Pis. Please, don't focus on that anymore.

Like someone else I know in your situation, who was modding video games: put a time limit to... the "kid shit." That's going to get me downvoted, but seriously, the world flies by you, and people like you have a lot more potential.

It is extremely downvotey, but there are objectively more important things for you to be doing. There are other people in your life who know this too (like probably your parents) but they may lack the sophistication to know, really, what you should target your talent cannon on.

Appreciate your perspective.

What's the point in doing anything if you don't enjoy it, or if it doesn't culminate in something you do enjoy?

My metric when I decide to do something isn't "how cool will Hacker News or Hack Club think this is?"

It's, how much will I enjoy doing this.

You may call it kid shit, and maybe this is the hard-headed kid in me talking, but I hope I never change.

This is a great attitude that you'd think would be more common at a place called "Hacker News". The temptation to get "finance brained" is incredibly powerful in this industry, especially as you get closer to Silicon Valley, and the more young programmers resist it the better off we're going to be. Thanks.
It's not really about finance brain. It's about where are you, as a smart, talented programmer, going to have an impact? For the past ten years, ALL of the major innovations in the software field have been based on GPGPU. Learning how to program GPUs is thus a core, foundational skill if you want to contribute significantly to the biggest innovations of computing. And of course there's so much else to learn on top of that, particularly in terms of math and algorithmic techniques and stuff.

Messing around with Raspberry Pis is kid shit by comparison. It's fun, but it's not going to advance much of anything. The Raspberry Pi is literally a "get kids into STEM" initiative, and yet it's used mainly by adults who want to cosplay as "makers". And even then, eventually they usually end up in a drawer.

If you want to mess around, Raspberry Pi game consoles are fine but if you want to make a significant contribution, time's a-wastin'. If the rocket takes off and you're not on it, there goes your chance. So yes, set a time limit on the kid shit. Put it away by age 20 or so, and start thinking about what really matters and what's really gonna change things.

Many people who in retrospect are truly innovative almost definitionally spend their time doing things other people don't regard as valuable (at first at least). As an extreme example of someone who prioritized a life of play look at Claude Shannon. He literally had a shop for building toys at home. I'm grateful he wasn't overly attracted to what others regarded as impactful at the time. That being said I still don't think it's important whether one's play becomes valued. I suspect in the long run we're all better off having people in the world who are passionate about what they are doing.
All of that might be true. All generalizations are sometimes untrue.

> spend their time doing things other people don't regard as valuable...

Sprig is an educational project, shepherded by adults affiliated with big name institutions like MIT and Google. They are extremely conventionally successful smart people who think "nurturing programming talent" is valuable. What are we even talking about? These things don't happen in a vacuum.

The idea that a "smart, talented programmer" should reshape their life and their interests around "hav[ing] an impact" and "contributing significantly to the biggest innovations of computing", to have "[their] chance" to get on "the rocket" before it "takes off", this is what I'm referring to. The idea that you're literally wasting your time if not working in certain fields: "machine learning, cryptocurrencies, immersive video games". Why do you assume that "impact" and "innovation" should be the driving interests of a young programmer's life? This is a cultural presumption, if not an ideological position.
> The temptation to get "finance brained"

Trust me, people don't get into programming video games for the money.

Anyway, this is a funny perspective. Zach Latta, the Hack Club founder, got a Thiel Fellowship. I would not characterize Peter Thiel's philanthropy as 100% mission driven. I also don't think he's a supervillian. But there is a finance angle, not a negative one, to even the most seemingly twee retrocomputing things.

Maybe if you saw Hack Club's deck, you would comprehend.

Any talented non-college enrolled young person could also consider a Thiel Fellowship. There are many opportunities out there.

Why should the goals of the project funder have any bearing on the goals of participants in the project?
> If this doesn't interest you, at least learn Unity and/or Unreal. No more custom game engines. There is a time limit.

I work in the games industry and couldn't disagree with this post more. The above is generic advice you give to someone just starting out and wants to work on games but has no clue where to begin. This person is working on a custom games console which is incredible experience, useful and impressive on so many levels.

You have to use new hardware all the time. You have to relearn a new shader language all the time. You have to re-learn Unity and Unreal all the time, because they are a shifting target (especially Unity). I have shipped games with 6 different games engines on 4 generations of hardware. I've used 3 professionally in the last two years.

The skills you will learn working on this console are the stripped-down core of game development: relevant and everlasting.

Second this. It should be drilled into the heads of everyone who wants to get into game development: USE A MAJOR ENGINE. No exceptions. Time is money, and hand-rolling an engine is a waste of yours. Unity and Unreal have many, many more man-hours of work put into them than anything you can build, so by choosing one of them you can avoid pitfalls you WILL run into starting from scratch, on top of the labor you'll save not having to build one in the first place. On top of all this, the entire gaming workforce is oriented around these two engines, so when it comes time to collaborate, you will be able to bring people aboard who can contribute immediately.

The GPGPU stuff is critically important if you are targeting low-level programming, to which I would add AI processors (NPUs, TPUs, etc.) And bone up on your statistics and linear algebra to like, the "Ph.D in math" level. The AI rocket is about to take off, big time; you want to be on it.

Counter-point : the tradeoff you accept when using a commercial engine is that they're extremely general purpose, which can be unsuitable if you're trying to do something weird.

Look at Braid if you want a good example. Using Unity or UE to build that game would almost certainly require more work than writing a simple 2d platformer engine. Furthermore, the story of how it came to be is, in fact, inexorably linked with the act of writing the engine itself.

Sometimes, writing the engine is the right choice.

Braid was released in 2008 -- forever ago in game-industry time. The industry has become more consolidated around Unity and Unreal since then.

Unity has 2D platformer support built right in, and the tricky bits -- like the time mechanic -- could be written as an extension. Heck, there's probably a time rewind mechanic in the Unity Asset Store as we speak. They've so far advanced that you're just never going to keep up writing a bespoke engine because they've benefited from being integral to the industry as a whole. Furthermore, the skills you develop on your own with your little bespoke engine aren't going to translate into the industry, where everybody uses Unity or Unreal.

It's kind of like how you're never going to build a graphic design business using GIMP, Krita, or Inkscape. They're all nice tools for amateurs and dilettantes, but entire industry standards and processes have coalesced around Photoshop and Illustrator, so that's what you use. The open-source alternatives are decades behind the curve here and in some ways, will never ever catch up. Good luck getting PANTONE support, which is critical to graphic design for print, into GIMP or Inkscape, for instance.

but the sprig team just wants to have fun. its exciting for them to NOT use a major engine. It feels new and exciting to work on things that are new, and not go along with the crowd. Time might be money, but we're still teenagers after all.