Terrain Demo available!

Terrain Demo available!

Hello folks!

I’ve packaged the current version of the game into a nice terrain demo. It allows you to place tees and corresponding holes, change the tiles in the landscape, as well as edit the height of the terrain.

demoHole

Controls:
-Mouse click does most things, mouse right click cancels actions and returns menu
-WASD and arrow keys pan the camera
-Mouse wheel and Q E zoom in and zoom out
-Holding mouse wheel and moving the mouse will rotate the camera

So you can download it here!

Give it a try, and comment anything you found interesting/annoying/awesome!

(Also, take screenshots!)

Cheers!

Quirk #3: Shorter, but is it?!

Quirk #3: Shorter, but is it?!

Hello folks!

In the process of today’s update, I came upon an interesting quirk when using grids.

I have finished implementing the hole creation in the new terrain, works like a treat. Now I’m in the process of processing the tiles in between the hole and the tee, so it can make calculations regarding base shot, par, actually distance etc.

Using A* to find the shortest path between the hole and the tee, leads to some interesting visuals:

astarlol

Above, the path traced by A* is marked with black spheres. The drawn red line shows the actual shortest path (a straight line) between the two points. When in a grid, the path marked by A* does signify the shortest path between two certain points in the grid. It can be set to ignore diagonal traversals, or to allow them (as is the case of Boss Golf).

Visually, though, it looks so quirky. To us, it’s clear to see that the shortest path is the line between the start and the finish. To the game, though, the shortest path ends up creating these doglegs all over the course.

That’s all! Almost done with the processing of the base shot, coupled with a lot of refactoring and reinforcement. Once it’s done, it’s demo time!

Stay tuned!

Dev Update #13: All connected! (Save for the golf course)

Dev Update #13: All connected! (Save for the golf course)

Hello folks!

As expected, today I was able to finish implementing the new terrain system completely, and connected it to the GUI and everything. So as far as terrain editing/tile placing is concerned, we’re all good to go.

finished_implement

The decoration system is also quite a bit better in placing things, though can still be improved further if there’s a need for more separation between objects:

treePlacing

And I also went ahead, and updated the decoration system to make it match the tile underneath, adjusting as height changes:

treeHeightening

It’s not 100% precise, due to the triangulation of the meshes. I’m thinking of looking into better triangle striping in the future, but that’s not a priority for now.

So with the new system in place, performance improved by a lot, and we can now create massive courses. Plus, I was able to re-engineer the architecture of the game to make it more modular and future proof!

Next step, reimplement the course building. Then it’s time for a new demo!

That’s all for today folks! Stay tuned for more!

Dev Update #12: Chunk Terrain is Connected

Dev Update #12: Chunk Terrain is Connected

Hey folks!

Today’s update will be a short one, but it is a good one: I’ve finished replacing the existing terrain system with the newer chunkier one!

implementedTerrain

And took the time to begin redoing other hastily designed systems for more solid ones, improving performance and maintenance as well. By the weekend, I’ll have it back to full functionality with improvements. And a new demo for playing around with the terrain!

Stay tuned!

Quickie: Going Chunky

Quickie: Going Chunky

Hey folks,

Today’s update will be a quick one, as the task is still underway.

I decided to do some test to check the performance of the current system if we use larger terrain chunks. So far, all testing had been done on a 16×16 grid, and performance was fine.

So I decided to up the ante to 32 x 32, and the performance was bad…

bad

There was a very notable dip below 60fps, and that’s not good. Not to mention this was just a barren terrain, and that is bad. I’m sure there could be some optimization done, but it still isn’t good enough.

So I decided to redo the tile system again (third time is the charm!), this way separating the terrain into chunks of 16×16 tiles, all contained inside a single mesh. (Chunks can be made up to near 64×64, due to Unity limitations regarding vertices in a mesh). As a test, I spawned 3 chunks of 32×64, and placed it all on the scene. This is roughly 6000 tiles on display, spread across 3 large meshes.

This is the result:

good

As you can see, the performance stayed at 70fps range, render thread was cut by 75%, cpu remained 4ms faster, much smaller number of shadow casters, batches, and a vastly greater number of verts and tris.

