Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

DvDmanDT

Member Since 10 Dec 2004
Offline Last Active Jun 28 2012 07:55 AM
-----

#4950949 Learning SlimDX (or should I just pick up XNA)

Posted by DvDmanDT on 20 June 2012 - 07:20 AM

I haven't tried either of them. My guess is that ANX framework is more complete since it uses DX as backend meaning the XNA api can be fairly easily mapped. MonoGame is probably a larger project community wise, but they target other platforms (iOS, OSX, Linux, ..) and therefore use OpenGL as backend. I think ANX intends to have selectable backends, including an OpenGL one though.

If you are interested in those, just start working with XNA. As I said, they should be more or less drop-in replacements for XNA, so you can use the development tools for XNA for now and then switch when you need other platform support or whatever.


#4950382 Structure of classes in good Game Engine?

Posted by DvDmanDT on 18 June 2012 - 03:14 PM

Debug utilities (ie logging) is one of the very few things which I consider suitable for global access (ie global variable, global function, singleton, ..). If you have other stuff you need everywhere, that might indicate a code design/architecture problem.


#4947383 How to reinvigorate a team?

Posted by DvDmanDT on 08 June 2012 - 08:57 AM

Getting the momentum up is the hardest part. One thing I had some success with was deciding on a time amount each team member was supposed to work each week (in our case 30h/week, for a hobby project it would likely be closer to maybe 5-10). We then setup a time reporting system in which members would login, enter a start and end time as well as what they worked on during that time. That way we could easily see who worked and on what, even when there were stuff that didn't give any visual indication of progress (stuff like testing or designing).

Another thing is communication. We used an internal wiki (MediaWiki) and an IRC channel with a history-keeping bot. The IRC channel/bot can help alot, if one person posts "I'm currently working on X, what do you think of this? <link>" then it often triggers responses causing other people to work as well. A Wiki on the other hand is great for storing documents and decisions. It's easy to collaborate and you get stuff like history for free which also means you can follow activity.


#4945195 C++ what other IDE other than VC++

Posted by DvDmanDT on 31 May 2012 - 10:13 PM

Has anyone actually tried the VC++ 2011 express edition? I'm a bit curious as to what that really means. To create a GUI app with Windows, all you need is a regular C compiler and the platform SDK. I can't imagine they removed that (the compiler)? Don't they mean there's no C++/CLI forms designers anymore? Did anyone really use those anyway?

Edit: OK, this is different. I just tried it, you can't even create a console application. You can't control your entry points as far as I can see. Same goes for C#, you can't even create a regular class library.

Edit2: Ok, by just hacking my project file I was able to create a regular console application. So what it all really mean is that there's currently no templates for regular native projects. I'll try to import an existing project next.

Edit3: Ok, that doesn't work.


#4944588 Proper DLL use

Posted by DvDmanDT on 30 May 2012 - 01:38 AM

If I understand your question, then yes. It's determined by the library, not how you use it in your code or what flag you pass when you link against the library.

When you create a library, you select whether you want to create a static library or a dynamic library (I think that's the terminology used in VS). If you choose to create a dynamic library, then both a .dll and a .lib file will be created, if you choose to create a static library you'll only get a .lib.

A static library is often quite large (hundreds to thousands of kbs) while an import library (the .lib file which just includes references to its .dll) is isually in the 5-20 kb range.


#4944514 is there a way of merging or replacing ambiguous methods / properties in an i...

Posted by DvDmanDT on 29 May 2012 - 07:44 PM

You can't do that in C#? There's no multiple inheritance?

Edit: Interfaces don't have that problem. Even if you implement several interfaces which 'inherit' from another interface, the class will only implement that interface once.


#4944379 I need a better precompiler for C++

Posted by DvDmanDT on 29 May 2012 - 11:54 AM

Instead of copy-pasting, can't you use pre-build events or custom build events to achieve whatever you are trying to do here? I mean, you can setup VS to take a .y file and generate a .c file (using Bison) and then compile it using the C/C++ compiler.


#4942207 Signing a message

Posted by DvDmanDT on 22 May 2012 - 08:15 AM

Another library you may want to use for big integers is GMP. I don't have any experience with MAPM, but I've always found GMP easy to work with, and they already have functions to compute things that you'll need for RSA, like a probabilistic primality test (mpz_probab_prime_p), modular inverse(mpz_invert) and modular exponentiation (mpz_powm).

There are also handy C++ wrapper classes, but the last time I used the library they didn't expose all the functionality of the C interface.


The G in GMP stands for GNU. For me that pretty much means "don't even consider looking at it or it'll ruin your life" as I'm writing closed source software..

I just noticed how to use key blobs. That was probably what I was looking for.


#4925502 Are dirty coding techniques okay to use?

Posted by DvDmanDT on 26 March 2012 - 07:15 PM

My advice would be to never take shortcuts with structural problems, such as "A needs to access some data held by B.. Aw screw it, let's just make it a global.". For algorithms on the other hand, I would almost encourage you to create a simple solution first, as long as you make sure you can easily replace it later. For example while doing collision detection, you can start with comparing all objects to eachother, then if it turns out to be too slow or problematic, optimize it.


#4923714 Avoiding Global Variables

Posted by DvDmanDT on 20 March 2012 - 01:14 PM

Static variables pretty much are global variables; they're just in a class and not a namespace.


It's providing global access to state which makes global variables harmful. The whole point of adding things like static members to C++ is fine control over not just instancing, but access.  So, no; Having the same sort of lifetime does not make them the same thing.


I'll have to disagree with you there. Global access is one of the things that makes global variables harmful, shared state is another. Privatly shared state can be just as bad if not worse. You're still limited to one instance, which can create all sorts of headaches, and you still need to make sure it's valid/reset it whenever you load a game or whatever. I'd say the shared state is the real problem with globals, not the global access (although, that is also pretty bad).


#4923637 Physfs tutorial

Posted by DvDmanDT on 20 March 2012 - 09:14 AM

It's not PhysFS that adds anything, it's due to how strings work in C/C++. It's not null-terminated at the moment. You'll need to add NULL after the last char that is read. In other words, you need to allocate an array that is 1 byte larger than the file and set the last byte to 0/NULL.

EDIT: Just google null-terminated strings and I'm sure you'll understand.


#4923379 Avoiding Global Variables

Posted by DvDmanDT on 19 March 2012 - 12:31 PM

Why do all the object need that outside connection? That's the key here. They probably shouldn't. Perhaps they need it for some operation? In that case, pass that data to that operation instead.


#4922788 I'm having trouble with Pong. (In C# w/ XNA)

Posted by DvDmanDT on 17 March 2012 - 05:12 AM

Well, you can't load content first, and then tell it where it where it should look for contents..?


#4912515 Multiple Types in Constructors?

Posted by DvDmanDT on 13 February 2012 - 01:26 AM

Ahh. No, they aren't.. Perhaps it would have been possible if you used a base class instead.. I'm not sure if a cast to a base class can return a derived class.

Still, that cast simply has to beat the alternative.

BTW, since you are using C#, you might want to prefix your interfaces with an 'I', since that's the usual notation (google 'MSDN Design guidelines for class libraries').


#4912510 Multiple Types in Constructors?

Posted by DvDmanDT on 13 February 2012 - 12:36 AM

Again, just create a DoubleModule which always returns the double. Look at this:

Blend((DoubleModule)0.0, someFBM, someFunc)

and then imagine writing a single constructor and single functions/methods/whatever, since you only need to handle the case where there are modules. You may not even need that cast, depending on implementation.




PARTNERS