Page 1 of 1

Sharing code with Shadowgrounds

Posted: Thu May 26, 2011 1:41 pm
by alt_turo
Shadowgrounds and Survivor share a lot of their code with Claw. Currently only the Windows code has been released but hopefully we'll get the Linux/Mac code soon. When that happens some people might want to start improving on it. It would we useful to share code and effort. Do we want to do this and if so how do we want to do it?

1. Keep separate repositories and occasionally port code back and forth. Might lead to wasted effort when the same changes need to be done to both repositories. But would allow the codebases to diverge more easily where necessary.

2. Have a single repository with two top-level directories for different games. Occasionally port code back and forth. Like above but everything in one repository. Would make it slightly easier to port changes.

3. Have a single repository with top-level directory for shared code and separate directories for game-specific stuff. Would make it easy to add improvements to both games at the same time. On the downside it would also be easy to accidentally break one of them. This would also require quite a bit of refactoring out the common code before we get to this point.

Questions? Comments? Flames?

Re: Sharing code with Shadowgrounds

Posted: Thu May 26, 2011 2:41 pm
by CheatCat
I like the 3'rd alternative, then you don't need to porting anything or copy code.

Re: Sharing code with Shadowgrounds

Posted: Wed Jun 01, 2011 6:11 pm
by Urfoex
(I had some issues with mercurial and not being able to checkout only parts of a repository.)
So I like the idea of having one repository for the engine and for each game (without the engine) another repository.
It would be like your third option I think.
The engine should be working without any game on top of it. Changes to the engine will (should) benefit each as long as the API isn't changed.

Re: Sharing code with Shadowgrounds

Posted: Thu Jun 02, 2011 10:10 am
by dublindan
I agree with Urfoex

Re: Sharing code with Shadowgrounds

Posted: Fri Jun 03, 2011 12:49 pm
by alt_turo
Urfoex wrote:So I like the idea of having one repository for the engine and for each game (without the engine) another repository.
It would be like your third option I think.
The engine should be working without any game on top of it. Changes to the engine will (should) benefit each as long as the API isn't changed.

But it's almost certain the API would change. Currently it's rather messy. There's the strings issue mentioned in another topic. Then there's setting video mode/creating window part. It was designed to allow the editor to "embed" the scene in an editor-created window. This doesn't work on anything but Windows/Direct3D and even there it's rather messy.

If we have three separate repositories then it becomes very hard to keep them in sync. You update one and forget to update the other(s) and then you have a big mess. Bisect also becomes very hard if you have to bisect across an API change.

Re: Sharing code with Shadowgrounds

Posted: Wed Oct 05, 2011 5:37 pm
by vayerx
alt_turo wrote:But it's almost certain the API would change.
alt_turo wrote:If we have three separate repositories then it becomes very hard to keep them in sync. You update one and forget to update the other(s) and then you have a big mess. Bisect also becomes very hard if you have to bisect across an API change.

Storm3D and other libraries may be used from external repository via git submodules, pointing to specific commits in master/features branches. This can be used to defer upgrades to newer api. Anyway, tracking/merging changes in a single repository is much easer than in different source trees.