Jump to content

  • Log In with Google      Sign In   
  • Create Account


ThePointingMan

Member Since 09 Nov 2010
Offline Last Active Jul 24 2014 12:43 PM

Topics I've Started

Is hatred for unity justified?

21 March 2014 - 03:09 PM

I'm currently going to school for programming, and my 3d graphics teacher absolutely hates unity. He complains about how he can always tell when a game was made with unity because the load times will be huge for small things and he will think to himself, "That shouldn't have taken that long." Another complaint of his is that it does everything for you and thus leads to incredibly generic games. I rather like unity, as it allows me to wip up a game fairly quickly without having to worry about first making a framework, but I must admit hearing his hate for it does spark a bit of fear in me, in the long run if my productions do get bigger, despite unity's ease of use, will it harm my product in the end, or is that entirely dependent on the user? If my fundamentals of coding are strong enough does it's easy workflow still come with a price or is it just as efficient as any other engine or is my teachers hate for unity justified?


Smoothing out the ray tracing of a surface on a curve

13 October 2013 - 04:51 AM

I've been using unity for some school projects recently, and I made a  racing game fairly similar to F-zero GX. It was really unpolished though, and I've got a question about one thing that I thought really needed polish. While the hover car goes along the track, it shoots a ray directly below it and orientates itself so that the car's up is the same as the surface's normal. Gravity is always pulling in the hover cars down direction. The biggest problem I am having with doing this is that with upward curves. Lets say I was doing a loop de loop. The car would move forward by an amount, then orientate itself and move forward again. If you are going fast enough though, you end up moving so far forward that you tap the surface of the loop de loops curve with your ship, making you loose all momentum. Does anyone have any ideas as to what I could do to work around this?


Depth Transparecy issues.

18 June 2013 - 09:43 AM

I've been working on a Direct3D game run for a while now and I've come across an issue with alpha blending that I don't quite know how to solve. 

I've set my render states like this

// both sides of the triangles
    d3ddev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);    
	//Set render states
	d3ddev->SetRenderState(D3DRS_LIGHTING, FALSE);// turn off the 3D lighting
	//make it so things color can fade
	d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
	d3ddev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
	d3ddev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
	//-------------------------------------------------------------
    d3ddev->SetRenderState(D3DRS_ZENABLE, TRUE);    // turn on the z-buffer
	d3ddev->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);

Now at first I thought everything was perfectly fine, things that where transparent in my png file would go on screen transparent, but I later found out that they will only be transparent to things they have been rendered after, so if i render a see through a space ship, and then a red cube and then an asteroid and put the red cube in front of both the space ship and the asteroid, only the space ship will be visible with a red tinge, the asteroid will be completely blocked out. Does anyone know why this is happening and how it can be solved?


Rotation in 3D

06 June 2013 - 05:42 PM

I am using direct x to try and make a free roaming camera. I am having a bit of difficulty when it comes to rotation. I have tried a few things, each having different result, none being the results that I want. This is basically how my camera system works. I plan on changing it a lot later, but i needed this to be done fast, and its mostly functional.

for(auto index = targets.begin(); index != targets.end(); index++)
		{
			auto node = static_cast<CameraNode*>(*index);
			if(node->Player != NULL)
			{
				Position = node->Position;//this is a pointer to the players position vector
			}
			if(Position != NULL)
			{
				

				static int i;
				i++;
				//Deal with the matrices
				D3DXMATRIX mTranslate;
				D3DXMATRIX mRotateX;
				D3DXMATRIX mRotatey;
				D3DXMATRIX mRotatez;
				D3DXMATRIX mScale; //MAYBEH LAAAAATA
				D3DXMATRIX mWorld;
				//Set All Matrices to a neutral state
				D3DXMatrixIdentity(& mWorld);
				D3DXMatrixIdentity(&mTranslate);
				D3DXMatrixIdentity(& mRotateX);
				D3DXMatrixIdentity(& mRotatey);
				D3DXMatrixIdentity(& mRotatez);
				D3DXMatrixIdentity(& mScale);
				//MoveEverythaaaang
				D3DXMatrixTranslation(&mTranslate,Position->Position.x,Position->Position.y,Position->Position.z);
				D3DXMatrixRotationX(&mRotateX,Position->Angle.x*(M_PI/180));
				D3DXMatrixRotationY(&mRotatey,Position->Angle.y*(M_PI/180));
				D3DXMatrixRotationZ(&mRotatez,Position->Angle.z*(M_PI/180));
				//Update the world
				mWorld = mTranslate * mRotateX * mRotatey * mRotatez;// this line maximum important

				// set the view transform
				D3DXMatrixLookAtLH(&node->Camera->mCamera,
				&D3DXVECTOR3 (0.0f, 0.0f, 600.0f),    // the camera position
				&D3DXVECTOR3 (0.0f, 0.0f, 0.0f),      // the look-at position
				&D3DXVECTOR3 (0.0f, -1.0f, 0.0f));    // the up direction
				// set the projection transform
			
				D3DXMatrixPerspectiveFovLH(&node->Camera->mLense,
										   D3DXToRadian(45),
										   (FLOAT)600 / (FLOAT)600,
										   1.0f,    // the near view-plane
										   1000000.0f);    // the far view-plane
			
				node->Camera->mCamera = node->Camera->mCamera * mWorld;
			}
		}

