Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
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 ... 38
1  Game Development / Game Mechanics / Re: Plane physics on: 2014-08-14 09:07:53
Does anybody know good equations for the following things?

- Lift amount for an angle of attack specified
- Drag amount for an angle of attack specified
Those will vary by aircraft. You need to decide whether you're trying to simulate a Cessna, a 747, an F-14, a Lancaster, ... and then try to find data specific to that plane. Bear in mind that airspeed also makes a big difference: especially the switch from laminar to turbulent flow which guarantees a stall.
2  Discussions / Community & Volunteer Projects / Re: Building RPG-like Tile-based Game on: 2014-07-22 10:57:52
It always has been. Read this thread in its entirety. There are some generally applicable comments in there which could probably be reworked into an FAQ at some point.
3  Discussions / General Discussions / Re: New feature: Embedded PDFs on: 2014-07-18 08:36:13
Due to a certain observed need
If you want people to be able to use nicely formatted formulae, you could install MathJax. Or point people at

In the case that there is no default PDF reader associated with the browser, which is often the case on phones and tablets, a download of the file is initiated. I'll work no this later, to prevent such 'unexpected' downloads on potentially bandwidth limited devices.
It would also be useful to not display it other than in the main thread view page. I had to cancel a second download when I opened up this reply page.
4  Game Development / Game Mechanics / Re: Vectors and Reflection - Ball bouncing messed up by simultaneous collisions? on: 2014-07-16 14:35:04
It's not a trivial solution, but the one which I used for Torquing! is from Complementarity based multiple point collision resolution, Giang, Bradshaw, and O'Sullivan, Eurographics Ireland Workshop, pp1 - 7, 2003, available online at
5  Game Development / Newbie & Debugging Questions / Re: Do I need permissions for SharedPrefrences? on: 2014-07-16 08:38:56
If you could say what the basic error was, the random person who finds this thread via Google in two years when they're trying to debug the same problem will be grateful.
6  Game Development / Newbie & Debugging Questions / Re: Collision detection with tiling, fall problems? on: 2014-07-10 12:54:38
I recall other games with similar problems but can't recall if they work around it or leave it. Does anyone have any suggestions?  Huh
Easy option: make the base of the robot be its widest part.

Nice option: have a width (e.g. 24px) and an effective footprint (corresponding to the graphic; e.g. 18px). If the effective footprint is above empty space, the robot falls, but you nudge it sideways if necessary to prevent its width from passing through solid space.
7  Game Development / Shared Code / Re: Trie-based dictionary on: 2014-07-07 09:19:54
Would a String be simpler than ArrayList<Character> for unscrambled? It has to be turned into a string for output anyway.
Not really, in the sense that because strings are immutable it would increase the amount of object creation. The way to reduce that is to use a single char[] (tracking the length of the subarray which is relevant) and then use the corresponding String constructor when a word is found.
8  Discussions / General Discussions / Re: The Wrath of Ackermann on: 2014-07-07 09:14:28
No matter how much I optimized, we just couldn't think of a good way to calculate past A(4,2)...

Any thoughts or takers?
Depends what you mean by calculate. For m > 2, A(m, n) + 3 = 2 → (n+3) → (m − 2) = 2 → (2 → (n+2) → (m − 2)) → (m − 3) = 2 → (A(m, n − 1) + 3) → (m − 3), so in particular A(4, n) + 3 = 2A(4, n − 1) + 3. If you want to calculate that naïvely as a list of bits, you'll run into trouble. But selecting the correct representation of your data is the first thing to learn in computing.
9  Game Development / Shared Code / Re: Trie-based dictionary on: 2014-07-03 09:30:37
3. Trie search (prefix tree search). This is supposed to be the fastest.
It probably would be if you implemented it properly. Linear search through a list at each level is not the classic trie implementation. It should be a single array lookup. The problem then is memory usage; I've found that if you have an expensive offline building process which generates the trie and then combines isomorphic nodes, it takes about as much space as the original word list but performs like a trie.
10  Discussions / General Discussions / Re: Programmer jokes on: 2014-06-24 16:59:13
His code gives you a IndexOutOfBounds Exception.
Not necessarily. You don't see where numBrainCells is set.
11  Game Development / Artificial Intelligence / Re: A* Multiple paths to goal on: 2014-06-24 14:45:36
I like Orangy Tang's idea a lot, but I'm going to throw a second idea into the ring, in case you're keen enough to try testing various ideas and see how effective they are. In short: meet in the middle.

