Hi All,
I’m working on a new game using Java and LWJGL, using the Eclipse IDE. The game will feature both single player and multi-player modes, and free-to-play single player subset of the game.
What I would like to do is offer the subset of the game’s single player mode as a free download from my website (like Minecreaft’s creative mode), and give the player the opportunity, if they enjoy it, t0 purchase the game which would then include the full content and the multi-player features.
My question is about how I could achieve this from within a single workspace?
A few constraints I have are:
- I do not want to maintain independent code for each game version. All code where possible, should be shared.
- The creative mode subset should not contain any code from the full multi-player version of the game. i.e. if you download the free single player version, you shouldn’t get any code from the network implementation or any assets exclusive to the full version.
- If it isn’t necessary to change, I would like to maintain my current workspace structure. This is because I already have a client, server and combined client-server versions of the game set up and they all share common classes. Structuring this was a pain and I’d rather not revisit it.
I can think of two way to approach this, but I’d like to hear if anyone has a better way or some tips they can offer.
The first way would be to store all the game code in two separate libraries; the free-code and the not-free-code and create two projects which include these libraries. The full version of the game would include both libraries.
The other idea I lack experience to know if it’d work, but I think this maybe possible to do using some build scripts and this would possibly be easier to maintain. Each build script would compile only the .java files from a specific list based on the client type I am trying to build. They would also only include the relevant assets. I’m not sure how this would be set up, or if is indeed possible. Anybody know?
Has anyone done this before, and how would you do it if you had to?
Thanks,
-LintfordP