Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Programmer16

Member Since 31 Jan 2003
Offline Last Active Aug 11 2015 07:21 PM

#5241172 Is there software that creates Game Design Documents?

Posted by Programmer16 on 18 July 2015 - 01:01 AM

The closest thing I've seen for design software is articy:draft (http://store.steampowered.com/app/230780), but it doesn't really help create a GDD per-se (and it's $99USD.)


#5240680 What are the more useful tools in the Humble Game Making bundle?

Posted by Programmer16 on 15 July 2015 - 10:15 PM

As I stated in other topics, Spriter Pro alone is worth the bundle. Sprite Lamp is pretty good too (note that it is not the pro version.)

Most of tbe assets are RPGMaker-esque.


#5239003 Humble Bundle is Selling a Game Development Bundle ($1 - $12)

Posted by Programmer16 on 08 July 2015 - 09:22 AM

Just want to say that Spriter Pro alone is worth the $12 and Sprite Lamp Hobbyist seems pretty good too (bought it yesterday, but I haven't tried it.)


#5238902 [C#] Is MonoGame good for Windows 8?

Posted by Programmer16 on 07 July 2015 - 08:33 PM

When speaking of Windows 8, there are 2 groups: Windows Store apps and desktop apps. The desktop portion of MonoGame is pretty solid, I can't really speak for the Windows Store side. I do know that it "works" in that you can develop and deploy games to the store.

I can also state that they have a great bunch working on it, but it's open source, so the best route for bugs is to fork it, fix it, and put in a pull request.


#5237137 If-else coding style

Posted by Programmer16 on 27 June 2015 - 01:23 PM

The difficult part here is that everything we say is going to be our personal preference. Personally, your example doesn't make any sense to me. With what you have, I'd have used:

SomeType GetSomething
{
    get;
    private set;
} 

SomeType is obviously nullable, so I don't see any reason for the extra code.

 

Also, at first glance, I would read your property as "normally this returns null, but under certain conditions it may return a value" (which may be where "misleading" came from.) I would use the format that SimonForsman used.

 


Without the else, if you didn't look into the "if" block you might think that the getter ALWAYS returns null.

This statement makes absolutely no sense to me. If someone is able to misinterpret a block of code like that, then they really shouldn't be working on it. Either way, it leads back to my statement and the reason that I would use the format that SimonForsman used.

 

In the end I understand the "misleading" note, but not for the reason you say that he stated.




#5236008 Content project monogame?

Posted by Programmer16 on 21 June 2015 - 09:19 AM

Content.mgcb is the content project. You should be able to open it by double clicking. If not, right click, select open with and add the Pipeline tool (should be in c:\Program Files (x86)\MSBuild\MonoGame\Tools) and then open it with that.

 

Once you are in the pipeline tool, select your Content entry in the top left and then select References in the property grid. Depending on which specific version you have, you may have to type the whole path to your DLL (older versions) or you can just select it (newer versions.) Note that you also need to add any non-standard references before you add your DLL. For example, a library named Graphics.Content that has a reference to Graphics will need to add a reference to the Graphics DLL first and then the Graphics.Content DLL.




#5222864 Alternatives to global variables / passing down references through deep "...

Posted by Programmer16 on 12 April 2015 - 11:08 PM

As MartinMM said, if you want to make a game, make a game. If it's not broken, don't fix it. You'll waste a lot of valuable time trying to perfect these things (I know this personally.)

That being said, your thought process seems backwards to me. A player wouldn't tell the audio system to play a sound, the engine should do that when it tells the player to jump.

Digressions aside, store your subsystems in a variable and pass that instead of passing each one separately.


#5220074 C#: How to best track in-game "states" of things (i.e. using bitwise...

Posted by Programmer16 on 29 March 2015 - 08:32 PM

You could for example use an enum, set the values to the various bits and annotate it with [Flags].
 
It's a C++-ism, and not that common, but it nevertheless works:
 
 

[Flags]
enum RenderType
{
  None = 0x0,
  DataUri = 0x1,
  GZip = 0x2,
  ContentPage = 0x4,
  ViewPage = 0x8,
  HomePage = 0x10 // Next two values could be 0x20, 0x40
}
You can use it like a normal type, but will have to cast to uint for storing/restoring.

RenderType renderFlags = RenderType.GZip | RenderType.HomePage;

 

I wouldn't say it's not common, I use flags like this all the time and see plenty of libraries that do as well.

 

Also, if you're going to be storing it as a uint, I'd change the enum's underlying type:

[Flags]
enum RenderType : uint
{
  None = 0x0,
  DataUri = 0x1,
  GZip = 0x2,
  ContentPage = 0x4,
  ViewPage = 0x8,
  HomePage = 0x10 // Next two values could be 0x20, 0x40
}

As a side note, if you use flags then I highly recommend using the HasFlag() function:

var renderType = RenderType.GZip | RenderType.HomePage;
// ...
if(renderType.HasFlag(RenderType.GZip)
{
    // Do something here
}



#5219979 working with newtonsoft json

Posted by Programmer16 on 29 March 2015 - 09:56 AM

You can tell the library to skip a property using the NonSerializedAttribute:

public class Person
{
    public string Name { get;set; }
    public int Age { get;set; }

    [NonSerialized]
    public string FavoriteFood { get;set; }
}

You can find more information in the documentation: Serialization Properties

 

As for types, you can find all of that in the documentation as well: Serialization Guide. But to answer your question, it can convert arrays and bytes.




#5216566 How to Acess a singleton from everywhere?

Posted by Programmer16 on 14 March 2015 - 11:48 PM

This is actually wrong, singletons(at least by the design of the pattern) will always be constructed with the first call to whatever Get function you are using.


Actually, you misunderstood what I said. Yes, they are created by the first call and that is by design (which I actually mentioned in my last post because the OP is kind of breaking this design.) The problem is that, when you have multiple singletons, you do not necessarily have control over the order in which they are constructed.
Well I did misunderstand what you said but why wouldn't you have control? They're always constructed in the order which you first call them, you could technically use some dummy Get's at program startup to initialize them in a certain order.
 
Although being honest his code is very confusing and I'm not at all advocating singletons, just that you COULD start multiple of them in a defined order, thats actually how the book framed the view of the problem of just making a bunch of extern subsystems in a header file, uncontrolled construction order.

That's actually my point. Your program entry function is not the first thing to run. Calling Get does not garauntee construction, only that you're getting a constructed variable. This is the same problem with global static variables.

For example, if you have another class that you create as a global static and it's constructor uses one of your singletons. This could cause that singleton's constructor to be called out of the order you wanted.

Another example would be if any singleton accesses another from their constructor.

While you do control these calls, you have to keep track of them and code on eggshells to keep them in that exact order.

With direct construction you can point to the line and say "I know for a fact that it's being constructed here."


#5216261 C# Interview test "failed"? Why?

Posted by Programmer16 on 13 March 2015 - 06:40 AM

It isn't there if I open the attachment in textedit or sublime on OSX or if I open the file in Xcode and write a test harness to run the method.

It, along with the semi-colon, are fancy versions of the characters probably automatically swapped out by programs like Microsoft Word. If you copy and paste it and put your cursor at the 1 , you'll most likely have to hit backspace 3 times to remove the "X1". Or paste it into a string and look at it in a debugger. For me, it shows up perfectly fine in Notepad++, but not Visual Studio.

Just because you don't see it doesn't mean it's not there; this happens with a lot of characters and depends on whether or not they exist in your font.

missing-character.png




#5216102 C# Interview test "failed"? Why?

Posted by Programmer16 on 12 March 2015 - 12:18 PM

If you look at the attachment, the minus operator is there for question #3 (and it's there in his post.) However, whoever created that line managed to enter it as a soft-hyphen (173) instead of a minus operator (45.) This seems to be pretty consistent throughout - for example, the semi-colons are not normal semi-colons (Visual Studio complains about them being invalid.) After thought - the test was probably written in a word processor, which might cause these character changes.

 

Along with the stated fact that unsigned int is not a C# type, there's also the fact that the ! operator cannot operate on uints (or any non-boolean value.)

 

For question 1, there are more differences between a struct and a class than just memory. For example:

Structs cannot be inherited from.

Structs also do not need to be initialized:

using System;

namespace ConsoleApplication1
{
    class Program
    {
        struct Person
        {
            public string Name;
            public int Age;
        }

        static void Main(string[] args)
        {
            Person me;
            me.Name = "Donny";
            me.Age = 28;
            Console.WriteLine(me.Name + " is " + me.Age.ToString());
            Console.ReadKey(true);
        }
    }
}

In question 8 you have:

Vec3 forward = new Vec3;

Which is invalid; "A new expression requires (), [], or {} after type" and as I stated above isn't even necessary (unless you want to use a user-defined constructor.)




#5215173 C# Linked List implementation review

Posted by Programmer16 on 07 March 2015 - 01:25 PM

I'm not the best on linked lists, so I won't really comment there; it looks good and I can't think of any way to improve it.

I did want to point out you have a type mismatch though. Your iterators (i) are ints while index is a uint.


#5215094 C# Variable binding

Posted by Programmer16 on 07 March 2015 - 12:52 AM

It appears you want string-keyed globals or something like the observer pattern.

 

I can't really offer any improvements on your overall design, but a few notes.

You don't need to store the function in a local delegate, you can pass it directly.

props.floatvariables.Add("fred", GetFred);

Or you can use lambda expressions:

props.floatvariables.Add("fred", () => fred);

You could also add an indexer to the PropertyNode class to simplify access:

public float this[string key]
{
    get
    {
        return floatvariables[key]();
    }
}



#4767367 SlimDX or SharpDX ?

Posted by Programmer16 on 31 January 2011 - 01:11 AM

What do you think?

Has anybody some deep experience with SharpDX and can give his opinion?


I have no experience with SharpDX, but one thing that I noticed is that it doesn't support Direct3D9 which, as far as I know, is still a majority of the market. It also doesn't support some of the other libraries (mainly XACT3, XInput, and DirectInput.)

Also, with it being generated directly from the native libraries, I doubt it takes advantage of C#'s major features.

On the pro side, it might be a little bit faster, it's somewhat platform independent (it states that it Direct3D doesn't actually work with Mono, but they're working on it), and it stores each of the API's in separate assemblies.

In my honest opinion, it looks like it has potential, but isn't developed far enough where I would consider using it. SlimDX on the other hand has been around for a while, has some great minds working on it, and is very well supported.

Hope that helps!


PARTNERS