• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
UnshavenBastard

Growing Libraries between projects

9 posts in this topic

When I wrote things that are not specific to the very application, and could be useful elsewhere, I’ll often move them to a library.
So far, that library always was part of a workspace (e.g. MSVC workspace) of projects that were related, as an own project.
I would then, despite knowing better, carry that library over to another project, i.e. copy. That means maintenance of several different places, keeping copies of the library in sync when bugs are discovered, or extensions are made, which may become useful for a later stage of older projects.
I knew from the beginning that it would probably be a good idea to have the library as a completely separate project, and only use binaries of it in other projects.
But then… it’s easier to debug everything if the library is part of a project. That’s why I kept it that way.
I can't say I'm really happy that way, though.

How do you do this sort of stuff?
0

Share this post


Link to post
Share on other sites
I don't know about other compilers, but Visual Studio can debug binary even if it was built in separate solution as long as debug information is present.

I think it also allows to add external projects to solution without copying, so you'll have only 1 instance of project. Edited by Ripiz
0

Share this post


Link to post
Share on other sites
I can only comment on what i have done, but so far(knock on wood) I haven't had too many issues.

My code is broken up into several libraries, most started as a project in one of my original solutions(vs lingo). As it sits now I have 5 or 6 game projects on the go, as well as 6 or 7 different libraries, math, graphics, physics, networking, sound, etc. I'll like never polish any of the game as they are, for the most part I use them to as tech experiments.

When I get some key functionality, like sprite animation, working the way I want in a game project, I create a new version of the library it should reside in or perhaps a new library all together, if it's something I've never encountered, and refactor the changes there.

When I'm working on a game project that does require functionality that exists in a new version of one of the included libs, I'll create a new version of the game project, make any changes necessary to use the new code, and go from there.

This way other game projects which didn't require that functionality can keep on using older versions of the libs, and I can continue to improve or polish these tech demo projects. As an added bonus, I get a growing base of functionality that has been refined and tested in multiple situations, to use in future projects.

While some might say i'm making engines not games, I have fun regardless, and have gained enough knowledge to feel confident enough that these projects could be finished up at some point in time, even if i never get around to it. Edited by Burnt_Fyr
0

Share this post


Link to post
Share on other sites
[quote name='UnshavenBastard' timestamp='1349959325' post='4989080']

How do you do this sort of stuff?
[/quote]

"Add Existing Project" and have both solutions refer to the same shared project.
2

Share this post


Link to post
Share on other sites
I've found that a key point here is to distinguish between library code compilation and linking and source revision control. I use the following approach:

- a single GIT repository for all projects.
- a library folder where all shared code go, such as math and low-level graphics stuff and other nice-to-have things.
- use GIT branching and tagging to keep track of latest stable version of each project.
- when library code diverge between projects (as it does!) use GIT to merge the diffs.

This way both the library code and the project code can evolve in a controlled way, so that changes in one project doesn't break code in another project.
0

Share this post


Link to post
Share on other sites
Without knowledge of one particular vendor's specialized tool, I can tell you that the solution for this problem developed by various system engineers some decades ago was something called a "shared library". The idea was that all of the common code would be maintained in one place, and bug fixes or enhancements would be done once in one place and used everywhere. Security fixes would be distributed for immediate and universal benefit.

On the Micosoft Windows OS a shared library is implemented as a DLL. On Mac OS X it's a framework. On ELF systems it's an SO file.

To be a useful shared library, the library file itself must go in a common (shared) area. That generally has to be a system directory for the runtime file, although there are always methods for using non-system paths. The development files (headers, link libraries if required) can generally be installed in non-system development paths and build configurations adjusted accordingly. the library itself is usually considered a completely separate project, benefits from things like stable versioned releases and regression testing, and can be separately distributed so it can be shared with friends and colleagues.

This is very, very fundamental technology. I suggest you are better off using what has been developed, tuned, and tested by many experts over many years than to come up with your own solution.
0

Share this post


Link to post
Share on other sites
[quote name='Bregma' timestamp='1349971158' post='4989136']
This is very, very fundamental technology. I suggest you are better off using what has been developed, tuned, and tested by many experts over many years than to come up with your own solution.
[/quote]

I'm not sure I get your point here... are you against static libraries in general?

But the question isn't about static/dynamic libraries, it's about how to organize your workspace when developing the project and the library in parallell.
0

Share this post


Link to post
Share on other sites
[quote name='Bregma' timestamp='1349971158' post='4989136']?the library itself is usually considered a completely separate project, benefits from things like stable versioned releases and regression testing, and can be separately distributed so it can be shared with friends and colleagues.?[/quote]


This is one end of the spectrum, and the appropriate approach in some cases where the library project is well defined and reasonably large. I've found myself on the other end, where I first tended to write the same code (e.g vector math) over and over again, and then moved to lots of copy-and-paste over and over again, and finally to GIT. There's no real "library" project in there, no library "team" and definitely no planned work devoted just for library code. There's just a lot of code reuse that's evolving over time. Moving to GIT (or any other good version control system) is the right tool for such an agile approach where you always work on real products and any shared code is generated as a byproduct of the refactoring steps. Edited by Felix Ungman
0

Share this post


Link to post
Share on other sites
If you don't like DLL's you can just use the DLL's for development and static link when you're done.

If you use svn you can use svn externals: [url="http://svnbook.red-bean.com/en/1.0/ch07s03.html"]http://svnbook.red-bean.com/en/1.0/ch07s03.html[/url], to nest repositories within repositories.

So let's say you have 3 projects

/project1
/project2
/project3

And a common module

/module

You use SVN externals to add create:

/project1/module
/project2/module
/project3/module

where all three link to the same folder which is

/module

I'm not sure how SVN externals work with branching though. And since you say you use updated versions for new projects it sounds like you'll need that branching capability.
0

Share this post


Link to post
Share on other sites
I found myself in the same situation, reusing my personal libraries in every project I start. And these libraries used to grow along with the project, so I, too, found myself in need to merge the various development steps into the other instances of the framework.

My solution: Subversion "external". I created a separate repository for the framework with all its libraries and their corresponding Visual Studio projects. Then I created a directory in each solution, usually called SourceExt/, and added a subversion property to check out the framework repository into this directory. Then it's just a simple "Add existing project" and maybe adjusting some include paths in the solution. And because of relative paths everywhere any of my team mates can simply pull the whole thing from the subversion repository and build it right away. I even put DirectX, FMod, PhysX and all the other dependencies there. Relative paths go a long way when used correctly.

Of course this is the opposite of what Bregma suggests, for example. But seriously: your project is most probably not important enough to add even more trash to the user's system's library directory. And dynamic linking prevents inlining and Link Time Code Generation, which is the single most important source of performance improvements in any of my projects. You don't want to place your framework in DLLs / SOs or whatever if you can link statically. So my suggestion is: link statically, share the repository.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0