• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

117 Neutral

About spacekid434

  • Rank
  1. How to use git in a mutli-user environment,

    I've thought of branching, but I wondered if it was the appropriate thing to have a branch per developer. I saw in the link I found that in git, you can fetch then merge, then push which means you won't get a non-fast-forward error.
  2. How to use git in a mutli-user environment,

    Doing some more searching  I found this. Looks interesting and sort of describes what I'm looking at. I would still really love some good articles so if anyone has anything It would be really great.   Thanks.
  3. Hello everyone and Merry Christmas,   Me and a friend have started working on some stuff together and we've decided to use git as our version control system. We keep running into issues with fast-forward errors. We're both working in one branch (master) and we often commit and push at the same time.   I'm wondering how we should best make use of egit on eclipse to try and avoid these issues. We're hosting on bitbucket if that helps. Should we both work in local branches then merge them before pushing or something like that?   There is very little information from what I can see on this (maybe I'm just wording it wrong in Google  and I would really appreciate some really in depth articles that describe it well, plus if they have a focus on egit as well that would be awesome, but it's by no means necessary.   Any help would be greatly appreciated. Thanks!
  4. OpenGL error with seperated matrices and GLSL

    I did some research and managed to write a function to convert from char* to wchar* and then to wstring. Unless I've done something wrong, it appears that there is NO debug information at all after compiling the shaders. So this brings be back to my original problem. Thanks for the help though. I really appreciate it!
  5. OpenGL error with seperated matrices and GLSL

    I could use printf(), but for the sake of my learning, how do I convert a C string to wchar?
  6. OpenGL error with seperated matrices and GLSL

    Thanks for that. I'm having trouble displaying the info log though. The issue is, I don't know how to convert from an GLchar* to a LPCWSTR for use in a MessageBox(). I'm not using ATL or MFC. Any help there would be greatly appreciated as converting between strings has given me a headache before. Thanks.
  7. Hello, I recently started playing around with OpenGL on C++ and after getting some of the basics, a simple GLSL implementation. I tried to add very slight random noise to some simple shaded polygons, where the colors are described at the vertices (I don't know the proper name for this) in a pyramid. I made it use FragCoord to get it coords to calculate the noise value, but this uses screen pixels and so the noise would stay the same no matter the prospective you're looking at the model from. I followed the description of a better method described in the top answer [url="http://stackoverflow.com/questions/4899555/glsl-how-to-get-pixel-x-y-z-world-position"]here[/url], but this doesn't seem to be working. I can't move the shape around and it's stuck at z=0. I can't change any camera perspectives. I think this may be an error in my GLSL as I'm totally new to it and it's quite alien to me. Here's an image of my problem. The first is what it's meant to look like (without the noise) the second what it looks like: [img]https://dl.dropbox.com/u/21274231/opengl-glsl-working.PNG[/img] [img]https://dl.dropbox.com/u/21274231/opengl-glsl.PNG[/img] Here is my code: frag.glsl [CODE] varying vec4 verpos; float rand2d(vec2 x){ uint n = floatBitsToUint(x.y * 214013.0 + x.x * 2531011.0); n = n * (n * n * 15731u + 789221u); n = (n >> 9u) | 0x3F800000u; return (2.0 - uintBitsToFloat(n)); } float rand3d(vec3 x){ uint n = floatBitsToUint(x.y * 214013.0 + x.x * 2531011.0 + x.z * 27644437.0); n = n * (n * n * 15731u + 789221u); n = (n >> 9u) | 0x3F800000u; return (2.0 - uintBitsToFloat(n)); } void main(void) { vec4 outColor = gl_Color; outColor *= ((0.2 * rand3d(vec3(verpos.x, verpos.y, verpos.z)) + 0.9); outColor.w = 1.0; gl_FragColor = outColor; } [/CODE] vert.glsl [CODE] uniform mat4 view_matrix; uniform mat4 model_matrix; varying vec4 verpos; void main(){ verpos = model_matrix * gl_Vertex; gl_FontColor = gl_Color; gl_Position = gl_ProjectionMatrix * view_matrix * model_matrix * gl_Vertex; } [/CODE] and my render method where I separate my matrices: [CODE] void App::render(){ start = SDL_GetTicks(); //Clear the matrices and pixel/depth buffer(s) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); //Create model matrix and pass to shader glTranslatef(x, y, -6.0f);//Modify the world matrix GLfloat model_matrix_array[16]; glGetFloatv(GL_MODELVIEW_MATRIX, model_matrix_array); glUniformMatrix4fv(model_matrix, 1, GL_FALSE, model_matrix_array); glLoadIdentity(); //Create view matrix and pass to shader glRotatef(roty, 1.0f, 0.0f, 0.0f);//Modify the view matrix glRotatef(rotx, 0.0f, 1.0f, 0.0f);//Modify the view matrix GLfloat view_matrix_array[16]; glGetFloatv(GL_MODELVIEW_MATRIX, view_matrix_array); glUniformMatrix4fv(view_matrix, 1, GL_FALSE, view_matrix_array); glLoadIdentity(); glBegin(GL_TRIANGLE_FAN); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glVertex3f(0.0f, 0.0f, 1.0f); glColor4f(0.0f, 1.0f, 0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); glColor4f(1.0f, 0.0f, 0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f); glColor4f(1.0f, 1.0f, 0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f); glColor4f(0.0f, 1.0f, 1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f); glColor4f(0.0f, 1.0f, 0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); glEnd(); glBegin(GL_QUADS); glColor4f(0.0f, 1.0f, 0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); glColor4f(1.0f, 0.0f, 0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f); glColor4f(1.0f, 1.0f, 0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f); glColor4f(0.0f, 1.0f, 1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f); glEnd(); SDL_GL_SwapBuffers(); frames++; current = SDL_GetTicks(); } [/CODE] I'm sorry that this is such a big post but I really hope it doesn't put people off and that someone can help me. I would really appreciate it. Thanks.
  8. Perlin noise and procedural generation

    Thanks, I'll have a look at that website when I'm back home. I did put a link to my perlin demo in the post but here's the image anyway: [img]http://dl.dropbox.com/u/21274231/Untitled.png[/img] Thanks
  9. I've recently been working on a 2d RPG adventure game in Java. I have world loading among other things and I want to use procedural generation for the landscape of the game world. I have had no previous experience with procedural generation so this was quite a learning curve for me and I feel I have done fairly well. I finally managed to make a Perlin noise demo with help from this article [url="http://devmag.org.za/2009/04/25/perlin-noise/"]here[/url] and I'm fairly happy of the [url="http://dl.dropbox.com/u/21274231/games/noise.jar"]result[/url] (that demo uses a persistence of 1 and 8 octaves). Here is the code for my Perlin noise. It's very fast to generate compared to some of the other algorithms I've tried. Im using a linear interpolate method because I don't notice the difference between a cos one except for the fact that linear is MUCH quicker... [CODE] double[][] genWhiteNoise(){ Random random = new Random(seed); double[][] noise = new double[width][height]; for(int x = 0; x < width; x++){ for(int y = 0; y < height; y++){ noise[x][y] = random.nextDouble() % 1; } } return noise; } double[][] generateSmoothNoise(double[][] baseNoise, int octave){ double[][] smoothNoise = new double[width][height]; int samplePeriod = 1 << octave; double sampleFrequency = 1.0f / samplePeriod; for(int x = 0; x < width; x++){ int sample_x0 = (x / samplePeriod) * samplePeriod; int sample_x1 = (sample_x0 + samplePeriod) % width; double horizontal_blend = (x - sample_x0) * sampleFrequency; for(int y = 0; y < height; y++){ int sample_y0 = (y / samplePeriod) * samplePeriod; int sample_y1 = (sample_y0 + samplePeriod) % height; double vertical_blend = (y - sample_y0) * sampleFrequency; double top = interpolate(baseNoise[sample_x0][sample_y0], baseNoise[sample_x1][sample_y0], horizontal_blend); double bottom = interpolate(baseNoise[sample_x0][sample_y1], baseNoise[sample_x1][sample_y1], horizontal_blend); smoothNoise[x][y] = interpolate(top, bottom, vertical_blend); } } return smoothNoise; } double[][] perlinNoise(double[][] baseNoise, int octaveCount){ double[][][] smoothNoise = new double[octaveCount][][]; for(int i = 0; i < octaveCount; i++){ smoothNoise[i] = generateSmoothNoise(baseNoise, i); } double[][] perlinNoise = new double[width][height]; double amplitude = 1.0; double totalAmplitude = 0.0d; for(int octave = octaveCount - 1; octave >= 0; octave--){ amplitude *= persistance; totalAmplitude += amplitude; for(int x = 0; x < width; x++){ for(int y = 0; y < height; y++){ perlinNoise[x][y] += smoothNoise[octave][x][y] * amplitude; } } } for(int x = 0; x < width; x++){ for(int y = 0; y < height; y++){ perlinNoise[x][y] /= totalAmplitude; } } return perlinNoise; } [/CODE] First off, can someone please tell me if the noise I have generated if suitable for random world generation or if it's not, can they give me some tips and/or links to good examples. and second, can someone please tell me a good place to start for turning that Perlin noise into a game world. I am using a tile based system and i plan on having mountains, sand dunes, forests and cities (they wont be randomly generated but they will have a random location in the world based on some placement parameters). Any help would be very much appreciated.
  10. Double.toString(MRTROLOLO.jpg)
  11. Export JAR using slick with Eclipse

    Sorry for bumping, but quite a few hours of work now will be for nothing if someone cant help. I don't even need a proper tutorial. If someone could just supply me with the settings they use or how they do it. Im open to new ideas and im willing to learn along the way. Thanks
  12. repost tic tac toe

    Dude, you cant expect us to help you if we can't even your read your code. You might want to fix post or you won't get ANY help.
  13. Hello Everyone. I've just started working on a new project and I was just checking the export as Jar to make sure that it works. It's a good thing that I did because for some reason I cant get Eclipse to properly export my project. Im using slick2d which is stored in a folder in my root project directory. (this also contains lwjgl.jar and all the win 64x natives) I have tried playing round with a few setting in the export as jar option and I have also tried export as runnable jar. When I export as 'jar', when I try to open the jar it says "Could not find the main class: com.thecreeperlawyer.enginedemo.EngineDemo. Program will exit.". I have looked into the jar with winrar and the manifest seems to say the right thing (from my limited knowledge of manifests) and I can also find "com\thecreeperlawyer\enginedemo\EngineDemo.class". When I export as 'runnable jar', when I open it nothing happens. Could someone please tell me, or provide a thorough tutorial on how to properly export a slick2D/LWJGL project from Eclipse. Also if anyone could provide (if the tutorial doesn't) the best way to export the libs (slick2d.jar, LWJGL.jar and the natives) that would be very much appreciated. Thanks
  14. Java Null Pointer Exception

    Hello. I'm currently working a a 2D dungeon crawler game. I have a tile based system with a Tile class. This contains a whole heap of public static Tile. The problem is, when I try to access these from anywhere, I get a Null pointer Exception. I don't how i get this though since I quite clearly instatiate the variables. Heres the code [code]public static Tile backgroundRock; public static Tile bars; public static Tile dirt; public static Tile grass; public static Tile grill; public static Tile platform; public static Tile rock; public static Tile shaft; public static Tile table; public static Tile water; static{ bars = new TileBars(0, 0, 0x404040); dirt = new TileDirt(1, 1, 0x7F3300); grass = new TileGrass(2, 2, 0x267F00); grill = new TileGrill(3, 3, 0x3F2F2F); rock = new TileRock(4, 4, 0x808080); shaft = new TileShaft(5, 5, 0xFFD800); table = new TileTable(6, 6, 0xFF4300); water = new TileWater(7, 7, 0x0094FF); platform = new TilePlatform(8, 8, 0x423300); backgroundRock = new TileBackRock(9, 9, 0xFFFCF4); }[/code] Please help, is there something I'm missing...
  15. Slick: Resource not found

    I started working with the slick 2D game engine for my upcoming 2D platformer written in Java. I started working on it today and i set it up according to the Slick website. However when I run it it throws this error: [quote]Thu Oct 13 22:06:41 NZDT 2011 ERROR:Unable to determine Slick build number Thu Oct 13 22:06:41 NZDT 2011 INFO:LWJGL Version: 2.7.1 Thu Oct 13 22:06:41 NZDT 2011 INFO:OriginalDisplayMode: 1920 x 1080 x 32 @60Hz Thu Oct 13 22:06:41 NZDT 2011 INFO:TargetDisplayMode: 854 x 500 x 0 @0Hz Thu Oct 13 22:06:41 NZDT 2011 INFO:Starting display 854x500 Exception in thread "main" java.lang.RuntimeException: Resource not found: org/newdawn/slick/data/defaultfont.png at org.newdawn.slick.util.ResourceLoader.getResourceAsStream(ResourceLoader.java:69) at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:169) at org.newdawn.slick.Image.<init>(Image.java:196) at org.newdawn.slick.Image.<init>(Image.java:170) at org.newdawn.slick.Image.<init>(Image.java:158) at org.newdawn.slick.Image.<init>(Image.java:136) at org.newdawn.slick.AngelCodeFont.<init>(AngelCodeFont.java:104) at org.newdawn.slick.Graphics$1.run(Graphics.java:142) at java.security.AccessController.doPrivileged(Native Method) at org.newdawn.slick.Graphics.<init>(Graphics.java:139) at org.newdawn.slick.GameContainer.initSystem(GameContainer.java:752) at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:378) at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314) at me.spacekid434.Exordium.Game.main(Game.java:72)[/quote] I'm using Eclipse as my IDE. I have included both slick.jar and lwjgl.jar in the build-path and have them in the root directory. Please help!
  • Advertisement