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

aregee

Member Since 06 Oct 2009
Offline Last Active Sep 30 2012 11:29 AM
-----

#4985060 HTML5 Game Sponsors?

Posted by aregee on 29 September 2012 - 08:22 AM

Hi. Congrats on finishing your first html5 game - I hope it's 100% mobile compatible, because there is where the market is right now. Get it polished as much as you can (quality still counts for a lot, regardless of platform) and when you're ready I posted up an article about HTML5 Game Sponsorship just the other day to my site, which you may find useful: http://www.photonsto...sorship-market/


OP, congrats on finishing your game.  That is more than I have ever done.  ;)  I have tested your game and have a few suggestions on how to polish it like photonstorm suggests:

- Your hearts are discreet units, suggesting they are lives I can lose before it is "Game over".  I thought they indicated the number of turtles that escaped making me wonder why clicking those bubbles gave me more lives.  A solid "progress" bar to indicate oxygen would be better, possibly engraved with hearts and maybe the text "O2" in front.

- Your background is nice, but making it animate would bring much more life to your game.  Maybe animate your turtles too, though maybe not necessary.

- You don't necessarily need music, but sounds would be nice.  Just make sure you can turn off sound since most people play without sound on hand held devices.

- I never read instructions, I never got the reason why your turtles had different colors, except maybe they moved at different speeds.

Oh a game ide too to make it even more interesting:

- After collecting 200 turtles I started wondering where they went.  Maybe you can have a set number of traps, like 20 or something before you have to send them to the surface for a bonus or more oxygen or something to free more traps to capture more turtles?

- Are there disadvantages to miss turtles at all?  How are they communicated?  Can it add to the excitement to implement disadvantages?

These are just my opinions, someone else might disagree.

Great game by the way.


#4959397 Need help understanding this logic....

Posted by aregee on 15 July 2012 - 06:34 PM

Taking the modulus isn't simply just dividing by a number and see the result.  Well kind of it is, but you have to remove the integer part and then multiply the decimal part with the same number again.  Let us use your numbers as an exercise.

Number to operate on with modulus 6:

32747 / 6 = 5457.833333... (unlimited expansion of '3')

Remove the integer part and then multiply with 6.

0.833333... * 6 = 4.99998

Which you can see is very close to 5 but it is not exact.

All rational numbers can be written on the form m/n.  (m divided by n.)  The number 5457.833333... is rational because it can be written in a predictable way.  You know there will be all number '3' for all eternity after  the last digit.

Let us convert this number to a fraction:


x = .833333333333333… (This is the number we want on the form m/n.)
10x = 8.33333333…  (Multiply by a number 10^n so that n makes the expansion of decimals overlap.  n=1 suffices here since all the numbers are equal.)
10x - x = 9x = 8.333… - 0.8333… = 7.5   (If this is hard to see, just know that 0.333... minus 0.333... = 0, see below)

It is easier to see laid out like this:
. 8.333333333... (Had to add a dot in front to make this line align properly)
- 0.833333333...
= 7.500000000...

Then we have:

9x = 7.5
90x = 75
x= 75/90 = 5/6

Our fraction is 5/6 which makes 0.83333...

Then we can multiply our fraction by 6 to get the modulus:

5/6 * 6 = 5

Which indeed is 5.  Exactly.

(Sorry about this but I was really bored today ;) )

Final note: taking the modulus of a number can never result in either the same number as the modulus or a higher number.  The result is always lower so having 8 as a result when the modulus is 6 is not possible. (It would mean you could still divide the number further, which is not a remainder at all.)


#4863100 Sound pops and clicks - XAudio2

Posted by aregee on 18 September 2011 - 12:33 PM

Thank you very much. You were right, 0 amplitude is 128 for 8 bits. Cracks are far less frequent now in my program. But can you please answer my this question:

performance wise, if sound has to stop and start many times (once a  second an average) is it better to leave the sound open with volume down  when not playing or is it better to completely stop the  sound and  restart the sound.

Thank you...

Glad that it helped!  :)

Regarding your question, I am not sure really.  It depends on a lot of factors.  My initial thought is that this is what XAudio2 is made to do.  Starting, stopping and mixing sounds through a convenient interface.  I believe there is very little overhead in starting and stopping sounds since you are not deallocating or reallocating resources for each time you do.  That would probably be a bit of a overhead and not a good idea anyway.

I suggest you just postpone any premature optimizations till you actually stumble upon a problem regarding performance since any optimization I can think of is a lot of work that is better spent on the progress of your work.  :)


#4862887 Sound pops and clicks - XAudio2

Posted by aregee on 17 September 2011 - 02:57 PM

@aregee: Uh oh, I just did that test with 0% duty cycle and I still got clicks and pops. :(

I have read about XAudio2 and its capabilities.  Unless XAudio2 is broken, I can not see that it should behave this way and I don't think XAudio2 is broken like that.

I have one suggestion to what may be the fault.  You are probably feeding signed data where unsigned is expected or the oposite.  This would create cracks and pops where there should be silence when you start and stop the sample.

So if you are feeding all zeroes when each sample is 16 bit, you may actually be feeding DC at max amplitude instead of DC at 0 amplitude.  Try the 0% duty cycle again, but this time use the value in the middle of an unsigned word or an unsigned byte depending on 8 bits or 16 bits sample size.  32768 dec (8000 hex) for 16 bits and 128 dec (80 hex) for 8 bits.


#4857019 Drop list GUI problem

Posted by aregee on 02 September 2011 - 09:02 PM

It seems you are scanning each row and column of your image to test if the mouse button was clicked there.  A better way of finding out whether your mouse pointer was clicked inside the image or not is to test against the borders of your image.  It is easily done doing a test like this:

(Given screen coordinates starting with (0, 0) at the top left corner.)

Be warned that I am basing this on some assumptions on your code.  I don't know anything about the parameters in the first 'if' test for instance.  I am just assuming it is correct.  I hope at least it will give you some ideas.


//To test if the left button was clicked at all

if (!(Event.Type == sf::Event::MouseButtonPressed && Event.MouseButton.Button == sf::Mouse::Left))
{
	// Left button was not clicked, so we do not need any more testing
	return;
}

// The left mouse button was clicked,
// Now test if the click was inside the image

int LeftEdge = ImageX;
int RightEdge = ImageX + ImageSizeX;
int TopEdge = ImageY;
int BottomEdge = ImageY + ImageSizeY;

if ((MouseX >= LeftEdge) && (MouseX <= RightEdge))
{
	if ((MouseY >= TopEdge) && (MouseY <= BottomEdge))
	{
		// Here you know that the mouse click was positioned within the image

		// To toggle the state of the image:
		if (Clicked) 
		{
			Clicked = false;
		}
		else
		{
			Clicked = true;
		}
	}
}


I believe that the code above should work, if I understood your code correctly.  Hope it is of some help as I am making quite a bit of guessing myself.  :)

Edit: I changed ButtonX and Y to MouseX and Y as the latter is what I assume is giving you the mouse coordinates.


PARTNERS