Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411492 Posts in 69377 Topics- by 58433 Members - Latest Member: Bohdan_Zoshchenko

April 29, 2024, 07:39:32 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallTwilight Golf, dynamic shadows and physics puzzles (iPhone)
Pages: [1]
Print
Author Topic: Twilight Golf, dynamic shadows and physics puzzles (iPhone)  (Read 1274 times)
slembcke
Level 3
***



View Profile WWW
« on: October 20, 2009, 09:11:23 AM »

I've been lurking on the forums for a while, but I think this is my first actual post. :O Sorry if it seems spammy.

We just released our newest iPhone game Twilight Golf: http://howlingmoonsoftware.com/twilightGolf.php


Full Version: http://itunes.com/apps/TwilightGolf
Lite Version: http://itunes.com/apps/TwilightGolfLite

We are pretty proud of how it turned out. It's a physics puzzle game inspired by mini-golf game turned on it's side and put in a dark and shadowy setting. We have a blog post about the evolution of the game on our blog including an old prototype written in Ruby: http://howlingmoonsoftware.com/wordpress/?p=189

The setting for the game was inspired mostly by the fact that I really really wanted to use the shadowing algorithm I had come up with to do super fast dynamic 2D shadows on the iPhone. Using it in a "Gulf" successor was sort of arbitrary, but I think it turned out to be rather cool. Neither myself nor my partner is much of an artist, so we started out using Danc's free "circle textures" collection. (http://lostgarden.com/2006/02/250-free-handdrawn-textures.html) It ended up looking really nice with the shadows and lighting applied over it so we decided that we might as well go with what works. Near the end of the project, we contracted a freelance artist out of the Netherlands for our icon and splash screen. He ended up offering to redo our sprites for cheap as well. He did a beautiful job as well and it was his idea to turn our lights into the dangly glowing plant things. I'll throw a plug out for him as well as it sounds like he wants to be able to do game art full time. (http://decentdesign.nl) He was a great guy to work with.

http://howlingmoonsoftware.com/images/twilight_golf.swf

We have a YouTube video of the gameplay as well:

(sorry no sound effects Sad )

P.S. Don't know if many people around here have heard of the Chipmunk Physics library, but I wrote it.  Smiley
« Last Edit: October 20, 2009, 01:21:06 PM by slembcke » Logged

Scott - Howling Moon Software Chipmunk Physics Library - A fast and lightweight 2D physics engine.
Cagey
Level 1
*



View Profile WWW
« Reply #1 on: October 20, 2009, 03:00:24 PM »

I've been doing some similar shadowing stuff recently, but damn yours looks impressive. It would be awesome if you ever felt like writing a post about how you went about achieving that look. Is it similar to this?

Just a note: people 'round here are pretty weary of people posting an 'ad' once and then never coming back, so it might be wise to post in the introductory thread. But since you wrote chipmunk it would be great to see you stick around Smiley
Logged

slembcke
Level 3
***



View Profile WWW
« Reply #2 on: October 21, 2009, 05:12:49 AM »

Actually the shadow algorithm is more similar to this. Basically, are generating a lightmap of sorts using additive blending. You use a radial gradient texture on a quad to simulate falloff, and mask out the shadows in the alpha or stencil buffer by drawing quads that extrude each segment you want to cast a shadow off in the direction away from the light.

Originally I figured it out after playing Gish. That game had similar shadows and they looked fantastic. My method was to use the stencil buffer and homogenous coordinates to project the shadows off to infinity. The article linked above (and Gish too actually) used a finite amount to extrude the shadows and made weird artifacts when a shadow casting entity was close to a light.

The iPhone doesn't really have that much CPU power though, so to run both the physics and the lighting, I had to figure out a way to make one of them faster. Having spent years working on Chipmunk, I figured it wasn't going to be that. Instead I found a nice way to avoid recomputing the shadow geometry every frame and it even worked out to be simpler code wise. Shadowing is very fillrate intensive, 2D or 3D and I had to make a handful of optimizations there as well (rendering a 128x128 FBO instead of per pixel, etc). We went from having 1 or 2 lights onscreen at ~40 fps to 5 or 6 at 50! I plan on detailing out how I did it someday, but for the moment I was hoping it to be a secret sauce that we can use on another game or two. The method I'm using isn't applicable to soft shadows either.
Logged

Scott - Howling Moon Software Chipmunk Physics Library - A fast and lightweight 2D physics engine.
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic