Re: realtime rl v.2



Never heard back, so here is my feedback with a sampling across a couple of different areas.

Game Play:
1. Would like more contrast between the viewport and the rest of the screen. In that the viewport should be black background to allow for quick view of the bounds and use of colors for the foreground.
2. It looks like the message box is improved from previous version (descending).
3. A couple of small spelling errors. I know that they don't seem like a big deal because your are focusing on other things, but an attention to detail is usually what prevents you from painting yourself into a corner later.

Application Design and Architecture:
1. Separate your Objects from their rendering implementation, and don't use a Form as the base class. You have to make a choice between a Rendering Engine knowing how to render objects of different type, or each object knowing how to render itself to a surface. If you want to use the second, the surface should be separate from the object and can be used like Object.Render (graphicsSurface);.
2. You have a lot of structures and static methods. Both of these should be very limited in C# (See #3 about value types). Use classes instead of structures and remove the static unless you really want a global function (that should live independent from any class implementation). If you use static, don't have it on an object that you would later create a separate instance of (as a reference value). It should just be an empty class.
3. Why is 'actors' a partial class? Why is 'arrow' a 'struct' when you have methods on it. Structures have a very specific purpose as value types and small footprints. I don't understand why some of your classes are actually forms. Why are you using a 'partial struct' to spread the item class across multiple files. You don't need the old header/cpp file structure in C#. You can use #region directives to help organize your code (see #2 below).

Programming Implementation:
1. Naming: http://msdn.microsoft.com/en-us/library/xzf533w0(VS.71).aspx
2. Use the #region directive. Start with (Private Properties, Public Properties, Constructors, Private/Protected Methods, Public Methods; for forms add Form Events and Control Events). This will keep you organized.
3. While it is extra typing, go ahead and specific declare a variable private with the 'private' keyword.
4. Read about Namespaces, you can quickly create them by creating folders.
5. I know it is a lot of extra files and work, but break each Enum out to its own file (trust me, it is totally worth it). Create a folder named "Enumerations", and stick them under that (a separate folder for each related namespace).
6. You have the following error in the Output Window: A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll. IT comes from the following line. To find it yourself, click Debug->Exceptions and then find the above exception, click the left check box and ok. Run application. I notice that you have an empty catch for it, but you might want to try bounds checking before assignment versus just allowing it to throw an exception. There is a small overhead to exceptions that can affect performance.
progbarturn.Value = progbarturn.Maximum - (int)(actorarray[0, curlevel].nextturn - now.Ticks);

.



Relevant Pages

  • Re: realtime rl v.2
    ... Separate your Objects from their rendering implementation, ... Rendering Engine knowing how to render objects of different type, ... private with the 'private' keyword. ... yourself, click Debug->Exceptions and then find the above exception, click ...
    (rec.games.roguelike.development)
  • Re: realtime rl v.2
    ... I'll give you an example of abstracting the rendering engine from the objects in another reply when I have more time to put together a good example for you. ... If you want to use the second, the surface should be separate from the object and can be used like Object.Render;. ... I prefer everything in lower case, so I don't reuse a variable name, since I can always go to the definition to see if a variable is public or private ... To find it yourself, click Debug->Exceptions and then find the above exception, click the left check box and ok. ...
    (rec.games.roguelike.development)
  • Re: evelyn! Youll come italians. Just now, Ill overcome the pride
    ... Ibrahim's exception. ... He might recognize itchy dreams, ... separate them? ... Let's desert by means of the ancient villas, ...
    (sci.crypt)
  • Re: Critique ThreadQueue class please
    ... intact in case I ever want to try again, but moved them to private ... Okay, since assignment op and cctor can be dropped anyway, the comment ... I never handled OOM condition in a program, but I do handle the exception ... const int NumOfQueues ...
    (comp.programming.threads)
  • Re: Draw Line is to slow, there is anything else ?
    ... I still found that the WPF is rendering way much ... I'm no expert in WPF and probably I ... First, in the Forms case, you aren't drawing in an optimized way, so ... private static readonly Random random = new Random; ...
    (microsoft.public.dotnet.languages.csharp)