Submit
In response to Humble indy game bundle
6837d514b487de395be51432d9cdd078
0
TheNut 179 Mar 08, 2014 at 19:47

A colleague of mine shops there. Personally I just stick with Steam. Not always the best price (often competes with Amazon and g2g), but if I’m going to buy something I do it with the mentality of supporting the devs.

6837d514b487de395be51432d9cdd078
2
TheNut 179 Mar 08, 2014 at 19:28

If I understand this correctly, I think the problem is understanding what a camera really is. A camera is just a transformation matrix (aka view matrix) that you must calculate the inverse to and apply to all objects in your world. gluLookAt() is a fixed function method that will set the transformation matrix for the current matrix stack. Typically you call this once, then push the stack, then render all your objects by first pushing their individual matrices on the stack, rendering the object, then popping the stack so those object transformations don’t effect future renders.

I don’t know how the Box2D rendering sample works (or if you rolled your own), but I would say stop what your doing immediately. Fixed function programming is deprecated. You should be using programmable shaders (minimum OpenGL 2.x API) and performing your transformations on the GPU. I don’t know of any sites where you can start, but try opengl-tutorial.org. Alternatively, consider an engine suited for 2D gameplay, such as Torque 2D, which I just now found out is open-source.

194653f6bf54cad70a7cf97e6b7f35a4
0
benrawlesmusic 101 Mar 08, 2014 at 16:59

Working on a new short film called ‘Simple Business’. Starting on some medieval music today! Contact me at benrawles.com if you need a composer or sound designer.

2068b9d739ccb5184d90f2ab0d217051
0
jbhargav1992 102 Mar 08, 2014 at 16:39

Umm… Okay! My code is a little messy. But, I’ll try to make it understandable to the best of my efforts. Here goes…

This is the camera class,

PerspectiveView.h:

#include "Include.h"
#define PI 3.14
#define PIdiv180 (PI/180)

struct P_3D_Vector
{
	GLfloat x, y, z;
};

struct P_2D_Vector
{
	GLfloat x, y;
};

P_3D_Vector View_3D_Vector(GLfloat x, GLfloat y, GLfloat z);

class Perspective_View
{
private:
	P_3D_Vector View_Direction;
	P_3D_Vector Right_Vector;
	P_3D_Vector Up_Vector;
	P_3D_Vector Position;
	
	GLfloat Rotated_X, Rotated_Y, Rotated_Z;

public:
	Perspective_View();
	void Render_View(void);

	void Look(P_3D_Vector Direction);
	void Rotate_X(GLfloat Angle); // To rotate the camera along the X-axis
	void Rotate_Y(GLfloat Angle); // To rotate the camera along the Y-axis
	void Rotate_Z(GLfloat Angle); // To rotate the camera along the Z-axis

	void Look_Z(GLfloat Distance); // To translate the camera along the X-axis
	void Look_Y(GLfloat Distance); // To translate the camera along the Y-axis
	void Look_X(GLfloat Distance); // To translate the camera along the Z-axis
};

The Include.h is a single header containing all the headers of all the different libraries.

PerspectiveView.cpp:

#include "Include.h"
#include "PerspectiveView.h"

#define SQR(P) (P*P)

#define NULL_VECTOR View_3D_Vector(0.0f, 0.0f, 0.0f)

P_3D_Vector View_3D_Vector(GLfloat x, GLfloat y, GLfloat z)
{
	P_3D_Vector Temporary;
	
	Temporary.x = x;
	Temporary.y = y;
	Temporary.z = z;
	
	return Temporary;
}

GLfloat Get_View_3D_Vector_Length(P_3D_Vector *V)
{
	return (GLfloat)(sqrt(SQR(V->x) + SQR(V->y) + SQR(V->z)));
}

P_3D_Vector Normalize_3D_Vector(P_3D_Vector V)
{
	P_3D_Vector Resultant;
	float l = Get_View_3D_Vector_Length(&V);
	
	if(l == 0.0f)
		return NULL_VECTOR;

	Resultant.x = V.x / l;
	Resultant.y = V.y / l;
	Resultant.z = V.z / l;
	
	return Resultant;
}

P_3D_Vector operator+ (P_3D_Vector V, P_3D_Vector U)
{
	P_3D_Vector Resultant;
	
	Resultant.x = V.x + U.x;
	Resultant.y = V.y + U.y;
	Resultant.z = V.z + U.z;
	
	return Resultant;
}

P_3D_Vector operator- (P_3D_Vector V, P_3D_Vector U)
{
	P_3D_Vector Resultant;
	
	Resultant.x = V.x - U.x;
	Resultant.y = V.y - U.y;
	Resultant.z = V.z - U.z;
	
	return Resultant;
}

