• 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.


  • Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About Lewis_1986

  • Rank
  1. I love that this was tested on a quad core package but i would be more interested in seeing the results on a dual or single core processor. Also i agree fps is not a valid measure please use avg ms with highest ms and lowest ms per frame
  2. if you are using the fixed function pipeline (I assume you are because otherwise you would have the view matrix because you would have coded the matrix stack) then you can use the following code [code] //To retrieve the current Modelview matrix: GLfloat m[16]; glGetFloatv (GL_MODELVIEW_MATRIX, m); [left] [/left][/code] this comes from http://www.opengl.org/resources/faq/technical/transformations.htm so I would say it was the recommended way to deal with fixed-function (pre 3.1 openGL). [quote name='Alessandro' timestamp='1315256046' post='4857958'] I'm trying to implement the glsl_pseudo_instancing nvidia example in my terrain engine project. I've already setup the proper initialization routines (loading the shaders etc.) but I'd like to ask some explanations about the render() routine. Here is the upper part of the original nVidia code: [code] void renderScene(void) { assert(gCurrentMesh != NULL); int i; int count; matrix4f view; vec3f light; vec3f lightWorldSpace(0.0f, 100.0f, 0.0f); vec3f lightPositionView; // Set state for rendering the mesh gCurrentMesh->setState(); // Get the view transform from the mouse interactor view = gMouseInteractor.get_transform(); // HERE IS WHERE I NEED HELP // Compute the light's position in view space view.mult_matrix_vec(lightWorldSpace, lightPositionView); lightPositionView = vec3f(0.0f, 0.0f, 0.0f); ....... // Download the view matrix glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 4, view(0, 0), view(0, 1), view(0, 2), view(0, 3)); glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 5, view(1, 0), view(1, 1), view(1, 2), view(1, 3)); glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 6, view(2, 0), view(2, 1), view(2, 2), view(2, 3)); glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 7, view(3, 0), view(3, 1), view(3, 2), view(3, 3)); // Download the light position glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 11, lightPositionView[0], lightPositionView[1], lightPositionView[2], 1.0f); [/code] From what I understood, I need to retrieve the current view transform and pass the matrix parameters to the vertex program using the glProgramLocalParameter4fARB calls beow. I have a very simple camera routine that just set pitch,yaw,roll and xyz positions. How could I calculate the matrix4f view (the view transform matrix) using my camera information? Thanks for any help! [/quote]
  3. Hi, I'm sure if the compiler did not optimize code for us we would have to inline the code like that but can anyone confirm or deny that the compiler does this? I'm sure C++ is smart enough to do basic var stacking and loop unrolling where needed... Hopefully anyway (this is my hopeful face) [quote name='godplusplus' timestamp='1314874053' post='4856225'] Now, a small comment regarding your code... You could put all those checks in one line. Basically, something like: [code] return (valueInRange(A.x, B.x, B.x + B.width) || valueInRange(B.x, A.x, A.x + A.width)) && (valueInRange(A.y, B.y, B.y + B.height) || valueInRange(B.y, A.y, A.y + A.height)) && (valueInRange(A.z, B.z, B.z + B.depth) || valueInRange(B.z, A.z, A.z + A.depth)); [/code] It will be faster, since there will be lots of early outs, instead of having to create 3 bools, calculate all of them and then check them. If you could, however, try using Lewis's version, it has less checks than the whole valueInRange thing. And it could be done even faster by doing: [code] return (A.bbMin.x <= B.bbMax.x) && (A.bbMax.x >= B.bbMin.x) && (A.bbMin.y <= B.bbMax.y) && (A.bbMax.y >= B.bbMin.y) && (A.bbMin.z <= B.bbMax.z) && (A.bbMax.z >= B.bbMin.z); [/code] [/quote] I am also quite sure you need extra brackets and to change some of the && to || ala [code] return ((A.bbMin.x <= B.bbMax.x) || (A.bbMax.x >= B.bbMin.x)) && ((A.bbMin.y <= B.bbMax.y) || (A.bbMax.y >= B.bbMin.y)) && ((A.bbMin.z <= B.bbMax.z) || (A.bbMax.z >= B.bbMin.z)); [/code] voilla this now works as expected when I test it (oh the cheek of me) by the way i'm not poking fun I'm just in a very good mood
  4. [quote name='mrbastard' timestamp='1314883200' post='4856279'] [color="#1c2837"][size="2"] [font="Arial"][color="#1c2837"][size="2"][color="#000000"][color="#1c2837"][size="2"][color="#000000"]Did you guys even read his code? (I know you didn't!)[/color][/size][/color] [color="#1c2837"][size="2"][color="#000000"]greentiger: You're doing the same thing no matter what the value of 'view'. [/color][/size][/color][/color][/size][/color]You probably wanted to do different things for different values of view... I guess moving the eye point.[/font][/size][/color] [/quote] To be fair I did read the code which is why I posted example code that I know works and is a rather nice example of gluLookAt to create a target camera. I quickly read his code i will admit but it absolutely does modify the values of axX and axZ which is what is passed to the camera... (sigh) Edit: Also I have noticed that you may need to fix the indentation because gamedev ever so cleverly b@||@#%d it with their code formatter
  5. what exactly are you attempting to achieve with the gluLookAt? here is a test 3rdPersonCamera that uses gluLookAt [code] #!/usr/bin/env python import sys import math try: from OpenGL.GLUT import * from OpenGL.GL import * from OpenGL.GLU import * except: print '''ERROR: PyOpenGL not installed properly.''' sys.exit() class thirdPersonApp: def __init__(self): #player coordinates self.playerX = 27.0 self.playerY = 0.5 self.playerZ = 27.0 #camera coordinates self.camX = 44.0 self.camY = 25.0 self.camZ = 44.0 self.playerRot = 225.0 self.cameraRot = 20.0 self.camDist = 50.0 #self.camHeight = 25.0 self.moveVel = 1.0 self.rotVel = 6.0 self.setupGL() def setupGL(self): glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize (400, 400); glutInitWindowPosition(100, 100) glutCreateWindow("Third Person Test Application") self.glInit() glutIdleFunc(self.onIdle) glutDisplayFunc(self.onDraw) glutReshapeFunc(self.onResize) glutKeyboardFunc(self.onKeyPress) glutMainLoop() def onIdle(self): self.onDraw() def onDraw(self): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)# Clear The Screen And The Depth Buffer glLoadIdentity()# Reset The View self.camX = self.playerX+self.camDist*math.sin(self.cameraRot*math.pi/180.0) #self.CamY = self.playerY-self.camDist self.CamZ = self.playerZ+self.camDist*math.cos(self.cameraRot*math.pi/180.0) gluLookAt(self.camX,self.camY,self.camZ,self.playerX,self.playerY,self.playerZ,0,1,0) glColor(0.5,0.5,0.5) glBegin(GL_LINES) i = 0 while i < 10: glVertex(-50,0,-50+i*10); glVertex(50,0,-50+i*10) glVertex(-50+i*10,0,-50); glVertex(-50+i*10,0,50) i = i+1 glEnd() #z-fight self.playerY = 0.5 glTranslatef(self.playerX,self.playerY,self.playerZ) glRotatef(self.playerRot,0,1,0) glBegin(GL_TRIANGLES) glColor(1,1,1); glVertex( 0,0, 7) glColor(1,0,0); glVertex(-5,0,-5) glColor(1,0,0); glVertex(+5,0,-5) glEnd() glColor(1,1,1) glBegin(GL_LINES) glVertex(0,1,0); glVertex(5,1, 0) # X glVertex(0,1,0); glVertex(0,5, 0) # Y glVertex(0,1,0); glVertex(0,1, 5) # Z glEnd() glutSwapBuffers() def glInit(self): glClearColor(0.0, 0.0, 0.0, 0.0) # Black Background glShadeModel(GL_SMOOTH) # Enables Smooth Color Shading glClearDepth(1.0) # Depth Buffer Setup glEnable(GL_DEPTH_TEST) # Enable Depth Buffer glDepthFunc(GL_LESS) # The Type Of Depth Test To Do glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) # Realy Nice perspective calculations def onResize(self,w,h): glViewport(0,0,w,h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, float(w)/float(h), 0.5, 1024.0) glMatrixMode(GL_MODELVIEW) def onKeyPress(self,*args): if args[0] == chr(27):#ESC Key self.eXit() elif args[0] == "w": self.playerX = self.playerX+self.moveVel*math.sin(self.playerRot*math.pi/180.0) self.playerZ = self.playerZ+self.moveVel*math.cos(self.playerRot*math.pi/180.0) elif args[0] == "s": self.playerX = self.playerX-self.moveVel*math.sin(self.playerRot*math.pi/180.0) self.playerZ = self.playerZ-self.moveVel*math.cos(self.playerRot*math.pi/180.0) elif args[0] == "a": self.playerRot = self.playerRot+self.rotVel elif args[0] == "d": self.playerRot = self.playerRot-self.rotVel elif args[0] == "q": self.camY = self.camY - 1.0 elif args[0] == "e": self.camY = self.camY + 1.0 if self.camY <= 10.0: self.camY = 10.0 if self.camY >= 180.0: self.camY = 180.0 glutPostRedisplay() def eXit(self): #destroy glForm sys.exit() if __name__ == "__main__": thirdPersonApp() [/code] it's a bit messy because it is so old and based off of a delphi application, but it should help you to better understand gluLookAt
  6. OMG you like DX better than GL... Many people in the world of DX (including myself) complained endlessly over features simply removed from the spec without deprecating, consulting or providing support from 7 upwards. OpenGL does provide full easily readable specification, that deprecates and has a wide base of developers, who develop for multiple platforms. Also OpenGL is extremely OOP! Just consider that encapsulation, abstraction, modularity, polymorphism, messaging and inheritance (wikipedias definition of OOP is completely met by OpenGL! Just thought I should point that out [quote name='oggs91' timestamp='1314867902' post='4856202'] [quote name='pcmaster' timestamp='1314866866' post='4856198'] You're really risking a huge flame-war here by calling either "cleaner", "better" or anything similar :-) Truth is that extensions get into OpenGL quicker (in fact you have to wait for Microsoft until they make up their minds to use [b]anything [/b]the new cards support!!!). Khronos don't change the whole API as much as Microsoft every time, fortunately. New features (functions) become available, some are deprecated, some finally removed. The whole concept persists. Same goes for OpenCL. Start learning directly OpenGL 4. No mather what, do NOT look at OpenGL 1.x, ever :-) That, unfortunately, disqualifies most of the famous NeHe tutorials, for example, hehe. Start with desktops, learn basics and do not touch OpenGL ES (mobile) before that much, if you plan to. [/quote] nehe was the first i had a look at xD looked quite old to me too^^ what tutorial source would you suggest =) ? or are there any recommended books for opengl4 ? i'd like to have an overview and basic techniques used in opengl beginning with - viewports over - view matrices for a camera, - how to use a fbo, - different techniques of drawing (read about displaylists, vertex arrays and vertexbuffers, different opinions in every spot i've read) - usage and need of shaders in opengl4 [/quote]
  7. Hi, [quote name='Wilhelm van Huyssteen' timestamp='1311070045' post='4837300'] Hi. Im currently writing an FPS. I allready have a working level and collisions between the player and the floor/walls work fine. I Test the players collision box with the floors/walls collision boxes using this simple logic. [code] boolean valueInRange(float value, float min, float max) { return (value >= min) && (value <= max); } boolean rectOverlap(Rect A, Rect B) { boolean xOverlap = valueInRange(A.x, B.x, B.x + B.width) || valueInRange(B.x, A.x, A.x + A.width); boolean yOverlap = valueInRange(A.y, B.y, B.y + B.height) || valueInRange(B.y, A.y, A.y + A.height); boolean zOverlap = valueInRange(A.z, B.z, B.z + B.depth) || valueInRange(B.z, A.z, A.z + A.depth); return xOverlap && yOverlap && zOverlap; } [/code] But that obviously doesnt work if i need to test the players collision box against a rotated collision box like for example a ramp. I can calculate the coordinates of the 8 corners of the rotated colision box in world space but how would i determine if it intersects with the players colision box. Its a givin that the players collision box will never be rotated for incase that helps. Any help appreciated. Thnx in Advance! [/quote] I'm not sure why it matters if the players box would be rotated? I use code similar to this code [code] boolean rectCol(Rect A, Rect B) //rectangle collision because overlap is such a long word ;) { bool xCol = (A.bbMin.x <= B.bbMax.x) && (A.bbMax.x >= B.bbMin.x); bool yCol = (A.bbMin.y <= B.bbMax.y) && (A.bbMax.y >= B.bbMin.y); bool zCol = (A.bbMin.z <= B.bbMax.z) && (A.bbMax.z >= B.bbMin.z); return xCol && yCol && zCol; } [/code] Of course this is not live code, it was whipped up just to demonstrate the simplicity of such code. Also if the language supports it pass addresses around as they are obviously smaller than passing whole complex objects! hope this helps there! Ramp collision should be implemented with the same bounding box collision, but then you would need to find the collision point within the box to test if the "player" is colliding with the ramp
  8. [url="http://en.wikipedia.org/wiki/Law_of_Demeter"]http://en.wikipedia..../Law_of_Demeter[/url], I have never heard of it before (although I have heard about encapsulation and abstraction) and I did know that it is naughty (not wrong) to assume a class has a class that has a function, but basically I think laws like this stifle common sense, it may not be very OOP to occasionally ignore this rule, but I can imagine significant code bloat and mind-boggling if it were universally applied to every single project or class. Having said this the engine->torque example was absolutely exemplorary. As a side note, in environments such as ECMA, could a person not chain evaluations to nullify the negative effects of such assumptions so: [code]eval("car57").eval("getEngine()").eval("getTorque()")[/code] As I understand it ECMA script provisions for all objects having internal evaluation and returning NULL (which is an object in ECMA I think) so does this destroy the need for demeters law Update: Just checked and I was wrong about ECMA, it cannot solve this problem but a solution would be some sort of managed code
  9. So basically the article suggests using a bool sometype::init() instead of the constructor object for allocating resources as init can fail gracefully and constructors will just create massive mem leaks. I actually agree 100% with the article on this issue and would like to suggest http://www.scs.stanford.edu/~dm/home/papers/c++-new.html as a good read on the subject of constructors
  10. I see! You would be best making it online then because it will be much easier, and nobody will have to install anything. As an added benfit people being online would be a given because D&D is a collaborative game (not single player). There are lots of freeware editors for html out there and basic javascript can load and save cookies of what each player has typed. you would also need a simple backend to be programmed in a server-side scripting language but it's all quite easy to do. You will need a web host with php or similar scripting language support and the rest of the information can be located through google and w3schools which are both free. Personally I know the webhost I use is affordable at only $10 per month (www.dreamhost.com) so get cracking and I will definately look forward to seeing what you come up with. Also after clarification from ApochPiQ about the intention of the response, I would like to apologise as I must have completely misinterpreted the post sent by you
  11. right personally I don't care what anyone's opinion is because I work on many different hardware platforms and get paid for what I do, if pixels are set then it is an image FULL STOP! You can abstract an issue as much as you like, and encapsulate it in various classes and give it fancy names but as long as you set pixels, your drawing an image. Drawing a font is an image action where the images width and height are relative to the resolution of the font, this is called raster text, it works with windowing toolkits, hardware accelerated libraries such as opengl and the result can be translated to devices like lcd's and braille output devices. Secondly, to the OP, I apologise for all this noise and that is the only thing I can describe it as but there is not a name for the system, although the process of combining images is called compositing. Are you looking for a framework that allows you to simplify this process or are you just asking how it would work because it can be simple or complex depending upon what you want to get out of it. drawing ascii characters for example is much easier than drawing wide characters 255 values vs 65535 values assuming in both cases loose one possible value to signify invalid data. You can PM me if you like or try to be more specific, no matter how trivial all details are needed for giving a fuller answer [b]Edit:[/b] Just seen your screenie, are you looking to implement this for the web or in a traditional application, because if it is for the web use input text boxes like below (note please do not copy and paste because this is not optimal code) [code] <div style=" background: url('./bg-img.jpg'); width: 100%; height: 100%; "> <div style="position: absolute; left: 50%; top: 50%; margin-top: -100px; margin-left: -150px; width:200px; height: 200px;"> some visible uneditable-text<br/> <input type="text" name="whatever_name" id="whatever_name" size="20" /> </div> <div style="position: absolute; left: 50%; top: 50%; margin-top: -100px; margin-left: 50px; width: 200px; height: 200px;"> some visible uneditable-text2<br/> <input type="text" name="whatever_name" id="whatever_name" size="20" /> </div> </div> [/code] If it is application code then it will be more complicated because you would need to program the classes such as input, also if you were drawing with opengl you could use glScissor command to only re-draw the textbox Edit2: by the way to only show the box of text is called clipping and using glScissor is one way of doing this, another way is to draw the text from right to left until the pixel position is less than the textboxes x component, but this is only for an application
  12. John Carmack is GOD and he regularly influences history to display his greatness. He created the agents in the film "The Matrix" because NEO was going to overload his matrix stack implementation, and at the end of the film you see the real John Carmack who pilots the John Carmack, we see's automaton body
  13. [quote name='ApochPiQ' timestamp='1314756559' post='4855712'] Are you talking about a web page? A custom program? A magical parchment? "Images" generally implies static visual content. Overlaying a text field on top of an image is pretty easy (in most design toolkits). Is that what you mean? [/quote] [quote name='Nanoha' timestamp='1314784498' post='4855812'] What are you trying to make this game in? web-based? [quote name='Lewis_1986' timestamp='1314782344' post='4855801'] @ApochPiQ, seriously the old addage "if you cannot say anything helpful, be silent!" springs to mind because mocking someone and then telling them what they want to do is trivial helps no-one [/quote] To me it comes across as "Trying to understand the question more fully", rather than mocking. Good questions get better answers, ApochPiQ seems to be trying to get a better question. [/quote] Seriously I hope I'm wrong but I cannot see why someone would take that mode of reply as a probe for more information? If it was a genuine probe I do apologise, but as an educator I see alot of people quitting very early on, simply because they do not understand a concept and when they ask a question the response stifles their interest. Also I do not see that it matters how the system of compositing would be implemented. Unless there is a system out there that uses elliptical co-ordinates, the basis is the same... html, xhtml, flash, c++ (winforms, sdl etc) all use rectangular co-ordinate systems for describing objects positions and bounds. I do hope that the original poster has a greater understanding of a way to draw text and images together and that if they do not, that they continue to seek answers and probe further.
  14. well the simplest way is to treat the text as an image, create a larger image representing the entire area that the text and images exist on and draw each object. Of course this all sounds very simple to an experienced programmer but I recognize some people may have trouble so i'll try to break it down a bit more for you 1) a glyph is the description of a character so it would have an x and y origin and an x and y extent (xorigin+width and yorigin+height) 2) the glyph would also contain a series of points with their position within the glyph (again x and y) and intensity, because if all points had the same intensity it could only represent a solid block or empty block, which would result in aliasing (blocky text) 3) once you have these points and have created a texture that is the size of the glyph, you can set each pixel to the value of the color you wish it to be with alpha multiplied by the intensity from the point (this will create anti-aliased text that is transparent and most computers now support rgba colours) 4) work out how large each entire piece of text is and draw each glyph in the text 5) draw the text and images onto the larger image N.B. every object will have a display rectangle, so text, images, characters (which make up text) and the drawing area can all be described and should use a rectangle to descirbe their position and extent @ApochPiQ, seriously the old addage "if you cannot say anything helpful, be silent!" springs to mind because mocking someone and then telling them what they want to do is trivial helps no-one
  15. the reason the file is only a few hundred kilobytes, rather than tens of megabytes or even gigabytes is because data is stored in binary mode and there is a maximum map size. Also because data is serialized in binary, rather than ascii mode, things like PLAYER1_START_LOC would probably just be stored in a structure as the value (the structure would probably have all of the start locations and may even have the name start_locations. Remember not many apps store their variable names (unless the data is a scripting language like lua or html) but rather use them as a tool of high-level programming to assist us the programmers to visualise a mental model of how the application works. Also there is a sourceforge project that works with w3g files in php which is about as high level as you could get for working with the format. http://sourceforge.net/projects/w3rep/ and one in delphi http://sourceforge.net/projects/dw3gparser/ They probably have comments in their code that will assist you, but please do not think studying someone elses format will lead you to an optimal solution because warcraft 3 was written many years ago and there will have been paridigm shifts in aspects of computing in general and gaming