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!


cozzie

Member Since 13 Oct 2004
Offline Last Active Today, 06:30 AM

#5230582 What does this mean: 0 < r, g, b, a < 1

Posted by cozzie on 23 May 2015 - 10:32 AM

Thanks, makes much more sense now.
To be honest 0 < r confuses me a bit, but not when I turn it around: r > 0


#5229779 game design from scratch

Posted by cozzie on 19 May 2015 - 03:05 AM

If you want, you could reuse some of this (approach, not content :)):
http://www.crealysm.com/other/BooH%20-%20Game%20design%20document%20-%20final.pdf


#5229678 Should I use an installer or .zip for my game?

Posted by cozzie on 18 May 2015 - 02:38 PM

Installer if you ask me, I've recently did this the first time and used "Inno setup".
Works like a charm, looks professional and is easy to use (also if a user wants to uninstall).

You can also add a txt file which can be shown before or after the install (readme, eula etc.).

 

You can check it out here:

http://www.crealysm.com/games/booh_setup.exe




#5229100 Collision & v-sync

Posted by cozzie on 15 May 2015 - 04:18 AM

Problem solved already.
Was a mix up between using "old" deltaT and new method.


#5229097 Collision & v-sync

Posted by cozzie on 15 May 2015 - 02:53 AM

It's been a while, but I've finally implemented it and tested it out, so for no luck.

updateDT seems to stay 0 or very low, resulting in now movements anymore in my game.

 

Any ideas?

int WINAPI WinMain(HINSTANCE hInstance,
				   HINSTANCE hPrevInstance,
				   LPSTR lpCmdLine,
				   int nCmdShow)
{

// load and initialize the game

	// TESTING DELTA T - GAME UPDATING (WITHOUT VSYNC)
	__int64 cntsPerSec = 0;
	QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec);
	float secsPerCnt = 1.0f / (float)cntsPerSec;
	
	__int64 prevTimeStamp = 0;
	QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp);

	long long physicsDelta = 0;
	long long physicsDT = __int64(float(cntsPerSec) / 60.0f);	// 1/60th second to update game

	// CONTINUE

	bool run = true;
	while(run)
	{
		_game.mInput.UpdateKeys();
	
		while(PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
			if(msg.message == WM_QUIT) run = false;
		}
		//_game.mTimer.CalcFps();
	
		if(active)
		{
			if(_game.mD3d.CheckDevice())
			{	
				/**** TESTING DELTA T - TIMING FOR GAME UPDATING (WITHOUT V-SYNC) *****/
				__int64 currTimeStamp = 0;
				QueryPerformanceCounter((LARGE_INTEGER*)&currTimeStamp);
				physicsDelta += (currTimeStamp - prevTimeStamp);
				float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt;
				/***** CONTINUE ****/

				// Game updating, including player, audio etc.
				
				/****** TESTING DELTA-T ******/
				while(physicsDelta >= physicsDT)
				{
					float updateDT = float(physicsDT) / float(cntsPerSec);
					physicsDelta -= physicsDT;

					if(!_game.Update(updateDT))
					{
						run = false;
					}
				}
				prevTimeStamp = currTimeStamp;

				// Rendering
				if(!_game.Render())
				{
					_game.mD3d.MsgBoxError(err_render);	
					run = false;
				}
			}
		}
	}
	return (INT)msg.wParam;
}




#5228839 What models are these, 2d or 3d

Posted by cozzie on 13 May 2015 - 02:20 PM

I would say 3d models, based on the shadows I see.
My expectation is also that ingame the models animate/ rotate, like meshes, not sprites.

For me it would take like forever, since I'm no modeler :)


#5228341 Creating Traffic lights (.x)

Posted by cozzie on 11 May 2015 - 06:07 AM

You could make one mesh for the trafic light pole/ object with it's textures, and then create a point light. The point light can be set at different position and color to control red, amber and green


#5228093 Is it efficient to sort a "render-queue" for less texture-switches?

Posted by cozzie on 09 May 2015 - 06:49 AM

First idea would be yes, but always profile to see if it really does (unless your not bound at all on cpu or gpu, if so, why change at all?)


#5228083 4x4 matrix determinant?

Posted by cozzie on 09 May 2015 - 05:46 AM

Hi guys,

I've been learning how to calculate matrix determinants, which is all so far so good.

Until the moment I want to calculate it for a 4x4 matrix.

 

For a 3x3 matrix I know that:

 

a11 a12 a13

a21 a22 a23

a31 a32 a33

DET = (A22 * A33) - (A23 * A32)

 

So I brushed up my knowledge by googling and studying examples.

I think I found out how it should be done, but an online calculator tells me otherwise.

 

Below my interpreation & execution of calculating the determinant for a 4x4 matrix.

Where I basically apply the 3x3 matrix determination calculation multiple times.

 

I hope someone can tell where I'm off/ doing something wrong.

Any input appreciated as Always.

 

4x4determinantNOK.jpg




#5227006 Collision & v-sync

Posted by cozzie on 03 May 2015 - 03:02 PM

Thanks.

Doing option 1 (don't support disabling vsync) actually solved the problem already (for my game in this situation).
Although I expect you to say that I'd be Lucky, because in theory it's not how it should work :)

 

