• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

robee00

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

206 Neutral

About robee00

  • Rank
    Member
  1. Hi!   What kind of shape should I use in a 2D topdown space game for collision? I was thinking about AABB, but as the ships are rotating they are not the best option. I was thinking about OBBs or a group of Bounding Circles. I'm more into the circles because of the performance, and I can define a ship's collider more precisely with more circles. I would like to hear your opinion too
  2. Ooops that t.y = t.y stayed in the code, I wrote t.y = 1f - t.y to flip the image on the y-axis. The texID's value is 0 by default, so I can check if there is no tex coords for that vertex.   https://mega.co.nz/#!8FtkXDzZ!R6S_71KMoKIhS4edYjq1VnnimMZ7TvLDL6OSmW_Zxuk <- link for obj and texture   It is not a cube, it's a sh*tty hallway, just made something to try the loader. Here is how it looks like http://i.imgur.com/sWXw7Lp.png   http://pastebin.com/38ECG3ge <- code for the class
  3. Hi   I wrote a simple OBJ loader but the texcoords are messed up somehow. I can't figure out what is wrong. I tried flipping the texture on the Y-Axis, no success. (Here is how my object looks like: http://imgur.com/d8edSyw   Code: (FaceData holds the IDs for vertices, normals and texcoords, Vertex class holds the data) public void parseObj(String path) { try { BufferedReader reader = new BufferedReader(new FileReader(new File("").getAbsolutePath() + "/res/" + path)); String line = reader.readLine(); while(line != null) { if(line.startsWith("v ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" " ); pos.add(new Vector3f(Float.parseFloat(vertexStr[0]), Float.parseFloat(vertexStr[1]), Float.parseFloat(vertexStr[2]))); } if(line.startsWith("vt ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" " ); tex.add(new Vector2f(Float.parseFloat(vertexStr[0]), Float.parseFloat(vertexStr[1]))); } if(line.startsWith("vn ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" " ); norm.add(new Vector3f(Float.parseFloat(vertexStr[0]), Float.parseFloat(vertexStr[1]), Float.parseFloat(vertexStr[2]))); } if(line.startsWith("f ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" "); for(int i = 0; i < vertexStr.length; i++) { String verStr = vertexStr[i].replaceAll("//", "/0/"); String[] asd = verStr.split("/"); FaceData data = new FaceData(); data.vertexID = Integer.parseInt(asd[0]); data.texID = Integer.parseInt(asd[1]); data.normalID = Integer.parseInt(asd[2]); faces.add(data); } } line = reader.readLine(); } reader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } for(int i = 0; i < faces.size(); i++) { Vertex v = new Vertex(); v.pos = pos.get(faces.get(i).vertexID - 1); if(faces.get(i).texID != 0) { Vector2f t = new Vector2f(); t = tex.get(faces.get(i).texID - 1); t.y = t.y; v.texCoord.set(t); } else v.texCoord = new Vector2f(0,0); v.normal = norm.get(faces.get(i).normalID - 1); vertices.add(v); } }
  4. I replaced drawElement with drawArrays, and it draws the cube perfectly, so the problem is with the indices.
  5. Hello guys.   I came across a problem today. I exported a single cube from blender, and I tried to wrote a simple .obj loader to use. I think my parsing method is okay, but I have problem putting the data into a vbo/ibo. The vertex and fragment shader is working, I used them before. What I get is a deformated cube. Like faces (quad) only got one of the tris drawn.   Vertex class contains fields for position, texcoords, and normals   FaceData just holds the ID for vertex, texcoord and normal. public class Model { ArrayList<Vertex> vertices = new ArrayList<Vertex>(); ArrayList<Vector3f> pos = new ArrayList<Vector3f>(); ArrayList<Vector2f> tex = new ArrayList<Vector2f>(); ArrayList<Vector3f> norm = new ArrayList<Vector3f>(); ArrayList<FaceData> faces = new ArrayList<FaceData>(); int vbo; int ibo; public int indexCount; public Model(String name) { parseObj(name); FloatBuffer vertBuffer = BufferUtils.createFloatBuffer(vertices.size() * 8); for(Vertex v : vertices) { vertBuffer.put(v.getElements()); } vertBuffer.flip(); vbo = GL15.glGenBuffers(); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo); GL15.glBufferData(GL15.GL_ARRAY_BUFFER, vertBuffer, GL15.GL_STATIC_DRAW); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); IntBuffer indices = BufferUtils.createIntBuffer(faces.size()); for(FaceData f : faces) { indices.put(f.vertexID - 1); indexCount++; } indices.flip(); ibo = GL15.glGenBuffers(); GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, ibo); GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indices, GL15.GL_STATIC_DRAW); GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0); } public void render() { GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); GL20.glEnableVertexAttribArray(0); GL20.glEnableVertexAttribArray(1); GL20.glEnableVertexAttribArray(2); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo); GL20.glVertexAttribPointer(0, 3, GL11.GL_FLOAT, false, 32, 0); GL20.glVertexAttribPointer(1, 2, GL11.GL_FLOAT, false, 32, 12); GL20.glVertexAttribPointer(2, 3, GL11.GL_FLOAT, false, 32, 20); GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, ibo); GL11.glDrawElements(GL11.GL_TRIANGLES, indexCount, GL11.GL_UNSIGNED_INT, 0); GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); GL20.glDisableVertexAttribArray(0); GL20.glDisableVertexAttribArray(1); GL20.glDisableVertexAttribArray(2); GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); } public void parseObj(String path) { try { BufferedReader reader = new BufferedReader(new FileReader(new File("").getAbsolutePath() + "/res/" + path)); String line = reader.readLine(); while(line != null) { if(line.startsWith("v ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" " ); pos.add(new Vector3f(Float.parseFloat(vertexStr[0]), Float.parseFloat(vertexStr[1]), Float.parseFloat(vertexStr[2]))); } if(line.startsWith("vt ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" " ); tex.add(new Vector2f(Float.parseFloat(vertexStr[0]), Float.parseFloat(vertexStr[1]))); } if(line.startsWith("vn ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" " ); norm.add(new Vector3f(Float.parseFloat(vertexStr[0]), Float.parseFloat(vertexStr[1]), Float.parseFloat(vertexStr[2]))); } if(line.startsWith("f ")) { int start = line.indexOf(" "); String sub = line.substring(start + 1); String[] vertexStr = sub.split(" "); for(int i = 0; i < vertexStr.length; i++) { String[] verStr = vertexStr[i].split("/"); FaceData data = new FaceData(); data.vertexID = Integer.parseInt(verStr[0]); //data.texID = Integer.parseInt(verStr[1]); data.normalID = Integer.parseInt(verStr[2]); faces.add(data); } } line = reader.readLine(); } reader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } for(int i = 0; i < faces.size(); i++) { Vertex v = new Vertex(); v.pos = pos.get(faces.get(i).vertexID - 1); v.texCoord = new Vector2f(0,0); v.normal = norm.get(faces.get(i).normalID - 1); vertices.add(v); } } }
  6. Hi!   I'm creating some little art for my game, and I don't know how should I make the walls...   I uploaded a pic which shows the 2 method, and I can't decide which one looks better in a game. I would go with 2, but it looks like if there was no wall there. I thought about dropping a shadowed, darker piece of wall instead of that "lines"
  7. That's why I ask it. I could learn OGL in a more familiar language than C++, but if I start learning C++ I could continue my OGL learning. So I could learn both of them
  8. Hi!   I'm currently learning modern OpenGL with LWJGL, and I have some experience in Java and C# (2 - 2,5 years). On the other hand, I want to learn C++ too. Is it "hard" to learn both? (C++ and OpenGL too) I have a bit of experience in C++, but I like the managed languages more. But I want to have some more experience in C++ too
  9. Okay, so I reduced it to render just one plane. And I found an other tutorial: http://www.rastertek.com/gl40tut06.html   I use EXACTLY the same shaders, and I use exactly the same position, and normals. But I got a black triangle instead of a yellow one. Looks like intensity is always zero.   The class of what I'm rendering: http://pastebin.com/ez5K9vN3
  10. Oops, I forgot to add that I left out the top and bottom sides. But okay, I'll try to rewrite that, and include the top and bottom sides
  11. Hello!   For now, I used OGL in fixed function mode. But now I want to learn the programmable pipeline now.   I tried to implement a simple diffuse - specular lighting shader from http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/directional-lights-per-pixel/ . But I got wierd results (picture attached)   I uploaded my code to pastebin:   - Rendering: http://pastebin.com/cUDtHcWJ   - Vertex shader: http://pastebin.com/hE8s3KE7   - Fragment shader: http://pastebin.com/pVpr6zhR   And if I move my camera further the object, it gets brighter. Something I had to do with the position right?
  12. Ooooo, thank you! That truly gave me some inspiration! Woah... :)
  13. Hi!   I'm having a plan on doing a 3D first person dungeon crawler. I'm doing the prototype with fantasy items (sword, cave setting, etc..), but I'm a sci-fi fan. I love game that is sci-fi. So, I was thinking about putting the game into sci-fi setting. But I'm having a hard time about melee weapons. Lightsabers are out, of course :P Energy swords? Or staffs? With ranged weapons, it's ok. I can drop in some guns, or something. And with enemies? Robots, aliens? And I'm not sure even if the dungeon crawler genre fits the scifi theme
  14. I did it, I used the distance method that shazem given. I get the object with the smallest distance that collided with the ray. If it's the player's AABB, then gotcha, the enemy can see the player.