![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Airstrike Development within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Version 0.01 For Version 1.5 PSPs Download here Airstrike is a clone + new features of a Missile Command. Basically, ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() Developer
|
Version 0.01
For Version 1.5 PSPs Download here Airstrike is a clone + new features of a Missile Command. Basically, you have to protect a base from incoming missiles coming down. At the moment there isn't a base though! lol Done - Added collision with missile codeToDo - Allow the cannon to target the cursor (thus aiming the cannon) and add a delay, also add limited ammoAnyway, even though it's at an early state, it's still quite playable. Instructions - If you wish to play an Mp3 while you play, rename an Mp3 music.mp3 and place it in the main folder Control the cursor using the Analog Stick Press Cross to fire Press Triangle to pause the music Press Start to pause, and Start > Select to exit Press R multiple times to speed up the cursor and L to slow it down again, useful later on in the game Still much to be improved on, but it will be coming eventually! If anyone is curious on the source code, I'll upload it, but it's not pretty and not advanced, so ... =) Old Version - 01 here Last edited by Smerity; 02-05-2006 at 11:09 PM.. |
|
|
|
|
|
#2 |
![]() ![]() Developer
|
For those interested, this is how the game looks at the moment -
As you can see, it's quite bare. I'm going to create the base and background after I work out how to rotate the cannon so it faces the cursor. Rotating it also means that I won't have to produce a large amount of images of the cannon at different angles. |
|
|
|
|
|
#4 |
![]() ![]() Developer
|
Thanks for the feedback harleyg =)
And yes, correct you are =) <ding ding ding> lol I separated the turret into the base and the top part, that was the easy bit =) Rotating the turret top is being quite difficult at the moment lol... I'm using OpenGL to try and place the turret onto a polygon as a texture and the rotate the polygon. If anyone else has an easier way to do it, I'd love to hear! lol |
|
|
|
|
|
#5 |
![]() ![]() Developer
|
<evil laugh>
It's rotating! Kind of... <cough cough> The turret has rotated (yes, I know it's not in two pieces, but at the moment I think it's more important I get the rotate function operating first)... The lines on the outside are caused by it going for a value that doesn't exist (ie, it wants a high pixel at 150 when the image is only 100 pixels high) and it is also going out of bounds (won't happen with the individual top of turret) From some talking in #pspdev (thanks mortehu) it appears that pretty much no matter how you rotate the image you'll end up with some artifacts. Best you can do is filter it a bit. Either way though, I don't mind if the image quality falls a little bit if it saves on images. Another interesting thing is it should have done a flip (I entered 180 degrees) and it did this... May have a kink in the line... The only real problem I have now, other than fixing up some small issues, is that the PSP hits a crawl with it. Mp3 plays full speed, but the screen refresh ends up dying to like a pixel every 5 seconds. If I can fix that though, the world's my oyster, and I'll start on the background, cuz I know you all want pretty pictures over functionality ^_^ Last edited by Smerity; 02-15-2006 at 04:25 AM.. |
|
|
|
|
|
#6 |
![]() ![]() Developer
|
Update - Got rid of those weird lines around the cannon. As I suspected they were from the conversion process trying to get pixels not actually in the image.
Still on the problem of speed however... If I place the code below out of the loop, I can play the game full speed. If it enters the loop at all however, it becomes painfully slow! If any PSP coders could have a look and may know the cause, please comment. Code:
int angle = 90, angleold = 0, imgx = 100, imgy = 100;
if ( angleold != angle )
{
angleold = angle;
int yx = 0;
int xx = 0;
int px = 0;
int py = 0;
int color;
while (yx < imgy){
while (xx < imgx){
int xi = xx - (imgx/2);
int yi = yx - (imgy/2);
px = xi*cos(angle) - yi*sin(angle) + (imgx/2);
py = xi*sin(angle) + yi*cos(angle) + (imgy/2);
if ( px < 0 ) px = 1; // following little bit gets rid of weird lines
if ( py < 0 ) py = 1;
if ( px > imgx ) px = 1;
if ( py > imgy ) py = 1;
color = getPixelImage( px, py, cannon_o); // this is what I'm worried about
putPixelImage(color, xx, yx, cannon); // and this...
xx++;
} // x <
xx=0;
yx++;
} // y <
} // if angle ! 0
-Edit- Talking on #pspdev, chip-pwl confirmed that memory bandwidth for the PSP is limited, and he suggested tentatively trying to use the GE (graphics engine) to do the work... 1:18 AM now, may or may not get around to testing it tonight... -Edit Edit- It does seem to be the low bandwidth for vram that is causing the slow downs. I either need to use the Graphic Engine's bandwidth or I need to put the texture on a polygon and rotate it. Looking more towards the latter at the moment. Giving up right now though, 3:37 AM in the morning, parents'll kill me =) Last edited by Smerity; 02-05-2006 at 08:35 AM.. |
|
|
|
|
|
#7 |
![]() |
You'd probably have alot more luck just making individual "rotated" .png's of the turret in photoshop, then have a function to determine what angle the turret is at and to blit that particular .png
I think doing software rotation on a sprite is a bad idea....even photoshop only does a so so job at it, so I wouldn't trust the PSP too far... Oh and on your speed problem there...that is alot of math to be making the psp do every cycle (which seems to be 100' or 1000's of times a second) I take it that's the rotation algorithm ? if so you should only call that when the user actually moves the cursor...oh yeah and I just read what you put below your code....yeah if you are not using GE then you are really limiting yourself to what you can do...i'd suggest looking at http://www.scriptscribbler.com/psp/t...s/lesson04.htm and switch over all your draw functions...
__________________
PSN: Shatterdome Last edited by Shatterdome; 02-05-2006 at 11:35 AM.. |
|
|
|
|
|
#8 | |
![]() ![]() Developer
|
Shatterdome, all my functions (apart from the bounding circle) are done using the Graphics Engine.
I really want to try and veer away from the multiple turret images / angles certain images work at. It wastes quite a bit of space and is a bit inelegant =) Quote:
I believe the limiting factor at the moment is the bandwidth for manipulating the pixels. I am going back to full GE like you suggested though. The only way to get work around this problem would be to put the images into the GE's vram and I have no clue how to do so. So, I'm going to be putting this image onto an OpenGL polygon and rotating it. Thanks for the comment =) |
|
|
|
|
|
|
#9 |
![]() ![]() Your Fate is Grim...
|
why does every GFX artist use photoshop? it looks too bare for me. paint shop pro has a bit more functions and it looks better. i dont know if it costs more though. anyway, great game! i can make a BG if you wish. just pm me or tell me.
__________________
-------------------------------------------------------------------------------------- ![]() |
|
|
|
|
|
#10 | |
![]() |
Quote:
__________________
[url=http://www.barbdwyer.com/footer.php][img]http://www.barbdwyer.com/8Ball.jpg[/img][/url] [FONT=Verdana][SIZE=1] [b]PSP Developer Resource Site:[/b] [url=http://www.psp-programming.com]PSP-Programming.com[/url] [b]Other:[/b] [url=http://wake-boarding.org]Wakeboarding[/url], [url=http://water-skiing.org]Waterskiing[/url], [url=http://wake-surfing.org]Wake Surfing[/url], [url=http://www.guitarhero-4.com]Guitar Hero IV[/url][/SIZE][/FONT] |
|
|
|
|
|
|
#11 | |
![]() ![]() Your Fate is Grim...
|
Quote:
__________________
-------------------------------------------------------------------------------------- ![]() |
|
|
|
|
|
|
#12 |
|
Yeah looks great!
Now i'm sure its got nothing to do with your slowdown problem - but humour me for a little bit will you. Just try taking the sin() and cos() calls out of your nested while loops (the c optimiser may already do this, not sure...). In fact if you work the maths all the way through i think you'll find that you dont need to use sin or cos at all! Made a similiar game in javascript ages ago for the PSP browser, may be some useful code in it (search for PSPtrooper). Hope it helps and good work. |
|
|
|
|
|
|
#13 |
![]() ![]() Developer
|
Version 0.02 is now up!
Main addition is the explosion effect (may add more frames to that animation...) and also the explosion stays where you spawn it and will take out any missiles that enter it's blast. Also, removed the red line that held above the missiles. So much still to do however! And lock, humour you I will =) I'll just do it soon, a little busy atm.
Last edited by Smerity; 02-06-2006 at 01:30 AM.. |
|
|
|
|
|
#14 | |
![]() |
Quote:
paint shop pro is better it has basically the same features but its easier to use |
|
|
|
|
|
|
#16 |
![]() |
For fast rotation and alpha blending, it's much better to use GU functions, checkout my game StarBugz and its source code:
StarBugz game prototype and engine (using Gu) with source |
|
|
|
|
|
#17 |
![]() ![]() Developer
|
I dub thee Guardain Coder Watson! lol
I'll certainly have a look at it. I got the rotation idea of mine going, but making it efficient enough for use in game was getting very daunting... Don't think I'll be able to do it tonight though. Tis 11:20 and I have first day of school in the morning <screams in terror> Thanks once again though dr_watson =) |
|
|
|
|
|
#18 |
![]() |
wow I love missle command. thanks! need any graphics tell me besides characters I'm no good at those. :icon_smil
Oh and grimfate I've tried paint shop pro and photoshop is definitely better but it was easier to learn like will said but photoshop actually does have more features it just takes awhile to learn how to use them :icon_wink
__________________
[CENTER] [url=http://gearsofwar.xbox360.gamebattles.com/stats/10774][img]http://gearsofwar.xbox360.gamebattles.com/card/10774|basic[/img][/url][/center]F*** Pillowpants! Honk if you love or like ****y![/center] Last edited by wallaby; 02-06-2006 at 12:16 PM.. |
|
|
|
|
|
#19 |
![]() ![]() Your Fate is Grim...
|
sorry smerity, looks like i wont be able to make the base for now. i got to go out of country to go see a relative. sry again, and dont worry, there are much better gfx artists out there. dont stop coding!!
__________________
-------------------------------------------------------------------------------------- ![]() |
|
|
|
|
|
#20 | |
![]() Join Date: Nov 2005
Location: Edmonton, AB, Canada Firmware:v1.50/3.40 OE MSDuo:4Gb & 3x1Gb
Posts: 244
Trader Feedback: 0
|
Quote:
Edit: Another reason for people pushing PhotoShop is that that is the premier MAC photo edit suite... and given that the MAC was the best performing system for graphic art (back in its hayday), It became rather popular. I too found Adobe PhotoShop to lack certain tools I use in JASC's (now Corel... GRRR!) PaintShopPro (PSP 8^). However the same can be said for PhotoShop. Last edited by DrNicket; 02-06-2006 at 06:51 PM.. |
|
|
|
|
|
|
#21 |
![]() ![]() Developer
|
Still having some problems creating a quad / rotating the turret, but once that is done and a simple aim at cursor algorithm is created (using sin/cos/tan), I'll get on to creating the background.
Since Dr_Watson's library is all in C++, and I'm coding my project in C, I can't use it directly (at least without a lot of work on my current code's structure), but if any of you are just beginning a project, I highly suggest you use his library, as it is quite advanced, featuring blending alpha, swizzling, rotation, the works really. But, considering I can't use it, I'm just porting the key bits that I want, which is at this point the rotation code. Damn difficult though, lots of debug work, it's just seeing how the function operates and recoding it, but I'll get it eventually... Cool to see I'm now a dev too =) |
|
|
|
|
|
#22 | |
![]() ![]() ...in a dream...
|
Quote:
Code:
MP3_Load(music.mp3); Code:
struct songinfo
{
char songname[255];
};
struct songinfo playlist[100]; //an array of 100 structures of type songinfo (which only holds one variable, but can hold as many as you want...
// This function reads all the songs in the psp/music dir and feeds them into that playlist[100] array, easier to work with...
void getsonglist(void)
{
int dfd;
SceIoDirent songdir;
memset(&songdir, 0, sizeof songdir);
int songcount = 0;
int i;
dfd = sceIoDopen("ms0:/PSP/MUSIC");
while(sceIoDread(dfd, &songdir) > 0)
{
//sceIoDread(dfd,&songdir);
sprintf(playlist[songcount].songname,"%s",songdir.d_name);
maxsongs = songcount;
songcount++;
}
sceIoClose(dfd);
}
MP3_Init(1);
MP3_Load(playlist);
meaning the buffer points to the structure, but not the files inside of it...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
|
#23 |
![]() ![]() Developer
|
Thanks SG57, yes. I'm looking at doing that, but atm I'm kind of holding off on development of Airstrike code. A little hectic, and I think it's more important I get the rotation code done before I do more music-y stuff.
http://forums.qj.net/psp-development-forum/9686-psp-programming-tutorials-post426704.html#post426704 There I patched Shatterdome's code to my example so that it works, but there are still quite a few bugs with it. I hope that helps with your error. -Edit- To note, you also don't actually need to include 'dirent.h'
__________________
Developer of Airstrike Last edited by Smerity; 02-17-2006 at 07:13 PM.. |
|
|
|
|
|
#24 |
![]() |
oops I may have left something out when I gave that to you, when you mp3_load you have to load another buffer like...
Code:
sprintf(songpathbuf,"ms0:/PSP/MUSIC/%s",playlist[songcounter].songname); MP3_Load(songpathbuf);
__________________
PSN: Shatterdome |
|
|
|
|
|
#25 |
![]() ![]() ...in a dream...
|
lol, this IS hectic lol. I knew you were missing something Shatterdome because it said invalid pointer/null buffer point, so I assumed there was a buffer call/statement missing, so I'll now try it ShatterDome, I'll update you if it works for me, and Smerity said there was a playing errror, meaning once it goes through all the available songs, it crashes trying to load the next one, deson't that mean your going to have to make a 'mark' on the songs after they play, so if it's already been 'amrked' it won't play 2 times until it goes through all the unmarked songs first, and if the next song (the one that makes it crash which is nothing) has a completely different marking, then it goes to the just marked ones... I dunno maybe someone else could think about that...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#26 |
![]() |
thats why I have a maxsongs variable in there, that is declared as a global int under your includes and #defines...
Then you can do something like if songcounter > maxsongs, songcounter = maxsongs, or to go to the first song in the list would be songcounter = 2, I also explained this in a different thread
__________________
PSN: Shatterdome |
|
|
|
![]() |
| Tags |
| airstrike , development |
| Thread Tools | |
|
|