So I'd really like to learn/ figure out how to decouple deltaT/ timing for rendering and 'physics'/ updating gameplay stuff.

 

I don't fully understand how to get there, but what I think is that:

- each update of the game I render

- based on elapsed time and 'set' time for rendering and/or physics/updating game, for some frames I won't call updating the game

 

It's a bit fuzzy still, maybe you can point me a bit in the right direction

(I've read the article multiple times, but don't understand yet how to go from there, in my code).

 

Here's some code snippets of my current solution:

 

Timer initialization (called with parameter value 60):

void CTimer::Init(const float pTargetFps)
{
	mTargetFps = pTargetFps;
	QueryPerformanceCounter((LARGE_INTEGER*)&mFrameDelay);
	QueryPerformanceFrequency((LARGE_INTEGER*)&mTicksPerSecond);

	mStartTime = GetTickCount(); // for testing only
}

Timer updating:

void CTimer::CalcFps()
{
	QueryPerformanceCounter(&mCurrentTicks);
	mSpeedFactor = (float)(mCurrentTicks.QuadPart-mFrameDelay.QuadPart) / ((float)mTicksPerSecond.QuadPart/mTargetFps);

	mFps = mTargetFps / mSpeedFactor;
	if(mSpeedFactor <= 0.0f)
		mSpeedFactor = 1.0f;

	mFrameTime = ((mCurrentTicks.QuadPart - mFrameDelay.QuadPart) * 1000 / mTicksPerSecond.QuadPart);

	mFrameDelay = mCurrentTicks;
}

Main loop:

	bool run = true;
	while(run)
	{
		_game.mInput.UpdateKeys();
	
		while(PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
			if(msg.message == WM_QUIT) run = false;
		}
		_game.mTimer.CalcFps(); // updates deltaT
	
		if(active)
		{
			if(_game.mD3d.CheckDevice())
			{	
				// Game updating, including player, audio etc.
				if(!_game.Update())
				{
					run = false;
				}

				// Rendering
				if(!_game.Render())
				{
					_game.mD3d.MsgBoxError(err_render);	
					run = false;
				}
			}
		}
	}

Part of game updating, moving the player:

		// GetMovement returns vector3 based on current direction
		VECTOR3 movement = mPlayer.GetMovement() * mTimer.GetDelta();
		mPlayer.Move(movement);

		bool collides = PlayerCollidesWall(mPlayer);

		if(collides)
		{
			mPlayer.SetPosition(mPlayer.GetLastPosition());		// move back player
			mPlayer.SetDirection(0);
		}

Does 'decoupling' mean that in my main loop I have to keep 'track of time', and basically desynchronize the calling of Update() and Render()?




#5226927 Collision & v-sync

Posted by cozzie on 03 May 2015 - 04:38 AM

Thanks, I've just read the article.
From what I understand, I have a couple of options:

- don't support disabling Vsync
- go for a fixed timestep
- split up "timing" for rendering vs physics (in my case player movement)
- set a minimum deltaT

Option 1 and 4 sound best to me.
Honestly I don't how to implement option 3 anyway.

If possible I'd like to leave my main loop alone, where I currently dont do anything with delays or frametimes (other then updating my timer/ deltaT), because multiplying deltaT with each movement (physics) works fine 99% of the time (this issue is the 1st I ever encounter on timing).

Btw, my current deltaT is set up with a static fps, so I basically setup the timer for 60fps, and update each frame to calculate the correct deltaT (would this be a fixed timestep?)


#5225416 Dx11, directxmath and d3dx

Posted by cozzie on 25 April 2015 - 06:18 AM

Thanks guys.
So basically if I don't plan to move to supporting Windows phone I could stay with d3dx11.

And if not go for assimp for now and maybe my own pipeline format later.

Just some last questions;
- does assimp also feature image loading? (Ie for sprites and textures)
- if a Windows Phone has a d3d11 compliant gpu, will a win32 application then simply run on it?
- what would be a good replacement for the d3dx9 sprite and font types/ functionality?


#5224890 Best Program for Beginners?

Posted by cozzie on 22 April 2015 - 12:35 PM

Not much too add to gian-reto.
One small remark; 3ds max can be used for free (student license), as long as you don't commercialize your resulting product (did the check with autodesk personally, to make sure :))


#5224541 Remaking Mario 64 from scratch, how long?

Posted by cozzie on 20 April 2015 - 12:56 PM

 

Maybe a bit off topic, but I would definately be willing to pay a few bucks for a good remake. Unfortunately nintendo and the world of law and all non-shared interests wont let this happen. Memories about the introduction are always good to remember smile.png

Dude, what are you talking about? They gave you the remake on the DS a couple years ago. You can play the original in Virtual Console. Nintendo has not abandoned that property.

 

For the PC I only now the emulator version which doesn't like quite well




#5224525 Remaking Mario 64 from scratch, how long?

Posted by cozzie on 20 April 2015 - 11:56 AM

Maybe a bit off topic, but I would definately be willing to pay a few bucks for a good remake. Unfortunately nintendo and the world of law and all non-shared interests wont let this happen. Memories about the introduction are always good to remember :)




PARTNERS