Go Back  
Reply
 
Thread Tools
Old 09-19-2011   #1
hackboiz29
Member
 
hackboiz29's Avatar
 
Join Date: Jan 2011
Location: Canada
Posts: 693
Likes: 337
Liked 346 Times in 191 Posts
Mentioned: 10 Post(s)
Tagged: 0 Thread(s)
[Released] They Do Not Die v0.5 - ThatOtherDev

ThatOtherDev, known for many entertaining homebrew games has just updated his popular game They Do ... [Read More]
__________________

Check Out Annelies
Black Screen Games? Troubleshoot tutorial here
hackboiz29 is offline   Reply With Quote
Likes: (1)
Old 09-19-2011   #2
Thelostdeathknight
Lord Loren Soth
 
Thelostdeathknight's Avatar
 
Join Date: Jan 2011
Location: Dargaard Keep
Posts: 2,088
Likes: 1,924
Liked 1,171 Times in 654 Posts
Mentioned: 39 Post(s)
Tagged: 0 Thread(s)
moved to front page!
__________________
Thelostdeathknight is offline   Reply With Quote
Old 09-20-2011   #3
Rogerdodger91
Member
 
Join Date: Jan 2011
Posts: 78
Likes: 0
Liked 23 Times in 14 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Hmm well in psuedo code i would do the fade away thing like this.

Struct Blood
{
vector4 bloodColorTrans = 0.0f,0.0f,0.0f,0.0f
Int DespawnCounter = 5

//And any other information you might need ect, like coordinates, size, ect //and a sturct constructor.
}

Blood bloodSprite = new Blood("path/to/sprite") //plus other consturct args

List<Blood> bloodList = new list<Blood>()

GameTime counter = GameTime.getSecond()

If(Bullet.Collision)
bloodList.Add(bloodSprite)

Foreach(blood in bloodList)
{
Draw(blood)
}

If (counter % 2.0f == 0) //
{
If (!bloodList == null)
Foreach(blood in bloodList)
{
If(blood.Counter > 0)
{
blood.BloodColorTrans = BloodColorTrans - vector4(0f,0f,0f,.2f);
blood.DespawnCounter - 1;
}
Else
blood.delete();
}
}

