Java is both a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

learn more… | top users | synonyms

6
votes
1answer
543 views

Appropriate level representation / data stucture for a 2D platfrom game?

I'm about to program a copy of Mario in Java. I'm thinking on 2 representations/data structures for the levels but I'm not sure which one should I choose: A 2D integer array. A quadtree to divide ...
6
votes
4answers
733 views

Profiling server side game loop in java

I am looking for tips to profile the server side game loop of a Java program for CPU usage. I tried to use the TPTP plugin for Eclipse so far. The problem I am having is that it is really slow. For ...
6
votes
1answer
5k views

Is libgdx fit for 2D game development on Android or are there simpler alternatives?

I'm looking for a Java framework to develop 2D games on desktop and Android. I've looked at Slick and I really like the API, however the developer himself says if you want a framework for Android and ...
6
votes
1answer
292 views

2D Polygon Triangulation

I am creating a game engine using the JBox2D physics engine. It only allows you to create polygon fixtures up to 8 vertices, To create a body with more than 8 vertices, you need to create multiple ...
6
votes
1answer
946 views

SQLite in libGDX

Does anyone have an example of how I can use SQLite in libGDX? I have a class in my original Android code that allowed me to easily access a database but I can't seem to find anything equivalent to ...
6
votes
2answers
882 views

How to loop over a part of an ogg vorbis stream?

I'm successfully streaming ogg vorbis data to openAL with the Java library JOrbis, but now I want to loop over a part of this stream, e.g from 30" to 1'30". I thought that at the end of the loop, I ...
6
votes
2answers
515 views

An odd performance problem rendering a simple scene (less than 14k vertices) in OpenGL using two vbos with LWJGL

Problem I have been having a strange degrading performance issue rendering a simple scene containing two "chunks" of 4x4x4 cubes each. Video of problem This is a screen capture showing my console ...
6
votes
1answer
643 views

Finding which tiles are intersected by a line, without looping through all of them or skipping any

I've been staring at this problem for a few days now. I rigged up this graphic to help me visualise the issue: http://i.stack.imgur.com/HxyP9.png (from the graph, we know that the line intersects ...
6
votes
1answer
722 views

Is Java AWT suitable for 2d game rendering?

[Reposting this question from stackoverflow, as it was pointed out that it fits better here.] I'm currently porting my 2D game engine to Java. I looked at some of the game libraries pointed at here ...
6
votes
1answer
4k views

Making a camera in a 2D game (glOrtho)

I'm trying to make a camera that follows my character and it seems I've managed. However, I don't know how to limit that my camera don't follow me when my character reachs the boundaries of the ...
6
votes
4answers
431 views

Implementing AI to hide behind obstacles

I am developing an AI simulation of predator and prey. I would like to simulate the AI hiding behind obstacles, if it is being chased. But I am still trying to figure out the best way to implement ...
6
votes
1answer
890 views

Minecraft Mod portable torch/lantern

I have just started making a mod for minecraft, I learned how to make items and import custom png's and have gotten all of that to work. I have been searching around the code trying to find a way to ...
6
votes
2answers
358 views

Where can I find some beginners to learn and work with? [closed]

I am very new to game programming. I am currently studying Java (Android mainly) and I know what it takes to make a game, as well as how to render it via OpenGL. Finding some others at nearly my level ...
6
votes
2answers
2k views

How to store 2D tile-map

I want to create a 2D map composed of small tiles, that should look like voxels (eg. this just from side). I think I can make a structure like Voxel2D, that have int X, Y and some Color, and every ...
6
votes
1answer
717 views

For 2D tiled maps is all object and NPC data loaded into memory when the map is loaded?

I'm creating a text RPG in Java, but I think this applies for a GUI as well with regard to the data structure. Each Level is a tiled map. Each Tile object has an (X,Y) coordinate, and references to ...
6
votes
2answers
836 views

Are there any game engines in C# or Java that are cross-platform and support multitouch input? [closed]

I'm looking for game engines (particularly 2D) that can run/create games for Windows, Mac, and Linux, and support multitouch inputs and gestures. I'm able to find many that meet the first two ...
6
votes
3answers
2k views

