Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (731)
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] 2
1  Java Game APIs & Engines / Java 2D / Re: Fake 3d effect? on: 2013-04-08 19:44:11
Grab a copy of Developing games in Java.  Or check out his sample code. He implements a full 3d toolkit under Java2d - and it performs stunningly well. Smiley
2  Game Development / Artificial Intelligence / Re: A* with wall based tiles on: 2013-01-28 23:32:42
OK thanks. Smiley  That means I just have normal bugs but I don't have to tweak the algorithm itself.
3  Game Development / Artificial Intelligence / A* with wall based tiles on: 2013-01-28 21:49:58
Hi guys,

I've been trying to build a path finder for my game. As you can see by the pic below, this is using walls instead of simple blocks. I'm not sure how this is affecting the algorithm.  Samples I've seen use tiles where each coordinate is either blocked or not. In my case each coordinate may be blocked only from a particular direction.

Any tips on how I could do the algorithm differently?

4  Game Development / Shared Code / Re: Simple no-nonsense persistence library on: 2012-06-21 19:09:54
I just installed PostgreSQL and my basic tests all pass fine. So thank's I'll add PostgreSQL to my supported databases and include new tests for it in my next build.  Smiley
5  Game Development / Shared Code / Re: Simple no-nonsense persistence library on: 2012-06-21 00:14:20
Sorry for the delay.

Cool that there is H2 support in there. If PostgreSQL can be added then it is pretty much solid for me Smiley I guess you have to deal with primary key generation yourself?

the pluralization mapping support reminds me a bit of Ruby On Rails' ActiveRecord.

Yeah I could test PostgreSQL.  If you download it and try it - let me know how it goes. I'll add PostgreSQL to my list.

If you create a table like this:

 NAME VARCHAR(30) NULL )  -- etc...

Then you have a class
public class Player {

    private int id;
    private String name;
 // setters and getters

You don't have to specify anything in the class. In most cases Persism detects that ID is autoinc (and therefore primary) even if you don't specify that it's a primary in the table create.  The exception so far is Oracle which needs the annotation. I can dig into Oracle more deeply and see if I can prevent that in the future. The way Persism works is that it uses annotations only as a fall-back.  You Normally don't need to specify anything special - simple POJOs are usually sufficient.

That's the goal I'd like to achieve.

6  Game Development / Shared Code / Re: Simple no-nonsense persistence library on: 2012-06-18 00:29:21
Hi, good question.  Smiley

Simple. Persism doesn't directly support the idea of having hierarchical objects. It's up to you if want to do that. Persism uses SQL directly so you can do it yourself. The library doesn't impose the methodology. 

Say you have Player

class Player {
  int id;
  // etc...

  List<Attribute> attributes;
  // getters/setters


Then you could do:

Player player =,"select * from players where id=?",123);
player.setAttributes( query.readList(Attribute.class,"select * from Attributes where Player_id=?",123) );

This is effectively what Hibernate does. The difference here is you're in control on how you want to do it.

Often if you want to join 2 sets of data together you might want to write a class with the specific values you want and then use joins instead of querying 2 separate times.

class PlayerAttributes {
   int id;
   int strength;
   int dexterity;

