• 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.
Sign in to follow this  
Followers 0
  • entries
  • comments
  • views

VaW progress: Week 2

Sign in to follow this  
Followers 0


Welcome back!

I haven't had much time to work on Vegetables at War this week. I was in Ludum Dare #21 this weekend! I was busy making sure my game library was ready, then busy actually making my game, and then after the deadline, busy trying to compile the damn thing for Windows. I wasn't able to actually able to do it successfully until about an hour ago!

You can see the game here: http://www.ludumdare.com/compo/ludum-dare-21/?action=preview&uid=4920

I tried Visual Studio first, but it didn't like some of my (perfectly valid) code, so I spent ages rewriting a lot of it, only to spend even longer trying to get the program to link. Then, when I finally got it compiled, it just didn't run! So I thought, "Why don't I just use the Windows versions of Eclipse and G++, like I do in Linux?". So I downloaded Eclipse and Mingw which had the G++/GCC compiler. It didn't complain about my code, which was a good start! Long story short, I still spent a long time trying to get stuff to work, but eventually I got it working by compiling GLEW from source with the game and making sure I had the Mingw SDL libs instead of VS ones (doh!).

Oh, and I bought Super Meat Boy. That took up a lot of my time rolleyes.gif

So, screenie:

It's almost the same as last week. I've updated my shaders so that there is a fog effect which becomes more intense as objects move into the distance. Originally, I wanted to have a blur effect, (which, again, would become more intense as you move back), but I think this looks good and was a lot easier. To achieve a blur effect, I would've had to render to a texture the objects I wanted to blur, then render that texture with a blur effect implemented in the fragment shader which would smudge the each pixel with adjacent pixels. I did get the rendering to a texture working actually. Then I tried the fog effect to see what it would look like, and then proceeded to scrap the blur idea tongue.gif

Each asset of type Scenery has a 'depth', which is independent of the Z value in space. It's the Z value according to a grid, with positive Z going into the screen, negative coming out. A depth of 0 is where the action of the game takes place, as you can see by where the carrot is standing. I used this in my fragment shader to determine how much the colour of the object should be blended with the background colour to produce the fog effect. I also needed to make sure that anything that is not Scenery or anything that has a depth less than or equal to 0 has no fog effect added to it.

The code to implement this (in the fragment shader) looks like this:

//'depth' and 'maxDepth' are floats (but they may as well just be integers) passed in by a shader uniform, which are grid depths.
//'z' is the z coordinate in space calculated by the vertex shader, which takes into account transformations so that the fog shading doesn't get screwed up

fragColor.r += (backgroundColor.r-fragColor.r)*((depth-z)/maxDepth)*clamp(depth, 0.0, 1.0);
fragColor.g += (backgroundColor.g-fragColor.g)*((depth-z)/maxDepth)*clamp(depth, 0.0, 1.0);
fragColor.b += (backgroundColor.b-fragColor.b)*((depth-z)/maxDepth)*clamp(depth, 0.0, 1.0);

What this code does is it takes the difference between the background colour and the current fragment colour (taken after texturing, lighting, etc.) and multiplies it by the percentage of how far away it is from the depth where every fragment becomes the fragment colour. Then it's multiplied by whether the depth is greater than 0, which acts as an IF statement. GPUs aren't good at branching, remember! Then this value is added to the fragment colour.

I can change the maxDepth value and background colour via script, which is very handy and only took a minute to implement! Yay for the super easy to use Ruby extension API! laugh.gif

Thanks for reading! Hopefully I'll get a lot more done this week than in the past week.

I'll see you next time smile.gif


Sign in to follow this  
Followers 0


There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now