Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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  Java Game APIs & Engines / Java 2D / Re: Active rendering and GUI components on: 2013-06-20 22:14:36
Thanks for your helpful answers :-) I learned a lot about OpenGL and computer graphics theory (midpoint algorithm, render pipeline, projections, matrix transformations and blabla...) some years ago, but I can't  work creatively with it. However, as far as I know OpenGL is nearly the same on all platforms, hence it's easy to write portable games which wouldn't be possible with an API like Java2D.
2  Java Game APIs & Engines / Java 2D / Re: Active rendering and GUI components on: 2013-06-20 18:03:34
Thank you. So you would generally recommend to get accustomed to OpenGL, even when doing 2D games?

The docu here http://docs.oracle.com/javase/1.5.0/docs/guide/2d/new_features.html#ogl says: "J2SE 5.0 includes a new OpenGL-based pipeline for Java 2D. This pipeline provides hardware acceleration for simple rendering operations (text, images, lines, and filled primitives) as well as those that involve complex transforms, paints, composites, and clips. This pipeline is available on all platforms (Solaris, Linux, and Microsoft Windows) and is currently disabled by default. To silently enable the OpenGL-based pipeline, specify the following system property on the command line:
  -Dsun.java2d.opengl=true".


Well, that sounds like OpenGl could be explicitly enabled.


3  Java Game APIs & Engines / Java 2D / Re: Active rendering and GUI components on: 2013-06-20 17:01:02
Thanks. I have read here http://docs.oracle.com/javase/1.5.0/docs/guide/2d/flags.html that the standard Java 2D API is also hardware accelerated, hence I don't understand why I a 3rd party library is more efficient.
4  Java Game APIs & Engines / Java 2D / Active rendering and GUI components on: 2013-06-20 13:49:46
Hello all,
I've read this tutorial ( http://docs.oracle.com/javase/tutorial/extra/fullscreen/rendering.html ) about active rendering, but I don't know if any GUI components can still be used in conjunction with active rendering. Can active rendering be only used in full-screen mode or also on a single component in a GUI application window?

As far as I understand, GUI components can't be used when doing active rendering, because active rendering means bypassing the OS's GUI control and give it completely to the application.

Please correct me if my understanding is wrong  Smiley
5  Game Development / Networking & Multiplayer / Re: P2P multiplayer game on: 2013-06-19 10:50:55
Thanks. My objective is not to implement a professional multiplayer game, but to understand and implement some basic multiplayer functionality.

I think that even in a P2P network it could make sense to implement the server separately from the game, because then the whole game loop and logic can run within the server. Finally the server doesn't care if one client connects from a remote host or from the localhost, so both clients could run the same kind of server locally. When one client plays alone, he uses his local server but if he plays together with someone else he either waits for someone to connect to his server or connects to someone else's server. Does this make sense?
6  Game Development / Networking & Multiplayer / Re: P2P multiplayer game on: 2013-06-18 23:00:19
Yes, I mean peer-to-peer, so that a multiplayer game is possible without central remote server.
7  Game Development / Networking & Multiplayer / P2P multiplayer game on: 2013-06-18 19:07:41
Hello,
I'm trying to implement a very simple P2P multiplayer game for two players, but I don't know how the game logic should be synchronized. For this to work I need one game to be the master and one game to be the slave, so I need some kind of "contract" between those two games that from now on one game is run by the other. However, I don't know how to approach this.

Thanks for any idea.
8  Game Development / Networking & Multiplayer / Re: Some general Java NIO questions on: 2013-05-23 14:36:16
That was a typo and I already changed that. I did not mean sockets, but socket channels.
9  Game Development / Networking & Multiplayer / Re: Some general Java NIO questions on: 2013-05-23 14:22:57
My goal is to get just a basic practical understanding of how this works, because it doesn't have a lot in common with standard Java sockets. It just aroused my interest, the practical usage is another question.
10  Game Development / Networking & Multiplayer / Re: Some general Java NIO questions on: 2013-05-23 13:23:54
Normal sockets need multiple threads to handle multiple clients concurrently, which would result in a cumbersome and resource-hungry multithreading implementation.
11  Game Development / Networking & Multiplayer / Some general Java NIO questions on: 2013-05-23 13:05:19
Hello,
today I have started with Java NIO, but it seems to be quite complex, hence I have some questions to which I couldn't find any answer in those NIO tutorials I have read.

For learning purposes I want to implement some very common use cases:

1. Sending serialized objects to a server, deserializing and storing them in a collection.    
2. Requesting data from a server. The data could be anything, maybe some objects in an array.

I don't understand how ObjectInputStream/ObjectOutputStream and ByteBuffer work together and I'm not sure how many channels I need on the client and on the server. Do I need one socket channel on each side for each use case (4 socket channels altogether) or would one read-write-socket channel on each side be sufficient?

Thanks for all answers.



12  Game Development / Networking & Multiplayer / Evaluation of highscore implementation methods on: 2013-05-06 17:39:17
Hello,
I want to implement a highscore list (simple XML file with players and their scores) without using a database or a server side scripting language like php. There are several possible ways to implement a remote highscore list:

- Pure Java sockets
- RMI
- Apache Commons Net

However, I don't know which one I should prefer. I have read, that RMI works well in local networks, but often doesn't work very well over the internet. It would be nice if someone could briefly evaluate those options.
13  Game Development / Game Play & Game Design / Re: Saving and reloading game state on: 2013-05-05 11:29:32
XML works great, but I don't know how I could store it securely on a remote server.

