Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 247 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?

Thanks,
-LintfordP

Online 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  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (23 views)
2014-09-12 09:08:26

Norakomi (56 views)
2014-09-10 13:57:51

TehJavaDev (69 views)
2014-09-10 06:39:09

Tekkerue (34 views)
2014-09-09 02:24:56

mitcheeb (56 views)
2014-09-08 06:06:29

BurntPizza (40 views)
2014-09-07 01:13:42

Longarmx (25 views)
2014-09-07 01:12:14

Longarmx (31 views)
2014-09-07 01:11:22

Longarmx (31 views)
2014-09-07 01:10:19

mitcheeb (38 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!