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

genjihl

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

110 Neutral

About genjihl

  • Rank
    Newbie
  1. Hello. I was wondering if there were any optimization benefits with drawing textures with only calling spritebatch.Begin() and spritebatch.End() once, as opposed to calling .Begin() and .End() for each texture. I understand there are limitations to using this approach, such as not being able to change the SpriteSortMode and BlendState, but I am not worried about that. I am only curious about whether or not designing a drawing system like this would have a significant affect on a game's performance. An explanation regarding the "expense" of calling a spritebatch's .Begin() and .End() functions would be appreciated! Thanks!
  2. [quote name='laztrezort' timestamp='1336741081' post='4939282'] Doesn't Rectangle have a Contains() method? If so, it would be simpler to use that instead of creating a rectangle of size 1 every time. [/quote] You're right, it does. I'll use that instead. Thanks everyone!
  3. Hello, please let me know if I'm being way too nit picky or paranoid about my game's performance with my query: To see if my mouse intersecting a Rectangle (in XNA), I've thought of two ways: 1. Check if the object's Rectangle intersects with a new Rectangle created at the mouse's position. Or 2. Initialize a rectangle to follow the mouse around, and update its position every time Update() is called, and when the check occurs, simply provide the mouse's Rectangle. Assuming the check is called very frequently (whenever other classes want to know if the mouse is hitting anything important), which method would be the most efficient? And, is this difference even significant? If you'd like to see what I mean in code: [quote] //Option #1 class MouseInput { [indent=1]MouseState lastState;[/indent] [indent=1]MouseState currentState;[/indent] [indent=1]public bool Intersects(Rectangle rect)[/indent] [indent=1]{[/indent] [indent=2]return rect.Intersects ( new Rectangle ( currentState.X, currentState.Y, 1, 1) );[/indent] [indent=1]}[/indent] [indent=1]public void Update()[/indent] [indent=1]{[/indent] [indent=2]lastState = currentState;[/indent] [indent=2]currentState = Mouse.GetState();[/indent] [indent=1]}[/indent] } //Option #2 class MouseInput { [indent=1]MouseState lastState;[/indent] [indent=1]MouseState currentState;[/indent] [indent=1]Rectangle mouseRectangle;[/indent] [indent=1]public void Initialize()[/indent] [indent=1]{[/indent] [indent=2]mouseRectangle = new Rectangle ( currentState.X, currentState.Y, 1, 1);[/indent] [indent=1]}[/indent] [indent=1]public bool Intersects(Rectangle rect)[/indent] [indent=1]{[/indent] [indent=2]return rect.Intersects ( mouseRectangle );[/indent] [indent=1]}[/indent] [indent=1]public void Update()[/indent] [indent=1]{[/indent] [indent=2]lastState = currentState;[/indent] [indent=2]currentState = Mouse.GetState(); mouseRectangle.X = currentState.X;[/indent] [indent=2]mouseRectangle.Y = currentState.Y;[/indent] [indent=1]}[/indent] } [/quote] Thanks in advance for the help!
  4. Thanks for the help everyone. I'm beginning to recognize the benefits to loading ships' data from a file. I admit I'm not used to working this way, but I realize storing/loading data from files an important skill to have, so it's about time I get used to it. To answer your question, jefferytitan, all of the Ship types are the same. There won't be any differences in behavior, only properties (health, shields, etc.). The class (or classes) would be used to produce multiple instances each, as you described (e.g. 30 Fighters, 5 Dreadnoughts). I will go with your suggestion and try using XML to supply my Ship objects with their default data.
  5. Thanks for the quick reply. I'm sorry but I didn't fully understand your suggestions. It sounds like I shouldn't create sub-classes of the Ship class and instead store different ships' default values in an XML file, regardless of the class' complexity. I'm curious, why do you recommend storing default values in an XML file? It seems more convenient to simply hard code the default values into the program. And, is there anything bad about creating sub-classes in this case?
  6. I'm working on a game where I will manually construct a large number of Ship objects (100+), each with their own unique stats, but, of course, sharing the same properties and methods. Someone suggested I should create a sub-class for each different ship to accomplish this, but this goes against my intuition. However, I don't know what would be bad about this approach either. This approach is tempting because I would be able to quickly access a particular subclass object with my IDE's auto-fill feature when I begin typing its name. Is there a performance cost or disadvantage to creating sub-classes in this manner, where I could just create instances of the same class instead?