Twilight Golf (and promo code giveaway)

Share your projects and Chipmunk enhancements.
Post Reply
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Twilight Golf (and promo code giveaway)

Post by slembcke »

We are just about to release our new game, Twilight Golf. \o/

http://howlingmoonsoftware.com/twilightGolf.php

It's a physics based minigolf like puzzle game for the iPhone. It also features super fast dynamic 2D shadows and lighting. We figured out a neat trick to make it so all the expensive shadow geometry gets calculated on the GPU. :)

We are running a promo code giveaway for a pre-release copy tomorrow. Details are here, but basically we are giving 10 codes away to people who tweet with #twilightgolf and 10 to people who have joined the Twilight Golf Facebook page.

Cheers!
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
Tam Toucan
Posts: 141
Joined: Tue Jun 23, 2009 4:26 pm
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by Tam Toucan »

That lighting is really nice. Good luck with this.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by slembcke »

Seems that it was made available a day early.

Full version: http://itunes.apple.com/WebObjects/MZSt ... 18006&mt=8
Lite version: http://itunes.apple.com/WebObjects/MZSt ... 26863&mt=8
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
dieterweb
Posts: 176
Joined: Fri Feb 27, 2009 7:12 am
Location: Germany
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by dieterweb »

really nice game. Congrats. I hope you are doing very well with it.

I would love an option to increase gravity. Could be a little faster for me.

Thomas
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
zaerl
Posts: 40
Joined: Fri Aug 28, 2009 8:36 am
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by zaerl »

Great work man, really well done.
eVillain
Posts: 4
Joined: Mon Feb 21, 2011 11:27 am
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by eVillain »

That lighting effect is amazing; any chance you would share some of that code or implement it into v6? :p
Mainly any hints toward how you store the object data in the GPU would be welcome, as just drawing that sort of lighting into a CCRenderTexture in Cocos2D looks decent but is a real performance bottleneck.
I know I'm not the only one who's interested but I haven't seen much discussion on this here...

edit: BTW the Twilight Golf link at http://wiki.slembcke.net/main/published/HomePage gives me a 404 because of a capital T instead of lowercase.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by slembcke »

Meh. Why not. I didn't really come up with the idea. I first saw this effect in a shareware game called Gish around 2004 maybe? It was arguably the coolest thing I'd ever seen in a 2D graphics engine. I had to figure out how to do it, and so I did (before beating Gish even :p). After years of sitting on the code and a half dozen unfinished prototype games that used it, we made Twilight Golf. Unfortunately it sold for crap like so many other iOS games. The game looks terrible in screenshots, and was very difficult to market. We could never get any blogs to post a video of it. We would have made more money working at McDonalds for the month we spent making it... I thought the lighting/shadowing code would be something special to make it stand out, but it didn't. Several people have expressed interest in buying the code, but that ultimately never went anywhere.

It's actually a really easy effect to do, jut a difficult one to do efficiently as it uses a ton of fillrate. Basically you are building a light buffer one light at a time. Without shadows, for each light you just draw a quad with a circular texture on it using additive blending. To cast shadows, you build a shadow mask in the alpha channel. Originally I used the stencil buffer, but the iPhone does not have one. For each shadow casting line segment, you create a quad. Two vertexes of the quad are the original segment vertexes, and the other two are just copies that are projected away from the light source. Once you do this for all the shadow segments, you have a visibility mask that shows where the light can shine. Use this to mask the light when you add it to the light buffer. Multiply the light buffer against your final rendered scene and you are done.

To make it really fast, I use a degenerate perspective transformation of the vertexes to project the shadow segments to infinity instead of wasting time doing it on the CPU. The "normal" edge of the polygon has a z of 0, and the projected side has a z of 0. Other than that the xy coords of the edges match. To cut down on fillrate, we subsampled the lights and used scissoring and partial clears when generating the shadow masks.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
eVillain
Posts: 4
Joined: Mon Feb 21, 2011 11:27 am
Contact:

Re: Twilight Golf (and promo code giveaway)

Post by eVillain »

Sorry to hear about the marketing difficulties, as you said the game really is such that it needs to be seen in motion to really be appreciated.

I'm pretty sure I can tweak my implementation now, I'll have to run some tests to see how low the res on the lighting would need to go and decide whether to keep it or drop it. For anyone else interested in having a look at how Gish does it the source is available from the developers: http://crypticsea.blogspot.com/2010/05/ ... ource.html

Thanks for the quick reply, it's much appreciated.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests