Java-Gaming.org
 Featured games (90) games approved by the League of Dukes Games in Showcase (557) games submitted by our members Games in WIP (476) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
 Show Posts Pages: [1] 2
 1 Game Development / Artificial Intelligence / Re: A* trouble on: 2014-03-16 00:12:02 Like i said, the map is created out of an array, which decides what tiles go where.The problem arises when the tile array, lets say its 512x512 tiles large, which makes the map 512x512x8 pixels large.One problem is that the algorithm has problems when going between the two, the second is the bad movement, the entity going to the "0,0 position" on each tile.
 2 Game Development / Artificial Intelligence / A* trouble on: 2014-03-15 16:30:45 I am having some troubles getting my A* algorithm working correctly, or rather, implementing the path on my entities correctly.I have successfully implemented this code into my game, it gets a path that avoids mountains and lakes.http://www.cokeandcode.com/main/tutorials/path-finding/The problem starts when i want my entity to follow the path. My map is made out of 8x8 tiles, and the algorithm calculates the path according to the map array, which makes the path 512x512 pixels large, instead of 512x512 tiles large. This creates a problem;I am not able to create a path to anything outside a 512x512 pixel area on the map, since otherwise it would be out of bounds, i have tried to fix this problem, but dunno if its a correct way.The unit does follow the path correctly, if i paint the path up, and then enlarge it over the map it is correct.I have tried to fix the problem by making the algorithm to work with tiles by dividing the target x/y by 8, thus getting the position in tiles. Doing this f*cked it up though, so probably i have missed something somewhere.  But my question is, is this the right way of doing it? The point is that i also want the units to walk pixel by pixel, but the a*star guides i have seen all goes by tiles, i dont think making a gigantihumongous array with every pixel on the map is a sane way of doing that.The game i am trying to make is RTS, but the only tile based stuff on it is the map, think age of empires.
 3 Game Development / Articles & tutorials / Re: Wondering how to use JarSplice? This is the thread for you! on: 2014-03-04 13:21:57 If there is more functionality in JarSplice maybe you could add some text about that? Would be nice to know what i am 'missing out' on if i only use eclipse.
 4 Game Development / Articles & tutorials / Re: Wondering how to use JarSplice? This is the thread for you! on: 2014-03-04 01:50:44 Why not just put the libraries in the jar with eclipse? Works just fine.
 5 Discussions / Business and Project Discussions / Re: RTS Programmers WANTED! on: 2014-02-20 01:11:25 Good looking graphics.I myself is underway of making a RTS., havent gotten far with it yet though.Like the other guy said, more info would be nice. I think it would be hard to work on something if you don't 'feel' with the game.
 6 Game Development / Newbie & Debugging Questions / Re: [SOLVED] Tile mapping on: 2014-02-20 01:08:42 Or you can just set a scanner to use comma as delimiter?And you don't really need the line == null stuff either?
 7 Games Center / WIP games, tools & toy projects / Re: eXo - snappy space strategy on: 2014-02-18 15:57:23 Looks a lot like Euflora?
 8 Game Development / Newbie & Debugging Questions / Re: LibGDX quest log display? on: 2014-01-28 20:15:48 TWL is what you need.http://l33tlabs.org/I havent tried it myself, but it seems totaly awesome. Though i heard it was a harder then the other GUIlibrary, Box2D i think it was called?Check both of those.
 9 Games Center / Cube World Projects / Re: How to add noise on: 2014-01-09 21:29:01 How do you create your map? The map array is what contains the data that will be rendered as your map. For example an array of floats with the values -1 to 1 as described below. You then tell the game to go trough every single post in the array and render all numbers between lets say -1 to -0.40 as a dirt block, -0.40 to -0 as grass, etc etc.
 10 Games Center / Cube World Projects / Re: How to add noise on: 2014-01-09 18:02:05
 11 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-07 19:05:25 The IDE isn't supposed to be able to run with a crash in the code. And if the IDE goes around this crash, knowing its there, it should tell about it. It makes total and complete sense, thinking anything else is f*cked up.
 12 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-07 12:32:28 If you follow a map(Eclipse), and it creates a bridge where it thinks it should be a bridge, but it is'nt actualy built. So in reality(running the jar) when you come to that place, there is no bridge. That is a fault on the map, not the reader.
 13 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-06 08:40:35 Its a bug in the software if it doesn't tell me that there is an error.It's eclipse on windows, running a jar on windows. They should give the same errors. If not, Eclipse has given a false compiler that gives people false input.
 14 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 23:56:57 If the compiler does not show that there is something wrong, even compiles and runs everything just fine, even though if there is an error that will prevent it from running, has an huge error in it.
 15 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 23:50:29 I always type the names the same way, but for some reason this time it was different.And how is it not eclipses fault if it doesn't pay attention to such an obvious error?
 16 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 22:31:28 Ok.... i am a little pissed now.Turns out Eclipse is not case sensitive when it comes to file names, whilst the java run outside Eclipse is....
 17 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 21:53:06 I am working my way slowly trough the game uncommenting stuff as i extract the game from a working state to a crashing state. I think its somewhere in the entity / player class. But since i dont get an error i have no idea.Yea, just export and run. The assets are there in the .jar file, so i am baffled.
 18 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 21:29:29 I have tried on my laptop, no luck.Works in eclipse, but not exported jar. :/