This is just a roughdraft of how i would start. (in C# hehe. )
************* [ - Post Merged - ] *************
Perhaps people should add on to what i put?
Rogerdodger91 is offline   Reply With Quote
Old 09-20-2011   #4
ThatOtherPerson
Homebrew Developer
 
ThatOtherPerson's Avatar
 
Join Date: Jun 2009
Posts: 66
Likes: 0
Liked 65 Times in 20 Posts
Mentioned: 3 Post(s)
Tagged: 0 Thread(s)
I have no problem with deciding when and where to place blood or their alpha value. I already have that implemented and it is working pretty well in a build that I have running on Windows using OpenGL for rendering (before anyone asks yeah I'll be releasing Windows versions eventually).



My problem comes when I get to that "Draw(blood)" part you mentioned.

This is what I've got now. It is imperfect when fewer then the maximum number of decals are in existence but whatever I'm content with it, it doesn't take long for 500 blood or corpse sprites to be spawned and I can improve upon it later.

Code:
#ifdef WIN
glBindTexture(GL_TEXTURE_2D,persontexture);
#endif
#ifdef PS3
usetexture(persontexture_image);
#endif
for(int a=0;a<decalcount;a++){
	#ifdef WIN
	glColor4f(1.f,1.f,1.f,(float)a/(float)maxdecalcount); 
	#endif
	draw2dquad(
		decallist[a].posx,
		decallist[a].posy,
		0.75f,0.75f,
		decaltexturecoords[decallist[a].type],
		1,decallist[a].angle);
}
#ifdef WIN
glColor4f(1.f,1.f,1.f,1.f); 
#endif
With this being the PS3 version of that draw2dquad function

Code:
void draw2dquad(float posx,float posy,float sizex,float sizey,float *texturecoords,bool centerandrotate,float angle){
	#ifdef PS3
	if(centerandrotate==0){
		float verts[]={
			posx,		posy+sizey,
			posx+sizex,	posy+sizey,
			posx+sizex,	posy,
			posx,		posy,};
		realityVertexBegin(context,REALITY_QUADS);{
			for(int b=0;b<4;b++){
				realityTexCoord2f(context,texturecoords[b*2],texturecoords[b*2+1]);
				realityVertex4f(context,verts[b*2],verts[b*2+1],0.0,1.0);
			}
		}
		realityVertexEnd(context);
	}else if(angle==0){
		sizex*=0.5f;
		sizey*=0.5f;
		float verts[]={
			posx-sizex,	posy+sizey,
			posx+sizex,	posy+sizey,
			posx+sizex,	posy-sizey,
			posx-sizex,	posy-sizey,};
		realityVertexBegin(context,REALITY_QUADS);{
			for(int b=0;b<4;b++){
				realityTexCoord2f(context,texturecoords[b*2],texturecoords[b*2+1]);
				realityVertex4f(context,verts[b*2],verts[b*2+1],0.0,1.0);
			}
		}
		realityVertexEnd(context);
	}else{
		angle*=-1;
		sizex*=0.5f;
		sizey*=0.5f;
		float vertsunrotated[]={
			0-sizex,	0+sizey,
			0+sizex,	0+sizey,
			0+sizex,	0-sizey,
			0-sizex,	0-sizey,};
		float verts[]={
			posx+vertsunrotated[1]*sin(angle)+vertsunrotated[0]*cos(angle),	posy+vertsunrotated[1]*cos(angle)-vertsunrotated[0]*sin(angle),
			posx+vertsunrotated[3]*sin(angle)+vertsunrotated[2]*cos(angle),	posy+vertsunrotated[3]*cos(angle)-vertsunrotated[2]*sin(angle),
			posx+vertsunrotated[5]*sin(angle)+vertsunrotated[4]*cos(angle),	posy+vertsunrotated[5]*cos(angle)-vertsunrotated[4]*sin(angle),
			posx+vertsunrotated[7]*sin(angle)+vertsunrotated[6]*cos(angle),	posy+vertsunrotated[7]*cos(angle)-vertsunrotated[6]*sin(angle),};
		realityVertexBegin(context,REALITY_QUADS);{
			for(int b=0;b<4;b++){
				realityTexCoord2f(context,texturecoords[b*2],texturecoords[b*2+1]);
				realityVertex4f(context,verts[b*2],verts[b*2+1],0.0,1.0);
			}
		}
		realityVertexEnd(context);
	}
	#endif
}
Yeah I know there is undoubtedly a lot of room for optimization especially when it comes to dealing with rotated sprites but the relevant part is that I obviously can't use glColor4f without OpenGL so I need a PS3 specific alternative.
__________________

Last edited by ThatOtherPerson; 09-20-2011 at 02:43 AM.
ThatOtherPerson is offline   Reply With Quote
Likes: (2)
Old 09-20-2011   #5
Rogerdodger91
Member
 
Join Date: Jan 2011
Posts: 78
Likes: 0
Liked 23 Times in 14 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
void realityDrawVertexBuffer(gcmContextData *context, uint32_t type, uint32_t start, uint32_t count);
************* [ - Post Merged - ] *************
Let me see if i can find what your looking for regarding the glcolor4.
Rogerdodger91 is offline   Reply With Quote
Old 09-20-2011   #6
daveyp187
Member
 
daveyp187's Avatar
 
Join Date: May 2011
Location: UK
Posts: 743
Likes: 114
Liked 173 Times in 108 Posts
Mentioned: 24 Post(s)
Tagged: 0 Thread(s)
I love this game
thanks for the update.
__________________

Ps3 3.55WT, 1TB HDD,
Find me on twitter@daveyp187
daveyp187 is offline   Reply With Quote
Old 09-20-2011   #7
jonnyjaeger
Member
 
Join Date: Sep 2010
Posts: 299
Likes: 122
Liked 66 Times in 48 Posts
Mentioned: 20 Post(s)
Tagged: 0 Thread(s)
Gonna try this one out as soon as I get home from work tomorrow. Seems like an awesome game. Thanks and keep up the good work!!
jonnyjaeger is offline   Reply With Quote
Old 09-20-2011   #8
cloneking666
Apprentice
 
Join Date: Sep 2011
Location: us
Posts: 10
Likes: 0
Liked 0 Times in 0 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
this would be a cool game.

some one showed make like a postal game. but a lot cooler. and more blood-yer.
cloneking666 is offline   Reply With Quote
Old 09-22-2011   #9
lukethomasx
Member
 
lukethomasx's Avatar
 
Join Date: Feb 2011
Posts: 268
Likes: 55
Liked 38 Times in 31 Posts
Mentioned: 4 Post(s)
Tagged: 0 Thread(s)
Originally Posted by cloneking666 View Post
some one showed make like a postal game. but a lot cooler. and more blood-yer.
hop to it clone king. But anyway this game is awesome and I can't wait to try co op with my gf later
************* [ - Post Merged - ] *************
I just wish it had some music/sound effects
__________________
Fat 3.55 cobra nfw 500 gb
Slim 4.0 ofw 320 gb
lukethomasx is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



PS3Hax.net is Copyright © 2010-2013.
Use of this site is governed by our Terms of Use and Privacy Policy. All Trademarks and images are owned by their respected owners.
Posts and links are subject to each author on this forum and are no way affiliated with the operations and/or opinions of ps3hax.net
All times are GMT -5. The time now is 09:28 PM.