Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (755)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Backwards-Forewords Compatible Save Game Data on: 2017-05-15 12:18:07
I've been poking around the internet trying to see if anyone has ever tried this before.  I've seen no evidence of it, so I felt I should share.

This could easily be used with other archive formats and other programming languages, but this is an old forum I used to, seemed the logical first place.
2  Game Development / Game Mechanics / Backwards-Forewords Compatible Save Game Data on: 2017-05-15 10:28:37
I've got an idea on storing saved games that I think is generally useful and helpful, so I felt I should share it somewhere.

Several months ago I was wracking my brain, looking for a strategy for storing a potentially large set of data for a given 2D game world made up of blocks and a friend sparked a fascinating piece of inspiration for me.  I was debating an XML format vs. some kind of custom-designed binary format and zip files came up in the discussion (he was just throwing out odd-ball ideas, trying to help me out).

That's when the thought hit me full force: zip files are the perfect solution (and Java supports them out of the box, woo!), allowing both backwards and forwards compatibility in my game world format.  My thinking (and what I've been working on) is that the zip archive holds each distinct type of data as a separate file in the archive.  When you need a new type of data, just slap a new file into the archive under a new name.  If an older version needs to load the file, it simply ignores data files it knows nothing about.  When a newer version loads the file, it can supply reasonable defaults for the data it considers to be missing or otherwise extrapolate from existing data (what we'd have to do on old files opened in a new version, anyhow).

The beauty of this is that as your needs change and evolve over time, your method for storing new data does not interfere with or even change the way you store old data, unless you're brave/foolish enough to re-arrange the archive's structure later on.  Another nice bonus is that you get compression for free, if you want it (one can always set the ZIPOutputStream to simply store files instead of compressing them).  Even setting the compression level to it's minimum setting gets you some rather good run-length encoding for only minimal processor usage.

As a more concrete example: the game engine I'm working on uses a number of run-time defined variables in game worlds that are specified mostly by XML files from game mods.  Each block in the world gets it's own little chunk of data for each variable.  From one run to the next, as mods are added and removed from the game, some of these variables may no longer be required.

Since each variable is a primitive type (byte, short, int, long, float or double), all I have to do when storing or loading them is read/write a bunch of raw data to/from the stream, without dealing with all the data being mixed together.  Each variable has it's own file and an extension matching it's primitive type, so anyone poking around in the files in the archive can be assured of the exact type of data based on it's name alone, though discovering it's exact purpose may require looking it up in the meta-data (see next paragraph).

For textual data, like Strings, I'm storing them in XML files.  I'm also storing some minimal meta-data as XML, like the dimensions of the world and a listing of the block types by name, so the world can be reconstructed from the raw numbers from other files.

Now, one hiccup I can see is that sometimes you're going to end up with data you don't know how to parse, because it's either no longer supported, or the mod that needs it was removed.  I currently haven't decided on how to handle that.  It's possible to preserve the old data and hold it in memory until the world is written to disk again, but this would not always be desired.  I think discarding it is probably the way I'll go.  It can always be manually retrieved from an old copy and re-inserted just by manipulating the zip archive a bit.

Another hiccup I see is that once you decide where in the archive a file goes, you can't ever move it without breaking compatibility with older versions.  So, if you make an ugly choice on placement of a file, you're stuck with it.

Anyway, that's my idea.  I hope others find in helpful.
3  Discussions / Miscellaneous Topics / Re: Are there any good physics engines written in Java? on: 2007-04-14 23:28:50
I'm working on a physics engine as one of my sub-projects here:

I don't know if I'd call it a good one yet, all depends on what you need.
4  Game Development / Game Mechanics / Re: Opinions please? on: 2007-03-31 15:49:26
All right, the Java Web Start version of the physics demonstrator is up on the website.

You can find it on the following page, along with some quick notes on what to expect when you run it:

If you just want to go straight for the JNLP file, here's the URL:

Just keep in mind that when you select one of the demos, the first window will vanish, a few seconds will pass and then the rendering window will appear.  To load a new demo, you'll have to run the application again from the beginning, using the JNLP file.

The new demo code is a little rough, but this should be far easier for the non-programmer to start up.  It will take care of downloading all the important bits for you.  I'll be polishing it more in the future; I just wanted to get something simple to use up ASAP.

I had to sign the Janino Jar myself, as it's author does not currently provide a signed version.  I sent the author an email about that.  Hopefully I'll get a reply and a solution for that soon.

Edit: I just barely got a reply.  We should have that fixed the right way soon.
5  Game Development / Game Mechanics / Re: Opinions please? on: 2007-03-28 14:59:46
Thanks for the advice.  I hadn't thought much about making the demos easier to use.

I could write a simple demo application that presents a list of scene files and lets the user select one.  Shouldn't take much to package it as a JWS app (something I've never done before).  I could even have it extract the command line arguments from the jar manifest and/or have it scan one of the directories in the jar for the demos.  I love this idea.

