Hacker News new | ask | show | jobs
Show HN: Rocket Drone, a lunar lander type game for the web (rocket-drone.lol)
102 points by crispisulcans 1410 days ago
45 comments

Hi all, thanks for all the great feedback so far! Here is a bit more context: I (also go by wavy) made this game while taking a break from my work project. It was inspired by the old-school lunar lander games as well as drone racing. I wanted to build something that illustrates the difficulty of drone flight. It was made in p5.js over the course of several weekends. I never really intended on publishing it until I showed it to a few friends who kept on encouraging me. I'm glad some of you are enjoying it!
>I wanted to build something that illustrates the difficulty of drone flight.

I think you nailed this part 100%. I suck in the very same way I did with my first - and only - real life drone I bought.

Many thanks for publishing it, think about releasing it as open source my daughter had a blast modifying the source code. Adding a little sister mode making it almost impossible to beat.
Hi again, for those interested the source code is now available at https://codeberg.org/wavy/rocket-drone
There is something very frustrating with the spin inertia, almost impossible to regain control when things start rotating...

Here is a tip for a recent C64 game that uses one rocket like lunar lander:

https://csdb.dk/release/?id=201753

I tried it just now (took me a while to figure out how to run this). From what I'm seeing this game has what is equivalent to attitude control on autopilot, meaning you stop spinning right away when you release the input. It is definitely easier to control, but removes one of the main challenges of drone flight.
Ok, yes you are right... rotational inertia is the challenge in Rocket Drone for sure.
I ran this full screen and let other people play. Some notes:

It's a really easy game if you have a slow computer, the physics has to be separated from the graphics.

Add a splash screen with the "Rocket drone" name when you die so it's easier to know what's being played.

The instructions for using P and Q was not obvious for three people who tried it. (non native speakers and children). N=5

Fun as a fast game or as a slow game.

Thanks for the user test :) I updated the game loop to be separate from the rendering loop. Any chance you can tell me if it is still slow?
Sorry no change, but on smaller maps it has better speed. So obviously a CPU issue or something.
It seems like since I first tried the game, it's gotten really slow on my machine, which is very odd, considering that it's a desktop ryzen 9 with 16 cores and a beefy graphics card. Weirdly, it still runs fast (and is consequently much more difficult) on my laptop.

Just tried it on my son's machine, which is the same hardware as mine (but running Windows rather than Linux, both of us using Brave for browsing) and it's fast there too. On my machine, even the clock rendering is dramatically slower than real-time; I'm not sure what's going on.

Great job with the feel and aesthetic!

But it's way too hard for me: I couldn't get past Level 3 of the tutorial :/.

I want to swap P&Q doesn't feel natural. This is hard as hell :D
Agreed! Even after getting used to it a little bit, really hard.
which keys would feel more natural for you?
Two adjacent keys so the same hand can be used. Consider having introductory levels with lower acceleration rates.
Make P=Q, and Q=P (swap the keys)
This, or at least allow inverted controls. It feels very counter intuitive to me as it stands. Seems like it could be fun though if that's added.
Also consider a more typical control scheme: up arrow is equal thrust, left arrow is a counterclockwise rotation (but at a much lower rotational acceleration rate than currently), right arrow is clockwise
This is a pretty solid game. Two thoughts:

- It is so hard to maintain control that it feels unfair rather than challenging on tricky levels.

- The game should reward the player to give them a sense of progress - this will prevent many of them from quitting after struggling for a few minutes. A leaderboard could work.

First couple of free play (random I guess) levels were easy, then I ended up with one where there was insufficient fuel to complete it. It might be solvable by going balistic through some section, but I lost patiens, then couldn't find the random id for a retry later.

Highscores for the daily (and yesterdaily to check where you ended up) would be nice.

On mobile it shows controls in lower left/right corners, which is a little inconvenient. Luckily, touching anywhere on the left/right side of the screen works.

Possibility to zoom out would be nice, to avoid the possibility to fly into a dead end.

Also, I'm somewhat confused. This is HN and noone has yet posted some js that calculates/plays automatically? Iirc that was the case for the NASA docking simulator. Or did I dream this up?