19  Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 21:16:14
I don't know how it crashes, it doesn't give me any error.

Show:
 1  2  3  4  5  6  7 `      map = new TmxMapLoader().load("maps/untitled.tmx");      mapRender = new OrthogonalTiledMapRenderer(map);      camera = new OrthographicCamera(width, height);      player = new Player(new Vector2(width / 2, height /2), 60, (TiledMapTileLayer) map.getLayers().get(0), 4, bullets, camera);      bullets = new ArrayList();      enemies = new ArrayList();      Gdx.input.setInputProcessor(player);`

There is nothing new in there, i don't remember the last time i edited anything in show().

Hide has nothing, i even commented out the call to the empty dispose. Resize is just changing the viewport and such, but isnt called since the window isnt resizable anymore.(i tried making it resizable again, but it crashes anyway.)
 20 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 21:00:35 There is nothing in the GameScreen dispose, the only one that got is the MainMenu screen, which also uses an atlas. But nothing else does(neither do they use and atlas), havent gotten into learning that or the assetmanager yet. Anyways, i have skipped all the screens in front of gamescreen and go directly to the gamescreen when the game launches, and the game crashes. So i dont think that has anything to do with it.
21  Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 20:40:57
https://www.dropbox.com/s/zgxk0ol9ohbdv18/folder.png

