Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: My first game, minimal procgen gravity golf inspired by Desert Golfing (astro.golf)
232 points by mrspatula on Oct 2, 2019 | hide | past | favorite | 113 comments



Hi HN,

I just launched this little game of mine - Astro Golf. You can think of it as Desert Golfing but in space, where the gravitation pull of the planets create some interesting levels. I think it was on an HN comment that I first heard about Desert Golfing many moons ago, so it felt fitting to post this back here.

All the levels are procedurally generated, and are guaranteed to be hole-in-one-able. I did this by computationally testing a huge amount of levels offline.

This is my first game, and I learnt a lot doing it. Happy to answer your questions! I hope you enjoy it.

Peace


So simple, yet incredibly fun, well done! Could you share how long it took to build it ? I've been thinking about creating a small game, for fun, and to learn stuff along the way, and I am wondering how much time it would take me.


Thanks. The goal of this project was to actually get something out there, so I deliberately set myself quite a small goal. I probably got "80%" of the way there in 2-3 weekends back in March, then I got busy with some other stuff. I didn't want to let this become another project that falls to the wayside, so I then spent another ~6 weekends polishing, refining, etc in the last 2 months. It was a great learning experience, and I would 100% recommend making a game. It's such an interesting mix of programming, animation, design, art, sound.


Oh, actually I'm also interested in how you made the levels. Because of the computational difficulty of solving similar things (eg the three-body problem is hard) and you've got several variables to work with, did you just experiment with each level and place the holes retroactively based on an interesting shot you found?

Or did you have to do a bucketload of math to work out where to place things?


Great job on completing it - looks fun! Any comments on troubles you ran into and surprises on the way?


Thank you.

Lots of interesting troubles - quite a few surrounding Unity itself. E.g. they have a physics API that gives different results when run automatically by the engine at 1x speed and when you run it manually as fast as it can go. This came up because I wanted to test every level automatically offline, using the exact same physics simulation as the player would experience.

The procedural generation of the levels was also an interesting problem. I used rejection sampling to basically place non-overlapping circles in a box, but when you want to create quite a dense level this becomes very inefficient (it can be very hard to slot the final few circles in). I tried a number of heuristics and other methods to speed this up, but none of them actually improved over brute force. One of the most interesting was using Gibbs sampling - i.e. generate an initial valid level configuration, then move one planet at a time and sample from the ensuing Markov chain (basically sampling from the marginal distribution of each planet given all the others). This ~kind of worked, but was annoying for a few reasons so in the end I just brute forced rejection sampling on a beefy AWS server :)


It's funny isn't it... just a pretty space golf game on the surface; but a monster of mathematics underneath it. Impressive stuff!


Stupid question... Did you try a voronoi diagram?


Not a stupid question - I did some small amount of experimentation with voronoi, but I also had some global constraints / parameters that I wanted the levels to have and these were more easily implemented in the sampling method.


I like it. Only thing I'd change is maybe the stars to be a fainter, more blue hue, and maybe have them as points or subtly x shaped, just to help visually distinguish the ball.


Care to share the tech stack behind the game? Seems that you used a cross-platform technology to make it runable on several OSes.


The splash screen says Unity on it.


Yes, exactly. Have to pay $$ to remove that splash screen logo!


Stupid question, but I see your logo is on there as well. Might you be able to just make a larger image, or make a background image that blended in with the colors so as to make it illegible? I'm sure that was not top priority, just curious.


Even if you're technically able to cover the splash screen, you aren't legally or morally able.


That's why I called it a "stupid question", because I asked out of technical curiosity alone and without intent to do so.


No, they don't make it easy (and more importantly, it would violate their terms). You just have to pay to remove the splash screen.


It's really not much of a bugbear anyway. I actually found it useful to see it was built in Unity!


I loved Desert Golfing, and also love gravity games (Angry Birds Space is great, and Mario Galaxy is one of my top games ever) but I really wasn’t enjoying this until I read a comment here mentioning hard mode being more fun. I never would have tried out hard mode on my own, or bought the full game, due to the main mode being so hard and, for me, unrewarding.

I’m finding hard mode easier in a way. I learn something between each shot, where I don’t necessarily when I land on different planets and have to make a brand new shot. This also just keeps my motivation up. Coming into a new level in Desert Golfing I usually see some way to get the hole in one, and can evaluate less risky plans that make progress — I get very little of that in this game. So having a mode that lets me learn from each shot helps.

I think what I’d really like is a mode that resets unless you land on the target planet. Let me make the putt. The aforementioned ghost arrow would be nice too.


Thanks, that's interesting to hear. I need to think about how to make hard mode more discoverable.

I do think you can actually get good at zen mode as well, but it takes a bit of practice. Having played a lot, I can usually set up the trickshot I intended and get it most of the way there - and when it doesn't, it's usually quite funny anyway. It's definitely a steeper learning curve than DG.

I'm definitely coming round to the idea of a ghost arrow in hard mode. Your idea about a shot and a putt is also very good - perhaps that could even be the default mode..

Great feedback!


Oh I’ve got no doubt it’s possible to get good at zen mode — just a brutal learning curve for me that I wasn’t going to make it past without the helpful tip from another poster. :)


Yeah, perhaps it is a bit too hard for a mass appeal. I'll have a think about what I can tweak. :)


The ghost arrow in hard mode is live!


I don't normally install games on my phone, but this looks fun so I just installed it. Seems like something I could entertain myself with for some time!

Also kudos on having a Linux version <3


Thank you! The entire game was developed on Linux as well ;)


Interesting! Including the iOS game? I would not think so?


You're right, I used a mac to build the iOS version but it's literally copy and paste then hit build in Xcode.


Finished the demo and enjoyed the experience. Fun! Thank you!

Some ideas that would have made it even more fun for me, though which might change the game too much from your original vision:

Ghost arrow: show what shot I played last time, so I can tweak my strategy.

Reset: some sort of gesture to quickly go back to the start, so I can tweak based on the ghost arrow.

Escape velocity: a fun part of orbital mechanics, and a way to penalize me for just using a “hit as hard as I can” strategy where the only changes I make are shot direction.

Hard mode was the most fun because getting a cool hole-in-one felt really fun. I almost missed that hard mode was even an option — the help screen says “hard mode” so I assumed that was the mode I was in, but it turns out it was the button to play in hard mode, which turned out to be a lot more fun because of the reset mechanic.


Thanks for the detailed feedback - some really good points.

Ghost arrow is something I thought of, but I was concerned it would make the game too easy.

Reset: you can long press without dragging to reset. There's a tutorial-prompt for it, but it only comes up when you appear to be stuck in a gravity well (which can happen).

Escape velocity: I did have this initially, but playtesters found it very frustrating and preferred to see a crazy figure-of-16 through lots of planets. I understand your point of view though.

That's very good feedback on hard mode - I wonder what I can change to make that more obviously a button. I personally prefer hard mode too.


This is brilliant! I've put hours in to Desert Golf, and this is an improvement on every level.

In particular, I find it much more relaxing that Desert Golf, which I think comes down to a couple of factors. The design is one – the cute graphics and colours really help. Music is another – you've done a great job there.

I think the most important bit is the gameplay though – with not showing the score constantly, I'm not as worried about trying to keep my stroke count as close as possible to the hole number constantly. The gravity dynamic also adds enough whimsy that I don't feel like I "absolutely should have got a hole in one" like I did on some holes in Desert Golf.

All in all, great job! Instant purchase from me and I think I'll be spending a lot of time with it.


Thank you, those are very kind words.

Have you discovered Hard Mode in the menu? That might scratch the high-pressure itch if you every get bored of relaxing!

PS: and please tell your Desert Golfing friends!


Yeah I'll second that. This game -- on hard mode -- is hitting exactly the same notes as Desert Golf but even better. Super relaxing and very strong on the "one more hole". I've been playing on and off throughout the day, up to level... 58. And now 61 because of course I couldn't just put the phone down.

Extremely impressed that this is your first game. There's a ton of polish in there. Love how pleasing the animation between holes is; you can just tell that went through many iterations until someone with the exact vision said "Yep, there it is".


Thanks - people seem to be really liking hard mode!

That level transition took a lot of iterations indeed - I'm glad people are noticing it!


The gravity mechanic is really amusing! I was actually laughing at a particularly poor shot I made that somehow went into the hole after a minute or so of fast-forwarding. I also really like your use of typography in the tutorials. Well done.


Thank you. Yeah, a fluke trickshot after 10 loopy orbits feels pretty epic!


Congratulations on making something and seeing it through to the end (launch). I love posts on HN like this, people like you out there hacking away, learning, and make something useful/fun/cool like this. Bravo!


Odd bit of feedback for you and others - you should register your domain and put some placeholder content that at least a week before posting the link everywhere. Many corporate firewalls block brand new domains!


That's a really good point. Currently I have astro.golf just set up to redirect, so there's no "content" as such. How do you think that could work?


Feedback:

It says any level can be beaten in one shot. Okay challenge accepted. Give me a quick way to reset if my first shot fails. (or if there is, make it more obvious please)

I love how fast it loads and how seamless it is. I love love love games that don't have level transition screens.

Okay I think I figured out how to reset. Hold down tap when not moving. But it doesn't reset the shot count. Why not??


