Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 12 Oct 2004
Online Last Active Today, 12:53 PM

#5227950 When you realize how dumb a bug is...

Posted by Mussi on 08 May 2015 - 07:51 AM

Do not code in the morning if you didn't sleep well.  I just kept starting at it.  Why isn't it working?  

for( int row = y; row < y + height; ++y ) {
   dest[ y * SCREEN_WIDTH + x ] = 0xFF;

I'm pretty sure this is the worst for loop I've ever written.

To infinity and beyond!

#5227933 Terrible Broken Age sales...!? (steamspy)

Posted by Mussi on 08 May 2015 - 06:33 AM

First, owners are 260 500 copies, but probably kickstarter backers should not count as people who bought broken age, since they didnt bought it, they kickstarterted it and all that money went probably into development so it is not an earning or profit for the creators (double fine).

This makes no sense to me. Why wouldn't a backer count as someone who bought the game? Because Double Fine didn't profit off of them? Even if they didn't, how is that any different from a studio with investors that first have to sell an x amount of games before they start making a profit?


There are a lot of ifs and assumptions you're making, what is it that you're interested in? It doesn't seem to be the number of people Tim Schaffer can appeal to(the number you mentioned is lower than the amount of backers).

#5226363 Extremely modular software architecture: GOOD or BAD?

Posted by Mussi on 29 April 2015 - 03:57 PM

I think you should start programming. Start with the basics of your game, see what steps you need to take to get some basic stuff on your screen and go from there. Once you actually have some code and know what step(s) you're going to take next, you can start thinking about whether you should make pieces of your code more abstract or not.


You shouldn't be writing abstract code because you're unsure where you want to go with your game. It takes more time to write and will probably not suit your needs very well.

#5225720 c++ shared_ptr usage

Posted by Mussi on 26 April 2015 - 04:24 PM

Passing as argument or storing as member are both valid designs. The examples you've given are quite distinct though. Calling the method with different instances of A is easy in the first example, less so in the second. If only a single instance of A should be coupled to B, then passing the pointer to the constructor would more clearly describe that intent.

There's also a difference in lifetime management, in your first example class B has no control over the lifetime of A, the second example does.


Depending on your requirements you can choose one over the other.

#5207471 Is it a very bad idea for a class to pass (*this) into a function? Strange bu...

Posted by Mussi on 29 January 2015 - 11:46 AM

The solution is to understand the Rule of Three (this rule has recently grown a bunch of different names, but I think this still is the best name).

Rule of 0/3/5

#5206545 Is it a very bad idea for a class to pass (*this) into a function? Strange bu...

Posted by Mussi on 25 January 2015 - 08:53 AM

There's nothing wrong with dereferencing the this pointer, your error has most likely something to do with your code(I'm guessing the second parameter is of type ClassA&).



Also, I know that "this" is a pointer... and since * is used to dereference a pointer, does that mean passing (*this) is pass-by-value?

That depends on the argument type in functionB, it could be by value, reference, const reference etc.

#5188057 Deciding on a Game Engine?

Posted by Mussi on 19 October 2014 - 07:14 PM

If licensing is your biggest hurdle, you'll want to check out the C4 engine by Terathon. It just had it's licensing model changed, there was a post about this on this forum here. No royalties, single payment of $88, 1 year of free updates. It doesn't get any better than that.

#5187583 Acceptable resolution for character turning?

Posted by Mussi on 16 October 2014 - 10:31 PM

I'm using 2 bytes for orientation of players in my multiplayer game, this gives you a resolution of 1/182 of a degree, which is more than plenty.

#5181615 Temporal coherence and render queue sorting

Posted by Mussi on 19 September 2014 - 02:50 PM

Wouldn't it be faster to just remove the no-longer present sub-meshes and leave the existing sub-meshes sorted?

Try to imagine what steps need to be taken to remove existing indices or to build a new array without these indices. Now compare that to creating an array from 1, 2, ... N.

#5176484 Welcome your new Visual Arts forum moderator

Posted by Mussi on 27 August 2014 - 01:07 PM

Welcome and good luck on your endeavors!

#5156774 Calculating healthbar percentage

Posted by Mussi on 29 May 2014 - 12:40 PM

Your currentHealth and maxHealth variables are integers, meaning that the result of currentHealth / maxHealth will also be an integer, which means the result of that operation will either be either 0 or 1. Integers are always rounded down, so you'll end up with 0 if currentHealth < maxHealth. You can go two ways here, cast the numbers to floating point numbers and cast back to an integer in the end, or simply multiply by 177 before you divide.

#5155749 Need help with 2D puddle

Posted by Mussi on 24 May 2014 - 05:09 PM

I'm not an artist, but maybe something like this?


#5155742 A list that does not disturb the order when pushed/popped?

Posted by Mussi on 24 May 2014 - 04:27 PM

I don't understand this new trend against new and delete. In a simple scenario like this, there's no reason not to use new and delete, it's ABC of programming with c++. If you can't handle a simple array of pointers, you have no hope with c++. It's a good exercise for the OP and understanding why he gets an error when deleting a player will save him a lot of troubles in the future.

It's the other way round, there's no reason to use new and delete here.

#5144646 Amusing glitch gallery

Posted by Mussi on 05 April 2014 - 06:25 PM

It seems that my vertex buffer stride was off-by-one. I call it "Origami World"...

I would drop all my plans and head into a new direction, that looks freaking awesome biggrin.png.

#5140275 Scoring system

Posted by Mussi on 19 March 2014 - 04:24 AM

Example: If both players started at 100 points and A wins 5 games straight, the scores would be 143 for A and 57 for B. After that, if B and A only win alternately, the scores will not equalize. A's score will fluctuate between 136 and 128, and B's score will fluctuate between 64 and 72. For B to bring A's score down to 100, B has to win 4 additional times to cancel A's lead in the beginning.

So if player B loses 10 games initially and then plays a 1000 games winning alternately the difference between player A and B is still the same as 1000 games ago? If so, those 10 games, which are a tiny fraction of the total amount of games, weigh more than the 1000 after that. Is that the behavior you're looking for? What are the scores supposed to represent?