This idea takes a parameter E (for excess) which indicates how much worse than optimal you're willing to accept. First find the optimal path length, L. Then, reusing the data structures you've already built up, extend into a breadth-first search of all nodes reachable from your start point in no more than EL/2 and with heuristic estimate no worse than EL/2. Now do a similar BFS from the end point. The intersection of the reachable points gives you paths of length no more than EL, and for each node in the intersection the path you get is the optimal path through that node.

The main downsides are that the two BFS will expand quite a lot more nodes than the original A*, and that you need to deduplicate. However, you'll probably need to do that with Orangy Tang's answer too unless you have a good heuristic for how much penalty to apply to each existing path, so without careful analysis or profiling it's hard to say which is faster.
12  Game Development / Newbie & Debugging Questions / Re: Shooting at the mouse on: 2014-06-23 09:04:13
You have x and y. You convert them to an angle. Then you convert back to x and y. It's a lot simpler to just normalise the vector and not do any trigonometry at all. In fact, most 2D games have little or no need for trig.
13  Game Development / Newbie & Debugging Questions / Re: Shooting at the mouse on: 2014-06-23 08:49:24
Why do you have a shootAtRad method? Isn't it just going to do a sin and cos to get back to an (x, y) vector?
14  Game Development / Newbie & Debugging Questions / Re: learning modern opengl on: 2014-05-21 12:58:15
Haven't read it myself, but I saw recommended recently.
15  Discussions / Community & Volunteer Projects / Re: game idea: "space wars" on Klein bottle surface? on: 2014-05-18 07:51:37
I once wrote up a design proposal for a puzzle game on a surface of genus 2, but I never made the game. I can't remember now what the reaction from the rest of the team was. IIRC I had some scheme involving 7 screens which gave the right topology, but it was a pretzel rather than a Klein bottle.

And I think I've seen occasional mention of other games which do puzzles on surfaces other than the simple plane, sphere, or torus, but no names come to mind now.

(No shooting self in the butt except in the narrow neck areas.)
Wouldn't the question become just finding a good projection operation for all that has no local intersections in 3D?

I would think that you want to project symmetrically, such that (modulo textures) the view is unchanging. Then if the projection has a local intersection and a narrow neck area, pick a part of the projection which puts them way beyond the horizon so that the player is unaware of them.

Aren't old-school game maps (Of the wrapping over head sort) basically these?

No, they're tori. A bit simpler.
16  Discussions / General Discussions / Re: Is it just me, or does everyone's GUI code look like spaghetti? on: 2014-05-14 08:41:42
It seems like a large majority of GUI code ends up like this, because you end up with a lot of similarly functioning buttons all under the same controls that are all just-different-enough you really can't combine much of anything together.. so for code as simple as detecting what button you're hovering over and what method to run when you click on it can easily skyrocket to a hundred+ lines of code just for a dozen buttons.
It shouldn't. The code in the methods might run to that, but the code to dispatch them should be much simpler. Unless you have so many buttons that you need a BSP or quad-tree, you just need to register tuples of (x, y, width, height, strategy) and loop through them.
17  Discussions / General Discussions / Re: Size of games written in Java. on: 2014-05-09 19:52:55
I don't recall whether anyone told me the official reason. I think my director of studies may have commented that a dissertation on a game would be unlikely to get good marks anyway. I don't actually know what aspect of RuneScape Andrew's dissertation was formally about; I would hazard a guess that the networking may have been a significant part of it, because I know that he implemented non-blocking socket IO for that before it was in the standard API.
18  Game Development / Newbie & Debugging Questions / Re: Game works in eclipse, but... on: 2014-05-09 19:31:01
Is it maybe my graphics aren't being exported? I selected export and compress files into jar at the option screen, but no luck.
If you want to check whether the graphics are in the jar or not, either use jar tf at the command line or rename it to .zip and open it with your favourite unzipper.

