Java-Gaming.org
 Featured games (79) games approved by the League of Dukes Games in Showcase (477) Games in Android Showcase (107) games submitted by our members Games in WIP (535) 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 Discussions / Community & Volunteer Projects / Re: Building RPG-like Tile-based Game on: 2014-07-22 12: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.
 2 Discussions / General Discussions / Re: New feature: Embedded PDFs on: 2014-07-18 10:36:13 Quote from: Riven on 2014-07-17 22:02:09Due to a certain observed needIf you want people to be able to use nicely formatted formulae, you could install MathJax. Or point people at http://mathurl.com/Quote from: Riven on 2014-07-17 22:02:09In 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.
 3 Game Development / Game Mechanics / Re: Vectors and Reflection - Ball bouncing messed up by simultaneous collisions? on: 2014-07-16 16: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 http://www.tara.tcd.ie/bitstream/2262/18699/1/GiangEgirl03.pdf
 4 Game Development / Newbie & Debugging Questions / Re: Do I need permissions for SharedPrefrences? on: 2014-07-16 10: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.
 5 Game Development / Newbie & Debugging Questions / Re: Collision detection with tiling, fall problems? on: 2014-07-10 14:54:38 Quote from: danieldean on 2014-07-09 22:34:38I recall other games with similar problems but can't recall if they work around it or leave it. Does anyone have any suggestions?  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.
 6 Game Development / Shared Code / Re: Trie-based dictionary on: 2014-07-07 11:19:54 Quote from: richierich on 2014-07-07 00:50:00Would a String be simpler than ArrayList 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.
 7 Discussions / General Discussions / Re: The Wrath of Ackermann on: 2014-07-07 11:14:28 Quote from: ctomni231 on 2014-07-07 08:47:48No 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.
 8 Game Development / Shared Code / Re: Trie-based dictionary on: 2014-07-03 11:30:37 Quote from: ags1 on 2014-07-02 23:50:403. 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.
 9 Discussions / General Discussions / Re: Programmer jokes on: 2014-06-24 18:59:13 Quote from: SHC on 2014-06-24 18:00:07His code gives you a IndexOutOfBounds Exception.Not necessarily. You don't see where numBrainCells is set.
 10 Game Development / Artificial Intelligence / Re: A* Multiple paths to goal on: 2014-06-24 16: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.
 11 Game Development / Newbie & Debugging Questions / Re: Shooting at the mouse on: 2014-06-23 11: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.
 12 Game Development / Newbie & Debugging Questions / Re: Shooting at the mouse on: 2014-06-23 10: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?
 13 Game Development / Newbie & Debugging Questions / Re: learning modern opengl on: 2014-05-21 14:58:15 Haven't read it myself, but I saw http://www.opengl-tutorial.org/ recommended recently.
 14 Discussions / Community & Volunteer Projects / Re: game idea: "space wars" on Klein bottle surface? on: 2014-05-18 09: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.Quote from: philfrei on 2014-05-18 04:35:22(No shooting self in the butt except in the narrow neck areas.)Quote from: Roquen on 2014-05-18 08:41:33Wouldn't the question become just finding a good projection operation for all points...one 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.Quote from: UprightPath on 2014-05-18 04:45:53Aren't old-school game maps (Of the wrapping over head sort) basically these?No, they're tori. A bit simpler.
 15 Discussions / General Discussions / Re: Is it just me, or does everyone's GUI code look like spaghetti? on: 2014-05-14 10:41:42 Quote from: Rayvolution on 2014-05-14 09:48:38It 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.
 16 Discussions / General Discussions / Re: Size of games written in Java. on: 2014-05-09 21: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.
 17 Game Development / Newbie & Debugging Questions / Re: Game works in eclipse, but... on: 2014-05-09 21:31:01 Quote from: TFDizzy on 2014-05-09 21:23:16Is 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.
 18 Discussions / General Discussions / Re: Size of games written in Java. on: 2014-05-09 14:55:18 Quote from: princec on 2014-05-09 12:28:29Likewise 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.
 19 Discussions / General Discussions / Re: Value Types Proposal for Java on: 2014-05-07 15:08:07 Quote from: gene9 on 2014-05-06 21:35:36Microsoft 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.
 20 Discussions / General Discussions / Re: Size of games written in Java. on: 2014-05-07 15:00:24 You may have heard of a MMORPG called RuneScape...
 21 Discussions / General Discussions / Re: JEP for making Unsafe a public API on: 2014-04-28 22:02:49 Quote from: SHC on 2014-04-28 17:10:38What 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.
 22 Discussions / General Discussions / Re: Suggest me a game for teaching purpose :/ on: 2014-04-28 12:43:31 Asteroids is extremely simple if they understand the basics of vectors and motion.
 23 Discussions / Miscellaneous Topics / Re: Can anyone give me 10 words all related to one thing in common? on: 2014-04-14 17:03:15 Quote from: KevinWorkman on 2014-04-14 16:35:49List of lists of lists of lists: just kidding... I think.It's been deleted three times...
 24 Discussions / General Discussions / Re: What hosting do you use for your websites? on: 2014-04-14 00:00:02 I'm still with the same hosting service I was with the last time this question was asked: http://www.java-gaming.org/index.php/topic,26592
 25 Game Development / Game Mechanics / Re: Mathematical curves. on: 2014-04-13 23:56:31 Quote from: matheus23 on 2014-04-13 19:40:30I 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.
 26 Game Development / Game Mechanics / Re: Mathematical curves. on: 2014-04-12 12:22:05 The key word is "easing". Armed with that I easily found these links:Pictures: http://easings.net/BSD-licensed Java code: https://github.com/jesusgollonet/processing-penner-easing/tree/master/src
 27 Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-12 10:24:34 Quote from: Rayvolution on 2014-04-09 18:09:48The 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.
28  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-08 18: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.

 1  2  3  4    public Color getColor(int x, int y) {      if (pixelData == null) {         pixelData = texture.getTextureData();      }

So getTextureData() is definitely the way to go.
 29 Game Development / Game Play & Game Design / Re: Text based strategy game examples? on: 2014-04-04 14:59:13 Pocket Kingdom 4K from the 2012 Java4k contest isn't quite what you describe, but it's in the ballpark.
 30 Discussions / General Discussions / Re: JGO Kickstarter on: 2014-04-01 21:41:31 Quote from: Riven on 2014-04-01 16:11:29Now the most important question is... do you guys like the new JGO logo?To be perfectly frank, it took me a long time to see that it's Duke upside-down. I thought it was some kind of Lovecraftian horror.
 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.
 pw (37 views) 2014-07-24 01:59:36 Riven (38 views) 2014-07-23 21:16:32 Riven (26 views) 2014-07-23 21:07:15 Riven (28 views) 2014-07-23 20:56:16 ctomni231 (59 views) 2014-07-18 06:55:21 Zero Volt (50 views) 2014-07-17 23:47:54 danieldean (42 views) 2014-07-17 23:41:23 MustardPeter (44 views) 2014-07-16 23:30:00 Cero (60 views) 2014-07-16 00:42:17 Riven (57 views) 2014-07-14 18:02:53
 Rayvolution 37x kevglass 35x theagentd 29x Riven 29x BurntPizza 20x Longor1996 17x Longarmx 16x princec 15x LiquidNitrogen 15x Drenius 11x SHC 10x HeroesGraveDev 9x JVallius 8x PandaMoniumHUN 8x Slyth2727 7x KevinWorkman 6x
 HotSpot Optionsby dleskov2014-07-08 03:59:08Java and Game Development Tutorials2014-06-14 00:58:24Java and Game Development Tutorials2014-06-14 00:47:22How do I start Java Game Development?by ra4king2014-05-17 11:13:37HotSpot Optionsby Roquen2014-05-15 09:59:54HotSpot Optionsby Roquen2014-05-06 15:03:10Escape Analysisby Roquen2014-04-29 22:16:43Experimental Toysby Roquen2014-04-28 13:24:22
 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