What main code are you after? just main class?

 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20 `package com.sabo.zombies;import com.badlogic.gdx.backends.lwjgl.LwjglApplication;import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;public class Main {   public static void main(String[] args) {               LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();      cfg.title = "Zombies";      cfg.useGL20 = true;      cfg.width = 480;      cfg.height = 320;       cfg.resizable = false;            new LwjglApplication(new Zombies(), cfg);   }}`
 22 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 20:21:42 Here is a screenshot proving that the libgdx stuff and others are in there, the folder is filled with classlibraries and so on.https://www.dropbox.com/s/cfnfstuf7fv2w12/rarcomfolder.pngAnd here is a screenshot of the settings.https://www.dropbox.com/s/ctf333pf6by7hlm/settings.png I have tried both extracting and packaging the libraries, nothing works. If it would have been a libraries problem, the first screens wouldnt work either, since they use tween stuff and the libraries associated with that. The only things i have added since friday are more images, which i have checked, they are there in the jar. Some code, and a new death/highscore screen. The code are simple loops to print the images up. *edit* I tried to comment out everything but the camera and map generation from the gamescreen and it still doesnt run.
 23 Game Development / Newbie & Debugging Questions / Re: [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 18:45:40 I have run it trough the console on windows, but i get no error showing up. I have tried added the try and catch on several different positions in the code, invoking the switch to GameScreen, and on the constructor in GameScreen. I also tried adding a few System.out.printlns here and there and none of them showed up.
 24 Game Development / Newbie & Debugging Questions / [LibGdx] - Exported to Jar, and Gamescreen wont show, but other Screens will? on: 2014-01-05 14:52:35 All right, so i have exported a game i have created to an runnable jar file as i have many times before. Earlier i haven't had a problem like this, the last time i exported it was on friday, and now when the last version is finished and i export it, the window just closes when i have gone trough a few screens, flash, credits and menu, no error is given if i run it trough commandline. The game works fine if i run it trough eclipse. I have checked the buildpath and the asset folder is there and all. I have opened the jar with winrar and checked to see that all images are there, and they are. I have tried both to extract and package the libraries. I am at a total loss....I looked around and only could find one thread on this, and that was an error with a static filepath.I really need this fixed since it's supposed to be turned in on tuesday. :/
 25 Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-31 14:32:14 Quote from: longshorts on 2013-12-31 00:01:18My implementation is pretty much taken directly from the link I posted above earlier:Stefan Gustavson, Simplex noise demystified: http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdfScroll 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.I copied everything from the pdf this time instead of the so called quotes the other guy offered and it seems to work as you said. Though i have found that the reason i receive so many 0's is that the negative numbers returns as 0's when i receive the array back from the method., so that's something I'll have to work with next year.As for making it random, go check the guy i was following at the beginning, the code that he quotes includes a seed and a random number in that version of Gustavsons code.http://stackoverflow.com/questions/18279456/any-simplex-noise-tutorials-or-resources
 26 Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 23:45:01 Quote from: matheus23 on 2013-12-30 23:37:32Quote from: Sabomoth on 2013-12-30 23:29:51Did you have a look at the Diamond/midpoint-displacement stuff? Of what i have seen from perplex noise it is a lot more smooth, while the other one feels more 'natural'.What do you mean by 'perplex' noise? Google couldn't help me :/Are you maybe talking about simplex noise?Simplex noise isn't much different from Perlin Noise (or, better: Gradient Noise), it is just slightly modified to use simplex shapes as cells instead of squares, which minimizes the number of interpolation points and finally makes the algorithm faster.Ken Perlin developed both algorithms and his aim with Simplex Noise was to make a faster version of Gradient Noise.I wouldn't suggest the Diamond-Square algorithm. It's not a function that you could call on an arbitrary position, you need to have a grid for that, which is why it's more limited in usecase (only limited maps, something like the infinity of minecraft would be impossible/hard).Yeah, i ment Simplex, i was a little perplexed(har har har...)One game i am thinking of having a go at this winter is a age of empires/anno style game, which has a set boundary, so its not infinite but quite large. While another is a more 'unlimited' role playing game. Havent decided which to go with yet, but whichevers mapgeneration comes out the best has an edge over the other. I am aware of the history, i have spent a few days reading up on the few different noises and such, just havent tried them myself till now.
 27 Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 23:29:51 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.Did you have a look at the Diamond/midpoint-displacement stuff? Of what i have seen from perplex noise it is a lot more smooth, while the other one feels more 'natural'.https://bitbucket.org/dermetfan/libgdx-utils/src/b220ba67bf5c2e7f9c3cfd77cfea5d9add542a8d/libgdx-utils/src/net/dermetfan/utils/math/Noise.java?at=defaultThat algorithm isn't as fast as perplex, a 512x512 grid can take 3-4 seconds to fill. Might be some faster implementations out there though.
 28 Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 21:57:44 Quote from: longshorts on 2013-12-30 21:45:37Try increasing decreasing the frequency of your output. I get much larger features and smoothing maps with a smaller frequency.I have tried lots of things, but when i used the method you posted instead of the one from the page i was able to create a better looking map, but, the problem is that is it generating way too much 0's and 1's. See this result; https://www.dropbox.com/s/z8bpolrdihegcqq/savedColor.pngUpping or lowering the frequency doesn't change the total amount of them.I am just copy and pasteing the code since i am not a brainiac for algorithms and math.
 29 Game Development / Game Mechanics / Re: Generating "True" 2D Perlin Noise on: 2013-12-30 20:40:34 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.Following this guys implementation of Gustavsons code on this page;http://stackoverflow.com/questions/18279456/any-simplex-noise-tutorials-or-resourcesI recieve this; https://www.dropbox.com/s/r9rmsldozvnfnhz/simplex.pngI also tried a Diamond Square/Midpoint Displacement-thingie by dermetfan and was able to shoot out this; https://www.dropbox.com/s/cfrc6pr71n8njcn/diamond.pngNowhere near as smoth as yours.
30  Game Development / Newbie & Debugging Questions / Re: Problem with mouse firing. (probably math related?) on: 2013-12-22 14:27:33
Woop!
I fixed it.
I found an answer online that converted the mouse position on the screen to the position ingame.
With that it is working as intended. And since it gives the coordinates in the same fashion i do not need to invert the numbers.

 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15 `   Vector3 test;   @Override   public boolean touchDown(int screenX, int screenY, int pointer, int button) {      switch(button){            case Buttons.LEFT:               test = new Vector3(screenX, screenY, 0);               camera.unproject(test);               this.musX = test.x - position.x;               this.musY = test.y - position.y;               this.dir = Math.atan2(musY, musX);                              shoot();      break;      }      return true;   }`