• 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.
  • entries
    67
  • comments
    291
  • views
    117585

Lines with rounded corners

Sign in to follow this  
Followers 0
slayemin

963 views

My girlfriend asked me today if I'm behind schedule on my game. I didn't really want to answer her, but she pointed out that I was planning on hiring an artist to work with me in December. It's long past December and I'm not really ready for an artist to come in and start making art assets. That's a few months off, at the very least. So, yes, I'm behind by quite a bit from where I expected to be at this point. Why? Because of three primary factors:

  1. I don't put in enough hours (~30-40/week)
  2. I am building my own game engine (dumb, yes, but it's something I'm enjoying a lot! I've never done it before.)
  3. I'm a perfectionist, so I take my time to make sure everything is just right (it works, is well tested, and very robust). I don't want to come back months down the road to refactor something I've forgotten everything about.

Since money isn't really an issue and I have all the time in the world, I'm okay with being behind schedule. It's a rare luxury I suppose...

I'm currently working on building a robust primitive system which is engineered for maximum usability and performance. I'm making slow but steady progress on that.

A few weeks ago, I completed my quads, point sprites, and billboards. Since I'm taking advantage of hardware instancing, I can have thousands of textured quads on the screen and run at 900+ fps (on my crappy dual core dev box).

After finishing the textured quads, next on the list was creating line lists, line strips, thick textured lines, and thick textured rounded lines. I think the thick textured rounded lines was one of the hardest ones to implement because of the math involved (or that I'm just dumb). Long ago, I had seen someone else do the same thing and posting the code to it. I didn't bother to look for it, and I thought I could do a much better job, so I started writing my own.

After much sweat and effort, here's what I came up with!
Thick-Lines.png

The white lines are added to show the vertices for the thick line. I also decided to show the underlying triangle structure.
Here are a few tips for anyone else trying to do the same thing:
-Avoid using triangle strips: I tried this at first, reasoning that I could save a teensy tiny bit of memory. In truth, creating triangle fans using triangle strips will cost you extra memory because you have to use ghost vertices. Instead, use triangle lists with index buffers. I think this may even save a smidge more memory, but it's kind of irrelevant. The real savings comes in the code simplicity and maintaining programmer sanity.
-Plan, then code: I'm kind of dumb. I usually can't just start writing code for something complicated and have it work the first time (though, it does happen on occasion). I have to literally draw out pictures and diagrams of what I'm trying to build. Then, I ask myself how I'm going to find the values in my pictures. I might even figure out what the values should be before writing any code. After I have a good plan, I write code to implement it. I constantly check to make sure that my code is doing what I've planned it to do and that the values I get match what I calculated. When I'm done, I run my implementation and see if it works as planned. In some cases, my conceptual planning was wrong or missing something and I have to revise it. When it's all done, what do you do with your notes? Save them! If you need to refactor later, you've got all your working notes, models, and comments to reference.
-Get it working first, then generalize: I sometimes jump right in and start trying to write a generalized solution and end up getting seriously bogged down in the details and quite confused. Sometimes, I scratch my head for hours trying to figure out how to even do a generalized solution to the problem. It's not always possible to immediately see all the patterns and write a generalization for them. So, start from the ground and build your way up, brick by brick. Start with a super simple task and build on it. Hard code your values in first, when it works as planned, then you can generalize.
-Don't trust something works correctly until it's been rigorously tested. This fact alone probably kicks my ass the most. Got a complicated function? Test it by throwing everything you can at it and see if any combo of parameters gives you unexpected results. Example: I wrote a function which tells me how many degrees are between two angles. The angle is always calculated by winding counter-clockwise from the first angle to the second angle. Now, what happens if the first angle is 315 degrees and the second angle is 45 degrees? If the math/logic is too simplistic, it wouldn't be able to handle an unusual case. It may look like it works for every test, but when another function depends on it to work correctly and it doesn't... you're gonna have a bad time. That leads to my next point...
-Don't try to compact your code: You think you can write a function using one or two lines of clever code? Good for you! But don't do it. It's a lot more difficult to debug when you have to squint at a line of code which does five different things at once. Unpack all that code. It doesn't save enough memory and clock cycles to justify wasting extra programmer time unpacking it if there are errors in there. Keep it simple.

Anyways, looking ahead to next week, I think I'll be able to finally tackle my outdated particle system and get that working to perfection with all the primitives I have.

5
Sign in to follow this  
Followers 0


1 Comment


Yes those are good points for keeping the code flowing, these especially:

 

-Don't try to compact your code

-Get it working first, then generalize

-Avoid using triangle strips (ie don't prematurely optimize)

0

Share this comment


Link to comment

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