This article is all about the wide world of programming so if your eyes start to glaze over…sorry…come back next week when I cover something more exciting.
|from Magic's multiplayer Commander set|
Maybe there is a trading card game (TCG) that you want to play. Maybe you love this TCG with all of your heart but no one else has ever heard of it and you bought a couple of starter decks and you just fell in love with it. Here are 7 steps that will get you started in the right direction.
1. Learn one programming language well. It doesn’t matter if you know C, C++, C#, D, Java, Perl, Python, Ruby or Lua. I would suggest studying for a certification test in your language which will force you to learn all of the tiny details that you otherwise might gloss over and those details become VERY important when you start to program anything over 1,000 lines. If you want a great book on good coding practices, I would suggest “Code Complete” by Steve McConnell. This one book taught me more about coding than my four years in college. (OK, it was really 6 years because I spent 2 years majoring in music which was really “fun” practicing 2 hours a day.)
--If you want to get started right away, you can start programming in a language that you don’t know but it can be frustrating since you have to look everything up in a book or online.
2. You have to become a rules lawyer. If you don’t know the rules, you obviously can’t program them. Learn to read the “comprehensive rules” that come with many TCG’s. Reading the comprehensive rules will open your eyes and will answer many of the details when programming like when your search your deck for a card can the player choose to not find a card even though it is in the deck. The usual answer to this is yes because otherwise you have to prove to your opponent that the card isn’t in your deck, which is annoying and time consuming. Many TCG’s share the same nomenclature such as zones.
--A quickstart idea is just to code two starter decks and let other people verify that your program implements the rules correctly.
3. Write the program for only yourself. By tailoring the program specifically to yourself, you are making many good design decisions. Not everyone will agree with you 100% but that never happen anyways.
4. Don’t expect anyone else to help or support you.
I know this sounds a little rough but if you are coding something that you think will make other people happy, you are in for a world of hurt. By programming something specifically for yourself, you are (hopefully) guaranteed to make yourself happy. And if you are happy, it will make the work that much more enjoyable. Internal motivation is much better external motivation, aka writing the program for somebody else.
Coding is really a one-man activity. And yes you may be working on a team but you will spend most of your time by yourself. Many open source projects are supported by only one-man so you have to learn to rely on yourself. (Yes, you can ask other people questions but don’t expect them to do the grunt work, you have to do your own grunt work.)
5. Spent a lot of time working on the user interface. People will make snap judgments about your program after using your program for only 30 seconds. The user interface is what people will be using and it will affect their enjoyment. With that said, I know that working on the user interface can be hard/annoying. Making your program look halfway decent is a big challenge. The reason that Forge has a fantastic, boring gray background is because that is the best that I can do. Programming the user interface can easily take half of your time.
6. Don’t be afraid to fail. I didn’t get Forge right the first time. The current version of Forge is probably by 3rd or 4th version. I would start coding the best that I could and eventually the project would just crumble right before my eyes. I would pick up the pieces and confidently try again. And now if I started Forge again, I think I could program it 80% better because I’ve learned so much. I’ve read that you learn more from your failures than you do from your successes.
7. Have fun. If you aren’t having fun programming something…then stop. Find something that is easier and work on that instead. By working on easier projects you are flexing your coding muscles so that you can handle that harder stuff later.
Hopefully that helps point somebody in the right direction. Obviously I left out many subjects like writing the AI, which is a whole book by itself, or stressing that automated tests are your friend (although I admit that I didn't write any). Coding can be fun, especially if you are working on a videogame.