With my limited experience, I would do it like this:
On the server side I would limit the access to the XML file only to specific IP addresses and on the client side I would encrypt the XML file before it is uploaded to the server. However, I don't know if that's the best way to get it done.
14  Java Game APIs & Engines / Java 2D / Re: 2D scene graph on: 2013-05-04 16:09:06
If there's not hierarchy, what sense does a scene graph make in this case? I haven't understood this yet.
15  Java Game APIs & Engines / Java 2D / Re: 2D scene graph on: 2013-05-04 14:21:56
Thanks. You are right, Tetris blocks are composed of multiple graphical objects, but would a scene graph still make sense if you just had to catch some graphical objects that fall from above? In this case, I don't see any hierarchy.

16  Java Game APIs & Engines / Java 2D / Re: 2D scene graph on: 2013-05-04 13:45:44
Yes, if it's not too complicated. In 3D a scene graph is used to implement an object hierarchy, but I'm not sure if it's useful in a simple Tetris or Super Mario style 2D game.
17  Java Game APIs & Engines / Java 2D / 2D scene graph on: 2013-05-04 10:09:53
Hello forum,
how could a scene graph for a 2D game be implemented? I would choose an array list and store some sprites in there, but maybe it's not that simple.
18  Game Development / Game Play & Game Design / Re: Saving and reloading game state on: 2013-05-01 21:06:01
Good. Then I know what to focus on. Should I collect the data from all classes that contain information that should be saved or should I copy all relevant data into some kind of game state class?
19  Game Development / Game Play & Game Design / Re: Saving and reloading game state on: 2013-05-01 20:43:51
Thanks. You are right, that's not the right section, but I understood "design" in terms of software architecture and not graphical appearance.

I know which data to save, but I don't know how to persist this data. I could write it to a XML file, text file or some other file, but I don't know which way is the best. Maybe I should use java.io.Serializable?
20  Game Development / Game Play & Game Design / Saving and reloading game state from a remote server on: 2013-05-01 19:42:18
Hello,
I would like to save the state of the game to reload it later. I have found some approaches, but I don't know which is best. Of course I can't save the state of the JVM, so I have to save the state of all objects. How could this be done?
21  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-05-01 18:10:34
Does anyone here use the observer pattern to give the game loop the ability to inform other classes about its update cycle? I don't know if that's useful, maybe it slows the application down.
22  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-05-01 14:16:46
Thank you guys. Do you wrap your classes in design patterns? You could make a singleton of the game screen or wrap methods like start game, stop game, pause game, resume game etc. in command classes, but I don't know if that is making sense.
23  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-30 12:58:50
Thanks. I am just thinking about how to decouple the game loop from the display update and game state update methods. In most cases you have a display class like

1  
2  
3  
4  
5  
6  
7  
public class GameScreen extends Canvas implements Runnable {

  run() {
  // game loop here with update and render methods
 }

}


A separate generic game loop class doesn't know which methods are the render and update methods, so I have to inform the game loop class about the methods it should use. How could this be done? Maybe by wrapping the render and update methods in commands?

Another option could be to make an game loop class that implements Runnable and that contains abstract render and update methods that have to be implemented in the GameScreen class. I think this was the idea that was mentioned in this thread before. However, if I want to extend Canvas in my game class I cannot extend the abstract game loop class, but maybe I should better use Canvas as a property?

Which one is better design?
24  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-28 01:00:36
Thank you :-)
My goal is to make a simple, very basic tetris-like game, but it should have a solid, efficient fundament which can be used to build more complex 2D games. I used OpenGL many years ago and have never used it since then, so I think it would be quite hard to implement. Most people don't recommend to use OpenGL for 2D, some do, but I don't have enough experience to evaluate the pros and cons. I also haven't found any tutorials on 2D OpenGL games in Java.
Doesn't Java2D use OpenGL under the hood? OS window managers are also 2D, but sometimes based on OpenGL.
25  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-27 23:15:13
In-game-gui means that all messages and preferences/settings panels are written directly to the screen without using any Swing/awt GUI components? Seems like a lot of work, but maybe it's easier than I think. Do you know any example for such a GUI?
26  Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-27 20:09:49
Thanks. The central point is that I want to use BufferStrategy, because according to some threads and tutorials this is more powerful than BufferedImage. However, it's part of AWT and not Swing, hence I think that it might make sense to use only AWT components to avoid any problems. At least for noobs that would be the less error-prone decision, wouldn't it?
27  Game Development / Newbie & Debugging Questions / Mixing light-weight (Swing) and heavy-weight (AWT) components? on: 2013-04-27 14:43:56
Hello people,
I have learned that mixing mixing light-weight (Swing) and heavy-weight (AWT) components is generally considered bad programming style, but in some cases it seems to be practicable. In the following example, the graphics are drawn on a canvas while for the rest of the GUI Swing is used. Why that? Why not AWT?

I am talking about that example:
http://www.java-gaming.org/topics/basic-game/21919/view.html

Other questions I have: What is the best way to put the game loop into a separate class? Maybe a singleton GameLoop class which provides a loop() method that is later called in the run() method? Does it make sense to use a scene graph for 2D games and if so, how is it implemented?

Thanks for any answer and have a good weekend.
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (13 views)
2014-07-30 21:08:39

Riven (21 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!