Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (687)
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]
1  Game Development / Newbie & Debugging Questions / Find closest valid cell in a tilemap on: 2014-12-29 14:04:09
Hi folks, my proposed problem I need help solving boils down to this: On game start, set player position to center of tilemap. If this tile is water however, find the nearest tile which is not water, and set the players position to that tile.

Now my current proposed solution is thus:
i = 1
while(valid tile not found){
Check each tile with distance i away from tile on x and y coordinate.
If valid, valid tile not found = false
Else i++

While I will think this will work in finding a valid  position for my player to spawn at, it isn't efficient (will find a close valid point, not nessesarily the closest) and feels like a real brute force method. I'm trying to find either a method of solving this using Pythagorean to measure distance (instead of iterating and returning first valid) while being less computationally efficient, or using the height map I also have to find the closest point of land. The latter might be possible, but I forget how to solve a possible valley problem in the search.

Anyway, any help would be appreciated Smiley
2  Games Center / Contests / Re: Ludum Dare 31: "Entire Game on One Screen" on: 2014-12-10 14:20:09
I present to you our LD31 Jam Entry: Lights Out!

Yes its another shmup :/ However I only realized that LD was on halfway through the weekend, so I enlisted some help from some friends and we quickly put something together within 24 hours in time for the Jam submission. All of us are pleased with what we presented though, and will see what we can do within 72 hours next time Smiley
3  Games Center / Showcase / Re: Panda City Jump on: 2014-05-29 12:12:53
Those graphics look gorgeous; I really like the art style. Very nice work for something built in a month Smiley
4  Game Development / Newbie & Debugging Questions / Online Card Game Architecture Design on: 2014-05-05 17:15:19
It has been a while now since I have made a client-server system, and the last time was when I was in university where I had a ready made web server to deploy to. So when my artist friend came to me with the idea to make an online card game I couldn't help but feel a little stupid on the subject.

What I'm looking for is some advice and recommendations as to what systems I should use to implement the following game system. I can look up tutorials later, but I want advice as to what direction I should take.

The client for the card game will be designed with LibGDX, which will maintain a TCP connection to the server (game is turn based so I figured TCP is fine). The server is then connected to a MySQL database which holds account details etc. What I'm fuzzy on is what to use to make the server, and what to deploy it on. I was hoping to use standard java ServerSockets for connections, and run the java servlet on an apache tomcat server (as that is what I have done in the past). Alternatively, I have been tempted by the RedDwarf ServerApp to administer a game server, but I am concerned as it seems to be a pretty out of date piece of software.

What would you guys recommend I use? Particularly for supporting the server.
5  Game Development / Newbie & Debugging Questions / [LibGDX] GWT Compile does nothing! on: 2014-04-28 11:15:29
[FIXED] After a while of agonizing I solved this by uninstalling all my GWT related plugins from Eclipse... I discovered that they were for some reason for an older version of eclipse to the one I have. I installed the latest GWT plugins, manually downloaded the latest GWT SDK and linked it to my projects build path and now the project is compiling. Somewhere along that process was the solution Smiley

I'm trying to deploy a web version of my game, which works fine on desktop and when exporting to a JAR, but for the life of me I cannot get it to pass through GWT.

As far as I can tell I've followed the normal process for creating the web app; Right click the gwt project folder in Eclipse -> Google -> GWT Compile. But when I click on it nothing happens. I get no popup, console feed and nothing changes in the WAR directory.

Can anyone suggest what I might be missing? Or an alternate way I can export my game as a web app?

6  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Forground and background camera pan on: 2014-04-23 12:15:20
Yes indeed it is parallax scrolling! Thank you very much to you both Smiley
7  Game Development / Newbie & Debugging Questions / [LibGDX] Forground and background camera pan on: 2014-04-23 11:51:34
What is the name of the effect where when your camera is panning in a game, the foreground is panning by at one speed and the background is panning by at a slower speed? I am looking to implement this in LibGDX so if someone could roughly outline how this is done I would be very grateful!

My brain has completely blanked here, I've seen this before but never programmed it!
8  Games Center / Contests / Re: Ludum Dare 29 on: 2014-04-23 11:36:52
I'll also be participating in this ludum dare. It is my first ever competition, but I have decided to go out and enter the compo as opposed to the jam to give myself a real challenge. Will see how I can perform with LibGDX under such tight conditions Smiley
9  Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 23:01:18
I am afraid our implementations of Gustavson's original code is mismatched for me to be able to easily patch them together, for example, the one i copied already had octaves and that running before, and the get noise method seems to differ a bit as well. The result i get from your newest method is just even more zeroes and ones, and it only gives between numbers 0-1. No matter how low/high/many octaves, roughness or scale i got. I guess i'll try to build everything from scratch and not follow that guide of there, might even learn something.

My implementation is pretty much taken directly from the link I posted above earlier:

Stefan Gustavson, Simplex noise demystified:

Scroll down to page 11, and you will find the 2D simplex noise method. You will need that and any other methods which are referenced by it (also listed in the same article). After that, the generateOctavedSimplexNoise method I posted earlier should link in with it just fine.
10  Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 21:39:12
matheus, I could kiss your genious face, your code worked brilliantly!

I have altered your code to the following so it outputs a two dimensional array that can be used for image processing, I'll post it here in case someone else wants to refer to it.

public float[][] generateOctavedSimplexNoise(int width, int height, int octaves, float roughness, float scale){
      float[][] totalNoise = new float[width][height];
       float layerFrequency = scale;
       float layerWeight = 1;
       float weightSum = 0;

       for (int octave = 0; octave < octaves; octave++) {
          //Calculate single layer/octave of simplex noise, then add it to total noise
          for(int x = 0; x < width; x++){
             for(int y = 0; y < height; y++){
                totalNoise[x][y] += (float) noise(x * layerFrequency,y * layerFrequency) * layerWeight;
          //Increase variables with each incrementing octave
           layerFrequency *= 2;
           weightSum += layerWeight;
           layerWeight *= roughness;
       return totalNoise;

I ran a few tests and everything works great. A nice map is generated with the following:

SimplexNoiseGen sng = new SimplexNoiseGen();
float[][] osn = sng.generateOctavedSimplexNoise(512, 512, 3, 0.4f, 0.005f);

And the output! Note, there is a large mass of water because the output is between -1 and 1 for this map, and my program is currently set to make anything less than 0.1 deep water.

Sabomoth, give it a shot with the method I just posted, and drop down the roughness parameter, that should give you the result you are looking for. If it still aint right, just play around with the last three parameters so you get a good feel of what they do Smiley
11  Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 20:45:37
That looks awesome!
I played around with that last night but couldn't get a result nowhere near what you just got there. Been trying for an half hour to touch it up a bit to give presentable images.

Try increasing decreasing the frequency of your output. I get much larger features and smoothing maps with a smaller frequency.


Looking at the code and image, it looks like you only utilize one layer of simplex noise. If you couple together a couple of layers with different frequencies and weights, you get a much nicer result.

Thanks, I did wonder about how to implement different octaves. I'll give it a shot then repost my results, thanks!
12  Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 19:08:47
Thanks for the confirmation Roquen Smiley

Well since I put up my last post, I decided to take a stab at implementing Simplex Noise instead of Perlin based off the implementation by Stefan Gustavson, Simplex noise demystified:

I used most of the 2D Simplex code he lists towards the end of the article, and then wrote the following function to stick it all in a 2D array that can be rendered in my game:

public static float[][] generateSimplexNoise(int width, int height){
      float[][] simplexnoise = new float[width][height];
      float frequency = 5.0f / (float) width;
      for(int x = 0; x < width; x++){
         for(int y = 0; y < height; y++){
            simplexnoise[x][y] = (float) noise(x * frequency,y * frequency);
            simplexnoise[x][y] = (simplexnoise[x][y] + 1) / 2;   //generate values between 0 and 1
      return simplexnoise;

This generates the following map!

Thank god. Just may end up using Simplex Noise after all! My only remaining question is how do you randomise this? My original idea was to simply give a random offset for all the x and y values of my array, but is it that simple? Or should I be doing something else instead?
13  Game Development / Game Mechanics / Generating "True" 2D Perlin Noise on: 2013-12-30 17:47:35
After reading material and trying out different examples for days I feel like I have hit a brick wall. Please note in advance I have read most posts and the wiki article on this topic, I'm just looking for some good advice.

I've been working on a 2D terrain generation system for a new game I'm working on, and after some reading decided to shoot for a Perlin noise powered implementation. After some reading, I found the following article:

How to Use Perlin Noise in Your Games:

I thought, "Brilliant! Finally an implementation I can seem to understand!" I put hands to keyboard and began writing an implementation based off the article. After running the code and finally getting some visual output I felt relief at first, and then slowly annoyance. Below are samples of my output.

I'm annoyed because this "random" noise seems to generate features which appear as horizontal or vertical compostions of mountains or ponds. There are virtually no diagonal lines and very few circular formations. I went back to the original article to discover that the implementation was not Perlin noise, but instead a variation of value noise.

So I scrap my pervious implementation and start again. I begin by implementing the version of Perlin noise featured on Riven's blog:

PerlinNoise :: smooth/turbulent :

Even though it seems to be in 3D space, I assume I can set Z to zero and all will be merry. Well so I thought, but once I test the code and find that for all possible inputs I was getting 0 from each call to the smoothNoise function.

Again, I feel like I have hit a brick wall, and I need to ask advice before I keep wasting any more of my time. Firstly, is the sort of horizontal/vertical features in value noise normal? And if they are, does Perlin noise not feature this? Lastly, if someone could point me in the direction of a functional Perlin noise implementation I would greatly appreciate it, as I am begining to think I am trying to understand something way out of my league :/
Pages: [1]
Dwinin (72 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (74 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (92 views)
2015-10-23 10:42:45

Jervac_ (106 views)
2015-10-18 23:29:12

DarkCart (135 views)
2015-10-16 00:58:11

KaiHH (116 views)
2015-10-11 14:10:14

KaiHH (156 views)
2015-10-11 13:26:18

BurntPizza (171 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!