Thanks for the feedback! The level generation probably still needs tuning to avoid those kinds of levels. Daily leaderboard is a great idea!
Reading the other comments I tried the tutorial (who plays tutorials?!). They did feel faster (and thus relatively more difficult) than the random levels. Is inertia and gravity the same on all levels?

And tutorials 8 and 9... they are intended for someone to implement automation, aren't they?

Inertia and gravity are the same on all the levels. I don't know why it would feel different... Yes, levels 8 and 9 are meant to be more challenging. you might encounter obstacles like that in the random levels. Each level of the tutorial is meant to give you practice tackling different kinds of obstacles. I would love to see what automatic inputs can do for some of these levels :)
If its not the physics then its the simulation. Free play is a lot slower than the tutorials, time feels like it is running at 50% speed. Android tablet, firefox.
oh I see, yes it could be performance-related. I will need to decouple the game update loop from the rendering loop. Will do soon.
I was able to manually succeed on level 8, but I have no idea how it's possible to accomplish level 9. I can't figure any way to get enough inertia or upward thrust to escape the narrow spot once I'm most of the way through it.

EDIT: and... literally on my next attempt, I made it through the narrows. It's possible.

EDIT #2: and... made it. >:D

How do you implement a leaderboard that can’t be spoofed with REST POST calls from curl or postman?(Genuine question for my own JavaScript game) doesn’t need to be perfect just a barrier that makes it painful to spoof easily
Include the complete inputs for the solution, and verify on upload.

Then don't accept dupes and make the leaders winning flights watchable.

Yes this is what I'm thinking. The replay links already include the full input. I would then just have to verify it and show the link for each entry. For example this is my flight just now for today's daily with a time of 12.97s: https://rocket-drone.lol/?level=5550594399&replay=IIgmIUWAJB...
Ooooh, replays already exist. I didn't notice the button.

https://rocket-drone.lol/?level=9&replay=IIiKIUWARAOBhYBzAQg...

sub-10s. feels like cheating with slowed reality of course.

https://rocket-drone.lol/?level=5550594399&replay=IIhSIUWBhB...

This requires deterministic physics.
Save the random seed
Really really fun. Thought "I'll give this a quick go before dinner" and ended up spending long enough on it that I need to re-heat dinner now.

Always been a huge fan of these types of games, and I think this one nails the frustration-that-means-you-appreciate-the-wins-more feeling that lots of arcade games had, and that so many modern games miss.

Classic problem of the game is too easy for the developer because they've been playing it for so long. The controls are unintuitive but fun if you're willing to take a beating for a while. Even after a long time learning tho there's a strong lack of control, a little bit of rotational friction tending to keep the ship upright would go a long way
I have many hours on a similar game on Android (Landing Confirmed), and although the particular tuning here is different, the general physics is the same. I'm having a lot of fun and it's still very challenging.
Very cool game! I'm into controls and would love to write a PID controller for it to stabilize it and have it auto-follow my mouse, as a controls demo.

I'm not sure how best to capture it's state though (position, xy velocity, angular velocity, etc.), Nor how to integrate mouse into it.

Not a bad idea, though you would have to use bang-bang control since the thrusters are either full on or full off. I'm not sure if you can integrate anything as is, but when I release the source code you can try to build up from that.
Tapping the keys at a certain frequency is the same thing as PWM control, which gives you an duty-cycle-based analog-like control input. PWM is just on_time/(on_time + off_time), so there are a number of ways to do this even with the key input as you have it. Again, in summary: you can do PWM duty-cycle control or tap-frequency-control, which is really just the same thing.
Lots of fun. Works surprisingly well on mobile too.

The Astro’s Playroom tech demo for the PS5 has a level like this where the DualSense triggers are used for the thrusters. The force feedback is incredible and really gives you an edge in feathering the thrust. It’s also a lot easier!

The controls get stuck on my Android phone. It'd be much more fun if that didn't happen.

The fact you have to land fully in the 'landing pad' is also immensely annoying. With a more play testing and better controls it could be fun.

I'm really tempted to make a clone in React.

Hmm I don't have an android phone to test. I hope it's an isolated case..
Found a way to reproduce, not sure if it is the source of the problem above or something else. When holding a pen while pushing the thrusters with the fingers, the thrusters get stuck in their current mode when the tip of the pen gets close to the screen (and the cursor appears).
Had no issue on my Android phone, Firefox Android 103.
Awesome! Great work. Reminds me of Landing Confirmed on android on which I have extensive flight experience, but this particular tuning of the physics feels more difficult.

