version control

Discussion about everything. New games, 3d math, development tips...
Post Reply
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

version control

Post by xDan »

So I'm going to bite the bullet and learn about version control, something I should have done a while back...

But I have a situation I'm not sure how to resolve.

I have a somewhat large game engine, which much like Irrlicht and its Tutorials, has projects using the engine in subdirectories. This is nice as the entire engine and projects using it can be built at the same time with CMake.

But one reason I am moving to version control is that sometime I may want to make my engine open source. But I won't want to open source the individual projects (games) of mine which use the engine.

So now I have the dilemma of how to organise all this stuff. I see two options:

1) seperate each individual game project to a separate repository, with its own structure not related to the engine. Keep the engine separate and compile and copy + paste across latest binary releases of the engine to the individual projects.

I don't like this approach since it means making new cmake scripts and such for each project. It is however very simple to understand.

2) Keep the project subdirectories as they are. Some projects I open source can remain there, such as engine tests and examples. Then, for my closed source projects I create a clone of the main engine source and develop them separately.

With this option, I have to make any changes to the engine in the main engine repository and then the clones must have these changes propagated to them somehow when I want to update to the latest version of my engine. I'm assuming version control supports things like that.

I'm guessing (2) is the route to go, but it seems a lot of hassle to have to develop my engine and games in two separate places and having to propagate engine changes across.

Opinions? What other options are there?
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Why do you need to copy your game engine? I have everything in seperate folders (although it's all open source), and when I compile it I just link to my .a files generated in some other folder. Or maybe do it like this:

Code: Select all

+ main folder
|
| (makefile)
|
+--+ engine
|  |
|  | (makefile)
|
+--+ game1
|  |
|  | (makefile)
|
...

With the makefile in the main folder you trigger the makefiles in the subfolders, and depending on what you want to share you add the subfolders to SVN (only the engine in this case ;) ).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

you can restrict access to certain folders using svn as well so you could have all of the code in one folder and then only allow anonymous access to the folders that are public and keep the other ones as authenticated access only or for a certain group of users.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

Keeping certain folders private sounds like the answer! I didn't realise that could be done..

I do want it all in the versioning system for backup purposes.
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

yeah, if you use subversion there is a config file (in each repository) which contains the ability to make certain folders public or private. I haven't had the need to distinguish between them so I don't have any more specifics. Google will help though/ you can then use a back up program to back up the repository folder and all info is retained.
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

We use Mercurial here and love it. We have the engine and all games using the engine, as well as libraries they rely on in seperate repos. (Smaller libraries are grouped into one larger libs repo.)

The main pitfall of this is that you have to separately commit/push repos, and you have to make sure you document which engine revision the game revisions match up with. However it has worked great for us!

~David
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

@DtD

I've been looking at Mercurial and Bazaar today.

You say you have different repositories for each game. Do you mean you have a complete clone of the engine in each repository? A bit like (2) in my first post?
Post Reply