What you're looking for is "Hard Mode" which you can access in the menu. Good luck ;)

As for the reset not resetting the shot count: that would be too easy!


Aha perfect!

Also idea for a power up if you're so inclined: when you get a hole in one on normal mode, visualize the gravity wells for the next level or two.


That's a nice idea - might be a bit tricky though. I'll consider it.

I like the ghost arrow idea a lot - I'm thinking of adding that to hard mode.


Yeah by all means you don't have to implement what everyone suggests.

Another suggestion: replay shot.i just had a hilariously roundabout hole in one. I wish i could replay it to grab a video to share (and therefore advertise your game!)


Yeah, the replay is an idea I'd like to implement - just need to work out how to do it easily without going down a rabbit hole..


Surely just record the last shot parameters? or even all shot parameters?

As long as the simulation is deterministic you'll be good to go.

Given a level and a list of velocities any sequence of shots should be reproducible.


Share replay feature is live in the store!


Wow, absolutely fantastic mate! So cool; a friend and I tried our hands at making a game in Unity called Galactic Putt a while back, with a similar riff, but sadly the physics got the best of us and we never finished. It is really inspiring to see someone with a one man team put out something so stellar. Keep up the good work!!!


Congratulations on your first game, and keeping it simple and fun.


Great game! Purchased. I think you could have a lot of fun visually by giving the ball some trailing particle effects or some other creative coloration of the trajectory. Especially on the long shots that loop around a bunch of planets, i want to see the curve I've traced out!


It's probably a bit buggy, but there's an Easter egg if you tap 3 times on the middle right planet during the loading screen.


That's too awesome a feature to keep hidden away as an easter egg! Your trail should start looking cooler and cooler the longer it continues on a single shot, and you should be able to unlock designs by doing stuff like making long shots, orbiting around a planet several times, making N holes in one in a row, etc.


I remember playing a game like this when I was a kid (25ish years ago) at school, except it wasn't golf, but rather a two player game where you shot gravity-assisted missiles at each other (think Worms-in-space). I remember it being on an Acorn Archimedes, but it may have been a PC.


Yeah, there are a few games with a similar mechanic! Probably not the one you're thinking of, but there is: https://sourceforge.net/projects/slingshot-game/


I've been looking for this game since I played it many years ago, but I had forgotten the name. Thanks for the link!


It was called !Gravity on the Acorn Archimedes. It was written in BASIC (and possibly some assembler) and I remember it being a popular game at school to hack - change the number of planets, acceleration rate etc.


That's the one :)


Warheads? I played it too!


https://www.youtube.com/watch?v=Vu3jzhwK60A

This one? If so, I played it three! One of those non-AAA games I most fondly remember from my teenage years!


Wow, warheads looks fun. Very complex. I'll be giving it a play tonight!


Great game! Reminds me of Gravitee which was also a blast to play, but requires Flash https://www.kongregate.com/games/funkypear/gravitee


This is a lot of fun and so simple! Congrats on the release.

What was your experience with using Unity? I have been dabbling with Game Maker for the last few months and find it fairly easy to work with, but I haven't attempted anything for mobile.


Thanks! I personally wouldn't use Unity again. I've run into so much trouble and so many little bugs. An example: just yesterday I updated Unity itself (a minor patch upgrade), and it broke half the links in my project, I had to manually downgrade some official unity packages to get it to compile, etc. I also find the fact that C# is garbage collected to be very annoying - in a real-time application, I just want total control over when stuff is allocated and deallocated. Even in a simple game such as Astro Golf, I spent ages tracking down silly allocations that lead to stutter-inducing GC. Unity physics is also a right PITA - I could go on and on..


Wow, surprised to hear this! I had assumed in a project that large and longstanding, most of the bugs would have been smoothed out.


So had I :(

A lot of these bugs seem to also go unfixed, I think with the intention that you pay for Unity Pro which gives you source code access to the engine and you can work around them / fix them yourself.


Pro doesn't give you source code access, just you need to at least have a Pro license to buy source code access (which is very expensive).


Ah, my misunderstanding. That's good to know. I imagine Unity pays more attention to Pros though? If you're free and you open tickets / post on the forums, they seem to just get totally ignored.


Each level gets better support, right up to getting roving Unity engineers in to help you out.

I don't think they are deliberately leaving bugs unfixed in order to up sell people though. More its just an enormous software project with an awful lot of people using it in lots of different ways. Basically an enormous surface area to try to tackle.


What platform would you consider using in the future, rather than Unity?


I've been looking more and more at Godot, and I really like it. Open source, you can script in C++, and it seems to have most of the features necessary for a simple 2d game like this (perhaps not for some AAA 3D game of course).


Also when developing on Linux I had more luck getting Godot to function than Unity. Had quite a bit of fun making a sidescrolling game in Godot :)


