• 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

294 Neutral

About ryt

  • Rank
  1. You do not need to free Bar since it is in declared in it and when you free Foo it gets removed automatically as Hodgman sad. If you create Bar in Main() it gets created on stack in this function and its removed automatically as you leave the function since stack on this function no longer exists. Similar is with the heap. But you need to remove it manually and when you do its all contents is removed.
  2. In C# in my base class Weapon I have declared a enum Firestate like: enum Firestate { Fire }; public class Weapon : MonoBehaviour { public Firestate firestate; }; And in a inherited class Gun I use that enum. But I get error CS0052: Inconsistent accessibility: field type 'Firestate' is less accessible than field 'Weapon.firestate'. When I remove public from firestate there is no error but then I cant use it in Gun since it is private.
  3. I agree with Nypyren. In some languages like C/C++ switch statements can be really fast. If you look at assembly code and your switch has like 1000 case statements in switch the code goes immediately to the desired case where in if else statements the code has to go trough every one to get to the desired one.
  4. How do you write variables for math names ? For vectors for example I sometimes append v like vLocalPosition. But for some common vectors I use names like pos, dir, dist. Also for coords I sometimes use forward, up, right. For matrices I append m in front or try to use a single uppercase letter like M.   How do you write names for transformations and rotations ? Names like transformAirplane or rotationCar seem a little cumbersome.
  5. That looks interesting. I did not know abaut corutines. In FSM for states I used enums and I would switch to a new state trough case statements. But I think functions could be also part of a state so functions could have the same name as a state. So if we need to switch to another state without using while we could just call another state function.
  6. I was building a finite state machine where I don't need a while statement but instead I just needed to switch to another state right after the first one finished. How would you transform the current code to put it out in a function ?
  7. I didn't know that. It looks like an old basic code . Is this a good coding practice ?
  8. Probably I asked the question wrong so it is misunderstood. What I actually wanted was to jump from one case statement to another case statement in one switch like: switch(somevalue) { case somevalue1: Function1(); break; case somevalue2: Function2(); break; } So for example that the code jumps from case somevalue1 to case somevalue2 without leaving the switch statement. But in C# we must have a break I think. Anyway I would like to jump to somevalue2 without deleting the break.
  9. Is it possible to jump from a switch statement to another switch statement without leaving the current switch in C# ?
  10. I don't understand. Why we should take T0 = T1 that is compute it for some T. The two objects will have the same position and it will take different times to get there. That is if first object travels faster or is closer to the collision point than obviously T0 < T1.   Why did you took the Dot and normalized the vectors ?
  11. Well my original question was about how to deal with the situation when we have vector division. In this case I took the magnitude of resulting vectors like:   t2 = |v1 * t1 + p1 - p2| / |v2|   So I wonder if this is the right way to use the magnitude and to get time t2 ?   In my example the two objects always collide since their final positions are same like p1 = p2 where p1 is final position of first object and p2 is final position of second object. If first object has some speed at some time t1 will arrive at position p1. So if their final positions of two objects are the same p2 is also known and we can find v2 and t2. If we set v2 to some speed and direction all we need to find is t2. This is the time that is in last equation. I made a mistake in the original post. I meant to say p1 = p2.
  12. I have two objects and I want to find when will they collide. Lets say first target has position p0, velocity v0 and the time it will arrive at desired position is t0. Similar for the second target it has position p1, velocity v1 and the time t1. The general formula for speed with constant velocity is:   p = v*t + p0   So if we try to find their colliding position p0 and p1 should be equal at desired time so p0 = p1.   v1 * t1 + p1 = v2 * t2 + p2   t2 = v1 * t1 + p1 - p2 / v2   t2 is the time that will second object arrive at colliding position. I wonder how we can calculate this ? On the right hand side of last equation we have vector division. So since t2 is a scalar on the right hand side there also must be a scalar. So I think we should take the magnitude of vectors on right side and divide them. What to do in these situations when we have a division of two vectors ? Is this approach correct one ?