• 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

100 Neutral

About Purebe

  • Rank

Personal Information

  • Location
    Richmond Kentucky
  1. I have no idea but I have to comment on how awesome that is!
  2. Yeah I just finished designing my own grid generating code (turned out eerily similar to the code I was referencing....wonder why [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]) -- but I understand it now. It's a lot simpler than I thought, I get overwhelmed easily sometimes in math sort of subjects. To me this seems to be a better way of doing grids than loading a mesh grid if you want to use the grids to "place" objects at the right coordinates (as a "reference" grid). My goal is to design a 3D level editor that is rather intuitive to use, as if you were walking around in say Minecraft and building (except with meshes, cameras, lights, etc, rather than blocks) Then I'm going to use that as a basis for the games I make in XNA with 3D, and as I go along add more and more functionality to the level editor. I feel like doing grids (generated this way) is more accurate than using meshes, but I'm probably wrong on that. Maybe it's just a preference thing? Next up: generating grids with triangle's rather than rectangles as the "meat"
  3. Ah well I understand the code, it's getting my head around the method it's using to create the grid, and I'd like to be able to extend it into the y direction as well, also to be able to do it with different primitivetypes etc. I was hoping for a more complete reference to getting all of that geometry "down" or something. I'm not sure of the right words to describe what I mean here, sorry. This particular bit of code is a beginning and I can probably extend onto the rest of what I want to do from it, but, I imagine there has to be a standardized way of doing these sort of things and I think that's what I'm really looking for. Thanks for the explanation though!
  4. Hey, I'm trying to really understand the idea of drawing a grid in 3D space, it seems fairly simple but on my own I'm just not getting it too well. I 've been able to only find a single source on the topic at all and it was just to give some code with no explanation. I can pour over this code if I have to in order to understand this concept but since it seems very important I'd like to understand it through and through and I was wondering if anyone knew of any good reviews of the topic? Thanks! Here's the code if anyone is interested: [code] public class Grid { private GraphicsDevice device; private GraphicsDeviceManager graphics; private ContentManager content; private Matrix worldMatrix, viewMatrix, projectionMatrix; private BasicEffect basicEffect; private VertexBuffer vertexBuffer; public Grid(GraphicsDevice graphicsDevice, GraphicsDeviceManager graphicsDeviceManager, ContentManager contentManager) { device = graphicsDevice; graphics = graphicsDeviceManager; content = contentManager; } public void LoadContent() { float aspectRatio = (float)device.Viewport.Width / (float)device.Viewport.Height; float fov = MathHelper.PiOver4 * aspectRatio; worldMatrix = Matrix.Identity; viewMatrix = Matrix.CreateLookAt(new Vector3(0.0f, 2.0f, 2.0f), Vector3.Zero, Vector3.Up); projectionMatrix = Matrix.CreatePerspectiveFieldOfView(fov, aspectRatio, 0.1f, 1000.0f); basicEffect = new BasicEffect(device); basicEffect.World = worldMatrix; basicEffect.View = viewMatrix; basicEffect.Projection = projectionMatrix; basicEffect.LightingEnabled = false; CreateGrid(10, 10, 5, 5, Vector3.Zero); } public void UnloadContent() { if (vertexBuffer != null) { vertexBuffer.Dispose(); vertexBuffer = null; } if (basicEffect != null) { basicEffect.Dispose(); basicEffect = null; } } public void Update(GameTime gameTime) { worldMatrix *= Matrix.CreateRotationY(0.005f) * Matrix.CreateRotationX(0.005f); } public void Draw() { device.SetVertexBuffer(vertexBuffer); basicEffect.World = worldMatrix; basicEffect.CurrentTechnique.Passes[0].Apply(); foreach (EffectPass CurrentPass in basicEffect.CurrentTechnique.Passes) { device.DrawPrimitives(PrimitiveType.LineList, 0, vertexBuffer.VertexCount / 2); } } // Algorithm/code thanks to: http://8bitmemories.blogspot.com/2010/01/simple-grid-in-xna.html public void CreateGrid(int width, int height, int rows, int columns, Vector3 position) { List<VertexPositionColor> vertices; vertices = new List<VertexPositionColor>(); int xDiff = width / columns; int zDiff = height / rows; float xBase = position.X - width / 2.0f; float zBase = position.Z - height / 2.0f; float yBase = position.Y; for (int i = 0; i <= rows; ++i) { vertices.Add(new VertexPositionColor(new Vector3(xBase + i * xDiff, yBase, zBase), Color.White)); vertices.Add(new VertexPositionColor(new Vector3(xBase + i * xDiff, yBase, zBase + height), Color.White)); } for (int i = 0; i <= columns; ++i) { vertices.Add(new VertexPositionColor(new Vector3(xBase, yBase, zBase + i * zDiff), Color.White)); vertices.Add(new VertexPositionColor(new Vector3(xBase + width, yBase, zBase + i * zDiff), Color.White)); } vertexBuffer = new VertexBuffer(device, typeof(VertexPositionColor), vertices.Count, BufferUsage.WriteOnly); vertexBuffer.SetData<VertexPositionColor>(vertices.ToArray()); } }[/code]
  5. @Nico: I'm trying to understand how the final rendered scene is set up. My current "understanding" is that for any entity you take that entities world matrix, multiply it by the projection and view matrix, and then preform that transformation matrix on the entity itself. Then if that entity is visible from the origin it should be rendered on screen, and if it's not that's how we know not to render it in the final scene. Hopefully this is correct. @Trienco: That helps me understand the view matrix and world matrix relationship much better, thank you! (actually it seems your entire post is exactly what I was looking for, but as I wrote above I'm not entirely certain I get it yet but I think this makes sense.) PS: Is there any way to enable spell checking on these forums? Fire fox usually works in these boxes but it doesn't seem to want to on this particular website
  6. Okay, so that means that the world matrix is actually just defining properties of an entity in the world (more precisely, it is multiplied by the "position" matrix of each entity to get them properly situated in world space) But...what is being multiplied by the view matrix? Each entity in the world space that can be seen looking out from where the view matrix position is? (But that can only be determined by the projection matrix...but what does the projection matrix get multiplied by?) I'm starting to get a better understanding of it I believe but I'm still not clear on the view matrix and the projection matrix. I understand that the view matrix "sets up" the camera and the projection matrix "sets up" what it can see, I think, but, I don't understand how that is achievable by matrix math?
  7. Okay so the view matrix represents where I'm at and objects that should be visible based off the projection matrix (I'm still confused on this one. What gets multiplied by the projection matrix?) are multiplied by the view matrix to position them into the area where they should appear so when they are rendered to the screen they look right? My deduction here seems really off. If you do not need a seperate view and world matrix, are they put together somehow or do they interact with different objects? I'm not sure that makes sense either. If I knew more about this I'd be able to ask better formulated questions but as is I'm just really mucked up, sorry.
  8. I'm reading 'Beginning XNA 3.0 Game Programming's chapter on 3D programming math. I had a univesity class (3D game design) where I pretty much screwed up a good chance to learn the math because I was slacking and now I'm actually interested and I need to learn the math behind it all so I can do it proficiently. With that out of the way...I feel like I'm getting this stuff (since I've already made a few 3D games before in XNA 3.1 my ideas here are somewhat clear, but I was really just trail n erroring my way through most of the 3D stuff) because it makes a lot of sense in retrospect. BUT...the book is not very clear on the following and I'd like come help to clear it up: 1. Since XNA uses a right-handed coordinate system objects with a negative Z values are what would be visible if the camera was at the origin. What I'm a bit confused on is this functions parameter and how it works: [code]Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10.0f) // parameters: FOV, Aspect Ratio, Near View Plane, Far View Plane [/code] The book explains it like this: [quote]... then create a perspective projection matrix, "looking" in a 45-degree angle as the field of view. The rendering happens for objects from 1 to 10 units from the screen (z values from -1 to -10).[/quote] I'm confused because it seems to me if the near view plane is set to be 1.0f, it should be at 1.0f along the z axis, which would be behind the screen, going further out behind the screen to 10.0f at the far view plane. However, it's saying this isn't the case, and I have a few ideas about why that might be but none seem obvious enough to not warrant asking for clarification. 2. What are these matrices {'view', 'world', 'projection'...etc} It lists the following as definitions of each matrix: [quote]View: defines the camera position and direction. Usually created using Matrix.CreateLookAt. Projection: used to map the 3D scene coordinates to screen coordinates. Usually created through Matrix.CreatePerspective...etc World: used to apply transformations to all objects in the 3D scene.[/quote] This gives me a great idea of what they are used for but I'm fuzzy on what they are. Here's my foggy understanding of each: View: My understanding is that this is the camera "in concept." In other words, every frame a camera matrix (which is a hard idea for me to get, a camera is just a matrix? Not that it would be able to do anything just as matrix, but you know what I mean maybe?) at origin, and then it's translated, rotatated, or whatever by matrix multiplcation with this view matrix. Projection: This seems to be the "functionality" of the camera. I have no idea what gets multiplied by this matrix or how it's used, REALLY foggy on this one. World: I'm also really foggy about this one. It almost seems like if every objects position matrix is multiplied by the world matrix then that is what sets up the scene for rendering, but, if that's the case then you aren't really using cameras you are just using a camera at origin and moving the entire world to fit your scene? Confusing. Sorry about the length of the post, trying to be as concise as I possibly can be.
  9. Hm...originally I had intended to do that but somehow I forgot about it...Something about my planning not being very good no doubt. Anyway, thanks for reminding me. But I still will have the problem of organizing them in the code. edit: @jyk: Thanks for the suggestions, they look right along the lines of what I was hoping for. That thread also looks like it will be a good resource, thanks a lot!
  10. I'm writing a level editor for my game and to simplify resource management I want to write a image manager class that I can use in both the level editor and my game. The idea that I currently have is basically every image is loaded into the image manager class and stored into a vector like this: std::vector<pair<SDL_Surface *image, int id>> m_imageList; Then have a header file that I'll share between them that looks like this: #define GRASS_TILE 1 #define STONE_TILE 2 #define CRATE_SPRITE 3 // .. etc etc Then, when I start up the image manager class I load each image in the same order that the header file uses. I'm worried that this is going to bite me in the ass later on somehow, so I figured I'd ask if there is a better way of doing something like this that I could look into?
  11. Thanks for the replies. After reading them and doing a bit of testing I believe you two are right, the jitter is being caused by the FPS not being stable. When I have my, botched, version of v-sync on, even though I'm running a steady ~62FPS it still doesn't give each frame the same amount of time, which causes the speed ups and slow downs as objects move across the screen. This became very apparent when I let the frames run unlimited and it would fluctuate between 700 and 850 FPS. Thanks for the link to fix my timestep, looks like that's what I need to do. PS: I got SDL_PollEvent() to work properly by removing my event handling code from my UpdateGame() function, and writing a HandleEvent() function that is now looking like this: while ( gamedata.game_loop ) { // Poll for all events while ( SDL_PollEvent(&gamedata.sdl_event) ) { HandleEvents(); } UpdateGame(); // Run game logic // .. } Makes sense when I think about it now, but dunno guess it just didn't before - either way thanks for the help!
  12. Hm..that is the structure I saw in the documentation however when I use that structure I have the problem of nothing happening unless an event is triggered. So I have to keep moving the mouse around or pressing keys to send events so each frame is rendered, because it waits on SDL_PollEvent() to find an event before doing anything. I haven't seen any information on that at all while looking through the documentation, so I'm not really sure what to do in that case.
  13. Are you calling the stretching functions each frame or are you creating new SDL_Surfaces for each of the stretched images and then using those each frame (I imagine it would cause a pretty severe slow-down to have to stretch everything each frame - although I could be wrong.)
  14. Hi, so, I'm trying to determine what the proper game-loop should look like in SDL, I currently use something like this - but I can't seem to find any resources on whether or not I'm doing it properly: int main(int argc, char* args[]) { // Initialize the game InitGame(); // Load the game resources LoadGame(); // Game Loop while ( gamedata.game_loop ) // This is a bool set to true until exit { // At the start of a frame we want to start our FPS timer timer_reg_fps.StartTimer(); // Grab the latest event in the event-queue SDL_PollEvent(&gamedata.sdl_event); // Update the game each frame UpdateGame(); // This runs game-logic // Render the game each frame RenderGame(); // Effectively this calls an SDL_Flip() to update the screen // Regulate the FPS - keeps the FPS around 60 if ( gamedata.vsync ) { // Check if we need to sleep if ( timer_reg_fps.GetTicks() < (1000 / gamedata.vsync_fps) ) { // Sleep SDL_Delay( ( 1000 / gamedata.vsync_fps ) - timer_reg_fps.GetTicks() ); } } // At the end of a frame we want to reset our frame timer timer_reg_fps.StopTimer(); // Now reset it timer_reg_fps.ResetTimer(); } // Unload resources UnloadGame(); // Exit program return 0; } At the start of UpdateGame() function I call an ClearScreen() command that effectively does SDL_FillRect() on the screen that will be SDL_Flipp()'d each frame in RenderGame(), then I redraw the entire scene. Unfortunately I don't know how to make this a clear and concise question, so I apologize for that - but my game tends to jitter a bit as I move along (it's a side-scroller very much like Mario) and I'm not sure if I'm doing something blatantly wrong here or if it's just to be expected when using SDL. (It's not a very noticeable jitter, I probably only notice it because I'm the one writing the game.)