So I’ll need some time to adjusting the current system to match this. The generation itself is working fine, as is the UV mapping. But I’ll need to rework the shot system since it’s all under one big mesh collider. Some things will be vastly simplified, though. And the game will run better for it!

Stay tuned for more!

Dev Update #11: Procedural Tree Placement!

Dev Update #11: Procedural Tree Placement!

Hello folks!

Today’s update is an awesome one.

If you’ve been following us so far, you’ve noticed that all our tree placement looks rather… Mechanical. One tree per tile. That’s just not how nature intended. We should do something about it.

And we did. Look at this barren course:

courseBarren

It needs trees.

So we give it trees:

courseBetter

Wow look at that! Beautiful procedurally placed trees, make the course look much prettier and breaks the monotony of single placed trees! Hurray!

But how?

Well with the new system! It will attempt to add a tree to a desired tile. If there’s already a tree, it simply adds to it, and jumbles up their positioning. A maximum of 4 trees can be added to any tile. Here’s the feature in action:

treeMaker

As a bonus, if you’ve reached the limit of 4 trees, and you try to place another one, it will simply randomize the positioning of the trees. This way you can keep playing around with the tile until the RNG gods smile upon you!

Next is ensuring the trees stay in location when you modify the terrain!

Til next time!

Dev Update #10: Base Shot Generation is Ok!

Dev Update #10: Base Shot Generation is Ok!

Heyo folks!

Finally fixed the base shot generation. Since it’s simply a guideline, it doesn’t really care about the sloping of the course: all it cares about is that there’s no direct obstacle in front of the shot! Technically, this is already an upgrade if compared to SimGolf since in SimGolf there were many instances where it would attempt to mark the course by going through trees or rocks!

Below you can see the course path being automatically edited to account for removal of valid tiles:

baseShot

That pretty much covers the basic shot generation. Great success!

I’ve already implemented utility functions for calculating the usefulness of aiming at a certain tile. With this update to the basic shot generation, I can move forward on finalizing the spawning of certain objects when painting the terrain (ie: trees) and create a basic demo for testing the terrain building. If you’re interested in trying it out, give me a shout!

Stay tuned for the next update!

Quirk #2: Stupid isn’t good either

Quirk #2: Stupid isn’t good either

For today’s Quirk, it’s an attempt to fix the greed issue on the base shot function. I added one simply look ahead step to ensure that the current maximum has at least one option going forward, so that the function doesn’t settle on a tile with no good moves.

It worked, to an extent. As you can see below:

greedisbetter

So while it does avoid certain obstacles, it ends up taking too many strokes to do so. Issue is also with the obstacle detection: if the line of a stroke so much as brush through a tree tile, for example, that stroke is completely discarded in favor of something else. I’ll add now a function to analyze the angle between the potential stroke and the center of the hazard, and allow it to pass through if the angle is large enough.

With that in place, in the example above, it could easily reduce 2 strokes off the base shot, making it more acceptable. (This is a Par 4 hole based on distance).

Here’s hoping that the third time is the charm!

Dev Update #10: Terrain controls good to go.

Dev Update #10: Terrain controls good to go.

Howdy!

Terrain controls are finalized! Created the displays for showing the vertice height to give you a better idea of the differences in your landscape. For this stage of the game, you can:

-Flatten the tile (to the value of the vertice nearest to the mouse pointer):

FlattenControl

-Edit the tile (by clicking and dragging the tile up and down with the mouse. It influences nearby tiles as well):

TileHeight

-Edit the vertice (by clicking and dragging the vertice up and down with the mouse. It influences nearby tiles as well):

VerticeControl

And as a bonus; since I added some thickness to the tiles, the current base shot generation function works mostly fine. But still need reworking. So that’s the next focus: Improve the base shot generation system. Also need to make it take terrain features into account.

With that out of the way, should be able to get a demo up for testing the terrain and course building, and implement the feedback. Once I’m happy enough with it, it’ll be time to add some golfers to the course!

Stay tuned for more!