Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
C++ Game Development Cookbook

You're reading from   C++ Game Development Cookbook

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785882722
Length 346 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Druhin Mukherjee Druhin Mukherjee
Author Profile Icon Druhin Mukherjee
Druhin Mukherjee
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Game Development Basics FREE CHAPTER 2. Object-Oriented Approach and Design in Games 3. Data Structures in Game Development 4. Algorithms for Game Development 5. Event-Driven Programming – Making Your First 2D Game 6. Design Patterns for Game Development 7. Organizing and Backing Up 8. AI in Game Development 9. Physics in Game Development 10. Multithreading in Game Development 11. Networking in Game Development 12. Audio in Game Development 13. Tips and Tricks Index

Choosing the right source control tool

In this recipe, we will see how easy it is to take a backup of our code using the right version control. The advantages of having a backup to a central server is that you will never lose work, can download the code on any machine, and can also go back to any of your changes from the past. Imagine it is like a checkpoint that we have in games, and you can go back to that checkpoint if you face problems.

Getting ready

To go through this recipe, you will need a machine running Windows. No other prerequisites are required.

How to do it…

Choosing a correct version tool is very important as it will save a lot of time organizing data. There are a few versioning tools that are available, so it is very important that we should be informed about all of them so that we can use the correct one based on our needs.

First analyze the choices that are available to you. The choices primarily include Concurrent Versions System (CVS), Apache Subversion (SVN), Mercurial, and GIT.

How it works…

CVS has been around for a long time, so there is tons of documentation and help available. However, a lack of atomic operations often leads to source corruption and it is not well cut out for long-term branching operations.

SVN was made as an improvement to CVS and it does fix many of its issues relating to atomic operations and source corruption. It is free and open source. It has lots of plugins for different IDEs. However, one of the major drawbacks of this tool is that it is comparatively very slow in its operations.

GIT was made primarily for Linux but it improves operation speed a lot. It works on UNIX systems as well. It has cheap branch operations but it is not totally optimized for a single developer and its Windows support is limited compared to Linux. However, GIT is extremely popular and many prefer GIT to SVN or CVS.

Mercurial came into existence shortly after GIT. It has node-based operations but does not allow the merging of two parent branches.

So to sum up, use SVN if you want a central repository that others can push and pull. Although it has its limitations, it's easy to learn. Use Mercurial or GIT if you want a distributed model. In this case, there is a repository on every computer, and generally, one of them is regarded as the official one. Mercurial is often preferred if it is a relatively small team, and it's easier to learn than GIT.

We will look into these in more detail in a separate chapter.

Tip

Detailed steps to download the code bundle are mentioned in the Preface of this book. Please have a look.

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/C++Game-Development-Cookbook. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

You have been reading a chapter from
C++ Game Development Cookbook
Published in: May 2016
Publisher: Packt
ISBN-13: 9781785882722
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime