Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 13 Jun 2001
Offline Last Active Today, 10:13 AM

#5216341 Starting fresh

Posted by Madhed on 13 March 2015 - 03:31 PM

Don't set everything in stone.

Be open to criticism.

Don't withhold information from your team. (within reason)


Actually this works from the other side too smile.png


Demand changes if neccessary.

Criticise unoptimal behaviour early and fairly.

Inform yourself regulary on what's going on.


Also: Don't be a dick.



#5214805 Texture atlas generator

Posted by Madhed on 05 March 2015 - 01:26 PM

we use TexturePacker https://www.codeandweb.com/texturepacker


It is a great tool but not free. (€39.95)

#5213304 Having trouble harnessing the power of Inheritance. (best practices advice re...

Posted by Madhed on 27 February 2015 - 06:57 AM

I don't quite understand why you say this. I'm familiar with inheritance vs composition, and IS-A vs HAS-A. It seems to me that this is clearly an IS-A situation. 
Wizard IS-A Baddie
Knight IS-A Baddie
Slimer IS-A Baddie

The problem is that you use IS-A in the way we normally use the term in natural, spoken language. However in OOP the term has very specific meaning. I personally blame bad teachers for this misunderstanding, as inheritance is often taught with contrived real world examples that never actually occur in real software projects. (Plant-Flower-Tree-Bush for example)
Make yourself familiar with the Liskov substitution principle. This should be the benchmark to decide wether you should use inheritance or composition. As a general rule of thumb: When in doubt, use composition.

#5210338 How to correctly inject and share an object to multiple other objects

Posted by Madhed on 12 February 2015 - 02:20 PM

Also keep in mind that, depending on your use case, you might not want to store a reference to A at all.

It's perfectly ok to just pass A as an argument when calling a method of B or C.

#5206480 Constructor gotcha's?

Posted by Madhed on 24 January 2015 - 06:01 PM

IMO the most important aspect of OOP? Invariants!

When you are declaring a class you are introducing a new type.


The constuctor is responsible to ensure that the object is initialized with a valid state. Every public method should make sure to leave your object in a valid state satisfying the class invariant.

Once you have internalized this concept, your code will become much more robust.

#5206090 no vsync means double buffering to avoid tearing, right?

Posted by Madhed on 22 January 2015 - 06:29 PM

Without vsync there will be tearing, whether double or triple buffering doesn't matter.

#5204951 Can anyone explain why this seems to be the source of intermittent slowdown?

Posted by Madhed on 17 January 2015 - 01:21 PM




#5204317 Checking the equality of objects in C#

Posted by Madhed on 14 January 2015 - 04:01 PM

Your code is very verbose.


Any reason why you are not using properties? http://msdn.microsoft.com/en-us/library/x9fsa0sw.aspx

You can also override Equals() or the == operator to make testing for equality much simpler http://msdn.microsoft.com/en-us/library/ms173147(v=vs.80).aspx


As for your problem: Are you sure the order of the arguments on this line is correct?

Person pSearch = new Person(firstName, lastName, State, ZipCode, PhoneNumber, Address, Age);


more stuff to read:


#5203587 Estimating effort Hours

Posted by Madhed on 11 January 2015 - 06:56 PM

You can give time estimates for the tasks. These will probably be wrong however.

After finishing some amount (say one week) you should go back to the original estimates and find out what took longer and what actually was done quicker than planned.

You should involve your team in this process and absolutely make clear to them that it isn't a personal fault if they needed more time than expected.

#5200685 Is Unity good for learning?

Posted by Madhed on 29 December 2014 - 06:07 PM

Visual Studio Express is a little bit weird. It's separated into a few different versions. I personally use their professional version, but I believe that the version you'd need is called "Visual Studio Express 2013 for Windows Desktop." Express should provide all the features you could ever need


Actually Microsoft just released the community edition of visual studio for free, which has all the pro features such as plugin support.



#5195332 Decoupling physics

Posted by Madhed on 29 November 2014 - 08:28 AM

Why are you doubting that this is the correct approach?

The physics systems acts as a service in this case and the other systems are consumers.


Events or not, your picking system is dependent on the physics system either way, as without it your code would not work.

#5195273 Particle Systems & Handling Transparency

Posted by Madhed on 28 November 2014 - 05:52 PM

Tween vertex color to RGBA(0,0,0,0) this gets rid of both terms

#5195254 Particle Systems & Handling Transparency

Posted by Madhed on 28 November 2014 - 03:58 PM


(it is possible to draw additive and alpha blended particles in a single draw call).


How do you do that? (I'm an OpenGL beginner)



I suppose with the blend function: Dest * (1 - SrcAlpha) + Src


Aka premultiplied-alpha.


If SrcAlpha is 0, it simply reduces to additive blending.

If SrcAlpha is between 0 and 1 you can achieve alpha blending but you have to premultiply your textures by the alpha value first.


This also allows you to seamlessly blend from explosion to smoke and other cool effects.

#5193245 The left-hand side of an assignment must be a variable

Posted by Madhed on 17 November 2014 - 07:48 AM


How does this even let you do this?

class Foo
   Foo yolo;


It's Java. yolo is a reference. You are probably thinking in c++ terms... tongue.png

#5192939 Proper C++ header file?

Posted by Madhed on 14 November 2014 - 08:32 PM


Where is the compiler output?


Hmm...? I'm compiling with g++ from the terminal command line. The only thing being output to the terminal that isn't posted here is the command I used to compile.


g++ -c TileMap.cpp



Ah, now it's there. It wasn't when I posted.