P_3D_Vector operator* (P_3D_Vector V, float R)
{
	P_3D_Vector Resultant;
	
	Resultant.x = V.x * R;
	Resultant.y = V.y * R;
	Resultant.z = V.z * R;
	
	return Resultant;
}

P_3D_Vector Cross_Product (P_3D_Vector *U, P_3D_Vector *V)
{
	P_3D_Vector Resultant_Vector;
	
	Resultant_Vector.x = U->y * V->z - U->z * V->y;
	Resultant_Vector.y = U->z * V->x - U->x * V->z;
	Resultant_Vector.z = U->x * V->y - U->y * V->x;
	
	return Resultant_Vector;
}

float operator* (P_3D_Vector V, P_3D_Vector U)
{
	return V.x * U.x + V.y * U.y + V.z * U.z;
}

Perspective_View::Perspective_View()
{
	Position = View_3D_Vector(0.0f, 0.0f, 0.0f); // Initializing the position of camera
	View_Direction = View_3D_Vector(0.0f, 0.0f, -1.0f); // Initializing which direction to look at
	Right_Vector = View_3D_Vector(1.0f, 0.0f, 0.0); // Initializing the rightward direction vector
	Up_Vector = View_3D_Vector(0.0f, 1.0f, 0.0f); // Initializing the upward direction vector

	Rotated_X = Rotated_Y = Rotated_Z = 0.0f; // Initial Angle
}

void Perspective_View::Look(P_3D_Vector Direction) // Translating the camera in all dimensions
{
	Position = Position + Direction; // Incrementing position of camera when translated
}

void Perspective_View::Rotate_X(GLfloat Angle) // Rotating along the X-axis
{
	Rotated_X += Angle; // Incrementing change in X-axis angle

	View_Direction = Normalize_3D_Vector(View_Direction * (GLfloat)cos(Angle * PIdiv180) + Up_Vector * (GLfloat)sin(Angle * PIdiv180)); // Updating viewing direction

	Up_Vector = Cross_Product(&View_Direction, &Right_Vector) * -1; // Updating upward direction vector
}

void Perspective_View::Rotate_Y(GLfloat Angle) // Rotating along the Y-axis
{
	Rotated_Y += Angle; // Incrementing change in Y-axis angle

	View_Direction = Normalize_3D_Vector(View_Direction * (GLfloat)cos(Angle * PIdiv180) + Right_Vector * (GLfloat)sin(Angle * PIdiv180)); // Updating viewing direction

	Right_Vector = Cross_Product(&View_Direction, &Up_Vector); // Updating rightward direction vector
}

void Perspective_View::Rotate_Z(GLfloat Angle) // Rotating along the Z-axis
{
	Rotated_Z += Angle; // Incrementing change in Z-axis angle

	Right_Vector = Normalize_3D_Vector(Right_Vector * (GLfloat)cos(Angle * PIdiv180) + Up_Vector * (GLfloat)sin(Angle * PIdiv180)); // Updating rightward direction vector

	Up_Vector = Cross_Product(&View_Direction, &Right_Vector) * -1; // Updating upward direction vector
}

void Perspective_View::Render_View(void) // Rendering the camera view
{
	P_3D_Vector View_Point = Position + View_Direction; // Incrementing center with change in movement

	gluLookAt(Position.x, Position.y, Position.z, View_Point.x, View_Point.y, View_Point.z, Up_Vector.x, Up_Vector.y, Up_Vector.z); // gluLookAt() used here to see the game space
}

void Perspective_View::Look_Z(GLfloat Distance) // Translating the camera along Z-axis
{
	Position = (View_Direction * -Distance); // Updating position
}

void Perspective_View::Look_X(GLfloat Distance) // Translating the camera along Z-axis
{
	Position = (Right_Vector * Distance); // Updating position
}

void Perspective_View::Look_Y(GLfloat Distance) // Translating the camera along Z-axis
{
	Position = (Up_Vector * Distance); // Updating position
}

The Main Window,

MainWindow.cpp:

#include "Include.h"
#include "PerspectiveView.h"