  // etc...

then the query would be
sql = "select, attributes.strength, attributes.dexterity from players p join attributes a on = a.player_id where = ?";
List<PlayerAttributes> list = query.readList(PlayerAttributes.class, sql, 123);

There actually is no n+1 select "problem". It's a problem only in as much as most ORMs have query languages that can't really optimize the set oriented nature of relational databases.  Persism uses SQL directly.
7  Game Development / Networking & Multiplayer / Re: Database for gameserver on: 2012-06-17 00:44:52
If you're using a database you can check here:

8  Game Development / Shared Code / Simple no-nonsense persistence library on: 2012-06-17 00:43:45
Hi all,

Based on a discussion here I thought I would post my ORM library for Java.  Have a look at Persism.

Persism is a simple no-nonsense, auto-configuration, auto-discovery, convention over configuration Object Relational Mapping library.  Persism uses POJOs for data objects and does not need any XML for configuration. Annotations are only used as a fall-back in cases where the library can't discover the mapping on it's own. Persism is pretty smart so you usually don't need to bother with annotations at all.

Persism has no external dependencies however it will use logging if available and it's only about 40k.

Persism has only 2 classes: Query for reading data and Command for updates/inserts and deletes.

The library works around the Connection object. Example of a query:

Query query = new Query(connection);
List<Player> list = query.readList(Player.class,"select * from PLAYERS where name = ?", "Fred");

// or a single object
Player fred =,"select * from PLAYERS where name = ?", "Fred");

// or even simpler
Player fred = new Player();
fred.setPlayerId(123); // set the primary key; // finds Fred in the database by primary key

Notice that the class is Player and the table is PLAYERS. Persism understands that and maps this for you without annotations.  Heck, the library will also map things like Category -> CATEGORIES and PlayerAttributes - > [Player Attributes].  Plural table names and tables with spaces in the names would all map fine without annotating anything.

Command is similar:
Command command = new Command(connection);

Player player = new Player();

command.insert(player );

command.update(player );


I've been using this library myself in various production applications. I marked it beta for now because I need some feedback on it before I finalize the API and also I added support for several different databases.

Current databases supported:
MSSQL (JTDS and MSSQL driver)

Thanks everyone! Let me know what you think!
9  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-06-17 00:10:57
That's pretty cool.  Cheesy Similar to my design except I don't need POJOs to inherit anything special.   Well I spent a bit of time on this and posted it up on sourceforge.  I'll post something in the Share Code section.
10  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-05-18 18:55:42
You can also do it the other way around - generating record classes from a db-schema. I had some good experience with JOOQ

Yeah JOOQ is interesting but really it emphasizes the query.  In many situations especially with games we don't have any complicated queries to worry about. Really I'd prefer just a simple Java Bean and a quick and easy way to read and write it.
11  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-05-18 12:10:19
This is a lot of good info. Thanks guys.

I have some code for this I've been working on as well. I have some vacation days so I was thinking of putting it together. 

It does not require any mapping, instead it uses auto-discovery and convention over configuration to figure out table and column names.

If I get something and post a link would anyone be interested in trying it out?  Maybe I could have something in the next week or so.

12  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-05-18 10:55:06
Play 2.0 uses Ebean for Java and Anorm for Scala.  They're both available separately.
There's also Siena, another AR type thing:
Thanks that's interesting.
13  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-05-18 00:52:53
I had done it before, but that's not reliable. On Play!, you just let the will-be-persisted class to extends Model and call save() like to persist. The framework will take care everything including table creation. If in next day you add more field, it will also update the schema for you. That's most simple DML related operation that I ever use.

Interesting but this is also a huge framework 90 MEG! On server side applications size is not so important. For smaller apps and Games we need something tiny that just does the job with little or no dependencies.
14  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-05-18 00:14:37
Hi Otto,

Even MyBatis seems too complex. If (eventually) I need to port to a smaller device - the smaller the library the better.

Let me mull this over for a bit.
15  Game Development / Networking & Multiplayer / Re: What do Java game developers use for Database persistence? on: 2012-05-18 00:04:35
Yeah I see what you mean. Most ORMs are more complex than they need to be for basic usage.

The closest I found is Persist ( but it's not well maintained and it has it's fair share of quirks.

I've been hacking around with various solutions and so far found nothing that I like yet.  I see what you mean by Play framework - something could be adapted from it.

16  Game Development / Networking & Multiplayer / What do Java game developers use for Database persistence? on: 2012-05-17 22:50:18
Hi All,

I've been hacking at a game for a while and I need a fair amount of data so I use SQLite and store it.  Using JDBC directly is somewhat tedious and I was wondering if anyone had any good ORM type libs they recommend for use for games or smallish apps.

I've looked at Hibernate but it's huge and over complicated for my needs.


17  Game Development / Game Play & Game Design / Re: Implementing battle actions in an RPG? on: 2011-03-05 00:39:10
In my opinion...

If this is your first game I would put none of the actions in XML.  Keep it all in Java until you come to that day that you're writing a lot of boilerplate code.  If that day happens, _then_ you can refactor your code to add more actions without recompiling.

Why?  Because you likely not have that many actions compared to mobiles and objects.

Good point. Java first is the best approach. Also I would recommend using the javax.script API instead of XML.
18  Game Development / Game Mechanics / Re: Line-of-sight algorithm on: 2011-03-01 23:39:35
Thanks. I found the Wikipedia entry on this.  Smiley
19  Game Development / Game Mechanics / Re: Line-of-sight algorithm on: 2011-03-01 02:42:04
Thanks. Gives me something to digest over the next few days.  Smiley
20  Game Development / Game Mechanics / Line-of-sight algorithm on: 2011-02-28 23:51:18
I'm building and RPG and working on the Monster AI. I got my head around the A* algorithm for path finding and it's working fine.  Now I'm trying to deal with ranged weapons and line-of-sight.

For example a player may want to take aim at a monster. How can I decide if he can see that monster?  Maybe there's a wall or other obstacle in the way. I could check simple directionality to see that a path is successful and straight but I think I should allow aiming around some things (like maybe another player). 

Any thoughts on this topic?

21  Game Development / Game Mechanics / Re: Enhancing game engine with scripting capabilities on: 2011-02-28 23:44:06

I do this using the built-in Rhino engine in Java6 (trying to keep dependencies down). I use it for menu code, puzzle code, maps and game interactions.  Works great. 

22  Java Game APIs & Engines / Java 3D / How to not stretch the texture. on: 2010-10-30 12:15:10
Hi All,

In my game I have a setting for wall height when creating walls. When I make the walls higher the texture image I use gets stretched and blurry. I would rather if the image didn't stretch and instead repeated itself. Any ideas how to do that?
I've tried setting TextureAttributes as MODULATE, DECAL, BLEND, REPLACE, or COMBINE and it doesn't seem to make a difference.

I also tried:

Primitive wall = new Box(THICKNESS, height, RADIUS, flags, wallApp, texHeight);

I'm assuming that the Box constructor's last param (called numTexUnit) is the correct way.

But I still see the texture stretch... Sad

The int texHeight is 1 or 2 or 3.

23  Discussions / Jobs and Resumes / Re: Music offered for Java Fantasy/RPG/Adventure/Strategy/War Games on: 2010-08-10 23:11:00
Excellent stuff Christian!

I'll keep you in mind.
24  Game Development / Game Play & Game Design / Re: wan't to programming an RPG on: 2010-08-10 23:02:17
If you are interested I'm building a gold box styled game and could use some help.
25  Game Development / Game Play & Game Design / Re: Data driving your games? on: 2010-08-10 23:00:57
Persist is a simple no nonsense persistence framework.

I use this for my games along with basic XML encoding.
26  Discussions / General Discussions / Re: Dealing with dates in an RPG on: 2010-08-07 16:35:20
27  Discussions / General Discussions / Dealing with dates in an RPG on: 2010-08-02 23:45:53
Hi All,

Just wondering if anyone has done something similar.  In my RPG I want to track time but I don't want to use a real Date or Calendar. I want to have a custom set of months and days of week.


 public enum DaysOfWeek {
        SolDay, MoonDay, SkyDay, WoodDay, StormDay, FreeDay, CronDay;

    public enum MonthOfYear {
        Janus, Februa, Marz, Aprilis, Maia, Juno, Quintilis, Numa, Septis, Octon, Novon, Decton;

Amusing 30 days a month and 7 days a week and 24 hours in a day.

Has anyone written something similar?  My idea was to have a tick method that could take a minute as integer and increment the current date/time.  I would call that method when the user moves.

28  Java Game APIs & Engines / Java Sound & OpenAL / Re: Clip slower on 64-bit JRE's on: 2010-06-21 22:01:51
Hmm. I see something similar as well. Your best bet would be to post on the java forums at sun/oracle. They have a section.
29  Discussions / General Discussions / Re: Security update breaks A LOT OF STUFF! on: 2010-04-18 14:06:11
I just tried it with .20 on Windows and your game came up fine.
30  Java Game APIs & Engines / Java 3D / Positioning the camera in overhead view on: 2009-11-29 22:42:00
Hi all,

In my game design I use first person view for movement and then switch to an overhead view for combat. This is working fine.

When I setup combat I select a player and the scene is re-rendered with the camera raised few meters and facing down.

Then I want to select a specific player on the screen at a coordinate a move the camera so it's directly overhead. This part for me is not working.

So in my keyBehavior class I get the Transform3D from the player object and from that get his vector. Then I try to place the camera at that vector. But the camera view goes haywire.

Code is like this:

// Local new transform3D so it should be empty
Transform3D t = new Transform3D();

// init the Transform3D from the selected object

// Get the vector for this object
Vector3d vector = new Vector3d();

// Reset the KeyBehavior Transform3D
t3d = new Transform3D();

// Set the KeyBehavior TransformGroup

// This is an instance var for repeated calcs

// move the camera?  Huh


Pages: [1] 2
Mac70 (33 views)
2016-05-24 21:16:33

theagentd (41 views)
2016-05-14 18:38:35

theagentd (73 views)
2016-05-10 22:37:41

theagentd (79 views)
2016-05-10 22:33:46

IanParcs (110 views)
2016-04-18 14:18:53

KaiHH (103 views)
2016-04-18 08:35:41

KaiHH (129 views)
2016-04-15 12:43:58

theagentd (133 views)
2016-04-14 02:16:17

theagentd (157 views)
2016-04-14 02:15:43

IanParcs (251 views)
2016-04-12 03:51:16
FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50 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!