Game Development Community

Merging

by Juha Eerola · in · 06/09/2006 (5:43 am) · 16 replies

Hi!

Just some questions before buying the kit...

How hard it would be to merge the TLK code to my project?
I have heavily modded engine source and I don't want to code it all again.

Has anyone done it and how long did it take to do so? (i know it depends on the amount of code changed but I want to know it anyway)

#1
06/09/2006 (6:00 am)
It hardly takes any time at all using winMerge or similar.
#2
06/09/2006 (6:05 am)
Use Beyond Compare , its an amazing tool.
All the lighting Kit code is commented so it should be straight forward.

However, I do things differently.
I use TLK as my base, once compiled I zipp it.

I will then add my C++ Changes to the good compiled version.
Then once that new one compiles I zip that too.
I MAKE A SEPEARTED ZIP AND COMPILE FOR EACH MAJOR CHANGE I DO.

Then when I know each one of these version compiles and runs correctly.
I begin to merge the major sepearated/tested C++ changes into one
Build that has all the changes into it.

This is the way I version my code, to keep it clean. Only you
will know how well you have your c++ changes commented. If they
are not well done, then I suggest from here on in you make them very clear.

And Why do I zip? so I can unzip something I know works if
all hell brakes loose, which it does on a regular basis.

Long story short , it should'nt be too hard. But I wouldnt want to do it that
way myself. Suggestion: Use tlk as base, and start over.


-Surge
#3
06/09/2006 (6:20 am)
Surge,

Sounds like an interesting approach -- not just for TLK stuff. Lately, I've been looking for a good way to 'modularize' my changes to the engine and this might be a good way to go about it.

Aaron E.
#4
06/09/2006 (6:47 am)
Ive been useing this technique for over 2 months, and i have had cleaner quicker results than
ever before. I can trace my steps back easily.
#5
06/09/2006 (7:26 am)
Thanks for the advices!
I'll buy TLK and merge it with my code using winMerge or Beyond Compare.

I'll come back if I encounter any problems.
#6
06/09/2006 (8:14 am)
Hi Juha,

Welcome to the TLK family. If you have any questions after buying TLK stop by the TLK private forums and we'll be glad to help.


Surge and Aaron,

Have you tried using a version control system like cvs or svn? They work in the same way, but automatically track your changes for you. You can also tag good revisions of code, so you can easily retrieve them again later (also you can retrieve any of the revisions, even untagged, and retrieve by date if you know your code worked at a certain point). All of your changes are housed in one easy to backup location, and you can automatically diff any file against any previous version of it.
#7
06/09/2006 (8:37 am)
I use CVS to get the latest TGE and TSE source stuff, but that's the extent of my experience with it. Whatever method I end up using will need to be really easy.
#8
06/09/2006 (8:53 am)
That's a very good point cvs and svn are not known for being easy to setup and use.

Honestly though once you get the hang of it using them becomes second nature. If you decide to try it out I recommend starting with cvsNT as your server and TortoiseCVS as the client - these are what I originally used to test out cvs (long time ago - if anything they should be easier to use now).

I also found it easier to do my testing/learning during my downtime, so I didn't feel pressured to get it working right away. :)
#9
06/09/2006 (9:29 am)
That sounds like good advise. I will give those a try. Thanks.
#10
06/09/2006 (9:39 am)
John's point about using cvs or svn even for a one-man project is very good,
and basically does what Surge is doing with the .zip's except i suspect it's a lot easier to work with.

I'm using TortoiseSVN as the client - it integrates right into the windows shell, so you don't even seem to be running (yet) another app to use it. Some cheap web hosts such as Dreamhost provide SVN servers, which i haven't used but could be pretty cool. - That way you also have your code/data on an external server in case your local HD tanks!

Regarding the OP, we merged TLK into a kinda heavily-modded TGE in about half a day. I think i used winMerge.
#11
06/14/2006 (4:09 am)
TortoiseSVN is quite useful for merging stuff around. Here's my ultimate method for merging TLK and your TGE-based project:

1) Create a dummy repository somewhere in your HD (you don't need to setup a server or something for such quick jobs).

2) Create a folder called "BASE_TGE" and checkout your repository there. It's empty for now.

3) Copy the whole original TGE into that folder (source and everything), mark all files (except .obj files, they're not needed in the repository) as "add" then commit them all. Your repository will now contain the starting point for your project.

4) Now make two copies of "BASE_TGE" and name one "TLK" and the other "MY_PROJECT".

5) Copy your whole project into the "MY_PROJECT" folder, overwriting anything in there. Also flag files you created/added to be added in your commit. Then commit everything. The repository now contains your project in the lastest state.

6) Copy the whole TLK into the "TLK" folder, overwriting any file if needed. Do NOT commit anything! This is a good chance to take a look at what changed in the TLK source, since TortoiseSVN will mark all modified files and you can use the "diff" optiont to see exactly where they were modified.

7) Now the magic: do an "update" on the "TLK" folder. It'll download and merge all of your changes into the TLK changes. A lot of files will get flagged as conflicted, so all you need is use the "check for modifications" dialog and go through each one of the offending files, using the "edit conflicts" option. Depending on how modified is your source, you might need to do some manual tweaking on some files, since the merge tool isn't perfect.

The nice thing about this approach is that it takes in consideration the original TGE, so in the last step you can clearly see which your changes are, and which are the TLK changes.
#12
06/14/2006 (4:52 am)
Interesting stuff, I am going to consider many things in this thread thanks everyone
#13
06/14/2006 (8:14 am)
Hi guys,

Also keep in mind that you can use the TLK code right out of the box without any changes if you're starting a new project or only made script and asset changes to an existing project.

This is also extremely handy for rapid prototyping, building demos and proof-of-concepts, just unzip a fresh TLK and start hacking away!
#14
06/14/2006 (8:48 am)
Manoel - great technique, thanks!
i'll definitely try it next time there's a sizable resource/kit to merge in.
#15
07/17/2006 (3:22 pm)
I just wanted to mention that P4V perforce is great for code management. You can just go back to a previous version. Look into it. I have been using it on a project and love it.

You just upload all the files, use get latest revision to get the latest. Copy your repository (read only p4v dir) to another folder (sandbox), unset read-only to sandbox, make your changes, check out the file or files you changed, copy them from your sandbox to your repository. Select a checked out file right click, submit (will show all files check out and you can check them) make a comment of your changes hit submit and thats it.

It sound complicated, but is really nice. It can auto detect differences. If you check out more files then you edited after copying you can hit a button to un-checkout unchanged files.

Really cool. And it is free! http://www.perforce.com
#16
07/25/2006 (8:56 am)
During the install
developersGuide.pdf is produced by extraction into path
SynapseGaming\contentPacks\LightingPack
under whatever root you use including destop extract of just the pdf

this document includes a very detailed list of files you MUST merge
files you MUST include with your project
and files that are optional

WinMerge is free and links to aquire are in the document
it also includes instructions for setting up basic filters to
make the merge go easier

the only not included is a VC8 or VS2005 solution
after the merge into project you may/will see a few
warnings/errors due to new compiling formats under VC8/VS2005

I am working right now on a TLK 1.4 release into my RTS_Beta1 merge
have encountered a couple of small setbacks during the effort
but only been at it for 2 days. I expect as with original Beta RTS build
the VC2005 solution will take about 3 weeks to get
clean precise build solution with proper documentation of the process

if you own the TGE and RTS I have a solution build avail thru the RTS private forums
Quick hop use right click new window