{"id":19489472,"url":"https://github.com/1j01/hacky-game","last_synced_at":"2025-02-25T19:26:47.237Z","repository":{"id":67695976,"uuid":"42155782","full_name":"1j01/hacky-game","owner":"1j01","description":"Crazy tech demo game thing with automagical LAN multiplayer","archived":false,"fork":false,"pushed_at":"2019-04-02T01:37:30.000Z","size":242,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T08:40:29.851Z","etag":null,"topics":["doors","game","hack","hacky","hacky-game","lan","lan-multiplayer","local-multiplayer","multiplayer","nexe","nw","nwjs","tech-demo","technical"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1j01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-09T04:23:15.000Z","updated_at":"2023-09-08T17:01:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8128635-e7d5-4e66-8685-0db398a72bec","html_url":"https://github.com/1j01/hacky-game","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fhacky-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fhacky-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fhacky-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1j01%2Fhacky-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1j01","download_url":"https://codeload.github.com/1j01/hacky-game/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240731776,"owners_count":19848578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doors","game","hack","hacky","hacky-game","lan","lan-multiplayer","local-multiplayer","multiplayer","nexe","nw","nwjs","tech-demo","technical"],"created_at":"2024-11-10T21:08:41.578Z","updated_at":"2025-02-25T19:26:47.224Z","avatar_url":"https://github.com/1j01.png","language":"CoffeeScript","readme":"\n# ![](game/images/icon-32.png) Hacky Game\n\nThis is the start of a game involving some crazy technical jazz,\nfor the sake of magical minimalism.\n\nThe game will be a platformer,\nwith lots of interconnected rooms and various enemies,\ntaking some inspiration from [Kirby \u0026 the Amazing Mirror][].\n\n(Some basics are implemented, like blocks, slopes, one-way platforms, and doors.\nThere are several rooms, but they're pretty boring,\nand the art is very preliminary.)\n\nThe game supports LAN multiplayer,\nand the client's world is simulated in between updates from the server,\na basic implementation of [client-side prediction][].\n\nSingle player is treated the same: the client hosts a server and communicates with it locally over TCP.\nThis might change.\n\nWhen other servers are discovered,\na door is opened to another world.\n\nPlayers can travel between worlds,\nand you can even have two players in each other's worlds.\n(But the player's client has to be online for their world to be available.)\n\nYou should be able to get a feel for the game in single-player,\nwith a substantial world to explore, but\nI think multiplayer will be the real focus of the game\nand I think it would be interesting to have parts of the world that you can only explore with a friend.\n\nOh, did I mention the worlds are gonna be procedurally generated?\nThat's probably kind of important.\nIt might have some areas that are the same in all worlds, like a tutorial level,\nor perhaps just fairly similar and functionally identical.\n\nBoth players should gain from exploring either players world.\nIt should be like the worlds combined make up the space to explore,\nand which one to do first shouldn't feel contentious.\n\nThere could be doors that require multiple keys, that you need to get from several people.\nThere could be keys that belong to random other worlds and you have to find the one player whose world contains the door.\nThere could be halves of items (including keys).\n\nKeys could be 2D \"pin arrays\", where locks run a game-of-life simulation for a number of iterations.\nThis would work well for a 1BPP game, as alternative to using color to distinguish keys.\n\nThere could be portals that you can pick up and place, including between worlds.\n\nThere should be limits on the viewport,\nmaybe fixed but not necessarily;\nit could have a maximum viewport size, and the ability to look in a direction,\nand then the total amount you could look could be fixed\nwhile allowing for a range of screen sizes on handheld systems etc.\n\nThe game runs in [nw.js][] (so it can include both client and server),\nbut the final `game.exe` is a wrapper.\nThe wrapper currently built with [nexe][],\nalthough this essentially means distributing two Node.js runtimes,\nwhich is a considerable amount of overhead which could ultimately be avoided.\nIt downloads the [nw.js][] runtime (on first load)\nand extracts a zip file from [a resource in the executable][nexeres] containing the main application.\nThen it launches the game, passing in the path to the executable.\nIt does all this so it can read and write game state from the end of the `exe` file.\n(At the moment this functionality is disabled.\nI did a tech demo of this first, but there are no persistent elements to the world yet.)\n\n\n## Open Doors to Other Worlds\n\n* Local multiplayer\n\n\t* ~~Discovers other clients through tiny JSON files stored with ports and PIDs.~~\n\t  Discovers other clients through [SSDP][]\n\n\t* **TODO:**\n\t  Manage input methods for multiple players.\n\t  You should be able to play with two people on one keyboard,\n\t  without some program to send input to two windows at once.\n\t  \u003c!-- sending inputs to two clients through one window. --\u003e\n\n\t* Could try to do single window splitscreen (\"normal\" local multiplayer) instead.\n\n\n* Multiplayer over LAN\n\n\t* Discovers other clients with [SSDP][]\n\n\t* You can use [Hamachi](https://www.vpn.net/) to establish connections between computers if LAN doesn't work for you\n\n\t* **TODO:**\n\t  When booted from a server, have the world door sputter out behind you\n\n\t* **TODO:**\n\t  Get booted if server doesn't respond for some time\n\n\n* **TODO:**\n  Implement [client-side prediction][] smoothing\n\n* **FIXME:**\n  There is a [race condition][] when going back and forth between rooms\n  where you can get viewing a room that you aren't in.\n  Entering a door involves sending a command to the server\n  but you switch the room you're viewing instantly.\n\n* **TODO**:\n  Remove the need for client-side prediction on the client's own server;\n  maybe merge the client and the server so they use one `World`\n\n* **TODO:**\n  Use random seeds to render the exact same blades of grass etc. as another client for the same world.\n  (Also, with pixi.js, it'll probably be fast enough to render the grass dynamically, so there could be wind and stuff,\n  rustling through the grass as you move,\n  explosions sending waves of air...)\n\n\n## Install\n\nFinal builds of the game will be standalone executables,\nbut there's not much of a point yet to trying to release builds.\n\nYou'll need [Node.js][].\n[Clone the project][cloning a repo]\nand then, in a terminal/command prompt in the project's directory,\nrun:\n\n\tnpm install ; cd game ; npm install ; cd ..\n\n## Run\n\nAfter installing, you can run the game with:\n\n\tnpm start\n\nOn the first run, it'll download the [nw.js][] runtime.\n\nThere are also scripts to run multiple instances of the game:\n\n\tnpm run start-secondary\n\tnpm run start-tertiary\n\nThese only work on Windows, but I could make a CLI script that works cross-platform,\nand allows any number of instances,\nplus other options like `--enable-logging`.\n\n\n## Build\n\nThe game implements hackily saving game data directly to the executable binary,\nwhich is rather platform specific.\nThis is only implemented for Windows so far,\nbut it should be feasible on at least some other systems.\n\nOn Windows:\n\n\tnpm run build\n\nOn other platforms, for now:\n\n\tnpm run build-simple\n\n\n[cloning a repo]: https://help.github.com/articles/cloning-a-repository/\n[Node.js]: https://nodejs.org\n[nexe]: https://github.com/jaredallard/nexe\n[nexeres]: https://github.com/jaredallard/nexe/pull/93\n[nw.js]: https://github.com/nwjs/nw.js/\n[client-side prediction]: https://en.wikipedia.org/wiki/Client-side_prediction\n[SSDP]: https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol \"Simple Service Discovery Protocol\"\n[race condition]: https://en.wikipedia.org/wiki/Race_condition\n[Kirby \u0026 the Amazing Mirror]: https://en.wikipedia.org/wiki/Kirby_%26_the_Amazing_Mirror\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1j01%2Fhacky-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1j01%2Fhacky-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1j01%2Fhacky-game/lists"}