He mostly based it on a book called The Short Timers by Gustav Hasford. Act 1 is a pretty faithful adaptation of the first part of the book, but after that he really only took bits and pieces. It's been over a decade since I read the book—and it was so thoroughly out of print that I had to get a copy through inter-library loan—but I remember enjoying it. There's even a sequel called The Phantom Blooper (though I haven't read that one).
Sadly, the full text used to be available online, but apparently the site was redesigned some time ago and the text was not put back up afterwards.