How do I render a PNG with transparency in LibGDX?

I'm building a simple tic-tac-toe example with LibGDX. I have simple images: cross, circle and board, all pngs created with GIMP with a transparent background. How can I render them as a Texture with ...
6
votes
1answer
230 views

How to debug framerate drops with VBOs, OpenGL

I'm working on an experimental app to test how VBOs perform when rendering a minecraft-like world. If the performance is better than what I use now I'll update my actual game. Based on what everyone ...
6
votes
2answers
369 views

Scalability of multi-threading in game server

What is a reasonable number of threads for a simple 2D mmo in Java? Is it reasonable to have two threads per connection, one for the input stream and one for the output stream? The reason I ask is ...
6
votes
1answer
910 views

Method of terrain in a 3d RPG

I am working on a RPG using the JMonkey engine. While I was conceptualizing the map, I realized I would have a problem with the terrain. My problem is this: I want to have a click to move interface, ...
5
votes
5answers
1k views

Do I really need to “learn” C# for XNA if I know Java?

I want to start developing in XNA. As of now, I do not know C#, but I would consider myself "good" at Java. I have looked at some C# code and it looks almost identical to Java. After looking at Java ...
5
votes
3answers
640 views

Is this really the reason for smoother movement?

Actually i'm watching a tutorial series on youtube about 2D Game programming in Java. My question is about the player-movement. The first version: public void keyPressed(KeyEvent e) { ...
5
votes
2answers
655 views

One Dimensional Perlin noise vs Multi-Dimensional

I am reading through a book called "The Nature of Coding" and I am working on porting the examples from Processing.js to Regular old Java. The example I am on uses the following method call in ...
5
votes
6answers
1k views

Is it possible to use Java as a scripting language?

Is it possible to use Java as a scripting language for a C++ engine/game? I understand that you need to make a binding to the interpreter, but I haven't seen any around.
5
votes
3answers
212 views

Serialization of objects problem

i have a problem with serialization (saving and loading game variabiles), when i save evreything seems to be saving correctly but when i try to load it only detects first 3 objects i saved and the ...
5
votes
4answers
818 views

Drawbacks of using reflection for a component based system at loading-time

I'm coding a little casual game in Java using Slick2D. This game use a lot of different "objects", managed in a composite way. So, firearms, furniture in the map, NPC and player character will be ...
5
votes
2answers
3k views

Breakout Collision: Detecting the side of collision

I am writing a breakout clone (my first game) and am totally stuck as to how I figure out which side of the brick was hit. I have a collision detection method that looks like this: ...
5
votes
3answers
2k views

GameState management hierarchical FSM vs stack based FSM

I'm reading a bit on Finite State Machines to handle game states (or screens). I would like to build a rather decent FSM that can handle multiple screens. e.g. while the game is running I want to be ...
5
votes
2answers
2k views

How do MMO servers communicate with players who are behind a NAT?

I'm now planning to develop a real-time mmo in the future using udp as the transmission protocol since it has lesser overheads than tcp... I understand that between the client and the server, they ...
5
votes
3answers
2k views

A more sophisticated ball-paddle collision algorithm for Breakout?

I have a simple breakout game I'm working on. The collision code is solid; things bounce as they should and don't pass through things or do other funkiness, but the reflection is a bit simplistic. As ...
5
votes
3answers
675 views

Programming Languages Recommendations: A Space shooter game that allows two people to play [closed]

Do you remember an arcade game, that allowed two people to versus or play each other? It was a Galaga/Gradius type game. Me and a couple of other people I know want to make a game like this. We want ...
5
votes
4answers
1k views

Should each Entity have its own update and render methods?

First, the questions: Should each Entity (which are classes like Character, Tree, Enemy) have its own update() and render() methods? If that's the case, then should I use Interfaces like ...
5
votes
4answers
856 views

Better way to generate enemies of different sub-classes

So lets pretend I have an enemy class that has some generic implementation and inheriting from it I have all the specific enemies of my game. There are points in my code that I need to check whether ...
5
votes
2answers
404 views

