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

alejandro

Members
  • Content count

    23
  • Joined

  • Last visited

Community Reputation

142 Neutral

About alejandro

  • Rank
    Member
  1. OpenGL

    struct Rect { float x, y; float w, h; // true means there's a collision bool checkCollision(Ball & ball) { return ball.x > x && ball.x < x + w && ball.y > y && ball < y + w } }; struct Ball { float x, y; float w, h; float dir_x, dir_y; }; Rect paddle; Ball ball; void display(void) { if(paddle.checkCollision(ball)) { ball.dir_x *= -ball.dir_x; } } This may work :)
  2. Movement behaviour is a common topic on any AI for games  book, you can check this oune out: http://books.google.com.mx/books/about/Artificial_intelligence_for_games.html?id=1OJ8EhvuPXAC&redir_esc=y
  3. As i see, there's no best pattern... though I like to use managers since it's easier to me to read the code like this.
  4. Thank you very mucho for all your comments, I liked the idea on Performance vs Maintainability, also because a lot of the code I do is also read by other team members so it's important to have maintanable code   I'll take a look at the Game Engine book   Until know there's no clear best one, it appears as everyone has different approaches, that's what I am searching, how people create the architecture of the code.   Does anyone has an example on how MVC pattern will work in a videogame? particulary on Unity
  5. Hello,   I want to know if there are any game architectures that are recommended, well, actually I don't know if I can call them architectures or design patterns.   Basically what I want to know is how do you structure your games at a logical for example I tend to the following.   I create an object named GameMaster, this object controls the game (enemies, ambient, etc) and knows the state of everything in the game, the control is done through Managers, for example EnemieManager, AmbientManager, etc. This managers don't communicate directly, the communication has to go throught the GameMaster.   In a more plactical way say we have the following:   class GameMaster { Player player; EnemyManager enemyManager; GameStatus status; void update() { if(enemyManager.enemies == 0) { status = GameStatus.EndGame; } if(status == GameStatus.EndGame) { player.stopInteraction(); } } void draw() { drawString(status); } }   Sure, the managers can also have control of a few elements... what I see in some friends code is more like...   class Player { GameStatus status; void update() { if(status == GameStatus.EndGame) { player.stopInteraction(); } } void draw()     {          drawString(status);     } } class EnemiesManager { Player player; int enemies; void update() { if(enemies == 0) { player.status = GameStatus.EndGame; } } } So my doubt are, what is better? what is worse? are there any architecture/patterns for structuring the objects in the videogames?.   I follow the GameMaster pattern because it's easier to me to structure things like this, but maybe this is not the best pattern...     Any literature on the topic is appreaciated
  6. You could try using fbo's, [url="http://www.songho.ca/opengl/gl_fbo.html"]here's[/url] a good tutorial with a working example
  7. Solved, if I inverse the matrix I get the results that I expected, at the end the code is like the following [CODE] void camera::drawDebug() { glm::mat4 res = glm::lookAt(eye, target, up); res = glm::inverse(res); glMultMatrixf(&res[0][0]); glTranslatef(-eye.x, -eye.y, -eye.z); glutWireCube(1.5); } [/CODE] Don't know exactly why this works.
  8. I try it, still not there, it looks similar to previous result.
  9. I'm developing a camera class on OpenGL in C++, I want to see the position and rotation that the camera has when using gluLookAt(), for this I'm using glm::lookAt() function, it retrieves a matrix 4x4 and then I multiply the current stack matrix with the one that was retrieve, and then I translate the camera to the position. So my code looks like this [CODE] void camera::drawDebug() { glm::mat4 res = glm::lookAt(eye, target, up); glMultMatrixf(&res[0][0]); glTranslatef(-eye.x, -eye.y, -eye.z); glutWireCube(1.5); } [/CODE] with this code I get the following image, considering that the red cube is at the center(0, 0, 0), and the wire cube is the camera, eye is (0, 5, 5), target is (0, 0, 0), up is (0, 1, 0) [img]http://dl.dropbox.com/u/597069/quickimage.gif[/img] As you can see it appears that the rotation is applied correctly but the translation is not correct. I'm doing -eye translation because of what it says on the documentation of [url="http://pyopengl.sourceforge.net/documentation/manual/gluLookAt.3G.html"]glulookat[/url]. [quote] ...gluLookAt is equivalent to glMultMatrixf(M); glTranslated (-eyex, -eyey, -eyez); [/quote] Any ideas on how to fix the translation?
  10. Hi, A few weeks ago I was messing with the same stuff, you can get a working example in [url="http://www.alejandrrro.me/wp-content/uploads/2011/12/GLOrthoAndGLPerspectiveTest.zip"]here[/url](sorry for all the messy code, hope it's useful). Basically your display function will look something like this. [CODE] void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // you can get the width and height using glutGet(GLUT_WINDOW_WIDTH) or HEIGHT height = height==0 ? 1 : height; float ratio = width * 1.0 / height; // dibujado en 3D glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, ratio, .1f, 1000.0f); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); gluLookAt( eyex, eyex, eyez, centerx, centery, centerz, upx, upy, upz ); glPushMatrix(); { // draw 3D things in here } glPopMatrix(); // 2D drawing glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, width, height, 0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushMatrix(); { // draw 2D things in here } glPopMatrix(); glutSwapBuffers(); } [/CODE]
  11. Everything loads correctly now, what I did was, change the .mtl file in the line where's kd 0.000 0.000 0.000 to 1.000 1.000 1.000 and I was not correctly binding the texture.
  12. I'm a total noob on Maya, so far I know how to place a cube and map it through UV Mapping editor . I want to export the model in an .obj file with the texture (.dds) and then add it to the Game Engine (using Assimp). The obj loads correctly and the texture loads ok, but the model is black, so I try loading the obj on Assimp viewer and the model is black though it loads correctly the texture, so I'm thinking that there's something wrong with the obj file and the uv coords. Though in maya everything looks ok Can you tell me how to export correctly the model? The steps I follow are, select the obj, then file>Export Selection>*.obj, save Thanks!
  13. This page has a few OpenGL 4.0 tutorials: http://ogldev.atspace.co.uk/ and this site has almost any new functionality on OpenGL with an example http://ogl-samples.g-truc.net/
  14. I'm trying OpenGL 4.0 Tessellation and I want to apply it to an stablished model, my model is on .md2 format, I'm assuming that a Bezier evaluation will do with the evaluation shader, though I may be very very wrong. Anyways I'm stuck with the following instructions [code] draw() { glBindBuffer( GL_ARRAY_BUFFER, vboid) { ... glPatchParameteri(GL_PATCH_VERTICES, 3); glDrawArrays( GL_PATCHES, 0, size ); // size = how many vertices the model has ... } glBindBuffer( GL_ARRAY_BUFFER, 0) } [/code] The problem is that when it renders the model looks all messy and it certainly doesn't look like when I rendered it using glDrawArrays(GL_TRIANGLES, 0, size). Any suggestions on what parameters to use on glPatchParam... and glDrawArrays? Thank you
  15. [quote name='karwosts' timestamp='1313425340' post='4849445'] Are you using GLEW? [/quote] Yes, glew 1.6 [quote name='karwosts' timestamp='1313425340' post='4849445'] Can you make sure that it is loading glBindFragDataLocation? [/quote] I'm not sure how can I do that, but if I go to the definition on VS 2010 I found the header definition of the function [quote name='karwosts' timestamp='1313425340' post='4849445'] Maybe you can try using glBindFragDataLocationExt instead. [/quote] It worked, at least no compile errors, though I don't see anything