brendonsmall

[Released] Beppo's Hole (in one golf)

Recommended Posts

***Update: You can now play the game right here: https://whilefun.itch.io/beppos-hole-in-one-golf

 

I had to start on my game earlier than anticipated, as the new year is going to be a bit hectic, schedule-wise. 

 

I've landed on a stroke play style golf game, which I've been wanting to make for ages.  Named for Idle Thumbs episode 185: Beppo's Hole. 

 

I present:

 

BepposLogo.png.bc48305a543e9e3676c20a47cf7ea06f.png

 

Just a mocked up title screen for now, and I have some prototype golf gameplay from the last few days of work.

 

This intro screen might look familiar to DOS golf game fans :sombrero:

 

797647-jack-nicklaus-greatest-18-holes-of-major-championship-golf.png.6463b0e1e023cf24ff2a485fd712092a.png

 

The goal of the game is to have mouse-only controls for a fully functional top-down golf game. I hope to have at least 9 holes ready for the jam deadline.

 

Was also thinking of titles such as "Super Expert Pro Championship Golf", "The 90s Were Great, Okay", "Into the Woods", or possibly others. But this will do :) 

 

 

Edited by brendonsmall
Released!

Share this post


Link to post
Share on other sites

WIP course editor mockup

 

EditorMockup.thumb.png.92b97843355b91237f68145efac6375d.png

 

The idea being that you can modify the 4 "hole overview"/flyover camera waypoints, place the tee and pin, and set the par and hole number.  Holes in the same folder will be part of a the same course, named for the folder. Will probably defer to hole filenames for ordering (e.g. hole01, hole02, etc.).

 

Likely will ship the course editor sometime in the future. The end goal is to have it in the game, but probably pushing my luck for inside of a couple of weeks work :)

Share this post


Link to post
Share on other sites
9 hours ago, RKSanders said:

Aw yea! I love old golfing games and I love games that include the tools used to make it. Good luck!

 

Thanks! I am really enjoying chipping away (hrm.) at this project so far :)

 

An updated WIP of the course editor in action:

GolfEditorWIP.thumb.jpg.b46dd16a02c8331e654bf370fdf22f97.jpg

 

I ran into some scoping issues with this, though. For the jam version, shipping externally edited holes might be hard from the perspective of distribution. For example, it would be lame to require folks to separately install a course pack in a specific location in addition to unzipped game files. So the jam course will probably live in the build's Resources folder until I can figure out a better idea for "runtime" hole editing.

 

But so far, it's going well! I've managed to author a hole, save it, and load it to verify and it seems to work. Hooray.

 

Share this post


Link to post
Share on other sites
22 hours ago, brendonsmall said:

the jam course will probably live in the build's Resources folder until I can figure out a better idea for "runtime" hole editing.

Does that mean you're using Unity? If so it's pretty easy to load from a relative folder from within your application directory, which will also be built and distributed with your game.

Share this post


Link to post
Share on other sites
On 12/26/2019 at 11:20 PM, RKSanders said:

Does that mean you're using Unity? If so it's pretty easy to load from a relative folder from within your application directory, which will also be built and distributed with your game.

 

Yes indeed. I ran some tests, and have successfully loaded some test course holes from within the build's directory. I can't find a way to include a separate folder with the build, though. But building the jam version with holes in the resources folder will work for now. if you have any build command or similar "hey also include this within the _Data folder" tips or links, I would love to give it a go as well.

Share this post


Link to post
Share on other sites

So after some scaling and physics calibration for realistic clubs, I realized having a scale capable of 1000yd holes was ...big. A good feature, but uncommon. As a result, my first hole looks more like this:

 

hole_1.jpg.72d00e3b94f003094f8d936388b2a640.jpg

 

The really nice thing is that creating this hole took about 3 minutes and it is done (works in game from tee off to completion). Glad I invested some time making a good tool chain for this goofy little golf game :D

Share this post


Link to post
Share on other sites
18 hours ago, brendonsmall said:

 

Yes indeed. I ran some tests, and have successfully loaded some test course holes from within the build's directory. I can't find a way to include a separate folder with the build, though. But building the jam version with holes in the resources folder will work for now. if you have any build command or similar "hey also include this within the _Data folder" tips or links, I would love to give it a go as well.

 

