Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
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   
Pages: [1]
  ignore  |  Print  
  Small Java Threading Library  (Read 4405 times)
0 Members and 1 Guest are viewing this topic.
Offline theagentd
« Posted 2011-11-24 16:53:25 »

Hello everyone!

I've created a small library to make threading games easier. This is done by putting the game logic in task objects and setting which tasks that has to be run before a specific task can be run. It's also possible to multithread a single task.

Anyway, the Google Code project is here: http://code.google.com/p/small-java-threading-library/ The source code is obviously also available, and there's Javadoc for all accessible methods. There's also two test programs that you can check out in the source code.

I hope someone finds it useful!

Myomyomyo.
Offline cylab

JGO Ninja


Medals: 49



« Reply #1 - Posted 2011-11-24 17:49:21 »

Wrong folder - the project belongs to be in trunk, not in the top level.

  • Trunk - the location where your main project files live.
  • Branches – individual copies of the project. These can be used to maintain bugfix releases of older versions or to prototype more fundamental changes to the codebase without interfering with the daily development on the trunk. Branches can be merged to the trunk semi-automatically.
  • Tags - copies of the project to mark certain milestones like release versions.


Mathias - I Know What [you] Did Last Summer!
Offline theagentd
« Reply #2 - Posted 2011-11-24 18:21:09 »

>_< I've managed to copy it to trunk, but I don't seem to be able to remove the old files... Geh, too tired...

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hraefn

Junior Newbie





« Reply #3 - Posted 2012-08-07 01:35:37 »

Hello there,

I am new to Java game development and am working on my first game. I came across your Thread Library after searching how to fix stutter issues. Right now I have a variable timestep loop setup but my game still stutters occasionally. I was wondering if separating game logic from rendering in separate threads would help my problem. Could you show me how you would go about doing that with your library? Is that even a good idea?

Thanks.
Offline gimbal

JGO Knight


Medals: 25



« Reply #4 - Posted 2012-08-07 07:48:27 »

Stutter issues can be caused by many things and are not solved by introducing threading. So far the two main culprits for a stutter in my games have been to screw up the timing of my game loop and to use integers for movement speed and positioning where I should have been using floats.
Offline theagentd
« Reply #5 - Posted 2012-08-07 15:20:13 »

Hello there,

I am new to Java game development and am working on my first game. I came across your Thread Library after searching how to fix stutter issues. Right now I have a variable timestep loop setup but my game still stutters occasionally. I was wondering if separating game logic from rendering in separate threads would help my problem. Could you show me how you would go about doing that with your library? Is that even a good idea?

Thanks.

No, sorry. Like Gimbal said, the problem is most likely something else. This library just allows you to cram out (a lot) more performance from multicore CPUs. This library is more flexible than just separating rendering and updating into different threads. It allows you to do task level parallelism, for example:

  Render terrain        Update objects
in graphics thread        (3 threads)
         |                      |     |     |
         |                      |     |     |
         |             Update AI      Handle collisions
         |                   |                   |    |
         |                   |                   |    |
         |                   |                   |    |
         |                   |                   |    |
  Render all objects after all other tasks complete
                                 |
                                 |
                                 |

Myomyomyo.
Offline Oskuro

JGO Knight


Medals: 39
Exp: 6 years


Coding in Style


« Reply #6 - Posted 2012-08-07 15:45:35 »

So a Thread Pool + Prioritized Task Manager? Sweet.

Offline Hraefn

Junior Newbie





« Reply #7 - Posted 2012-08-07 18:32:56 »

Thanks for the replies! I guess I'll keep looking for other reasons why my game is stuttering. I might look into threading as my game gets more complex though.
Offline Sickan

Senior Member


Medals: 9



« Reply #8 - Posted 2012-08-07 20:05:22 »

Can I use this with Slick2D?
Offline theagentd
« Reply #9 - Posted 2012-08-08 01:32:56 »

Can I use this with Slick2D?
I think so, but I don't know much about Slick2D. As long as you only call Slick (and OpenGL) functions in DrawTasks it should work.

Myomyomyo.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

radar3301 (11 views)
2014-09-21 23:33:17

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (19 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

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

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

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

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

Tekkerue (50 views)
2014-09-09 02:24:56
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!