Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
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   
  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. http://www.brackeen.com/javagamebook/  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:

1  
2  
3  
CREATE TABLE PLAYERS ( 
 ID IDENTITY,
 NAME VARCHAR(30) NULL )  -- etc...


Then you have a class
1  
2  
3  
4  
5  
6  
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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
class Player {
  int id;
  // etc...

  @NotMapped
  List<Attribute> attributes;
 
  // getters/setters

}


Then you could do:

1  
2  
Player player = query.read(Player.class,"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.


1  
2  
3  
4  
5  
6  
7  
8  
9  
@QueryResult
class PlayerAttributes {
   int id;
   int strength;
   int dexterity;

  // etc...
 
}


then the query would be
1  
2  
sql = "select player.id, attributes.strength, attributes.dexterity from players p join attributes a on p.id = a.player_id where player.id = ?";
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:
http://www.java-gaming.org/topics/simple-no-nonsense-persistence-library/26665/view.html

 Smiley
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. http://persism.sourceforge.net

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:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Query query = new Query(connection);
List<Player> list = query.readList(Player.class,"select * from PLAYERS where name = ?", "Fred");

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

// or even simpler
Player fred = new Player();
fred.setPlayerId(123); // set the primary key
query.read(fred); // 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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
Command command = new Command(connection);

Player player = new Player();
player.setPlayerId(123);
player.setPlayerName("Fred");
player.setEmailAddress("x@y.com");

command.insert(player );

player.setPlayerName("Barney");
command.update(player );

command.delete(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)
Oracle
MySQL
Derby
H2
SQLite


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:
<snip>
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 playerData.save() 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 (http://code.google.com/p/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.

Thoughts?

TIA
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?

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

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.


tia
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 http://goldchest.sourceforge.net/ 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.  http://code.google.com/p/persist/

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
Thanks!
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.

example:

1  
2  
3  
4  
5  
6  
7  
 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 javax.media 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
selectedPlayer.getTG().getTransform(t);

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

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

// Set the KeyBehavior TransformGroup
targetTG.getTransform(t3d);

// This is an instance var for repeated calcs
toMove.setTranslation(theMove);

// move the camera?  Huh
t3d.mul(toMove);
targetTG.setTransform(t3d);

******

TIA
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (25 views)
2014-09-19 03:14:18

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

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

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

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

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

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

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

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

Longarmx (40 views)
2014-09-07 01:10:19
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!