Is the acceleration constant or does it dependent on fuel remaining like real rockets?

Thanks! I didn't know about Landing Confirmed. It looks pretty cool too. The thrust is constant. With both sides firing it has a 2:1 thrust to weight ratio.
I see, great! I'm having a lot of fun still after many hours on Landing Confirmed. I think the auto generated levels are a great touch. I would add a threshold for collisions, so that under a certain low speed, collisions cost no health. Either that or add landing legs :) You could also easily have different types of vehicles by just varying the thrust and the distance between the two engines. Would make a easy variety being able to pick a spacecraft. Also you can easily make different "planets" by just changing the background color and the gravity value :) and on some planets add an atmosphere of various thickness which adds drag!
There is already a collision threshold, but very low. I might have to increase it to be noticeable. Otherwise great ideas all around :)
Wow, this is a very hard game :) Five tries to even go away from the first platform :)
After trying this for 30 minutes and not landing... I noticed the .lol domain extension.

I hate you

A lovely little game, I didn't enjoy Q and P as the main controls as it forces two hands and there are few existing games using this layout, so a little counter-intuitive. Otherwise a great LL clone!
Wow. This game is hard, and kind of addicting. I haven’t even gotten to land safely once.

One feedback: on mobile, if my phone locks or I navigate away from the browser, it freezes when I come back. I can’t click reset. (IOS)

Hmm I'm not able to reproduce that. Which phone and iOS if I may ask?
Really cool game, but the name should be something different, like Explosion simulator or Drone kamikaze. I couldn't even complete the tutorial, I can't keep control of the thing :)
I'd love to see you add some settings we can change, such as gravity and moment of inertia parameters, engine thrust force, and custom control keys.
Could do with some optimisation. Runs very slow for me.
Just perfect, don't change a thing about the steering! <3 Very rewarding!

Add some cool retro music and wait for Ludwig yelling at the game on stream ;)

This is brilliant. Spun out of control into a fiery crash.

Any chance you could, if you're the creator of this, share the source code?

Thanks! Yes I can consider sharing the source code. Check back in a few days :)
Modest success using African drumming patterns on the thrusters. Always knew that class would be useful one day.
I've always found rocket thrust control games like this extremely satisfying for some reason.
Level 8725302049 is absolutely mean

Love it; look forward to next version with 1 booster + 2x reaction wheels ;)

Even if you use procedurally generated levels, first few should be hand picked to be easy.
You are a sick person, crispisulcans, why would you bring misery to the world ? :D
Holy shit this game is hard. First few levels, maybe a bit of extra health?
Try Crossing Hand, Right hand on Q and Left hand on P.

It will help a little bit, not much.

I can’t get anywhere on this. Instantly lost 20 mins of my life!
Looks perfect for use in RL tutorials. Does it have an API?
I hadn't planned on that use case, but check back in a few days where I might share the source code. Perhaps you or someone can build around it.
Just a small suggestion, make the initial few levels easy!
Thanks! I intended for folks to start with the tutorial. They are easier than any of the free play levels but still challenging until you get used to the dynamics.
Crash and burn. Constantly. Why do you do this to people?

I’m trying again…

this is awesome - definitely takes some skill. is there a website for simple games like this (sorta like miniclip)?
Most of the challenge comes from bad controls.
Definitely want to learn more about this!
At least it's fast to try again!
window.setInterval(() => game.drone.damage_threshold = 1000, 1000), still hard. Very nice!
Agh so good but so annoying :)
controls are way, way too sensitive.
god damn this is so hard hahaha
This game is terrible, I will not be playing it again.

[47 long years pass, my family gathers solemnly at my deathbed]

Fine, okay, one more try. But then that is it.

The thrust being so sensitive you have no control, and then when you have enough speed, you have no power. It's literally unplayable.
Absolutely unplayable. I spent 5 minutes on the "tutorial" and can't do anything but crash after 2 or 3 seconds. Looks like trolling, not a game :)
why not use the arrow keys?

It's bloody weird using both hands to try and control the ship

I avoided arrow keys partially because the drone will generally not move in the direction you press, but I'll consider adding alternate key mappings :)