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   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: First game, experienced Java programmer - design questions on: 2009-07-06 17:04:12
As for AI [...] I'd try a learning algorithm like a genetic algorithm or Q-learner.

Thanks for the encouragement Demonpants! You've hit the nail on the head with the genetic algorithm advice actually. I wrote a very messy version of this for my third year dissertation and a rudimentary AI based on genetic algorithms. At the time I was a lot less experienced (and possibly high on Red Bull and energy bars) and didn't do a very good job, so I suppose I'm looking to correct that with this project.

I think what would really help me the most is to be able to look at some source code, as that's the way I learn the best. Anyone know any good turn based games, or especially multiplayer card games, that I could look at?
2  Game Development / Newbie & Debugging Questions / Re: First game, experienced Java programmer - design questions on: 2009-07-05 10:22:45
I siad first that you should cut out some stuff

for example: network play

I take your point, I don't have any intention of doing any complicated stuff before the basics are down, all I wanted to do was somehow program everything along the way with it in mind, so that it isn't a headache to refactor all the code somewhere down the line!

A book recommendation for game programming, including ULM charts.

Great book, thanks zoto! I've checked it out before and intend to buy it - only passed it up in this case because it seems to be biased away from games with a set turn order.

Could you elaborate on what problems you are having with state changes? They are general int's or Enum's checked with a switch/case statement.

I suppose I'm struggling to figure out what would be the best practice. I'm looking at the basic idea of switching over an Enum or int, but I guess I don't like it because that kind of code can get messy, is difficult to extend/adapt, and I guess would probably need to be repeated in a few different places, all making it that much more unmaintainble. I did toy with the idea of using a state system similar to states in MVC model 2, where the state holds all the information the game needs to both update it and render it, and it would be passed around the various facets of the game being updated and rendered as appropriate. Predictably this ended in a mess too! Is there a best practice here? Some guidelines I can follow?? Thanks all for your help so far Smiley
3  Game Development / Newbie & Debugging Questions / Re: First game, experienced Java programmer - design questions on: 2009-07-03 22:30:44
If you are as much of a newbie as you say, then this may be to big for now. Or atleast cut out some of those features you listed.

Really? Because I have all the basics down, I think. For example, I tested myself and wrote a simple program that allows you to move a red ball around a screen, mostly from memory. Is there much of a gap to fill between that and a relatively simple card game? All I really need to learn from there is how to structure multi-player input and how to handle state changes. I don't actually want to implement all the features I listed straight away, I just want to write the program with a view to making my life easier somewhere down the line.

EDIT: included quote from previous post
4  Game Development / Newbie & Debugging Questions / Re: First game, experienced Java programmer - design questions on: 2009-07-03 19:33:05
Thanks for the quick reply! I've downloaded the source related to the book and I'll check it out and see if the book looks worth buying too. I was also hoping for more help in the design area of game programming, for example how the overall system would look on a UML diagram and how the constituent parts could/should interact. Do you have any advice on that topic?

What might also be helpful is source code for some turn based games with more than one player, preferably written in Java, if anyone knows of such a game Smiley
5  Game Development / Newbie & Debugging Questions / First game, experienced Java programmer - design questions on: 2009-07-03 19:06:13
Hi all, I've wanted to get into game development for as long as I have been programming, my first language is Java so I prefer to program in my native tongue, even though it probably isn't the best choice for game development in general. Aaaanyway to cut a long story short, I want to try and make a solid and robust game version of the card game Rummy (similar to Gin Rummy). I've been hammering away at the project for a few months now, and during that time I have learnt a few things - mostly how little I know about programming games - but I've become familiar with all the basics, and how to implement them in Java - writing a "game loop", double buffering, BufferedImages, etc.

My real problem is trying to settle on a broader design for the system. What I want is for it to be nice and flexible, so that I can play around with adding new features to it in the future (I'm thinking of writing several different types of AI, a replay feature, possibly a network multiplayer option and maybe eventually a multi-game server). This means that the design needs to treat each player in the game as abstractly as possible, and hence taking player input as abstractly as possible.

I've looked at a couple of tutorials from, namely the space invaders and asteroids 2D tutorials. I've also been studying the MVC design pattern and how this could work, and also the Entity System that is hailed by some as the saviour of game programming. I've attempted both of these but each time I try and refactor the code it seems to collapse in a muddy heap. It's getting to the point where I feel like giving up altogether as every time I try a new approach it seems to fail before I've even finished writing it!

Sorry for the longwinded post, please feel free to reply with a one line comment that I need to "go and buy this book", because I imagine this kind of question is asked so frequently that one might as well write a book on the subject.

A confuzzled newbie  Undecided
6  Game Development / Game Play & Game Design / Re: Game Object Component System on: 2009-06-19 13:23:33
ES is a fascinating concept, I like how flexible and maintainable it can be. Especially regarding to the article linked earlier in the thread (

At the risk of inserting a noob question, can anyone show how (if at all) it could be incorporated in a "game" loop like the following:

while (running)
   // tick something over   

   // display something to the user   

Would what be the "something" that ticks over here? Would it be a single Entity Container, containing everything that has been set up? This would presumably imply that every entity would have a "tick()" method, or some other similar way of updating itself.

Also on a completely unrelated thought process, would other non game world objects like user interface objects be entities too?
7  Game Development / Game Play & Game Design / Turn based card game, also using MVC - design questions on: 2009-06-18 16:22:17
Hi all,

I'm having a design issue using the MVC. I've written the game so that the "game" loop lives inside the Controller.

The Controller is initialised a with a Model and a View.
The Controller is started (enters the "game" loop)

The game loop looks like this:

// this is the "main" or "game" loop
while (running)
   // the engine is the model
   // the ui is the view

   // let the OS do it's thing

... and here is engine.stepOver():

public void stepOver()
   // dont do anything if we aren't playing a game!
   if (currentGame != null && !currentGame.isGameOver())
      // what goes here?

I'm trying to decide on the mechanism for actually polling players for their moves. The implementation I am following is to have a queue of Command objects in the Model, that encapsulate a method call on a Game object using the Command pattern. These Commands would then be executed in the stepOver() method, in the order they were received. When this list is cleared, the method does some more calls on the Game to check for a win condition or to move to the next player, and then finishes.

What I can't work is how to get the Commands into the queue. At the moment I have a PlayerInterface interface, that is implemented by an AIPlayerInterface and runs in a separate thread, vaguely checking if a move is required of it and queueing one up if so. But I think I might run into concurrency issues and am not sure how to structure that. I'm also not to sure how to implement that interface for a human player, at the moment it is implemented directly by the View (the UserInterface).

Is the thread based idea a good one, or can anyone throw in two cents about a better way of queueing commands by a set of players?
Pages: [1]
EgonOlsen (44 views)
2018-06-10 19:43:48

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

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

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

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

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

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

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

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

Solater (142 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!