int main()
{
	Perspective_View Current_View; // Declaring an object for the Perspective_View class

	b2Vec2 World_Gravity(0.0f, 9.8f); // Defining gravity
	b2World *Game_World = new b2World(World_Gravity, true); // Creating the Box2D world

	b2BodyDef Ground_Body_Def;
	
	Ground_Body_Def.type = b2_kinematicBody; // Defining type of body
	Ground_Body_Def.position.Set(0, 768); // Setting initial position

	b2Body *Ground_Body = Game_World->CreateBody(&Ground_Body_Def); // Creating body

	b2PolygonShape Ground_Shape;
	Ground_Shape.SetAsBox(2000, 69); // Defining body shape

	b2FixtureDef Ground_Fixture_Def;
	Ground_Fixture_Def.shape = &Ground_Shape; // Defining body fixtures

	Ground_Body->CreateFixture(&Ground_Fixture_Def); // Binding fixture to body

	bool No_Key_Pressed = true;
	bool Facing_Right = true;

	while(/*window is running*/)
	{
		Game_World->Step(1/60, 8, 3); // Iterating the game world in Box2D

		if(/*Right Key Pressed*/)
		{
			No_Key_Pressed = false;
			Facing_Right = true;
		}

		if(/*Left Key Pressed*/)
		{
			No_Key_Pressed = false;
			Facing_Right = false;
		}

		if(No_Key_Pressed)
		{
			Current_View.Look_X(0.0); // Don't move
		}

		else
		{
			if(Facing_Right)
			{
				Current_View.Look_X(1.0); // Move Right
			}
			else
			{
				Current_View.Look_X(-1.0); // Move Left
			}
			
		}

		No_Key_Pressed = true;

		Current_View.Render_View(); // Here, we are calling the render function containing the gluLookAt()
	}

	return EXIT_SUCCESS;
}

This is the Main Window. It is quite messy. I have omitted the OpenGL drawing and rendering methods. They execute perfectly so I did not include them in the code above. However, the OpenGL camera and Box2D is the problematic part, hence I included only those function calls. Thank you for your patience to go through my code. It is quite long, I know. You need not go through the whole Perspective_View class. I just included it to show what it does. The actual problem is in the MainWindow itself. I hope it is clear and understandable help solve the problem. Please help me on this. Thank you.

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Mar 08, 2014 at 11:19

Can you post some code (Please remember to format it so we can read it clearly)

Using gluLookAt for 2D is a really bad idea. It’s designed for a perspective view.

2068b9d739ccb5184d90f2ab0d217051
0
jbhargav1992 102 Mar 08, 2014 at 10:33

Well, I used gluLookAt() to create a 3D projection matrix but I am only using the X and Y co-ordinates to move the camera in only two dimensions. Is this the reason why my camera is unable to affect the Box2D bodies? Will using glOrtho() solve this problem? Please tell me this. Thank you.

B5262118b588a5a420230bfbef4a2cdf
1
Stainless 151 Mar 08, 2014 at 10:16

Box2D just returns a set of 2D body positions, unless you are using the debug renderer, rendering is completely up to you.

gluLookAt creates a 3D view matrix, are you projecting the bodies into a 3D space?

I think that is unlikely.

Try using glOrtho instead of gluLookAt

In response to Humble indy game bundle
B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Mar 08, 2014 at 09:00

Yes, a mate of mine put it together and has set up a company just to put together more bundles like this.

It’s surprisingly hard to get developers to agree to bundles.

In response to reply on What to do with crap games
A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Mar 07, 2014 at 14:11

I think that’s part of it. Part of it is that game players and critics are always crying for something new. I see so many reviews that say, there’s nothing new here, so developers start throwing in lame things to please them. Games should just be a constant refinement of game play, tactics, and story delivery if it’s a story game. If anything they should take extraneous things out and be making the UI more intuitional but not to a point where it interferes with strategy.

In response to BaconGameJam07
4018726c138c59d7fb77d59c95f70cbd
0
Silveryard 101 Mar 07, 2014 at 13:16

ANNOUNCEMENT: Only 14 days left until BaconGameJam 07 ;) If you haven´t already registered you might do it now. Do you want to participate in team? No problem. Use our Teamfinder to get yours. There are a lot of people around looking for one

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Mar 07, 2014 at 09:52

There comes a time when you have to either sack, or move a game designer.

I’ve seen it before. They have a hit game, get an ego, release a follow up game, ego gets bigger.

After a few iterations they believe they can do anything and it will be a hit.

So they start playing with the format, change this, change that, blah blah blah

In the complete and total belief that they are infallible.

As we all know, no one is infallible.

Cde90b30459e062a7d4424af18a3e1ca
0
BlankMediaGames 101 Mar 07, 2014 at 05:05

We have gotten some great reviews/let’s plays from some big names on the youtubes: https://www.youtube.com/watch?feature=player_detailpage&v=zSndvoT8Anc#t=5

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Mar 07, 2014 at 01:52

