Advertisement Jump to content
  • Advertisement


GDNet Emeritus
  • Content Count

  • Joined

  • Last visited

Community Reputation

498 Neutral

About JWalsh

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Indeed. Another interesting take on this was from the 2012 DigiPen student project "Perspective". It's a 2D platformer, however you can rotate the camera and zoom in and out in order to change perspective. This allowed you to solve puzzles such as jumping over too large of gaps, or climbing under too small of walls just by changing the perspective.  
  2. JWalsh

    Is GLM fast enough for games?

    In your original post you asked about compatibility issues between GLM and Direct3D. If you're going to be using Direct3D for your graphics, just use DirectXMath for your math library.   DirectXMath is the public version of XNA Math - the math library that's part of the Xbox 360 Dev Kit (XDK) used by game companies to develop Xbox 360 games. It already utilizes SSE and SSE2 instructions and is about as fast as you can get.   Cheers and good luck!
  3. JWalsh

    Starting C#

    I find that all books on C# say about the same thing, as the language is well defined. The "information" is the same regardless of which book you read, it's just a matter of how the individual book presents it. With that in mind, it's often best to go straight to the source. Here are some informational links and online course which should hold the answers to all your questions. The first is the course, the second link is the homepage to the MVA course, and then the links get more and more technical from there, ending with the C# specification. It's the most terse to read, but there's no better authority than the language spec itself. And of course, as you learn more about C#, feel free to post your questions here and the community will be happy to answer your questions.   Programming in C# JumpStart (a MVA course) C# Virtual Academy C# Programming Guide C# Developer Center C# Reference C# Specificiation
  4. JWalsh

    DirectX 11 Draw Text

    Check out Ruefelt's OpenSource D3D Font Library. It's licensed under the MIT License. There's discussion about it here on as well. Cheers and Good luck!
  5. JWalsh

    So I want to be a game developer....

    I tend to be on the more nitpicky side with my code reviews, but I feel it helps to develop good habits early on. Don't feel like it was a smack-down. Learning is a process and the fact you started and finished a game - even Pong, is a huge step, as many people never even get that far. Again, kudos to you, and please don't get discouraged, that wasn't my intention. SpriteBatch allows you to specify the origin of an image as well as it's position. By default, the origin is in the top-left corner. However, if you move it to the left-center or center-center of an image, then you can vertically align to sprites by drawing them at the same vertical position. C# and Java treat classes about the same. The only real difference is that Java doesn't have structs, so everything is pass-by-reference. If something feels like it should be a class, go ahead and make it one. You can bing/google the design pattern for information on how to implement it. There's plenty of C# implementations out there as well for reference. Also, here's the Game State Management sample on the XBLIG website. Look it over. Enums are the same in C# and Java I believe. They are a way of defining a set of things in code, which can be identified by their symbolic values. Such as having an enum of dates, and giving them the values Days.Monday, Days.Tuesday, etc... See the C# Documentation for a full description with plenty of examples. Scroll down pass the member information. As an alternative, you can have the AI attempt to move up or down based on the "current" vertical position of the ball. So if the ball is at 200y, it'll change direction so the center is at 200y. Then, if you only update the AI every 10, 5, 2, 1, etc... updates, you can make the computer appear "smarter", as it'll respond more quickly to the current state. Nice way to provide a progressively more challenging AI. I did a find for //, and then scrolled to the bottom of the file to see how many lines of code there was. Nothing magical, or even relatively accurate. There's no ideal % or ratio that I know of for comments to code. In general, the goal is to make the code self-documenting, such that reading variable, class, and method names makes it 100% clear what is happening at a single glance. But, if that's not the case, either because of a complex algorithm, or a particularly interesting implementation detail, it's a good idea to add a comment. If I had to guess, I'd say my ratio is at about 10-20% or 1:7 comments per lines of code. Again, there's no magic number. Glad it helps, but please don't view it as a slap. They were just some friendly suggestions or direction, not reprimands. Go back and make the changes if you want practice in working with enums, using Finite State Machines, or object-oriented programming. If not, just incorporate those things into your toolbox as you move forward. Cheers!
  6. JWalsh

    Debugging (managed) DX11

    No. It's not an advertisement. It was my validation for why I think WinDbg is the best tool for doing low-level debugging of .NET. It was no more an advertisement than your mentioning ANTS or dotTrace. The commands weren't for you, I wrongly assumed you were an expert at WinDbg and didn't need them. The commands are for any readers who want to research why WinDbg is so powerful. It amazes me how, in spite of how small the industry is, people still feel like it makes sense to treat others with disrespect. Rather than being a douche, why not say "interesting... you seem to feel this tool is very powerful, and you work closely with some of the original .NET developers, perhaps there's something I may be missing." But instead, you jump right to "that's ridiculous". I guess your perspective changes with age and experience. /sigh
  7. JWalsh

    Debugging (managed) DX11

    You don't really know if it's overkill. At this point we don't know what exactly he's trying to do. DebugView works great if he's just wanting to see the Debug messages, but if he wants to set breakpoints, step, make changes to memory, etc... he's back to needing a debugger. My aim was to point out the WinDBG is better at debugging certain problems than Visual Studio (and other tools). It's all about using the right tool for the job. If you're not particularly fond of WinDBG's !DumpHeap or !EEHeap commands, that's cool. You're entitled to think my opinion is ridiculous. But I say that WinDBG is the only good way because WinDBG has tons of support for working with the heap. Being able to see how much memory is in each generation, where the pages start and end, being able to see how many objects of each type are in the heap (and where), and cross-reference them to see how much memory is being used by each and in total. Additionally, you can evaluate the class table for each type, etc... Heck, you can even investigate the LOH. And that's not to speak of any of WinDBG's other great commands. !Analyze, DumpStack, EEStack, DO, GCRoot, etc... I never feel more in control of the run-time and what it's up to than when using WinDBG. If you know of another tools that gives you that, I'm more than happy to change my perspective. I honestly haven't ever seen one, but would love some recommendations. I'm always interested in learning about new tools. Mark's tools are fantastic.
  8. JWalsh

    Debugging (managed) DX11

    Hey Shane, I see what you mean about not supporting mixed mode debugging. With the DX debug mode enabled, are you still seeing debug output in the output console? what do the exceptions look like that you're receiving? Also, you may try installing Visual C++ 2010 Express edition. Having both on your machine may give you more options. When an exception is thrown, you may just try attaching with the Visual C++ Native debugger if you can. And if all else fails, there is WinDBG. It's a difficult, somewhat cumbersome tool to learn to use (especially with managed code as it requires using the SOS extension), but is by far the most powerful debugger in the world. It is in fact the only good way to view the garbage collected heap for your application while running.
  9. JWalsh

    C++ Game Gui Programming

    Good suggestion, moved to FB. What API are you using for 2D or 3D graphics? Since "Game UI" is generally handled by the 2D component of whatever engine or Graphics API you're using, you'll want to start there specifically.
  10. JWalsh

    Debugging (managed) DX11

    Not sure what you mean by this. I've had no problem setting breakpoints, stepping through code, evaluating memory, callstacks, etc... What problems are you encountering? Also, which language and version of Visual Studio Express are using - VS 2008, 2010, or 2012? If you can provide more information about the problems you're facing, I'm sure we can find a solution.
  11. JWalsh

    So I want to be a game developer....

    Ok Chris, I got a chance to look at your Pong game. Here's some feedback if you're interested. Assets Don't duplicate art assets just to put an arrow in a different place in the menu. Instead, make the arrow it's own sprite, create one asset for the menu, then draw the arrow next to the menu item that is currently active. Unless you're looking for very stylized text, it's often better to use SpriteFont to draw text against menu background, rather than putting the text in the image directly. Then, if you decide to change the text, localize it, etc... it just requires changing a line of code, not re-visiting an image editing program. SpriteBatch works by drawing textures to the screen via 2D pre-transformed quads. Each time you switch textures for a different sprite, it has to do a sort of context switch. So instead of creating sprites as different image files, put them all in the same image file and use source rectangles to identify where in the sprite sheet to pull the texture from. This works for sprite sheets up to about 1024x1024. Anything bigger and you risk video cards not being able to load it effectively. Objects & Classes In your program you group data together such as this: [source lang="csharp"]int ballSpeedX = 5; int ballSpeedY = 1; int ballDirectionY = -1; int finalBallLocationX = -1; int finalBallLocationY = -1;[/source] This is the perfect place to create a Ball class. You can add to it [font=courier new,courier,monospace]ballTexture[/font] as well. In your update method you have several if-else statements to determine what the current state is and then process the logic for that state. Additionally, in your Draw method you have several if statements for what to draw. Instead, look at the State Machine design pattern. Each of those states can be their own class, and then inside of [font=courier new,courier,monospace]Game.Update()[/font] you'd just call [font=courier new,courier,monospace]curretState.Update()[/font]. In [font=courier new,courier,monospace]Game.Draw()[/font] you'd call [font=courier new,courier,monospace]curretState.Draw()[/font]. The logic for switching between states is then embedded within each state, and your Game's Update and Draw methods become nice and clean. Code Cleanliness You call [font=courier new,courier,monospace]KeyboardState gameState = Keyboard.GetState();[/font] in each of your game state blocks. Instead, just call it once at the beginning of your update method, and then use the keyboard state as necessary in the rest of the method. Even if you don't use an object to represent your game state code, you should switch from String to Enum for your game states. Enum is more type-safe, as string will allow the state to be literally any string value. Your use of [font=courier new,courier,monospace]lastState [/font]and [font=courier new,courier,monospace]state [/font]can be restructured so you don't really need lastState except when entering or leaving a menu screen. I'm not quite sure why you have [font=courier new,courier,monospace]finalBallLocation[/font]. I see you calculate it's value in several places, but don't immediately see it being used for much. There are several complicated if-statements, especially in the collision detection section. It's a good idea to make the code self-documenting to break those clauses up into smaller chunks and wrap them in methods. Perform static calculations once, and save the values. There are several places where you perform the following: ball.Y = Window.ClientBounds.Height / 2 - ballTexture.Height / 2; ball.X = Window.ClientBounds.Width / 2 - ballTexture.Width / 2; pos1.Y = Window.ClientBounds.Height / 2 - texture.Height / 2; pos2.Y = Window.ClientBounds.Height / 2 - texture.Height / 2; Not only is the code present in your source file more than once, but it's called each time you enter the restart state, or exit state, even though it's a known value from the moment your application loads the texture. So instead, perform the above calculations in Initialize or LoadContent so you only perform the calculations once. The same goes for things like this: spriteBatch.Draw(player2Restart, new Vector2(Window.ClientBounds.Width / 2 - player1Main.Width / 2, Window.ClientBounds.Height / 2 - player2Main.Height / 2), Color.White); That's a lot of calculations being performed each Draw, considering those are all known values. Compute them once, then keep re-using the calculated value. This is easiest if you create a Sprite class. Then you can create an instance of a Sprite for each object, set it's texture, position, etc... once, and just keep calling Draw on the sprite. Commenting Your code is over 800 lines, and there's about 5% commenting. Most of which are method headers that were auto-generated for you. If you're doing a complex if-checks, or if something isn't immediately readable, add a comment. Also, it's good to use comments to tell why you're doing something, not just what.
  12. JWalsh

    So I want to be a game developer....

    In truth, I think a Zelda style game is a pretty large jump from Pong. To implement a Zelda clone you need several systems that don't exist in pong or similar games. These include: Collision Map 2D frame-based animation 2D texture sheets RPG Gameplay mechanics AI Multiple Sound FX More UI elements A screen manager to deal with inventory/stat screen. Here on GDNet you can post in the Help Wanted section. In a search engine you can search for "Sprite Sheets," however, keep in mind that all the art assets you get are copyrighted, and cannot be used in a game (that you distribute) without permission from the creator. So it's fine to use those for your own projects to learn from, but you can't use them beyond that. In truth, finding good 2D and 3D artists is the hardest part of starting your own larger game projects. Which is why I recommend postponing that as long as you can. A breakout clone, like Pong, doesn't really require any art assets. A few bricks, a ball, a couple paddles, and you've got all you need.
  13. JWalsh

    So I want to be a game developer....

    Congrats, man! Getting started is the hardest part. Finishing is a close 2nd. Awesome. It sounds like you're headed down the right path. That's all you're really supposed to learn with Pong. In general, I prefer receiving a zip file containing all source and assets. Then I can compile it on my own and run it. I generally don't like downloading & running executable files unless it's from a trusted source. Who knows what can be in those things! And don't take it personally, it's entirely possible someone could distribute a virus without even realizing it. I recommend you keep iterating on it as much as possible. Working your way through a tutorial or book is a great way to learn and get started, but to really benefit you need to get in and play with the code yourself - make changes, add your own style to the game, etc.. Here's some ideas: Add some enemy AI (that can be beaten) Make obstacles slowly fall from the ceiling which reflects the ball back Make the ball reflect differently depending on where on the paddle it hits Add power-ups like Breakout that causes the ball to speed up/slow down, or makes the paddles change size Make the ball speed up each time it bounces Add title screen /w main menu and a high score screen (implement high scores) Make it so each time the ball hits the paddle it chips away a little from the paddle, making it 1 pixel narrower at the point of impact Add multiplayer via TCP/IP ... Once you've gotten it as far as you can go, it's an easy transition from Pong to Breakout. That's the game I recommend people try second, as it shares a lot of common code and assets with Pong. Cheers!
  14. You're right. I don't see a lot of examples online. I'll add deferred shading with DirectX 11 to my list of upcoming tutorials. Cheers!
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!