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 (843)
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 18: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 17: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.

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 19: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 18: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 14:27:44

How efficient  / mainstream is this for a game?
6  Discussions / General Discussions / Re: Inheritence Refresher. on: 2009-08-23 20: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 20: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 19:27:36
This is the inheritance tree of my game.


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 19: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 00: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. 
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,

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-22 23: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???

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 19: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]
EgonOlsen (37 views)
2018-06-10 19:43:48

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

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

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

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

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

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

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

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

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