I give my old games to my brother who just basically plays games all the time and doesn’t have a lot of money. I think I gave him a final fantasy a while back because I didn’t like it. Played it about half an hour. I didn’t like the fights, thought I would. The worst was they added these quick time events where you had to push a certain button in a given amount of time. Totally ruined it. I wonder what they are thinking when they add things like that? Here’s a great idea, you have to push a button in a certain amount of time. No strategy, nothing, just push it while it’s lit up. And we’ll change the buttons you have to push, so it won’t be an automatic thing, it will always be frustrating.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Mar 06, 2014 at 21:22

oh i thought my poo was important… its big poo tho! fit on a whole wall, the biggest poo of all time, a big poo is more important, but also more of a disgrace.

Cde90b30459e062a7d4424af18a3e1ca
0
BlankMediaGames 101 Mar 06, 2014 at 12:49

We are working on our own login system so you don’t have to use Facebook. Also, we are talking to some pretty cool YouTubers that are gonna be making Let’s Plays with us. They have over 200k combined subscribers so I think that will bring in some traffic :)

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Mar 06, 2014 at 11:36

Speaking with Joystiq, Kitase said that he “wasn’t really shocked. There are negative reviews and positive reviews, it’s a real mixture. When I started making this game I took on very new challenges, so in a way I had anticipated that there would be mixed opinions, so this is more or less what we had anticipated.”

He anticipated mixed opinions!!!! What a complete and utter cock.

What he is saying is he DELIBERATELY alienated some players. Why the feck would you do that?

This guy is an advert for forced euthanasia

4de273c4867d977112b9766f31653e99
0
greenhousevn 101 Mar 06, 2014 at 08:00

oh. looking graphics for this game. :) like this

6837d514b487de395be51432d9cdd078
0
TheNut 179 Mar 06, 2014 at 07:50

I can’t speak on behalf of the latest Final Fantasies since I stopped playing them after 7, but every one I played was a masterpiece. Having said that, I’d play it to the end and enjoy it for its story. I never really bothered with grinding or finding the top tier treasure in those games. For me, it was all about the story and I even remember a great deal of the plots and characters from all of the series I played. That’s hard to say for a lot of other top games I’ve played where I can only recall certain images and nothing about the characters or their plots.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Mar 05, 2014 at 18:25

Sell it used online? Won’t get full price for it, but better than nothing.

Cde90b30459e062a7d4424af18a3e1ca
0
BlankMediaGames 101 Mar 04, 2014 at 21:49

Continue-play wrote an article about us. http://www.continue-play.com/news/town-of-salem-seeks-funding-on-kickstarter/

Cde90b30459e062a7d4424af18a3e1ca
0
BlankMediaGames 101 Mar 01, 2014 at 21:05

Funding update: We are at 31% funded! The $50 early bird specials sold out very quickly so we added 25 more of them. With a $50 donation you will unlock all of the cosmetic effects for life, you won’t need to pay for anything in the game ever. The game is free to play but the shop sells things like new houses, character skins, pets and other cosmetic effects.

In response to 1° Bit Apps Jam
Fd80f81596aa1cf809ceb1c2077e190b
1
rouncer 103 Mar 01, 2014 at 19:33

wow 5 whole dollars! shit man im excited!!!!

Cde90b30459e062a7d4424af18a3e1ca
0
BlankMediaGames 101 Mar 01, 2014 at 04:30

We are doing a testing event tomorrow at 4pm CST. The Devs will also be in our teamspeak server to personally answer questions for people and to talk with the community.

8ada3e36fdcf96dee59a5eab86cb0184
0
zabast 101 Feb 28, 2014 at 07:55

Maybe your driver or hardware is blacklisted by the browser and it goes back to software rendering. Updating your driver usually helps.

70cce83ee25b1d0f2e86dc3c59efcc1c
0
Credd2012 102 Feb 28, 2014 at 07:34

They would definitely do better if Kinect was optional. People need to remember the design changed since the original Xbox One inception. The “online-only” fiasco really put a niche in the game. Honestly, I think developers are just being lazy when it comes to unlocking the true potential of the console, citing Sony as “easier”. The Xbox One has a great deal of life, the Playstation 4 is the current lovechild of the industry. Sony made a great console, but it hasn’t floored me. Supposedly, it has more horsepower, but it’s not always the size of the tool that counts. It’s how that tool is used.

Welcome to DevMaster, a community-driven game development website of posts and resources!

Recent Tags

indie × 4
game-development × 4
ios × 3
android × 2
mobile × 1
native × 1
macos × 1
physics-engines × 1
windows-phone × 1
sound × 1
music × 1
networking × 1
testing × 1
multiplayer × 1
game-programming × 1
design-patterns × 1
3d-engine × 1
shaders × 1
gaming × 1
cross-platform × 1
royalty × 1
game-design × 1
game-industry × 1
graphics × 1
mmo × 1