News for hackers. Stuff that matters.
Re:Show HN: Simple 2D car physics with JavaScript by tomxor on Wednesday January 01, 2020 @12:53PM (#21929304)
:( ah well, was fun while it lasted. I was the "HN" sprite :P
Re:Show HN: Simple 2D car physics with JavaScript by pkstn on Wednesday January 01, 2020 @05:46PM (#21931276)
Looked fun, I was just worried about game performance and server bandwidth usage..

Both frontend and backend are open source and work straight away without bundling, if you want to fiddle around:

https://github.com/pakastin/car https://github.com/pakastin/car-ws

Pull requests also welcome! ;)

Re:Show HN: Simple 2D car physics with JavaScript by tomxor on Thursday January 02, 2020 @01:21PM (#21938072)
> Looked fun, I was just worried about game performance and server bandwidth usage..

Yes, that turned out to be a legitimate concern... later on I saw people go a step further and write entire sentences out of cars... they probably didn't realize but it was effectively DoSing your server and preventing anyone else's socket emits getting through so all you could see is the text.

I guess it's a difficult balance if you want to allow playful hacking but don't want to be DoSed. (BTW it's easy to bypass the origin restriction by just injecting code into the browser), perhaps a better restriction would be a max sockets per session or IP, that would still allow some hacking but reduce chance of DoS intentional or not.

Anyway I changed tack to try implementing some basic bots in smaller numbers. Was fun to see how people interact with them.