6 ms·
Show HN: RESTful Doom – HTTP+JSON API inside Doom
- fedebongio 9y agoI saw this presentation twice, and everytime is better. I love it.
- Impossible 9y agoThis is a fun little project. I'm anxiously awaiting obligatory HN comments about how C is unsafe, you should never write a web application that uses strcmp, and maybe this would be ok if he rewrote Doom in Rust first :).
- brian_herman 9y agoYou took the words right out of my mouth.
- dang 9y agoPlease don't post like this. Analogously to how antivirus and virus software are kind of the same thing, it perpetuates what you're complaining about.
- rpazyaquian 9y agoNow to add Twitch integration.
- jeff_harris 9y agoHaha yes... although I would be slightly nervous to expose my janky C code to the internet. Where I'm confident it would crash and burn in a very short amount of time :)
- _lce0 9y agoMost certainly your machine will suddenly reboot to a newly installed arch ;)
- jeff_harris 9y agohaha yes!
- Xeoncross 9y agoUse a proxy. Openresty (nginx+lua) or a Go app would do. Only allow whitelisted commands through like the basic control commands and then pass it on to your C code.
- jeff_harris 9y agoyep, that would definitely be a good idea!
- pjc50 9y agoI'm reminded of "psdoom", a version of doom that let you kill processes with the shotgun: http://psdoom.sourceforge.net/ http://psdoom.sourceforge.net/
- jeff_harris 9y agoYes, I think subconsciously I was also. I remember being amazed by that back in the day also!
- qualitytime 9y agoGreat work and fantastic project idea and method of execution.
- jeff_harris 9y agothanks! It was a lot of fun. Big thanks to chocolate-doom project also which I built on top of :)
- coroxout 9y agoThat's pretty cool! Well done. Now I'm wondering whether the game clock could be suspended unless ticks were sent via API, to turn it into a turn-based game to be played only via API calls...
- jeff_harris 9y agoI had an idea to write a text adventure interface, where you would type in 'forward', 'left', 'shoot' etc via the API. We understand nearby objects like doors, monsters and pickups, so could implement things like "An 'IMP' appears 300 yards away", or "There is a door requiring a red key in front of you" etc. Could be fun!
- JazzXP 9y agoSounds like an API version of Superhot.
- jeff_harris 9y agowow I hadn't seen that game, the trailer looks amazing!
- OutsmartDan 9y agoAmazing work!
- cschep 9y agothis is SO cool, thank you!
- deleted 9y ago[deleted]
- netvarun 9y agoSince this has 'native' integration it could be a great testbed for learning/applying reinforcement learning algorithms in a fun setting without having to deal with the 'heavier' (but more comprehensive) vnc based tooklits such as openai universe. Awesome work, btw!
- cdevs 9y agoWell now I'm screwed at work tomorrow, I want to tie in so much of our logging into this some how like psdoom. Q: Are the files done processing ? Me: I don't know check if the door is open in doom.
- jeff_harris 9y agohaha yes!
- juststeve 9y agoSo nerdy but so awesome - my jaw dropped when i watched the video :) i think this could open up possibilities with live stats if each player runs their own server and the results are combined on into a seperate website? otherwise it could be used to create new game modes or a scoring system?
- bmn__ 9y agoThis isn't REST, there are no hyperlinks and no hypermedia controls. It is designed pretty wrong. Just look at this brittle coupling! POST /api/player/actions Content-Type: application/json { "type": "shoot" } How do I know what "type" of action is available to me? It isn't documented. Why should I need to know or try to look it up in the documentation in the first place, anyway? The server should just tell me what I can do, and then I act on it! Why should I need to know all these special URLs, except a single central entry point (a.k.a. bookmark)? The server should just tell me from each resource where I can go to! A more useful attempt: GET / Content-Type: text/html <p>The <a href="equipment#shotty">shotgun</a> is equipped. There is a <a href="items/157">green armor</a> ahead.</p> <p>You see a <a href="monsters/2018">baron of hell</a> attacking an <a href="monsters/1170">imp</a>.</p> <p>There is a <a href="doors/104">yellow-framed door</a>, attempt to <form action="doors/104" method="post"> <input type="submit" value="open" /></form> it.</p> <form action="position" method="post"> <input type="hidden" name="x" value="-225" /> <input type="submit" value="move forward" /></form>, <form action="orientation" method="post"> <input type="hidden" name="angle" value="90" /> <input type="submit" value="turn left" /></form> … (HTML used for ease of illustration on HN, alas JSON proper - being a dumb serialisation format - it deficient of hyperlinks or hypermedia controls, but there are extensions for it. This audience is less likely to be familiar with them.) It really bothers me that programmers call things REST, and when you look at it it isn't REST at all because they don't know the first thing about it.
- MuffinFlavored 9y agoCan you share some of the extensions?
- Dashron 9y agoI like hal+forms!
- MuffinFlavored 9y agoIn a traditional REST API, where do non-RESTful things (like other API calls, or "business logic") tend to go? Is there /db/restEndpoints and /rpc/nonRESTfulEndpoints?