HNHacker News
TopNewBestAskShowJobs

KilledByAPixel

517 karma · joined April 2, 2019

submissionscomments
KilledByAPixel··on How I made a 3D game in 2 KB of JavaScript
You could do that, but it would not compress as well. For example the word const is not use anywhere in the 2k version, while Math. is used about 40 times so it becomes essentially free when compressed.
KilledByAPixel··on How I made a 3D game in 2 KB of JavaScript
Nope! It is not a raycasting engine at all, but instead built similar to old school racing game tech.
KilledByAPixel··on How I made a 3D game in 2 KB of JavaScript
HD because many tiny games like this do not stretch to fill the whole window. It requires extra code to do this and have everything scale properly.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
It is the JSCrush code. I don't fully understand it, but it's a brute force approach to find the longest substrings.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Yes, localstorage is great, but this for making URLs that are short enough to share on twitter, dischord, etc. The max twitter url length is ~4000 characters I think.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Awesome project.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Thanks, that is good reference. It makes sense that Zip would beat out JSON for longer strings. Just as another point of comparison, how about encodeURIComponent(gzip(input))?
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Also, LZ beats it out for longer strings, but not by much for strings in the target range (~5000 characters).
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
I do want to use that as reference if I ever decide to clean it up.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
I assume they minified it, but I don't have access to the unminified source. I'd like to clean it up or find a cleaner version, but for now it works well enough.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Looks cool, I just checked into it. It does work well, but doesn't appear do anything to reduce repeated substrings. Maybe a combination of the two would work well though.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Encoding to base64 increases the size by at least 33%. This is to help make links small enough to share on places like twitter, dischord etc where the max length is around 4000 bytes.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Yes, I'm interested in trying to make it work with longer strings. Worst case scenario if it gets long strings it could just split it up into strings of length that it can handle. The speed seems to decreases rapidly with string length at some point eventually hitting a brick wall, the sweet spot seems around 1000-5000.
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
This is the JSCrush algorithm that I did not write and it is kind of magic. The uncompressor is crazy small. You can read more about it here...

https://nikhilism.com/post/2012/demystifying-jscrush

KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
As far as I know base64 is not guaranteed to be uri safe, though most of the time you should be fine. However more importantly converting to base64 automatically increases the size by 33%

https://developer.mozilla.org/en-US/docs/Web/API/WindowBase6...

KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
I had some issues with long strings, like 5000 or greater. What length string were you using?
KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
It worked great for my use case http://zzart.3d2k.com

Reduces share urls by about 75% for these very repetitious JSON strings.

KilledByAPixel··on JSONCrush – Compress JSON into URI Friendly Strings
Sorry, that part of the code is from JSCrush which I did not write. I don't fully understand it but here's an explanation someone wrote...

https://nikhilism.com/post/2012/demystifying-jscrush

If you go to the live demo, it will do a test to crush/encodeURI and uncrush/decodeURI to the string you pass in and verify that they are the same. Maybe I should write some automated tests.

KilledByAPixel··on I’m only making business card sized games now
Hi, I'm the author of the post. Thank you for your thoughts!

I certainly don't want everyone to make business card games. I do however want games that are tighter and more focused. Like imagine RDR2 without the mini games, shorter story, and just much better core mechanics. That's the game I want to play.

I will say though that philosophically a deep and complex game can already exist on a business card. Take the classic board game go for example. Someone could probably code that (minus the AI) on a business card, and it's one of the most complex games known to man that people have been playing for thousands of years.

The lesson I was going for is not anything can be simple, we already know that.

The lesson is more about how developers are so focused on making games fun that we sometimes forget that making games should be fun too. I really do believe that for any kind of artist, to create great art, it's more important to have fun creating something then what the actual end product is.

Also that there is value in simplicity, it is sometimes worth creating something that seems pointless just because it's fun. The journey towards it may yield unexpected rewards.

KilledByAPixel··on I’m only making business card sized games now
I've watched lives literally be ruined by this industry. Why is it hard to feel bad for them just because they were doing what they loved and got shit on?
KilledByAPixel··on I’m only making business card sized games now
Thank you for understanding!
KilledByAPixel··on I’m only making business card sized games now
Do you think great artists make things that are fun to make, or do you think they really just try to make stuff that other people will enjoy?
KilledByAPixel··on I’m only making business card sized games now
Hi, I'm the author of the post. I actually am an indie dev myself and have many smallish games as well as worked in AAA for years.

I think indie developers tend to get it right more often, but anyone can fall into the wrong approach of over-complicating their games with needless features that actually detract from the fun.

Like take for example RDR2. Imagine if instead of having all those silly mini-games, they just polished the core combat and movement mechanics more. That's the game I want to play.

I guess I was trying to say a few things with this post, but one big part is that removing stuff from a game and making it simpler is often better then adding more stuff. I talk much more about that in my epic js1k post coming soon!

KilledByAPixel··on I’m only making business card sized games now
Hi, I'm the author of the post. The reason I made it is because I've already worked on a ton of other games and I wanted to try something different!

I've worked in the AAA industry for years on many games. Just recently on Doom, I remember that code was so bloated you could open "hands.cpp" and just hold page down for days. I've also released many games on my blog, like close to 40 games on there.

So the main point is just try creating something different. Maybe for you it's not writing tiny code, maybe it's something else that seems pointless but you know you will have fun doing it and at least create something in the end. Trust me, it will be worth it.

← PreviousPage 2 of 2