Yep, I've had endless trouble with Unity on linux. Simple stuff like GUI lagging out, it not finding my android sdk, etc.


I built a game based on gravity and other physics and pool a long time ago on iOS which did not go anywhere; possibly because the next game that came out on the same day was called "Angry Birds".


Oh man, that really sucks. Getting anywhere in the app store is so difficult nowadays. I'm a complete marketing rookie but atm I'm just trying out random ideas to see what sticks.


Has anything sticked so far that you could share? I am also thinking to do a small little video app.


Brilliant first game!

How does one make the in-app purchase? Do I have to complete multiple levels in an on-boarding flow first?

Edit: I found it: I needed to play 10 holes.


Great job on completing it, and great job on nailing the same beautiful simplicity of Desert Golfing, but with planetary gravity.


Thank you, I was hoping it would appeal to the DG crowd. I couldn't go as full minimalism as DG since I felt that some explanation / tutorial was necessary (the game being a little less obvious). I also wanted to play more on a "Le Petit Prince" theme!


That's really neat !! :) You should add a trail to the golf ball so we can see its trajectory.


There's a little easter egg if you triple press on the big top right planet during loading


On Android, is there a way to restart the whole game from the first hole? If not, I presume erasing user data will do the same thing. :-)

In Zen Mode, a way to retry a previous level would be nice, for practice and to try to get a better score, even if it's not a hole in one.


No way to restart the game - you'll have to reinstall :)


Such a great game. This is exactly the type of pick up and play game I enjoy. Very well done!


I think a leaderboard feature would be awesome an a way to share the score with friends


Do you mean to compare scores after a specific number of levels?


Absolutely


This is a great game! One request: there's a way to turn off the music but the sound effects keep playing. Could you make that button turn off all sound, not just the music? Or add another one to turn off the effects as well?


Thank you - that seems sensible, I'll fix that shortly.


Thanks! That'll make me play this game a lot more. :)


Presumably you want to listen to music over it?


Mostly I just want to play it in situations where my phone making sounds might bother people.


Can you turn down the volume? On Android, there are separate volumes for games/music/videos, and for notifications - are you on iOS perhaps?


I don't usually install apps (especially games) with in app purchases. The only time I sometimes do is when I know what they are up front. Can you explain what the in app purchases are in the description?


You can expand a section lower down on its App Store page to see what's the iaps are. In this case I think it said unlock full game.


That's good to know. Not sure if that's the case on Android - I don't think it is.


Ah yeah, I'd not clocked your link takes us to the relevant App Store so I'd assumed it was an iOS only game.

It's great by the way! I've played a bit of desert golf over the years after reading a HN comment about it, and your game is a delightful improvement =]


Yup, it's a smart link that should redirect to the right platform (hopefully..)


Sure thing - that's a good point. I will add something to the store descriptions.

The first 10 levels are free (and you can replay them endlessly). To unlock infinite levels, there is an IAP for ~1.99 USD.


I was little frustrated in normal mode. But hard mode is so much fun.


I don't know whether you have access to the "Taptic Engine" API on iOS, but a tactile ping when striking the ball and thuds when it hits a planet surfaces could be nice.


That is a nice idea indeed. I'll have to look into it. I'm always a bit concerned about vibration in games since you don't know how intense it will be on different devices: it can be very tacky if it is over-the-top.


Some of the good quality iOS apps that aren't even games use the TE in multiple places, so it definitely can be used tastefully.


Really well done! This is a very great idea and well executed


Mostly just curious: Why is the android version 9MB, the iOS version 62MB, and 3 different desktop versions a fixed 22MB?


I really don't know. I'd like the iOS version to be lighter, but I'm at the whim of Unity. I've tried a couple of ideas to make the iOS bundle smaller, but no luck.


This is very, very good. Congratulations.


Cool game! Played till the end. Does this suppose family sharing? Would buy it instantly if it did


I don't know if it supports family sharing - do I need to opt in manually on my end? It's just a normal IAP to unlock the game, so if IAPs work with family sharing then it should be OK


Awesome, downloading now!!!


why no portrait?

it also wouldn't be bad to have the previous launch vector shown


Hmm, the game can be played in portrait with one thumb without much loss. The only thing that has an orientation is the shot count.


and the notification drawer, app switch gesture etc, the orientation change has a lot of annoying side effect on the os itself


Looks like a rip-off of the good old "spaced penguin" shockwave (flash?) game.


Hadn't heard of spaced penguin, but I make no claim that the gravity mechanic is original. There are a long trail of similar games going back to the 80s!




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

Search: