Minigolf, Camera, A Blast from the Past, and Aidan
by Kevin Ryan · 11/09/2004 (12:00 pm) · 14 comments
Minigolf
First, while you are still reading, I'm very close to having a test build of Minigolf available. If you would like to check it out and give feedback email me at kevin@netptc.net. Feedback from kids, wife, husband, non-computer development types would be great.
Here's a couple of screen shots:
On the Move hole
Plows hole
Since the conference in Eugene last month I have been working on fixing gameplay issues with the holes and also creating a few more dynamic holes. The last few days I have been working on a camera system which leads to the next section....
Camera
An automatic ball following system presents some interesting challenges because the ball can get itself into some very tight spaces.
My first pass at this was very simple just to see how it felt - place the camera 45 degrees off of directly behind the ball and looking down at a 45 degree angle. It checks ahead every so often and if the camera's view of the ball is going to be blocked then it switchs sides. Here is a rough top-down look at it:

This wasn't too bad - a little robotic feeling though. Since I was using the ball's forward velocity to orient the camera, the pitch would vary too widely as the ball bounced - very jarring on the eyes. I ended up damping the ball's z velocity quite a bit so the camera's pitch only varied slightly. I may end up taking the z velocity completely out of the equation.
From here I went on to implement a system where I could define a set of camera viewpoints relative to the camera and then automatically choose the best one. Here are top and side views of where the camera would be relative to the ball:

Once a view has been choosen it stays with that view until it is blocked and then it finds another best non-blocked camera view. This worked pretty well except for a visual-feel problem when the ball bounced off a wall and reversed direction.
Right now the camera moves linearly from its current position to where it wants to be. When the ball bounces off a wall the camera ends up passing over the top of the ball to get back behind it and it just doesn't feel good.
If anyone is interested I can post this version of the code. I hesitate a little bit about posting it publicly because at this point of a project sometimes expediency takes the place of elegance and the code can get a little brute force and ugly. This code is a little ugly :^)
To get the camera code final from here I am just going to compute the camera offset from the ball initially when the putt occurs and then only when the view is blocked. This will allow the ball to roll towards that camera and the camera will not always be maneuvering to get behind the ball. I think a less busy camera will feel better and it will only require minor changes to my current code.
Other solutions that I considered were using spherical linear interpolation instead of linear interpolation to get the camera from where it currently is to where it wants it to be. I think this would look and feel pretty neat. I also thought about building a path over each hole that the camera was constrained to. The camera could move along this path and with a rule that it always had to keep the ball in view.
I'm not doing either of these because while it would be fun to implement - shipping a product sooner would be more fun.
A Blast from the Past
As Jeff mentioned at the conference there was an earlier version of a ball racing game back in the mid-90s. It never got past the early design phase and the only thing that Marble Blast took from it was the rolling ball concept.
For your amusement here are a couple of pieces of art from the design:
Kevin's concept art
Artist's slightly better version
Can you tell that I'm not an artist?
Aidan
Aidan is my 5 year old son who has had some medical problems throughout his life. For those who have been folling his saga, he is currently doing very well.
This summer his liver numbers started going up again. In September he had a liver biopsy and the result showed that had EBV. He is on an anti-viral med for the next year because EBV can turn into PTLD for guys like Aidan.
Basically, he is very happy and if it wasn't for the blood test you would never know that he has some new medical problems.
Aidan likes Indie Games
First, while you are still reading, I'm very close to having a test build of Minigolf available. If you would like to check it out and give feedback email me at kevin@netptc.net. Feedback from kids, wife, husband, non-computer development types would be great.
Here's a couple of screen shots:
On the Move hole
Plows holeSince the conference in Eugene last month I have been working on fixing gameplay issues with the holes and also creating a few more dynamic holes. The last few days I have been working on a camera system which leads to the next section....
Camera
An automatic ball following system presents some interesting challenges because the ball can get itself into some very tight spaces.
My first pass at this was very simple just to see how it felt - place the camera 45 degrees off of directly behind the ball and looking down at a 45 degree angle. It checks ahead every so often and if the camera's view of the ball is going to be blocked then it switchs sides. Here is a rough top-down look at it:

This wasn't too bad - a little robotic feeling though. Since I was using the ball's forward velocity to orient the camera, the pitch would vary too widely as the ball bounced - very jarring on the eyes. I ended up damping the ball's z velocity quite a bit so the camera's pitch only varied slightly. I may end up taking the z velocity completely out of the equation.
From here I went on to implement a system where I could define a set of camera viewpoints relative to the camera and then automatically choose the best one. Here are top and side views of where the camera would be relative to the ball:

