Nickolas wrote: I've developed a small indie game which I want to sell (on CD's). How do I protect it from being pirated?
You can't. Even big corporations have trouble from keeping their games from being cracked (see any popular torrent site).
Nickolas wrote:Also, how do I protect my code and artwork from being copied?
Code? depends on the language you are developing. Using Java/C# has biggest change for the code for being decompiled (see minecraft mods). Artwork? If you are talking about logos and similar then there is little that one can do aganist a screenshot, if is about game resources (skins, some audio, models, etc) then you could try to make your own encrypted virtual filesystem like a lot of games are using. Of course this doesn't help too much aganist a skilled reverser (take a look at the xentax forums, you can find a lot of skilled people who can extract resources from the most popular games).
Also, could somebody explain to me how commercial games determine whether you have the original CD inserted and not a pirated version of it? Thanks in advance!
Well, they have special disks and CD writters who can write special sectors on the disk that conventional writers cannot, then the game checks them.
IMO, just forget about DRM, they make things more complicated for your users. If you atill want to go that route then you could try the watermark approach. Personalize every build in a way that the signature cannot be completly found and removed so if your game ever gets pirated then at least you can know what customer did it to you.