In your project create the directory "Assets/StreamingAssets/". From there you can put any child hierarchy you want like "Assets/StreamingAssets/_Data/". Then you can access that directory with this property + your local path:

Application.streamingAssetsPath + "/_Data"

Anything in the streaming assets folder will be copied to your game build inside: ".../game_Data/StreamingAssets/".

(more info here)

 

You could stop here and require the player to also save their courses in this directory. However, that means if you update the game, the user would have to do some work to get their courses in the updated version. E.g. coping their courses out of the old versions folder into the new version. So, I think separating player courses from the game build folder is preferable. You could do this by using the 'Application.persistentDataPath' property. 

 Application.persistentDataPath + "/_Data"

Which is a path specific to the users OS that doesn't change with game updates. On Windows it would be something like: "%userprofile%\AppData\LocalLow\<companyname>\<productname>\_Data\". 

 

Hope this helps!

 

 

Share this post


Link to post
Share on other sites
5 hours ago, RKSanders said:

 

In your project create the directory "Assets/StreamingAssets/". From there you can put any child hierarchy you want like "Assets/StreamingAssets/_Data/". Then you can access that directory with this property + your local path:


Application.streamingAssetsPath + "/_Data"

Anything in the streaming assets folder will be copied to your game build inside: ".../game_Data/StreamingAssets/".

(more info here)

 

 

Hope this helps!

 

 

 

Very helpful, I was not familiar with how streaming assets worked. I will give that a try! Thanks :)

Share this post


Link to post
Share on other sites

GolfWIP06.thumb.jpg.1bc32716633bac73c32e1a9ce3944546.jpg

 

Just got shot accuracy and wind implemented with some other bonus effects (perfect power click helps reduce accuracy errors, etc.). The game is coming along nicely. The UI is very "programmer art" but functional.

 

A handful of bugs to work out and other tweaks to make to core rule set, otherwise it's almost ready for some course creation B)

Share this post


Link to post
Share on other sites

Looks like it's coming together nicely! Does the course's physics map handing some sort of blocking obstacle like trees that the ball can't go over or through?

Share this post


Link to post
Share on other sites
On 12/31/2019 at 11:42 AM, RKSanders said:

Looks like it's coming together nicely! Does the maps physics map handing some sort of blocking obstacle like trees that the ball can't go over or through?

 

Not yet, but it's on the list of eventual things. They'll basically be crude, and probably just a circle collision detection with an altitude to allow the ball to bounce off of it or clear it if high enough. I might try to get "pin shots" finished in time for the jam, in which case trees and other things are basically just taller, thicker flag pins.

 

For the sake of efficiency, I might have to do some kind of "sector"-based detection, depending on the number of trees. I am not using the built in physics engine (for many reasons), so I should be able to make something nice and quick. Naturally, I will probably try "just check all trees each frame" to see how slow it actually is, and go from there. Surely checking a few hundred coordinates a frame should be very manageable, since I will only need to perform the "billiard ball" bounce result on the tree that the ball hits.

 

 

 

Share this post


Link to post
Share on other sites

Ah, I thought you might just use a channel value in the physics map, like say red 255. But I don't know how you could calculate a collision normal (without a normal map) from that to make the ball reflect. So having collision objects sounds like a good idea.

 

If you do need a more optimized search method here's a simple generic quad tree script I love using: 

https://pastebin.com/WUjCytRj

 

It can be used by putting the following in your tree script for example:

Spoiler

public class Tree {
    public static GenericQuadtree<Tree> Quadtree = new GenericQuadtree<Tree>();
    System.Collections.Generic.LinkedListNode<Tree> quadtreeNode;

    void OnEnable() {
        //Register this object in the quadtree
        quadtreeNode = Quadtree.Insert(this);
    }

    void OnDisable() {
        //Unregister from quadtree
        if (quadtreeNode != null) {
            Quadtree.Remove(quadtreeNode);
            quadtreeNode = null;
        }
    }
}

 

 

And something like this where you want to test for collision e.g. ball script:

Spoiler

