Pirates Classic Remake

Would you like to see this happen?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    0

Pickle: i just put it in a gif to show the animation. i have all the frames saved as .png.


Paulo Becker: i just changed the color from pink to blue in gimp real quick


btw just to let you know i will be doing most of the work on the weekends. (stupid school)
 
BadWolf posted on Sep 25 2006 at 04:45 PM said:
Pickle: i just put it in a gif to show the animation. i have all the frames saved as .png.


Paulo Becker: i just changed the color from pink to blue in gimp real quick


btw just to let you know i will be doing most of the work on the weekends. (stupid school)

Pink background is good, its what im using. png are good too. If the frames are placed with the animation going left to right, that will make life easier.

There are 2 ways I can see doing the waves, either place them in the ascii map or randomly animate them anywhere in the water. THe second I think would be better, just will take more time.
 
Last edited by a moderator:
Pickle posted on Sep 26 2006 at 05:33 PM said:
Pink background is good, its what im using. png are good too. If the frames are placed with the animation going left to right, that will make life easier.

There are 2 ways I can see doing the waves, either place them in the ascii map or randomly animate them anywhere in the water. THe second I think would be better, just will take more time.
do you mean just rotating the animation 90 degrees?

I think that if they are going to go anywhere in the water they would need to be a different animation and just be kind of like a swell.
 
Last edited by a moderator:
BadWolf posted on Sep 26 2006 at 05:02 PM said:
Pickle posted on Sep 26 2006 at 05:33 PM said:
Pink background is good, its what im using. png are good too. If the frames are placed with the animation going left to right, that will make life easier.

There are 2 ways I can see doing the waves, either place them in the ascii map or randomly animate them anywhere in the water. THe second I think would be better, just will take more time.
do you mean just rotating the animation 90 degrees?

I think that if they are going to go anywhere in the water they would need to be a different animation and just be kind of like a swell.

no I dont want to rotate the animation. What i meant was each frame is placed in order from the left to the right. So the leftmost frame has the wave near the bottom and the right most frame the wave is near the top.
I also meant it should be a swell. I just not sure where to actually do the animation, weither it would be staticly asssigned a spot on the map or randomly appear anywhere in the water.
 
Last edited by a moderator:
LIke so? there are 8 frames in there btw.

how about where the swells should be are calculated during a loading time for a set distance from the ship depending where the land is and have it calculate a little more when it passes half of that pre calculated distence...................or something. that way there is the posibility for randumly generated maps in the future.
 
BadWolf posted on Sep 27 2006 at 10:53 PM said:
LIke so? there are 8 frames in there btw.

how about where the swells should be are calculated during a loading time for a set distance from the ship depending where the land is and have it calculate a little more when it passes half of that pre calculated distence...................or something. that way there is the posibility for randumly generated maps in the future.

Thats it exactly, I will try and get this into what I have working so far. Going to try and get a window message system working to. I want to be able just plug in the real graphics when they are ready. I think this is the approach I will need to take with most of the graphics. Create some crappy filler and then hope some really good comes along to replace it.
 
Last edited by a moderator:
ill help as much as I can but during the school week and sometimes on the weekends i dont have much time :/
 
BadWolf posted on Sep 28 2006 at 05:46 PM said:
ill help as much as I can but during the school week and sometimes on the weekends i dont have much time :/

Understandable, it will be the same with me at some point.
 
Last edited by a moderator:
Pickle posted on Sep 29 2006 at 08:31 AM said:
BadWolf posted on Sep 28 2006 at 05:46 PM said:
ill help as much as I can but during the school week and sometimes on the weekends i dont have much time :/

Understandable, it will be the same with me at some point.

Update, made some progress yesterday. Im working on getting my ship to move at any angle 0-359 degress, before I hacked it to move 16 directions. Did my homework and relearned some trig.
You can calculate the rise run from angle, using triangle properties:
1. Convert your angle to radians RAD=DEG/180*PI, where PI=atn(1)*4
2. Get the rise run X=sin(RAD) and Y=cos(RAD)
3. Moving X and Y, you can appear to move in any direction

The problem right now is, I have to work with floats at the moment to get accuracy, but my offsets are long, so it deoesnt quite work, but I have a plan.

Also the frame handling work with any angle, rather than a hardcoded direction. This will be nice if I upgrade to a 32 direction sprite, right now I have a homemade 16.

Also I have some other news, there was a pirates clone project called hunt for gold, its on sourceforge. I contacted the lead of the project and anything can be used as long as this application is released under GPLv2. The problem is I cant seem to get the CVS to work. Can anyone get to it and look for graphical stuff and thier map of the caribean? (Cant use source as its in Java)
 
Last edited by a moderator:
Here's a faster way to work with angles, I hope it helps :)

Code:
// look up bit shifts on google!
// setting a higher value for SHIFT, like 8, would produce even more precise results

#define SHIFT 5;

long int ship_x = 0;
long int ship_y = 0;
int x, y;

int cosTable[360];
int sinTable[360];

// angle set at 45 is just an example...
int angle = 45;

--

for(int x = 0; x < 360; x++) {

  // multiplying the small float from the trig function by 32, then converting the result to int helps maintain precisity

  cosTable[x] = (int)(cos(x) * (2 ^ SHIFT));
  sinTable[x] = (int)(sin(x) * (2 ^ SHIFT));

}

--

ship_x += cosTable[angle];
ship_y -= sinTable[angle];

--

// drawing function, use these values for x and y coordinates:
// this is like doing ship_x / 32 (or ship_x / 2^5), only much faster because it's not floating point!

x = ship_x >> SHIFT;
y = ship_y >> SHIFT;

BlitFunction(x, y, shipgraphic, etc.);

Edit: added comments and fixed some things!

- Alex
 
Alex. posted on Oct 4 2006 at 01:59 PM said:
Here's a faster way to work with angles, I hope it helps :)
- Alex

Cool, I have seen/read this approach to create a look-up table. It would be a good idea since we dont have a FPU. Thanks you for the contribution. Let you know how it goes.

Just going over what you have, why is the angle set to 45 deg?
Also why the shift? Seems its thowing away the data?
 
Last edited by a moderator:
Re-read my previous post, I added comments and fixed something.

- Alex
 
Yeah! 360 movement is working, did with the lookup table but slightly different than Alex's method.

Create the Table:
Code:
//Create Angle Tables
	float pi = (float)atan(1)*4;
	for(int a = 0; a < 360; a++)
	{ 
		sprite_angle[a][0] =  (int)(sin(a*pi/180) * 32767);	//X		
		sprite_angle[a][1] = -(int)(cos(a*pi/180) * 32767);	//Y
	}

The table will create numbers 0 - 32767 (scaled integer's)
Then i created 2 unsigned int's, one for x and the other for y, which are scaled integer also.

Code:
	XPosScaled = 0;
	YPosScaled = 0;

Then when I move, apply the angle velocity and look up the new position. Move by what the anlgle took up table has stored.

Code:
void CSpriteDynamic::MoveByAngle( std::vector<CSpriteStatic>* tiles )
{   
	AddAnglePos( AngleVel );	

	AddYPosAccurate( sprite_angle[AnglePos][1] );		
	collsionbox.y = YPos;	   //Offset the Sprite Collision box	  
	if( tiles != NULL) DetectCollisions( YAXIS, tiles );

	AddXPosAccurate( sprite_angle[AnglePos][0] );
	collsionbox.x = XPos;	   //Offset the Sprite Collision box		
	if( tiles != NULL) DetectCollisions( XAXIS, tiles );  
}

In this part basically 32767 is going to equal 1 pixel, so every time I reach > 32767 i move one pixel, and in the other case every time i go < 0 i move back 1 pixel. I do the same for x and y.

Code:
void CSpriteDynamic::AddXPosAccurate( int posxscaled )
{
	if( posxscaled > 0 )	  //Positive
	{
		if( posxscaled > 65535 - XPosScaled )
		{
			SetXPos( GetXPos() + 1 );
			XPosScaled = posxscaled - (65535 - XPosScaled);
		}
		else
		{
			XPosScaled += posxscaled;
		}
	}
	else if( posxscaled < 0 ) //Negative
	{
		if( -posxscaled > XPosScaled )
		{
			SetXPos( GetXPos() - 1 );
			XPosScaled = 65535 - (-posxscaled - XPosScaled);				 
		}
		else
		{
			XPosScaled += posxscaled;
		}
	}
}
 
Im sorry that i havent had much time but here is a grass tile that dosent look like its a tile :)
http://www.silvir.com/tile.php?src=http://...6/grasstest.png

and in single form
grasstest.png
 
BadWolf posted on Oct 8 2006 at 12:47 AM said:
Im sorry that i havent had much time but here is a grass tile that dosent look like its a tile :)
http://www.silvir.com/tile.php?src=http://...6/grasstest.png

and in single form
grasstest.png

Thanks! One by one and it will get done. I didnt do anything this weekend, needed a break otherwise I probally would go crazy.
Im still trying to implment a "wind" that moves the ship object. I have both coded just need to tie them togther properly.
 
Last edited by a moderator:
I have some great news. In an earlier post I had mentioned the 'Hunt for gold' project and that is was in source forge. Stupid me missed the web CVS viewer. Long story short I have all the graphics/sounds from the project.
This includes all of the ships (3d models, 16 dir), tiles, backgrounds, in-town graphics, and more. The only requirement to use these is the program has to released under GPLv2.
These dont have to be used, but I will use them at least for place holders until something better comes along.
For example there are flag graphics, but there not the greatest and would like to redo them.
(I think the ships are the best from it all)

Heres some samples:

Frigate:


Tiles:


Background:
 
i hate the grass in those tiles :p and the water. the colors are to.....bland?

*stabs clouds*
 
BadWolf posted on Oct 9 2006 at 05:04 PM said:
i hate the grass in those tiles :p and the water. the colors are to.....bland?

*stabs clouds*

stabs clouds?
we can still keep your stuff, but maybe we can use the different types of tiles for ideas. Or use your grass and overlay it on top the these.
 
Last edited by a moderator:
Back
Top