But the typical problem here is getting the structure for the resource path wrong. If you want help debugging, it would be useful if you post the relevant snippets of code, the relevant snippets of the jar structure, and the exception message.
19  Discussions / General Discussions / Re: Size of games written in Java. on: 2014-05-09 12:55:18
Likewise Runescape. That just started out as a college project, I seem to recall.
Indeed. Nowadays the CS department in Cambridge bans games for dissertation projects.
20  Discussions / General Discussions / Re: Value Types Proposal for Java on: 2014-05-07 13:08:07
Microsoft recommends you only use structs with immutable values, but the language doesn't require it.

That's an understatement. C# makes it impossible, because structs always have an implicit no-args constructor which doesn't initialise any of the fields (even if you define a no-args constructor which does initialise them). I've was bitten by that at least once.
21  Discussions / General Discussions / Re: Size of games written in Java. on: 2014-05-07 13:00:24
You may have heard of a MMORPG called RuneScape...
22  Discussions / General Discussions / Re: JEP for making Unsafe a public API on: 2014-04-28 20:02:49
What uses does it have?
Dirty hacks. I've seen it used to do custom serialisation, exploiting its ability to instantiate an object without calling its constructor and to set the values of its final fields.
23  Discussions / General Discussions / Re: Suggest me a game for teaching purpose :/ on: 2014-04-28 10:43:31
Asteroids is extremely simple if they understand the basics of vectors and motion.
24  Discussions / Miscellaneous Topics / Re: Can anyone give me 10 words all related to one thing in common? on: 2014-04-14 15:03:15
List of lists of lists of lists: just kidding... I think.
It's been deleted three times...
25  Discussions / General Discussions / Re: What hosting do you use for your websites? on: 2014-04-13 22:00:02
I'm still with the same hosting service I was with the last time this question was asked:,26592
26  Game Development / Game Mechanics / Re: Mathematical curves. on: 2014-04-13 21:56:31
I think what you wanted to say is: They tend towards zero, but never approach it (and therefore the Cubic Root is never going to be flat at some point).
I blame a lack of coffee for my ability to read that more than once without mentally processing the word "root". You are quite correct.
27  Game Development / Game Mechanics / Re: Mathematical curves. on: 2014-04-12 10:22:05
The key word is "easing". Armed with that I easily found these links:

28  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-12 08:24:34
The problem isn't so much loading the sheet as it is using .getColor() 1024 times on a 32x32 sprite that's located on a 1024x512 sheet. Basically I'm not working with a 32x32 image, I'm working with a 1024x512 one and java really doesn't like that. :/
Java per se has no problem with handling 0.5 megapixel images.

Lets take a step back here. You're loading images with LWJGL and then extracting their contents to process them. I'm going to guess two things: firstly, that these images serve only for collision testing, and secondly that LWJGL loads them into texture memory on the graphics card.

If I'm right then the solution is to skip the graphics card. If you load the images using javax.imageio.ImageIO then you get java.awt.image.BufferedImage instances and you can call getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize) to extract your sprite from the image.

For completeness, there may also be a way in LWJGL to create a new 32x32 texture, paint the appropriate segment of your sprite sheet onto it, and then fetch just that back from the graphics card; but I can't see any good reason to do that.
29  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-08 16:33:13
I'm seeing Image.getTexture().getTextureData() in the Slick docs, could be useful, but most likely slower than Image.getColor() method if you can't batch the texture downloads from the card.

Look at the Image source, linked above.

   public Color getColor(int x, int y) {
      if (pixelData == null) {
         pixelData = texture.getTextureData();

So getTextureData() is definitely the way to go.
30  Game Development / Game Play & Game Design / Re: Text based strategy game examples? on: 2014-04-04 12:59:13
Pocket Kingdom 4K from the 2012 Java4k contest isn't quite what you describe, but it's in the ballpark.
Pages: [1] 2 3 ... 38

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

The first screenshot will be displayed as a thumbnail.

atombrot (22 views)
2014-08-19 09:29:53

Tekkerue (22 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (57 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (36 views)
2014-08-06 19:49:38

BurntPizza (66 views)
2014-08-03 02:57:17
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 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!