I think I'll do the same for the 3D modeler and the sound modeler, once I do some more work on it (actually turning it into a modeler).

Thank you for sparking a good idea!
6  Game Development / Game Mechanics / Re: Opinions please? on: 2007-03-28 02:38:03
A very amitious project! Are you working on it alone? I love space shooters as well, although I'm generally too lazy to actually get my joystick to play...

Writing your own physics simulation seems overly complicated, why did you choose to write your own rather than to use for example JOODE?

I am working alone.  There's another guy listed as a developer on the project, but only because he used to be in charge of the website (good friend of mine in RL).  I've posted through the help wanted system on more than once, but never got a response.

I would love to have help with the project.  It would likely take me a bit to adjust, however (setting up CVS, communicating with other developers, setting up and assigning tasks, etc.); I've never really worked with others on a project for all that long.  That's probably due to my insistence on doing things differently (people don't usually believe what I say is possible until I've built it).

My guess is that most people look at my projects and go, "WTF?"

Case in point: I built a unix-like system in Java (, though I abandoned it in favor of this project (this one is more satisfying, as I'm not slamming my head against the limits of Java every five minutes).

Another example is my 3D modeler (part of this project).  I built it for programmers instead of artists.  You build models using Java source code, which when run produces the model.

Like I said, I do things differently.  Different is good, eh?   Wink

To be honest, I wanted to write my own physics engine so I could learn how it's done.  I also don't like the style in which the existing engines were programmed.  I mean no offense to those who wrote them, I just don't like them (granted, I haven't looked at JOODE).  This is simply another in a long line of re-inventions of the wheel, because I didn't like the wheels that were available.

This also isn't my first physics engine, but it is the most capable so far.  Once I have the rotational bits working and a few more collision detectors, it will fill my needs nicely.  Everything else (more forces and pretty eye candy) is just icing on the cake.
7  Game Development / Game Mechanics / Re: Opinions please? on: 2007-03-27 15:57:25
Did you download the required libraries, as the documentation tells you to? (In the 'docs' directory)  Please follow the install directions.

You need to visit the Janino website and download it.  This is the exact error I get when Janino is missing.

You'll also need JOGL (  Use the JSR 1.0.0 version.

Make sure their jar files are in the same directory with the other project jars, spelled and capitalized as follows: "jogl.jar", "janino.jar".  Please follow the instructions in JOGL's docs on installing it's native bits, though you'll find some hints in my project's documentation.

Edit: I do not include the libraries in the main archive because it simply bloats the download for people who already have them, I don't want to include the native bits for every platform and I wish to direct web traffic to the websites of the libraries I use.  They scratch my back, so I scratch theirs...
8  Game Development / Game Mechanics / Re: Opinions please? on: 2007-03-27 14:29:09
In the 'scenes' directory of the main project archive, you'll find a bunch of Java source files.  These are the test scenes.  DO NOT compile them.

Type this from the base directory:
java -jar physics.jar scenes/

If for example, you want to run

I'm using a runtime Java compiler called Janino ( to compile the scenes from source.  It's handy for testing and such.

Hope that makes things clearer.
9  Game Development / Game Mechanics / Opinions please? on: 2007-03-27 02:25:15
I'm working on an open source game project.

I was hoping to get some opinions on the physics engine I've built.  So far, it handles spheres and you can easily implement arbitrary physical forces, such as gravity between particles, springs, etc.

It supports (generalized) gravity and springs out of the box.

Collisions are detected and handled at the precise moment they occur, between integration steps.  Collision detection is pluggable and based on an interface, so it is possible to build your own collision detector.

I admit there are some bugs to fix and important features still left to be implemented, but I'd like some feedback.

Thank you.
10  Java Game APIs & Engines / Tools Discussion / Re: How do you work with 3D Models? on: 2007-03-12 16:58:26
This might not be quite what you're looking for, but I built a 3D modeler myself.  I designed it with a programmer's needs in mind, rather than an artist's, because Blender makes no sense to me.

Basically, you write Java source code that builds the model.  All you need is graph paper, a pencil, a colored pencil, and a ruler.

It might help you with the creation of new models, but not with the modification of existing models.

Currently, it doesn't support any kind of 3rd party model import/export, as this isn't a feature I actually need for my project, although it is something I've thought about adding many times.  File parsing is a pain...  I'd be happy to accept submissions in this area, BTW.

Edit: Forgot to give you the URL:
Pages: [1]
DesertCoockie (52 views)
2018-05-13 18:23:11

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

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

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

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

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

Solater (102 views)
2018-03-17 05:04:08

nelsongames (184 views)
2018-03-05 17:56:34

Gornova (426 views)
2018-03-02 22:15:33

buddyBro (1086 views)
2018-02-28 16:59:18
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!