So basically I am multiplying the camera's matrix by a matrix that is being affected by a vector containing pitch, yaw, and whatever the name for the other axis of rotation is, and a position vector

 

Now if I multiply mtranslate by the rotation matrices, then I can turn my camera just fine, but moving forward only goes the base forward, so it I am looking left, forward is not to the left, but remains unchanged.

if i do it the other way around then when i rotate I orbit around the center point.

To counter this I when't with the one that would still move forward and backwards independent of which direction you are looking and threw this in to my player move thing.

for(auto index = targets.begin(); index != targets.end(); index++)
		{
			auto node = static_cast<MoveNode*>(*index);
			//Deal with the matrices
			D3DXMATRIX mTranslate;
			D3DXMATRIX mRotateX;
			D3DXMATRIX mRotatey;
			D3DXMATRIX mRotatez;
			D3DXMATRIX mScale; //MAYBEH LAAAAATA
			D3DXMATRIX mWorld;
			//Set All Matrices to a neutral state
			D3DXMatrixIdentity(& mWorld);
			D3DXMatrixIdentity(&mTranslate);
			D3DXMatrixIdentity(& mRotateX);
			D3DXMatrixIdentity(& mRotatey);
			D3DXMatrixIdentity(& mRotatez);
			D3DXMatrixIdentity(& mScale); 
			//MoveEverythaaaang
			D3DXMatrixTranslation(&mTranslate,node->Position->Position.x,node->Position->Position.y,node->Position->Position.z);
			D3DXMatrixRotationX(&mRotateX,node->Position->Angle.x*-(M_PI/180));
			D3DXMatrixRotationY(&mRotatey,node->Position->Angle.y*-(M_PI/180));
			D3DXMatrixRotationZ(&mRotatez,node->Position->Angle.z*-(M_PI/180));
			D3DXMATRIX mRotation = mRotateX * mRotatey * mRotatez;

			D3DXVECTOR3 Position;

			//D3DXVec3TransformCoord(&Position,&node->Velocity->VelocityPos,&mRotateX);w
			D3DXVec3TransformCoord(&Position,&node->Velocity->VelocityPos,&mRotation);
			//D3DXVec3TransformCoord(&Position,&node->Velocity->VelocityPos,&mRotatez);
			node->Position->Position += Position;// * time;
			node->Position->Position += Position;// * time;
			node->Position->Angle += node->Velocity->AngularVelocity;// * time;
		}

Now this works if I only rotate on one axis, but as soon as I start rotating on 2 things go crazy!

 

Any advise on how I should go about making this not go insane for a free roaming camera/how have you accomplished what I am trying to do in the past?


Component Entity system difficulties

08 May 2013 - 01:04 PM

I've been interested in the component entity system for a while, and figured I would fallow this guide on making one, break it down and figure out how everything works. http://www.richardlord.net/blog/what-is-an-entity-framework It worked pretty good for a while but I am having difficulties with the core of it, I can register components and systems to my engine, but one of the things this guide does not cover is how to actually convert all these components into nodes that the systems can use. Would anyone have any insight as to how this would be completed? The guide uses action script, but i am coding in c++ btw.

 

Also on a side note, do you feel that the component entity system is a good one? I spoke with a teacher about it and he said it wasn't how he liked to think about things, so he didn't use it. Also mentioning that if you go to EA none of the games he worked on used this system. He wouldn't say that it was bad, he just said that nothing hes worked on has used it, because they didn't need to.

I'm wandering what the advantages of it over others is, as well as any disadvantages.


PARTNERS