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

andrew111

Members
  • Content count

    93
  • Joined

  • Last visited

Community Reputation

310 Neutral

About andrew111

  • Rank
    Member
  1. You might find these interesting:   Game Developer Dec 2012 p36 - recording unity - Building a replay system in Unity http://twvideo01.ubm-us.net/o1/vault/GD_Mag_Archives/GDM_December_2012.pdf    Game Developer May 2008 p46 - IMPLEMENTING DETERMINISTIC PLAYBACK SYSTEMS http://twvideo01.ubm-us.net/o1/vault/GD_Mag_Archives/GDM_May_2008.pdf   Game Developer Jun-Jul 2008 p47 - IMPLEMENTING DETERMINISTIC PLAYBACK SYSTEMS PART 2 http://twvideo01.ubm-us.net/o1/vault/GD_Mag_Archives/GDM_JuneJuly_2008.pdf
  2. If the implementation language doesn't matter, there is a library for Scala called Kiama at https://bitbucket.org/inkytonik/kiama   I don't remember all the details since it has been a while since I used it, but it uses a "packrat parser". Which you basically write the grammar directly in Scala, and specify the classes/params to be used to build the syntax tree.   Attributes are declared in recursive tree-like  expressions. We used the attributes for things like calculating scope and constant expressions, I forget what else, but I remember it being really easy at the time.   Another option is to use Ragel for lexing and Lemon for parsing. These can be used to generate parsers in C.   http://www.colm.net/open-source/ragel/ http://www.hwaci.com/sw/lemon/  
  3. Try this: Display *display; Window win; Atom wmDelete; void onInit() { wmDelete=XInternAtom(display, "WM_DELETE_WINDOW", True); XSetWMProtocols(display, win, &wmDelete, 1); } void onUpdate() { XEvent ev; while(XPending(display)) { XNextEvent(display,&ev); if(ev.type==DestroyNotify) { //on exit } if(ev.type==ClientMessage && (Atom)ev.xclient.data.l[0] == wmDelete) { //on close window } XFreeEventData(display, &ev.xcookie); } }
  4. Looks like a cut down version of stencil shadow volumes. Where it draws the shadows quads to the stencil buffer, and then the lit things are drawn except for the pixels marked by the stencil buffer. Pretty neat idea, looks like it would work for any N sided polygon.   You can't do it in a vertex shader since you can only access one vertex at a time, where as that algorithm needs access to two. Also I think vertex shaders can spit out only one vertex at a time, where that spits out 4. If you had geometry shaders you could do it there but that's opengl 3.3+.   Edit: Actually you could pass more than one vertex to the shader by doing something like for verts in quad or triangle {   glVertex4f(cur.x,cur.y,next.x,next.y); }   But I don't know if you are able to emit more than 1 vertex from the shader. If you could, it might be possible...     Edit2: Actually I just realised another idea, where you send a quad for each edge, e.g. for each edge {   glBegin(GL_QUAD);     glNormal(edgeNor.x,edgeNor.y,0);    glVertex3f(cur.x,cur.y,0);//0 represents the vertex on the edge to not extrude     glNormal(edgeNor.x,edgeNor.y,0);   glVertex3f(next.x,next.y,0); //0 represents the vertex on the edge to not extrude     glNormal(edgeNor.x,edgeNor.y,0);   glVertex3f(cur.x,cur.y,1); //1 represents the extruded vertex     glNormal(edgeNor.x,edgeNor.y,0);   glVertex3f(next.x,next.y,1);//1 represents the extruded vertex   glEnd(); }   Basically in the vertex shader you: 1. redundently do the dot product check to see if a shadow should be extruded. Pass a varying float to there fragment shader, where if shadow pass 1, else pass 0 2. If the vertex.z ==1, extrude the vertex along the light direction.   Fragment shader: 1. Check the varying float passed from the vertex shader, if == 0 then call discard to abort drawing the shadow   Kind of convoluted, but it should/could work.
  5. This library really needs some kind of docs or at least example code, I wasn't able to figure it out.
  6. Thanks, I'll give it a try when I get time.
  7. Okay, after Álvaro's question I realised I was confusing the problem. for two triangles sharing an edge I want to find out whether they are facing away from each other, facing towards each other or laying flat (same normal).   So a slight change from  C0lumbo's method, I dot product the normal from the first triangle to the non shared edge of the second triangle, where dotproduct=0 is both triangles laying flat, dotproduct<0 facing away (convex), dotproduct>0 facing towards (concave).   Seems like it should work.
  8.   Yes this was the problem I ran into, I'll give your suggestion a try.     The triangles are part of a 3D mesh, so I'm trying to tell if they are concave or convex, so >= PI is convex and < PI is concave.   The vertices are winded clockwise so the triangle normals always on the outer surface of the mesh.   EDIT:   Ah I just realised what you meant, I've been looking at the problem a bit wrong. I'll have think about this a bit more and get back to you.
  9. Hi I have two triangles sharing an edge and I have their normal vectors. Na          Nb  \    F   /   \  /|\  /   \/ | \/    /\ | /\    \  | /     \ | /     \|/       G (Na and Nb are the triangle normals, F and G are their shared edge) I want to check if the angle between the normals is: = 0, < PI, = PI or > PI.   I'm a bit rusty on 3d related math, but I looked at dot product and I don't think that works since I believe it can only be used to find the angle between 0 and PI, where as I  want between 0 and 2*PI.   I think maybe something could be done with cross product, e.g. since normals are unit length I have: Na * Nb = sinX*V (V being the cross product, X being the angle).   But I don't know where to go from there.       I've looked at this post from a similar/same question: http://www.gamedev.net/topic/112385-detecting-if-2-triangles-are-concave-or-convex/?view=findpost&p=1604381     But in this I don't understand what the a1 and a2 is (I'm guessing something like sinX), or what he means on the second step, compute the components?   Thanks.
  10. OpenGL

    If you mean to combine the results of multiple shader programs into one, I think you will have to render the mesh to a texture with each shader program, and then blend the results together (probably using another shader program).
  11. When I learn a new language I usually find a decent book to go through, where I go through each of the language features, e.g. syntax, modules, classes, functions, data types, inputting/outputting text etc, while trying out some small examples from each part (just so I don't immediately forget) and spending only enough time to get an idea of how each work (nothing in depth). Then once I've got all that down I'll flip through the standard libraries and write some examples on any that interest me, while just making mental notes of the rest of the libraries so I know whats available if I ever need them. Then after that like others have said, working on various projects that interest me, or for whatever reason I picked that language.
  12. [quote name='jeffkingdev' timestamp='1352837944' post='5000654'] I'm not sure what LuaJIT is, [/quote] Well one thing you can do is use c code from within it. I've just started looking at LuaJIT recently, and an idea I had apart from scripting world objects, was to use it to setup all the monotonous code, such geometry data (eg vertexarrayobjects, vertex buffers, attribute bindings, index buffers etc), shader programs, textures, texture samplers etc. Using luajit ffi to minimise the amount of cbindings necessary. And then in your main program, load those 'resource files' into a table and just say: [code] load_resource("shader_program.lua"); lua_getfield(L,-1,"prog"); GLuint program = *((GLuint*)lua_touserdata(L,-1)); lua_pop(L,2); .. glUseProgam(program); [/code] A resource file might look like: [code] prog = CreateShaderProgram { {"vert", [[ attribute vec3 a_pos; void main() { .. } ]]}, {"frag", [[ void main() { .. } ]]}, {"attrib", "a_pos", 0}} vao = CreateVertexArrayObject { .. } [/code]
  13. The [i]More OpenGL Game Programming[/i] book's [url="http://glbook.gamedev.net/GLBOOK/glbook.gamedev.net/moglgp/code.html"]source code[/url] has an example under [i]Chapter09/SkyDomesWin32[/i]. I'm not sure if the book explains it or not.
  14. [quote name='antiHUMANDesigns' timestamp='1340547802' post='4952317'] Don't you agree that C++ without OOP could just be C instead? Most of the improvements in C++ are related to abstraction. If you chose to ignore those, you might as well go with C? Do note that I'm trying to teach a beginner the difference between C and C++. I dont have any other agenda here. But don't get me wrong, I never meant to claim that you can't write C++ procedurally. I agree that it will compile, but I'm also quite sure that the only reason it will still compile is because C++ never got a chance to get free of C. Stroustrup himself says that C is obsolete, and that he wants C++ to be free of it. [/quote] I'm not sure if you've programmed in c, I've used it a bit for writing libraries, and the main problems I have with it, are things that c++ has introduced shortcuts for, and of course its painfully lacking of the standard template library (So you have to implement your own lists, hashmaps etc). So not defining classes isn't really equivalent to c code. [quote name='antiHUMANDesigns' timestamp='1340550633' post='4952331'] And mixing procedural and OOP is the same application simply feels right-off stupid to me. I see no defense for it. (OR, more correcly: I see no defense for ME to do that.) [/quote] I know the feeling, I dislike mixing functional code with imperative code, but I think procedural and oop can fit together fine. I know the feeling of over obsessing with oop from when I first started programming. If you want to see programming from another perspective, to see why oop isn't so important, you should look at a functional language like scheme ([url="http://racket-lang.org/"]racket[/url] is a good implementation) or [url="http://www.haskell.org/haskellwiki/Introduction"]haskell[/url]. Also if you're interested in alternate oop systems, look at [url="http://www.gigamonkeys.com/book/object-reorientation-classes.html"]clos[/url] (common lisp object system), I think it's a vast improvement over the c++/java/c# oop system. Knowing some of these things, I believe will help you put things in a better perspective.
  15. [quote name='antiHUMANDesigns' timestamp='1340513578' post='4952233'] but C++ does not run on a virtual machine like Java does. [/quote] That does not have anything to do with why c++ doesn't have an "Application" class for the main. riverreal is correct in that c++ is a multi paradigm language, which means you use oop where it helps, and procedural or functional (limited) programming etc where they help. And I don't think having an "Application" class helps at all, making a class to be instantiated once (except for cases of inheritance) seems like a wasted effort.