Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (653)
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] 2 3 ... 7
1  Game Development / Game Mechanics / Re: Component based game objects on: 2011-10-05 20:40:51
I guess game programming != neat programming  Grin
2  Game Development / Game Mechanics / Re: Handling RPG-like stats on: 2011-09-21 05:52:11
What is labelled here as damage is really "Attack Power". Damage is, as you say, a process, that can have a multitude of twists, turns, and outcomes.
3  Game Development / Game Mechanics / Re: Handling RPG-like stats on: 2011-09-20 18:22:26
I've had similar problems before, when writing a combat system for a mud.

My advice is to let each bonus/malus be its own object.

Always keep the "base value" untouched, - you don't want to meddle with it.

  Each stat would have a list of bonuses.
  Each bonus knows what stats affect it. (In Rammus' example; Attack damage would contain a bonus, call it "Spikes" or whatever. "Spikes" lists Armour as a stat that if it changes, "Spikes" requires recalculation).
  If/When a bonus wears off, remove it from the list, and recalculate that stat. (Again, in Rammus' example; "Spikes" would never wear off, but temporary effects will).
  Resolve and calculate static bonuses first ( +5 etc ), and then accumulate dynamic bonuses (like %), and calculate those.

Does that make sense?
4  Game Development / Newbie & Debugging Questions / Re: Can anyone help me understand these texture coordinates? on: 2011-09-20 13:11:40
Ok, I should have tried this first of course, rendering the entire Atlas... The entire texture is flipped vertically, so that explains the weird texture coordinates.
5  Game Development / Newbie & Debugging Questions / Can anyone help me understand these texture coordinates? on: 2011-09-20 12:53:53

Imagine a very basic Texture atlas, looking roughly like this: (A and B are the 2 different pieces).


Now, judging from this, piece A can be found at
[ left: 0.0f, bottom: 0.0f, right: 0.66667f, top: 1.0f ]

I have always imagined, and was sure that piece B could be found at
[ left: 0.66667f, bottom: 0.5f, right: 1.0f, top: 1.0f ]

However, that's not coming out right at all. Piece B IS coming out right at
[ left: 0.66667f, bottom: 0.0f, right: 1.0f, top: 0.5f ]

I render as triangles, and my data for rendering B looks like this:

float[] {
                       x - 64, y + 64, // top left
             x - 64, y - 64, // bottom left
             x + 64, y - 64, // bottom right
                       x + 64, y + 64 // top right

Texturebuffer (doesnt work, but what I thought was correct)
float[] {
                       0.66667f, 1.0f,
             0.66667f, 0.5f,

Texturebuffer (works, but what I thought was wrong)
float[] { 
                       0.66667f, 0.5f,
             0.66667f, 0.0f,

I hope my question is understandable, and that someone can explain to me what's going on here.
6  Java Game APIs & Engines / Java 2D / Re: [Solved] Canvas drawing problem! on: 2011-09-10 09:10:40
I would set the frame visible, and create the bufferstrategy inside the EventQueue.invokeAndWait() to avoid deadlocks on older java versions, and to make sure that on your first render loop, getBufferStrategy() doesn't return null.

7  Discussions / General Discussions / Re: Java Closures Finalised! on: 2011-09-10 09:01:07
I work with C# in my dayjob, and I for one will definitely welcome closures with open arms Smiley Miss my lambdas.
8  Java Game APIs & Engines / Java 2D / Re: [Solved] Canvas drawing problem! on: 2011-09-10 08:53:13

createBufferStrategy(..) is an asynchronous operation, that's why it fails "now and then". (Sometimes it finishes before the frame is visible, sometimes not).

Try something like

EventQueue.invokeAndWait(new Runnable() {
        public void run() {
9  Game Development / Game Play & Game Design / Re: Top-down scrolling shooter - Map/Level design? on: 2011-09-06 19:07:11
This a basic example of a ship doesn't have much behaviour, and I agree with you, with hundreds of these pr. level, xml quickly gets really bloated.

<Entity entityType="">
        <Curve preDefined="CURVE_FROM_CENTEREDRIGHT_TO_LEFT" stepTime="10" totalTime="15000" />
        <Parameter type="float">64.0f</Parameter>
        <Parameter type="float">64.0f</Parameter>
      <LevelInfo entryTimeMs="75000" />
      <Method name="setX">
        <Parameter type="double">0.0</Parameter>
      <Method name="setY">
        <Parameter type="double">0.0</Parameter>
      <Method name="setFireDelay">
        <Parameter type="int">300</Parameter>
      <Method name="setMaxHealth">
        <Parameter type="int">3000</Parameter>
      <Method name="addHealth">
        <Parameter type="int">3000</Parameter>

A JSON-like structure seems like a good idea. The funny thing is that it'll most likely turn out easier to read and parse as well.

When it comes to an editor, I made that for my previous game. I might have gone overboard, as it turned into a photoshop look-alike tilemap editor. I spent months on it, trying to make it a general-purpose editor, but in the end I had top stop. I could have gone on and on, and never finished it. And that's my problem; I know myself, once I start writing an editor, I'm going to be thinking miles ahead, and I'll never get anything done on the game itself Smiley

But maybe I'll just try something simple this time.

Going for the JSON, - but keeping reflection in there Wink

10  Game Development / Game Play & Game Design / Top-down scrolling shooter - Map/Level design? on: 2011-09-06 18:29:17

I'm looking for tips on how to design a level for a top-down scrolling shooter game.

Basic premises are:

1) Level scrolls at a constant (although may differ from level to level) speed.
2) Player(s) are always constrained by the boundaries of the screen (Cannot reverse to make level scroll slower, or push forward to make it scroll faster. Neither can you move to the left/right beyond what's visible on the screen. These are pretty common rules for top-down scrollers that automatically move the player forward at a predetermined pace. Think 1942 etc.
3) Enemies appear at a given time, with given points to move through, at coordinates in the range of 0 - screenwidth/screenheight. (As opposed to enemy appearing at y=24000, and having to care how far the level has scrolled).

What I could use input on is how to store leveldata. What do I need to have on file, how would you store it? How would you go forth to avoid making level-creation a massive manual job with editing files. What's your story, - how do you do it, and are you happy with your approach?

Up to now I've used xml, - and although it's working, it's extremely tedious writing huge amounts of xml to create levels.

11  Games Center / WIP games, tools & toy projects / Re: Arcane Nebula 1.0 on: 2011-08-29 07:22:06
Then it seem like the game tries to compensate for the low framerate, and goes into super high gamespeed for a second or so, making the ship fly clear across the whole world practically instantly.

Yeah I'm going back to frame-based programming =D

Don't! Smiley Give your delta value a ceiling.

public void update(double delta)
  if(delta > X) delta = X;

12  Discussions / General Discussions / Re: Kickstarter - Headless JVM for iOS on: 2011-08-23 22:34:39
Noone with rich uncles around here then?  Cool
13  Game Development / Newbie & Debugging Questions / Re: Method Calls (eclipse) on: 2011-08-23 19:34:20
Right click on the method, and look for "References"
14  Discussions / General Discussions / Re: Brainstorming the future on: 2011-08-23 18:12:08
Hate to be the party pooper, but I love that JGO is java only.
15  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick Jittery Movement on: 2011-08-23 11:42:33
You're right, you cannot know the delta beforehand. But you probably know how fast you want your objects to move, and from there you can say something like: "I know how far I want my ball to move in 1 second". Lets say you want to move 5 pixels in 1 second (1000 ms). You take 5/1000, and then you know your multiplicator. In this instance with 5 pixels pr second, it would be x += 0,005 * delta

16  Discussions / General Discussions / Re: Brainstorming the future on: 2011-08-23 07:54:22
As developers, engineers and inventors, we're often inclined to "create it ourselves" rather than take the time to learn other people's tools and creations. But if the tools are right here with the creators at hand to answer silly questions, it might be easier to take advantage of all the nifty stuff people here already created.

So I definitely support the suggestion to upload Applets, but also the possibility to launch WebStart applications (and of course games) from JGO. Some kind of moderation process on such uploads would possibly be advantageous, to avoid the usual clutter that comes with these ideas.
17  Game Development / Newbie & Debugging Questions / Re: Java - Multiplayer card game on: 2011-08-20 07:47:23
Please let me know if you finish this game. I am in the same situation as yourself, - I own Dominion + Expansions, but get to play it too rarely with my friends because some of them live far away.

Good luck!
18  Game Development / Performance Tuning / Re: Read File to String: can you do faster ? on: 2011-08-16 18:33:01
Obviously this method has some theoretical limitations to size, but you could set some kind of size limit where if size > limit, choose the buffered approach.

At least it's fast.

public final static String readFile(String fileName) throws IOException {
   File f = new File(fileName);
   FileInputStream fstream = new FileInputStream(f);
   byte[] bytes = new byte[(int) f.length()];;
   return new String(bytes);
19  Discussions / General Discussions / Re: Is Java the right way for me to go? on: 2011-08-12 10:54:43
It's also a matter of what you plan to do with the technology you learn later on. You want to make a game now, is that a stepping stone to something else (motivation to learn?), or do you aim to work as a game developer? Do you plan to work with web technology, server technology, gui design&development ?

For most options, Java is a safe bet. It's a language that you will benefit from learning in most scenarios. It doesn't have the cleanest API, it doesn't have the most modern language features, - hell GUI design in Java sucks,  but it so well-adopted to the point that google will help you solve most problems you face. It's also very similar in many ways to C#, which in many business scenarios is the "other side of the coin" in technology choice. Transition from Java to C# is luckily easy.

If I was to learn my first language now, it would definitely be either Java or C#. Business value, vast knowledge-base, both languages let you do "everything". There are tons of other languages that I'd die to have time to learn well, but there are few others that I can see that I would use for everyday problems.
20  Game Development / Newbie & Debugging Questions / Re: First Number from Integer on: 2011-08-12 10:39:06
int a = 12009;
int b = (int)(a / Math.pow(10, (int)Math.log10(a))); // b --> 1

Math.abs() if a is negative.

Edit: Ok, just saw delt0r posted the same.
21  Discussions / General Discussions / Re: Unlimited Detail Update on: 2011-08-11 14:43:16
Oh stop being so jealous Wink It looks awesome.
22  Game Development / Newbie & Debugging Questions / Re: Drag and Drop from Desktop to Swing app? on: 2011-08-03 17:31:21
I've tried dragging simple text, and files. Like I said, it works between different components within the same application, and from Eclipse to my application.
23  Game Development / Newbie & Debugging Questions / Drag and Drop from Desktop to Swing app? on: 2011-08-03 13:07:28

I am struggling to get drag and drop working properly.

I can drag and drop stuff within the same application OK. I can also drag and drop stuff from for instance Eclipse into my application OK.

But I want to drag something from my desktop into my application, and that is NOT OK. Is it possible at all, because I sure can't seem to find out how Wink

Any ideas?

I'm running Windows 7.
24  Games Center / Archived Projects / Re: Simple Bitmap-Font Editor on: 2011-07-29 17:43:03
Hehe, "editor" might not be the correct term maybe.

The deal is to choose the font, font size, colors etc. You end up with an image that represents characters (ascii 0 - 256), you save it, and you end up with a .png and a .txt file. The .png file serves as a texture, and the .txt holds texture coordinates for the different letters in the .png so that you can render text using just one texture.

Like I said, it's nothing fancy, but I've found it useful Smiley
25  Games Center / Archived Projects / Simple Bitmap-Font Editor on: 2011-07-29 12:39:46

For a project I'm working on, I required some simple fonts, so I created a small app to create bitmap fonts for me.

It can be downloaded at

I know smart people here have worked with vectorized scalable fonts for use in OpenGL, but maybe others beside me just require something simple.

In any case, like I said, I intended it for my own use, but figured if anyone wanted to use it, all the better.

26  Game Development / Newbie & Debugging Questions / Re: Algorithm for Equirectangular projection (Plate Carre) ? on: 2011-06-02 18:11:54
Now we seem to be on the same page Wink Excellent.

Cube mapping, - check. I'll definitely look further into that. Thanks!

27  Game Development / Newbie & Debugging Questions / Re: Algorithm for Equirectangular projection (Plate Carre) ? on: 2011-06-01 15:07:39
Oh dear, I'm not even sure of what I am looking for, - there are so many terms and topics I know next to nothing about.

Let's say I have an image A, which is some fractal generated "world map" that I made. It can for instance be 512*512 pixels, with no distortions of any kind.

I want to get to image B, which would be a 1024*512 pixels image, with distortions near the poles, in a equirectangular (or plate carree, equidistant cylindrical, I guess it has many names) projection.

Does that explain better what I am looking for? (Because honestly, I did not understand half what the HEALPix page said).

Thanks for [your attempt] to help ;-)
28  Game Development / Newbie & Debugging Questions / Algorithm for Equirectangular projection (Plate Carre) ? on: 2011-06-01 12:54:58

I'm dabbling with a spacegame, and I'm working with texturing planets at the moment. I have some tools to create decent-looking planet surfaces, - however they're the typical flat kind based off heightmaps etc. (Square shaped, - 512*512 pixels as an example).

To wrap around spheres seamlessly, I'd like to convert these images into an equirectangular projection so that they map very nicely around spheres. Does anyone have any code that does this, or perhaps can explain the algorithm to me?

29  Game Development / Game Play & Game Design / Re: Player sprite just doesnt move smooth? on: 2011-05-06 16:59:02
My point was that my rendering loop is nothing special whatsoever, except that it uses Thread.yield() instead of Thread.sleep()
30  Game Development / Game Play & Game Design / Re: Player sprite just doesnt move smooth? on: 2011-05-06 16:16:26
As stated in another thread (that's lost for me), switching from Thread.sleep to Thread.yield has solved this problem for several people.
Also, small stuff, if you're running in a JFrame, use an empty RepaintManager (since you'll be using active rendering anyway),

- which pipeline are you running with? I just booted some old Java2D games I wrote some years ago, and I have no stuttering. (They use the OpenGL pipeline for Java2D). Beyond that, and the fact that I use Thread.yield instead of Thread.sleep, the games wary hugely in both design and form, yet none of them stutter.
Pages: [1] 2 3 ... 7
SHC (28 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (21 views)
2015-07-27 15:35:20

Riven (24 views)
2015-07-27 12:26:13

Riven (14 views)
2015-07-27 12:23:39

BurntPizza (36 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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!