Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wrote effectively the same thing without AWS lambdas https://playmcnow.com/

It’s so cheap[1] to start and stop servers on demand that I’ve decided to give “away” servers for free. I wrote a little proxy in Go that detects minecraft login requests and starts a server with the specific world. After a dropped connection I stop it.

[1] For 15€/month you can have ~30 servers running in parallel and thousands of powered down worlds. https://contabo.com/en/vps/



BTW, other fun hacks include:

1) Initial world creation is quite slow - 10-15 seconds on a moderately powerful hardware. Since I want first joins to be as fast as possible, I keep 1000 pre-generated worlds and one of them is chosen randomly to be used as template on your first login.

2) In addition to login packets, minecraft clients send a ping packet to check if the server is online. I forge a valid response because I don't want to start a server just so you can see "server is up, 0 players online".


This gives me an idea for recycling the powered down worlds into "new" worlds for new users. Being able to see and use the abandoned bases of past players would be quite fun.

You could take this a step further by "decaying" the bases in some way (remove torches, remove some large percent of the items in chests, add vines, weather rock, move blocks from the ceiling to the floor, etc)


At least the issue with that years ago was when minecraft would have an update that introduced some new generated resource where you would have to get to the edge of the map to generate some to use. Most servers restart periodically to get fresh resources near spawn, not only for new resources that might have come out in recent updates, but just because the area has been completely harvested by past players like some scarred piece of land and you need to start venturing out far to find trees or ore.


Is there a mod that gradually adds new resources to old worlds, gradually adds ores back to their gaps in caves, gradually restores the environment, as well as gradually removing torches and “decaying” old structures?

Otherwise someone should make one. No need to full reset servers any more.


I think some servers do "chunk resets". The idea is to take chunks with little or no player activity and delete them so they'll be regenerated next time someone comes along. I think I've heard of this being done automatically (chunks that a player hasn't been to in X days will be deleted). It would lead to a discontinuous world though, with older chunks having sharp borders with newer chunks that aren't even the same biome.


You get to explore an ancient civilization that went extinct!


This is great idea, but may be tricky as people often just mess around with the world. You would need to, somehow, decide which abandoned base is visually appealing and/or matches the environment.


If my memory serves me correctly, it is rather easy to decouple natural from player made blocks. It was either stored separately on storage or at worst you can deduce it by "subtracting" a fresh chunk generated from the seed.

Then you just need a good heuristic to guess whether or not a group of blocks matches your definition of a base to be explored.


Yep!

You could take this a step further; once you have determined that a set of chunks have been modified significantly, you could apply that set of changes to the same coordinates of any map generated from that seed, meaning you can combine changes from multiple worlds into one (with the same seed).


Fwiw, there are public servers that have been running for a decade now that have a similar effect. The world is chock full of player content just sitting around waiting to be rediscovered.


Even without modifying the world it’s an interesting idea. Basically the option to fork some random person’s world as your new one.


Cool way to see and judge phallus build quality.


I was looking for a way to incorporate forging responses to the pings but couldn't find a way to consistently have a socket open on 25565 that didn't incur a hard monthly cost. Your service and approach looks great, I'm surprised I didn't run across it when researching before...


I'd love to discuss helping out with this project, but I don't see a way to contact you on your HN profile or on the site. Is that something you are open to?


Sure, get in touch at stanislav.ltb[at]gmail[dot]com :D


Sent!


Those Contabo VPSs are shockingly cheap. Seemingly several times cheaper than, say, vultr. How do they do it?


I could see a couple ways to make it work - use the NVME drives they mention as swap space to get cheaper, but lower perf RAM, and put multiple vCPUs on each core. Lower performance, but still exactly what they offered.

But that's my skepticism talking.


Massive cpu steal and poor storage io performance.


It would be good to add some explanation to your site describing what it is and how to use it. I clicked the link and had no idea what to do next.


Wow this is really cool, thanks for making it free as it seems really handy, one question though, is there a way to get op to use commands for creative mode etc? Also my skin doesn't seem to load on the server for some reason but it's not the end of the world. Thanks.


Thanks for trying it out! Op commands are disabled because I haven't gotten around to making every user admin by default. I also remember some vague security concerns on the back of my head ;D. It would be cooler if I could also let you change the game mode from the web interface.

As for the skins - servers run in "offline mode", which means no communication with the Microsoft authentication API responsible for validating accounts and (I believe) giving skins to players.


Would you say their lower M tier is enough to run just a couple of worlds? (Possibly modded.)


Yup. In my experience a stable server requires about 700MB of RAM. There are reports on https://www.reddit.com/r/admincraft/ saying you can run it in 200 MB but I haven't managed. Probably with the right swappiness settings, performance tuning of the JVM and the Spigot / PaperMC instance.

So 16GB of ram should be enough for 20-60 servers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: