Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (565) Games in Android Showcase (152) games submitted by our members Games in WIP (607) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Show Posts Pages: [1]
 1 Game Development / Newbie & Debugging Questions / Re: Noise Problem on: 2013-04-30 05:57:58 wow this helps so much! I love this image, I saved it on my desktop
 2 Game Development / Newbie & Debugging Questions / Re: Noise Problem on: 2013-04-30 04:30:26 Does anyone else know how to use this algorithm? I seem to misunderstand the concept of noise I think...
3  Game Development / Newbie & Debugging Questions / Re: Noise Problem on: 2013-04-30 03:03:45
I just tried it, like that :
 1  2  3  4  5  6  7  8 `public static void main(String[] args) {      Noise p = new Noise(45643);      System.out.println("=====noise=====");      for (int i = 0; i < 30; i++) {         System.out.println(p.noise(i));      }      System.out.println("=====noise=====");   }`

It outputs 0.0 everywhere!!
 4 Game Development / Newbie & Debugging Questions / Re: Noise Problem on: 2013-04-30 02:56:45 I'm gonna test it in a minute after my maths homework (lol kinda related except it's probabilities(boring)) but thanks alot!
5  Game Development / Newbie & Debugging Questions / Noise Problem on: 2013-04-30 01:45:11
Hi everyone, I'm in the process of creating a really simple game like terraria, just for fun and as a challenge for myself. I'm currently in the process of making the terrain generator, and I kind of struggle with all these noise functions... I've looked over on the web and I found the j3d library for a perlin noise function. Here's a simple test code I wrote :
 1  2  3  4 `PerlinNoiseGenerator p = new PerlinNoiseGenerator("My seed".hashCode());      for (int i = 0; i < 30; i++) {         System.out.println(p.noise1(i));      }`

The only thing that's comming out of this is 0.0 and -0.0... "wat.". Does anyone know why it's doing this(/another good library or source code)? I had a library in C# when I was using XNA that was doing essentially the same thing.. but it was working!

 6 Game Development / Game Mechanics / Re: Tower Defense Save File on: 2013-04-28 14:48:11 Let's say you have an Object(class) called "Player" and this player has value(String name, int life).You need to make an array of bytes to save to the file. The best way is to make an interface (let's say we call it "ISavable").this interface forces you to implement the two methods shown previously. when you save your game, you itterate over all your game elements that are "ISavable" and you append the byte array of each object to the file. when you load the game, it's gonna go over all the file byte by byte and put those values in the right place using the fromBytes(byte[] b) method.hope this helps
7  Game Development / Game Mechanics / Re: Tower Defense Save File on: 2013-04-28 14:22:11
A good way to save things to files is to create two functions on every items you want to save. One for creating a byte[] of the values (exporting its values), and another one for decoding an byte[] (importing its values).

Example :
 1  2  3  4  5  6  7  8 `public byte[] getBytes() {    return this.name.getBytes();}public void fromBytes() {    this.name = new String(bytes, "iso-8859-1"); // remplacer l'encodage au besoin}`

it's a very abstract example but you're probably going to need to add lists or arrays with a correct size for storing your data.
8  Game Development / Game Mechanics / Simple render limitation Slick2D (keep the high update count) on: 2013-04-28 14:15:30
Hi everyone, I'm working on a game right now, Had my collisions working after a day of work, and now I'm stuck with a problem that I though I could solve... I need to increase the update count (significantly higher than 60, let's say 120+), But I don't want my renders to increase. I've been trying this for about 2 hours and I can't find it! I'm using Slick2D with a base game of type (StateBasedGame). There's a function "setTargetFrameRate(60), that's for the renders AND the updates, also there's a vsync (same), and two functions I tried to use, like that :
 1  2 `app.setMaximumLogicUpdateInterval(100);app.setMinimumLogicUpdateInterval(1);`

this above works, but the renders are insanely high(3500) and the updates are around 500, which would be perfect if I could limit the renders...

Any knows in Slick2D how to achieve this?
 9 Games Center / Cube World Projects / Re: Low fps problems with many objects in OpenGL on: 2013-03-18 14:32:41 Wow thanks ok I'm gonna try that out right now and I'll give you some feedback once I'm done!
 10 Games Center / Cube World Projects / Re: Low fps problems with many objects in OpenGL on: 2013-03-18 11:23:36 Ok I'll check out these posts... Last question if someone can help, the only thing I'm not entirely sure about is the way my chunk is supposed to update... I'm gonna be doing 16x16x16 chunks, but I'm working with FloatBuffer and the predefined .put(float values) function... I have to tell my FloatBuffer what size it's gonna be before even knowing it! is there a workaround? Perhaps I should be using float[][] and then getting float[] from each block, and then put them manually in the FloatBuffer? That seems slow to me!(For lighting, I use the OpenGL predefined glLight set to a color! I love it and it's simple.... no shadows though, I'm gonna have to work on that some time soon!)
 11 Games Center / Cube World Projects / Re: Low fps problems with many objects in OpenGL on: 2013-03-18 04:44:08 Alright I'll take a look, is this a board on this forum?
 12 Games Center / Cube World Projects / Re: Low fps problems with many objects in OpenGL on: 2013-03-18 04:40:30 I know minecraft uses something like 16x16x16 blocks chunks, but won't it be slow to re-render if a modification happens? maybe a thread? I'm lost ! but thanks for the idea, gonna try that for the next few days
 13 Games Center / Cube World Projects / Low fps problems with many objects in OpenGL on: 2013-03-18 04:33:38 Hi everyone, I wrote a simple "game" using LWJGL that allows me to modify a chunk of 32x32x32 blocks ust like in minecraft. It has ray picking and lighting. Here's a screenshot of what I can do with it : Alright, now here's my problem. My code is fairly good, I'm using vertex buffer objects, one for each block. The chunk is never really re-rendered, because each block is an individual object and can be rendered alone. The blocks are also only rendering faces that are visible, and they tell the 6 blocks (if existing) to hide a face for faster rendering.Now, I'm only getting ~100fps with a 32x32x32 block that only contains 32x8x32 blocks really, the rest is air. Why am I getting so low fps? Anyone has proposition?Here are the system specs :i5 760 2.8ghz8gb ram 1333gtx 580 1.5gbintel 80gb ssdI can post parts of my code if anyone wants it to help me!Thanks a lot!
 Pages: [1]
 Riven (10 views) 2015-04-01 18:27:05 ags1 (27 views) 2015-03-31 10:55:12 theagentd (13 views) 2015-03-27 23:08:20 wxwsk8er (54 views) 2015-03-20 15:39:46 Fairy Tailz (48 views) 2015-03-15 21:52:20 Olo (29 views) 2015-03-13 17:51:59 Olo (33 views) 2015-03-13 17:50:51 Olo (40 views) 2015-03-13 17:50:16 Olo (44 views) 2015-03-13 17:47:07 ClaasJG (61 views) 2015-03-10 11:36:42
 BurntPizza 21x LiquidNitrogen 21x KevinWorkman 18x EgonOlsen 17x theagentd 16x basil_ 16x Roquen 15x Varkas 12x wessles 11x 65K 11x Riven 9x Rayvolution 9x phu004 8x SHC 8x princec 8x Ashedragon 8x
 How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27
 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