Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Project Setup and Maintaining Different Builds  (Read 1273 times)
0 Members and 1 Guest are viewing this topic.
Offline lintfordpickle

Senior Newbie

Projects: 1

« Posted 2014-05-08 07:30:00 »

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?


Offline SHC
« Reply #1 - Posted 2014-05-08 07:36:14 »

I'm not an expert regarding to large projects, but if I were you, I would develop the multiplayer thing as a plugin. You load the plugin if it is present in the game directory. Then for free version, you give only the application and when purchased, you give your extension.

Offline StrideColossus
« Reply #2 - Posted 2014-05-08 08:32:27 »

I think you have a couple of options:

1. Multiple projects: You could split your project into multiple sub-projects, e.g. the single player version, the multiplayer client, the multiplayer server, free version, and everything that is common to all the above (which will probably be the largest component).  As you're using Eclipse you can specify the inter-project dependencies as part of the build-path:  Project > Properties > Java Build Path > Projects.

2. Build tool:  You've already suggested using some sort of build tool, I would suggest Maven since it's relatively simple and fairly ubiquitous if you need help getting to grips with it.  You could structure your project as #1 and define the inter-dependencies in the POM, with the added bonus that you can also use Maven to specify and manage any third-party libraries you're using.

Either of these approaches should hopefully satisfy the constraints you've specified, for example only the multiplayer client and server projects would contain any networking code (you might even consider another common component here).

I have used both of these approaches in real-life work and well as personal game development projects.

One approach I wouldn't recommend is to try and develop scripts that 'cherry-picks' source code from some uber-source-tree - from experience it can quickly become messy and therefore difficult to maintain, taking time away from actual development.

- stride
Pages: [1]
  ignore  |  Print  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (210 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (779 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!