Once a view has been choosen it stays with that view until it is blocked and then it finds another best non-blocked camera view. This worked pretty well except for a visual-feel problem when the ball bounced off a wall and reversed direction.
Right now the camera moves linearly from its current position to where it wants to be. When the ball bounces off a wall the camera ends up passing over the top of the ball to get back behind it and it just doesn't feel good.
If anyone is interested I can post this version of the code. I hesitate a little bit about posting it publicly because at this point of a project sometimes expediency takes the place of elegance and the code can get a little brute force and ugly. This code is a little ugly :^)
To get the camera code final from here I am just going to compute the camera offset from the ball initially when the putt occurs and then only when the view is blocked. This will allow the ball to roll towards that camera and the camera will not always be maneuvering to get behind the ball. I think a less busy camera will feel better and it will only require minor changes to my current code.
Other solutions that I considered were using spherical linear interpolation instead of linear interpolation to get the camera from where it currently is to where it wants it to be. I think this would look and feel pretty neat. I also thought about building a path over each hole that the camera was constrained to. The camera could move along this path and with a rule that it always had to keep the ball in view.
I'm not doing either of these because while it would be fun to implement - shipping a product sooner would be more fun.
A Blast from the Past
As Jeff mentioned at the conference there was an earlier version of a ball racing game back in the mid-90s. It never got past the early design phase and the only thing that Marble Blast took from it was the rolling ball concept.
For your amusement here are a couple of pieces of art from the design:
Kevin's concept art
Artist's slightly better versionCan you tell that I'm not an artist?
Aidan
Aidan is my 5 year old son who has had some medical problems throughout his life. For those who have been folling his saga, he is currently doing very well.
This summer his liver numbers started going up again. In September he had a liver biopsy and the result showed that had EBV. He is on an anti-viral med for the next year because EBV can turn into PTLD for guys like Aidan.
Basically, he is very happy and if it wasn't for the blood test you would never know that he has some new medical problems.
Aidan likes Indie Games
#2
11/09/2004 (12:54 pm)
Nice, good luck with everything :)
#3
Kind thoughts and best wishes from Montreal
11/09/2004 (3:00 pm)
Glad to see Aidan is enjoying himself and grinning as widely as any of the kids who haven't been through 1/100th of what he's seen so far :)Kind thoughts and best wishes from Montreal
#5
I'd love to try out your minigold game, certainly looks appealing and fun.
Hope your son gets better.
11/09/2004 (3:24 pm)
@Kevin, I'd love to try out your minigold game, certainly looks appealing and fun.
Hope your son gets better.
#6
11/09/2004 (4:01 pm)
Nice Job and best wishes for the family!
#8
Myself and another programmer went through quite a lot of iterations before it got to the point where it was pretty good.
I basically used a lot of the characteristics of steering behaviour code from craig reynolds AI papers on the subject to apply steering forces to the camera. In the end Martin also added your system of "pick a useful shot from a list" into that too and merged the steering in with it. We ended up with quite a dynamic camera shot system that was pretty fun.
Good to hear about Aidan too!
BTW: Love to test the game. No wife to ask about it though :) zoombapup at gmail.com :)
Best of luck and ship soon!
Phil.
11/10/2004 (4:33 am)
Interesting read about the camera Kevin, I had a hell of a time with a similar issue on Worms 3D, where we have the possibility of a worm moving around an arbitrary level and possibly being obscured.Myself and another programmer went through quite a lot of iterations before it got to the point where it was pretty good.
I basically used a lot of the characteristics of steering behaviour code from craig reynolds AI papers on the subject to apply steering forces to the camera. In the end Martin also added your system of "pick a useful shot from a list" into that too and merged the steering in with it. We ended up with quite a dynamic camera shot system that was pretty fun.
Good to hear about Aidan too!
BTW: Love to test the game. No wife to ask about it though :) zoombapup at gmail.com :)
Best of luck and ship soon!
Phil.
#9
Interesting that you would mention AI because just before I started work on the camera I told my wife that basically the camera was a creature that lived in the minigolf world and its only motivation was wanting to look at the golf ball.
@all
Thanks for the kind words about Aidan. Since Feburary he has had a calm mostly normal life.
I should have a test build this evening...
11/10/2004 (7:31 am)
@PhilInteresting that you would mention AI because just before I started work on the camera I told my wife that basically the camera was a creature that lived in the minigolf world and its only motivation was wanting to look at the golf ball.
@all
Thanks for the kind words about Aidan. Since Feburary he has had a calm mostly normal life.
I should have a test build this evening...
#10
11/10/2004 (6:08 pm)
my best wishes to you and your son
#11
Unfortunately, it works, but doesnt quite give a "directed" look.. its kind of like our designers always wanted more strict control than just "have it follow the object". Kinda like your bouncing back towards the camera example.
I basically did a simple sidestep with the camera if the object was moving towards me.. doing a raycast either side to choose which direction was more favourable.
11/11/2004 (3:23 pm)
Kevin: thats basically what I thought. I figured that its kinda like a non rendered creature that is tethered to the object it wants to look at. Unfortunately, it works, but doesnt quite give a "directed" look.. its kind of like our designers always wanted more strict control than just "have it follow the object". Kinda like your bouncing back towards the camera example.
I basically did a simple sidestep with the camera if the object was moving towards me.. doing a raycast either side to choose which direction was more favourable.
#12
- Aidan's liver blood test numbers are now normal
- Aidan is now longer positive for EBV
Yay!
01/23/2005 (1:08 pm)
I need to post a new plan, but in case anyone happens to stumble across this old one:- Aidan's liver blood test numbers are now normal
- Aidan is now longer positive for EBV
Yay!
#13
That is wonderful!!!!!!
I am really looking forward to this game.
It was a lot of fun testing it.
01/25/2005 (3:21 pm)
Kevin,That is wonderful!!!!!!
I am really looking forward to this game.
It was a lot of fun testing it.
#14
07/20/2005 (11:11 am)
Any more updates? 
Torque 3D Owner Chris "DiGi" Timberlake