I wonder if there is any connection between exhaled air and lung capacity. I need to implement some algorithm in my game to calculate points of how much time you blow and compare it maybe with some sportsman.
At a first approximation the total lung capacity is the anatomical dead space(the volume of your trachea, more or less) + the tidal volume(the volume of each breath). It's slightly more complicated than that based on the differences in how deep you breathe and how often you can breathe, but at a first approximation exhaled air + half a liter(plusminus) = lung capacity.
First of all nice idea! Secondly, wikipedia has very nice graph to answer your question (Image courtesy: wikimedia commons)
Look at the caption below figure in wikipedia for specific details. You will get all values you want plus how to calculations.
[Note: Sorry, I am not able to interpret why X axis is sinusoidal]