How does this formula for generating water waves work?

I have been trying to implement the wave equation described in this paper ("Water Simulating in Computer Graphics," Kai Li and Liming Wu) in Java. Part of the paper discusses modeling waves as a sum ...
5
votes
2answers
664 views

3D models on 2D tilemap perspective when scrolling

I am creating a small top-down game, where the player traverses a 2D tilemap, with an illusion of depth provided by 3D models for things like buildings or trees. Having gotten to the point where I ...
5
votes
2answers
807 views

Is it legal to pack LibGdx libraries in my jar file? And to obfuscate them?

I'm using LibGDX and deploying a runnable jar file, using the Eclipse feature, with libraries extracted into it. There are also .so files and .dlls inside. 1 . Is it legal to do so? I didn't find ...
5
votes
4answers
330 views

What version of Java should I target for applets?

I recently deployed an applet that seems to require Java 6 Update 24. I assume the reason for this requirement is the matching JDK version I used to create the applet (I am new to Java). The fact ...
5
votes
2answers
815 views

Disadvantages of using multiple versions of OpenGL in LWJGL?

So, I'm trying to figure out LWJGL, and my goal is to use OpenGL 3.2 (because pretty shaders are pretty). But in every tutorial I can find for LWJGL, they import a bunch of different OpenGL versions ...
5
votes
1answer
700 views

Particle System OpenGL (ortho)

I want to implement a particle system in my game but i have no idea where to start :S I've never programmed a particle system, so this is my first time >.<. I only want to display pixels ...
5
votes
1answer
5k views

OpenGL: Resizing Display and glOrtho/glViewport

I have researched this question from several sources and have yet to find a firm answer saying that "yes that is correct thinking" or "no, here is how it's done." I am trying to ensure resolution ...
5
votes
5answers
7k views

Moving from XNA to Android

I've been using XNA to learn game programming for some time, and I'm interested in moving to Android. Having said that; the learning curve to get started seems to have ramped up exponentially. I ...
5
votes
2answers
465 views

Physics in my game confused after restructuring the Game loop

I'm on my way with making a game in Java. Now I have some trouble with an interpolation based game loop in my calculations. Before I used that system the calculation of a falling object was like ...
5
votes
1answer
1k views

Circle-Rectangle collision in a tile map game

I am making a 2D tile map based putt-putt game. I have collision detection working between the ball and the walls of the map, although when the ball collides at the meeting point between 2 tiles I ...
5
votes
4answers
6k views

2D Platformer Collisions

I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, ...
5
votes
2answers
1k views

Java game design question (graphical objects)

I'm beginner in game development, in Java and here on this site too and I have a game design question. Please comment my idea: I have a main loop which call update and draw method. I want to use an ...
5
votes
2answers
529 views

Is it possible to implement Steamworks functionality in a Java game? How?

I have a basic game that I want to eventually turn into something better. The game is all Java as of right now, but I want to implement the Steamworks SDK into my game (so it can have achievements, ...
5
votes
1answer
3k views

Box2D Difference Between WorldCenter and Position

So this problem has been brothering for a couple of days now. First off, what is the difference between say Body.getWorldCenter() and Body.getPosition(). I heard that WorldCenter might have to do ...
5
votes
1answer
284 views

Move penetrating OBB out of another OBB to resolve collision

I'm working on collision resolution for my game. I just need a good way to get an object out of another object if it gets stuck. In this case a car. Here is a typical scenario. The red car is in ...
5
votes
1answer
204 views

Should I amortize scripting cost via bytecode analysis or multithreading?

I'm working on a game sort of thing where users can write arbitrary code for individual agents, and I'm trying to decide the best way to divide up computation time. The simplest option would be to ...
5
votes
2answers
264 views

Are display lists faster than VBOs?

I'm making a voxel rendering engine. My "chunks" are 32 * 32 * 256 blocks and I can render a 16 * 16 square of them (which corresponds to Minecraft's maximal render distance). I'm using VBOs holding ...