Slowvomit

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

128 Neutral

About Slowvomit

  • Rank
    Newbie
  1. Your opinion on C# graphical libraries

    I honestly think GDI+ is a good place to start with C#. XNA is very good too. Don't be scared off by the fact that its not updated anymore! It is very well documented, and still has good community support. I have issues with MonoGame. It still needs time to mature. If you learn XNA, that knowledge will be very easily transferable to MonoGame later.
  2. Start learning C# togheter with XNA?

    First of all this just is my opinion. I'm not trying to limit C++ to anything at all. Though, I like to use it when I do "low level stuff"; making a custom direct3d rendere, interfacing with C or assembly, embedded programming, dll injecting... you get the point. When I sit down with a UML class diagram, containing hundreds of classes (maybe describing a game?) I tend to pull out the C#/.Net combo. I do admit this is a personal choice and it does reflect the fact, that I was schooled in C# and thought myself C++ on the side, acknowledging the limitations of C#/.Net in a unmanaged capacity. I know that C++ can facilitate oo programming just fine, but I do like syntactic and technological "simplicity" of C#, when I have to build bigger systems. Again, it could just be the fact, that C# was my introduction into programming. I was taught with very strict oo discipline... all the jazz; KISS, UML, design patterns and automatic garbage collection etc. Bit of a ramble there, and probably off-topic, but I think you know what I'm getting at
  3. Abstract base class ..... in C#?

    I understand that its a arbitrary example to learn the strategy pattern. But it is not aptly applied. The strategy pattern is a way to encapsulate algorithms and make them easily interchangeable. You would never use a design pattern for something as trivial as movement speed and animation change. Movement can however be aptly applied to a strategy pattern example using your movement types: public class Program {     public static void Main()     { //game initialize phase: //constructing the objects in our game GameObject[] movingObjects = new GameObject[10];  for(int i = 0; i < movingObjects.Length; i++) { movingObjects[i] = new movingObject(); movingObjects[i].SetMoveStrategy(new BasicMovement()); } //set object 1 to use astar movingObjets[1].SetMoveStrategy(new AStarMovement);   //game update phase: //showcasing polymorphysism //we don't care which movement algorithm is selected for the game objects we simply want them all to move. for(int i = 0; i < movingObjects.Length; i++) { movingObject.Move(MovementType.Walk); }     } }   public class GameObject //context of strategy pattern {     private MovementStrategy movementStrategy;       public void SetMoveStrategy(MovementStrategy movementStrategy)     { this.movementStrategy = movementStrategy;     }       public void Move(MovementType movementType)     { movementStrategy.Move(movementType);     } }   public enum MovementType { Skip, Walk, Run }   public abstract class MovementStrategy //interface of strategy pattern {     public abstract void Move(); }   public class BasicMovement : MovementStrategy //concrete strategy {     public override void Move(MovementType movementType)     { //Basic Movement algorithm here, differentiate by movement type.     } }   public class BreadCrumbMovement : MovementStrategy //concrete strategy {     public override void Move(MovementType movementType)     { //Bread Crumb algorithm here, differentiate by movement type.     } }   public class AStarMovement : MovementStrategy //concrete strategy {     public override void Move(MovementType movementType)     { //A Star algorithm here, differentiate by movement type.     } }   The base keyword is not used at all to demonstrate the strategy pattern. It is used for "inheriting" constructor arguments passed to the base class or to reference it implicitly.
  4. Start learning C# togheter with XNA?

    Generally speaking, Learn C++ and HLSL if you want to get into graphics programming and manipulating direct3d on a "lower level". Learn C#/XNA if you want to make an actual game, while becoming a oo programmer. You can always build HLSL onto this. Learn Unity if you just want to make a game quickly. That said, all programming is hard in the beginning. And what you should learn, depends on what you want to do, and how quickly you want to do it.   In your case, With C# you should have a thorough understanding variables, conditionals, loops, functions and classes (delegates, generics and lambda are in the "nice to have" category) before even contemplating moving on to XNA. In addition, C++ requires some knowledge of the memory model. The concepts of dynamic memory allocation and pointers are vital. This is why its harder. So, if you have a good knowledge of these concepts, I wouldn't switch so late in.   
  5. I need a C++ Mentor.

    Mentoring someone in C++ is a full time job. You should go to school and find a teacher, if you're adamant on getting a mentor :)
  6. What kind of pathfinding are you using? (from your post it seems like you're using basic, two point, linear interpolation) What kind of collision detection are you using? (from your post it seems like you're want to use pixel-by-pixel/per-pixel collision detection) Consider the differences between collision detection and collision response.     You probably need to set the current tile to walkable and the destination tile to !walkable after your first step. Considering your only collision detection is a boolean on a tile, you need some kind a collision response for that. This could be done by placing the unit on an adjacent tile, if the destination is !walkable. Alternatively, if you want "pixel perfect collision", you should implement real collision detection and response, and only use the tile system for pathfinding.   I'm sorry I didn't really answer you're question about why your losing performance, but without more information and/or the actual source code, it is impossible to say.