public class GolfBall {

    void CheckTreeCollision() {
        var allCollisions = new System.Collections.Generic.List<Tree>();

        Tree[] allTrees = SomeMethodThatGetsAllTheTrees();
        Vector2 ballPos = new Vector2(ball.position.x, ball.position.z);

        for (int i = 0; i < allTrees.Length; i++) {
            Tree tree = allTrees[i];
            float treeRadius = tree.radius;
            Tree.Quadtree.Query(ballPos, treeRadius, allCollisions);
        }

        //If the ball was within the tree's radius, that tree will now by in the allCollisions list.
    }
}

 

 

Share this post


Link to post
Share on other sites
8 hours ago, RKSanders said:

Ah, I thought you might just use a channel value in the physics map, like say red 255. But I don't know how you could calculate a collision normal (without a normal map) from that to make the ball reflect. So having collision objects sounds like a good idea.

 

 

 

Yes, exactly what I was thinking. I could assume everything is a sphere, but I might want to add clubhouse buildings and the like as well in the future.

 

8 hours ago, RKSanders said:

If you do need a more optimized search method here's a simple generic quad tree script I love using: 

https://pastebin.com/WUjCytRj

 

 

Wow, this is super helpful, thanks! 

Share this post


Link to post
Share on other sites

Decided I should probably include difficulty settings now that green break and wind are included. On max wind and max break, things can get a little dicey.

 

BeppoDifficulty.thumb.jpg.923d5342568da2027c009180c89d6450.jpg

 

Turns out I will have a few extra days I can work on this, hence the scope increase :)

 

Next up I need to get score card to display, and ensure you are returned to main menu once you finish hole 9. There are some other shot transition items to work out as well, like letting "ball splash into water" animation plays, etc., before setting up for next shot.

Share this post


Link to post
Share on other sites

OH YEAH MAN I WANNA BE HOLIN' IT WITH BEPPO!!

 

Seriously, I like 2D golf games so I am hyped about this.

Share this post


Link to post
Share on other sites
20 hours ago, Henke said:

OH YEAH MAN I WANNA BE HOLIN' IT WITH BEPPO!!

 

Seriously, I like 2D golf games so I am hyped about this.

 

I've never been this jazzed for a jam game before! Excited to share the result :D

Share this post


Link to post
Share on other sites

Working on the score card...

 

5e119bbfe3404_zzz_2020-01-0503_17_15-Unity2018.3.1f1Personal-GolfHole.unity-PixelGolf-PCMacLinuxStandal.jpg.48b2e57e0b07a321a25d41da4d3ef216.jpg

 

Going for that "printed on a budget" look and feel of the courses of my childhood. Beppo's not cheap, he just saves money where he can!

Share this post


Link to post
Share on other sites

Refreshed logo and typeface. Leaning into that DOS-era golf game vibe a little harder...

 

LogoRefresh.thumb.jpg.1cbefb3e1d203090c357d61eaa02eaed.jpg

 

This is surely offensive to people who are good at pixel art, but alas it's a game jam and time is a fixed constraint, y'all.

Share this post


Link to post
Share on other sites

Got that play options screen implemented. Super Expert Pro provides a solid challenge, even for me, a grizzled DOS golf game champion.

 

GolfWIP06.gif.1a7e2c6f16edf7f0e61ce1a872724dc4.gif

 

 

And finished some "hazard effects" for water and bunkers. Note that the shot result dialog graphics are going to get a little lower resolution to align with the rest of the visuals...

 

Spoiler

GolfWIP07.gif.e20c963d3662562be31c6437615219ed.gif

 

Share this post


Link to post
Share on other sites

Added some wind particles to give sense of wind direction and intensity beyond the UI meter:

 

GolfWIP08.gif.13ce081a1aeb758c043de6f3382f78df.gif

 

Also playing on Super Expert Pro is hard work! B)

Share this post


Link to post
Share on other sites

Thanks y'all

 

@RKSanders I implemented pin shots (only for pin, no trees probably in time for jam). The resulting combination of other game content resulted in this moment:

 

 

I actually did a little fist pump "yesss" moment. Actual fun! It's turning into a Video Game, I think! :)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now