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 (535)
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: Threading for an RTS. on: 2010-02-24 19:13:18
do how you like but remember that you will have been advised ....

How about advice on how to do it this way? Not just "do it like everybody else does"
2  Java Game APIs & Engines / Java 2D / Re: Threading for an RTS. on: 2010-02-24 18:06:44
note that synchronising mouse input make sens because until the entity is rendered to screen change made to it wont be visible to the user so making all change just before rendering ii is just "making things" at the right time.

http://www.youtube.com/watch?v=GICc2oJFwVA

It doesn't seem like a completely lost cause, the swing usage that is. I just need to fix the concurrent mod exceptions and occasional glitchiness.
3  Java Game APIs & Engines / Java 2D / Re: Threading for an RTS. on: 2010-02-23 20:36:10
hmm, just curious why do you want to thread you game? is it to improve performance?

if it is for faster performance, I'd try move away from using swing first rather then multithread the app.

my game is based on mouse interaction, and swing makes that aspect simple to implement.
4  Java Game APIs & Engines / Java 2D / Threading for an RTS. on: 2010-02-23 19:54:53
How should I thread a swing based RTS? I was previously using ignoreRepaint(true) for all my components and repainting manually all in one thread to avoid concurrent mod exceptions. What is the correct way to do this? For smoothness, efficiency, etc. I imagine it would be a nightmare to program every in game entity to know when it needs repainting, so updating the gui at fixed intervals still seems desirable. Thoughts!
5  Discussions / General Discussions / Re: Inheritence Refresher. on: 2009-08-24 16:27:44
instanceof

How efficient  / mainstream is this for a game?
6  Discussions / General Discussions / Re: Inheritence Refresher. on: 2009-08-23 22:52:29
If I have a group of packages I always import, is there a way to import them as a group?

package = new package(java.util.ArrayList, java.awt.Color, javax.swing.JLabel);
import Main.package;

Something like that?
7  Discussions / General Discussions / Re: Inheritence Refresher. on: 2009-08-23 22:38:00
I've answered my own question. I think the best solution is to pass the graphics object to the current object and let it draw itself.
8  Discussions / General Discussions / Inheritence Refresher. on: 2009-08-23 21:27:36
This is the inheritance tree of my game.

Actor->Object
        ->Character->NPC
                            ->PC

Now if I store all my actor objects in one 'queue' that gets processed in the logic cycle,
What is the cleanest way to determine what type the current object is?

For example, if the current object in my iteration is a character i'm going to want to draw a health bar.
Thanks in advance.
9  Discussions / General Discussions / Re: Realistic Expectations on: 2009-08-23 21:23:05
The reason I don't use a game library is that most of them restrict you to a single game window. One of the neat features of my now entirely NPC mmo is that you can view 10 characters at once with instances of the camera objects.

I've never heard of tearing but that sounds like the cause.
I guess I'll try the Canvas approach (another couple of days of conversion). Thanks.
10  Game Development / Performance Tuning / Re: Whats the ideal way to rewrite my game? on: 2009-08-23 02:07:02
"Not smooth" is usually a sign of some "bursty" behavior that stalls out your game loop by forcing an iteration to run over the allotted (or reasonable) time.  For example, if you have set you game loop up to execute one fixed game step every 20 milliseconds, for a target of 50fps, then any step that runs longer than 20 milliseconds is going to feel like a stutter.  Loading images from disk disk would do it, so would a big garbage collection pause.  Switching to a time-derived step (passing an elapsed time variable) can help with this, but can be a major overhaul if you have a lot code that assumes a fixed step, and it won't help you if your  pause is a *really* big one.

I suggest:
1) Run your code through a profiler.  The netbeans one is free.  http://profiler.netbeans.org/ 
2)  Add timing calls to your main loop to capture avg, max time elapsed per loop
3)  Reduce your target framecount.  100+ fps is great for shooters, but only gives you a budget of 10 millis per frame.  25fps is a lot more forgiving.
4)  Move any heavy lifting (image IO) to a background thread.
5)  Force a low-pause garbage collector, (such as +Xincgc)
6)  If all else fails, switch your code over to a time step / as fast as possible method.  I think the Filthy Rich Clients book had some useful code, in chapter 12 - 15, http://filthyrichclients.org/


I ran it through a profiler... what should I be looking for? Please make it easy for me to understand.
11  Discussions / General Discussions / Realistic Expectations on: 2009-08-23 01:15:41
Currently, my game renders to a JPanel in a window, by drawing to a bufferedimage and drawing that image to the panel.
It works fine in windowed mode, but flickers in fullscreen. HELP ME. I'm really sick of java recently because I spend more time implementing low level stuff such as sound than I do working on gameplay.

I've tried setIgnoreRepaint(true) with every combination. Either it still flickers, or it doesn't paint anything.
The JPanel doesn't even center correctly in fullscreen mode. And why can't you create a BufferStrat from a JPanel???

WHY CAN'T ANYTHING IN JAVA WORK WITHOUT WORKAROUNDS.
Am I wrong to expect this?


The fullscreen rendering is the most pressing of my problems. Hope you can help.
12  Game Development / Performance Tuning / Whats the ideal way to rewrite my game? on: 2009-05-12 21:05:05
I am looking for performance gains out of my 2D tile game.
How should I store a layered map? A three dimensional array? I am currently using an Array List of objects containing matrices.

Where do I store the array determining what is walkable and what isn't? Or should my 3 dimensional matrix contain objects that have this property (like they do now). Is this incredibly slow?


The main thing is my game is running fast but not completely smooth. This is not due to graphics but due to loading additional tiles when the map shifts. The lag is barely noticeable, but it shouldn't be there for such simple a game.

What is the best way to do a time step for a game without physics or simulation by a time step variable? Consider a simulate() method that can only run forward 1 step in game time.
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.

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

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

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

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

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

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

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

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

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
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!