![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on 2D RPG Engine Project within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; EDIT 08/18: I figured people might check the 1st post here, and it's WAY old... EDIT 11/18: Actual screenshot on ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
EDIT 08/18:
![]() I figured people might check the 1st post here, and it's WAY old... EDIT 11/18: Actual screenshot on the current build. Zelda sprites for test purposes. Progressing nicely.... So I've only spent a few hours at it tonight, and my C skills aren't as good as they should be, but I've decided to teach myself PSP Programming by making a basic 2D homebrew RPG engine. Starting with the movement engine, I wrote the basic program that will keep track of your X/Y Coordinates on the screen. It currently limits the boundries to 100x1000, but this will be tweaked as I add more. I'M ONLY RELEASING THIS CODE AS A LEARNING PROCESS. I figure there's a lot of you out there like me just getting started with PSP programming. So do what I did. Install the SDK, look at Guess PSP, Snake, and the Maze Gen (all are great programs that show different aspects of the PSP programming) and play around with it. DO NOT DOWNLOAD EXPECTING A GAME. IT ONLY PRINTS X/Y COORDINATES TO THE SCREEN AT THIS POINT. This hopefully will evolve into something great, but it depends on how busy work and my dotcom business keeps me... http://www.framerate.info/psp/test.zip for this test code. We'll see where it takes me tomorrow. I'd like to get some basic graphics or perhaps an event trigger programmed. We'll see...
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] Last edited by framerate; 08-18-2006 at 06:16 AM.. Reason: update |
|
|
|
|
|
#2 |
![]() |
Cool?
__________________
[center] Just because your paranoid, doesn't mean someones not following you. (Member since 7/20/05) [img]http://acrility.net/Animation2.gif[/img] :ROFL::ROFL::ROFL: Throw a tomato at a forum member [img]http://instagiber.net/smiliesdotcom/otn/funny/tomato.gif[/img] [img]http://www.garpland.com/v2/html/emoticons/Boo.gif[/img] [/center] |
|
|
|
|
|
#4 |
![]() |
heh yeah.. well they told me that too for my dotcom (social networking, 5 subject news, and a "yellowpages" of hip places around the world, yet I have it over 50% done by myself and I'm just now trying to add a 2nd coder but having trouble finding what to tell him to do!
Most of my work is just a learning experience anyways, I like learning new things... so this is just another of those. So far it's going well. It all just depends on how much time I have to put into it. If you want to offer me some help via AIM, my name is youaremylast on there, I'd love to see some basic code you used to show the images in SIMON! (I'm sure if someone really wanted to help, I wouldn't refuse it.. just at this point I need to make some progress on my own)
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#5 |
![]() |
Also....
(in a perfect world) All I'm setting out to do at this point is the basic engine. Load a gfx background, and either random or load a .txt file with event triggers. Event triggers would be start battle, getItem, or change map.. Battle engine would just be fight or run... Simple (i've done it before on a TI-86 ha. but that's not REAL progamming). So my goal is rather realizable for one person... If it works that far, then you're right. It' be nice to have someone helping with story/gfx/sound etc... We'll see how it goes... even if I don't get past my initial vision, I'm sure someone else could use it to continue..
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#6 | |
![]() PREMIUM Member
|
Quote:
but if you want a quick...simple..run down of imgs here: http://www.psp.to/tools/ convert your jpg into code and shove into bitmap.c add #include "bitmap.c" to your main file and make sure pg.h is included: pgFillvram(0); //fills bg pgPrint4(4,7,0xffff,"Pres ents"); //for text (xloc,yloc,color, char string) pgBitBlt(160,40,80,80,2,i mage_seclogo); //(xloc,yloc,width,height, array name in bitmap.c) pgScreenFlipV(); pgWaitVn(200); //pause |
|
|
|
|
|
|
#7 |
![]() |
Thanks man, I'm gonna try that here in a sec (I dreamt about PSP code last night hah)
The worst part about programming for the PSP is the lack of documentation (but we're still early in it's life cycle).. hard to learn this stuff on your own. So far everyone has been really cool =) Thanks again for the image code.
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#8 |
![]() |
question...
pgBitBlt(160,40,80,80,2,i mage_seclogo); //(xloc,yloc,width,height, array name in bitmap.c) you're passing 6 variables, but only telling me what 5 of them are =) Im displaying my text but it's all garbled on screen. My goal right now is to get a full screen image to display... Any help on that?
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#9 | |
![]() PREMIUM Member
|
Quote:
|
|
|
|
|
|
|
#10 |
![]() |
Yeah I got it to display right by looking at some code on psp.to. when I set the background to an image, the size/resolution of my text changes majorly. I know this is simple, but now I just have to learn why that's happening (I assume it's since I'm drawing to a buffer instead of straight to screen?)
Yay!
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#11 | |
![]() PREMIUM Member
|
Quote:
That 2 in the function call is for magnitude. If you looked at pg.c, you'd have seen that. ;p Putting a 2 there means youre stretching it. If you want perfect res you'll want to put a 1. |
|
|
|
|
|
|
#12 |
![]() |
hey now! I looked at pg.c! I just didn't post back about it
![]() I'd really like to see your source for simon, if you have it ready at all soon... I notice on the score you seem to be using printf to print it, instead of doing some sort of RGB hack with pgPrint() like I'm trying to do... (I'm pretty sure it's just my inability to remember my old graphics knowledge...) I've made some great progress today though, I'm displaying the images and still keeping track of the movement/location. Now I'm just going to connect the image to the movement... EDIT: to clarify my problem, using pgPring() to print the text works fine, if I clear the screen after every button input.. but then if I get that damn flicker.. So I'm trying to set up double bufferring (which I assume is the easiest fix for this). From what I remember, that's the easiest and most efficient way to get rid of the flicker, but I'm just not 100% on how the PSP does it
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#13 | |
![]() PREMIUM Member
|
Quote:
I'll go ahead and post the SIMON source with the next update which should either be today or tomorrow. Hopefully that'll help. Im having issues getting sound to work ;[ |
|
|
|
|
|
|
#14 |
![]() |
Aww sorry to hear it. i've gotten about all I'm going to get done on my project for the weekend. I think I'm going to take it easy tonight and play with it more tomorrow a bit...
I'll look for your source soon, I have a feeling it'll help answer a few of my graphics questions.
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#15 |
|
i'm terrible at c++, i just picked it up this week. but i wanted to see if i could pass the x and y variables on to the position of a text character and have it move around with the d pad. here's my very sloppy, very ghetto results.
|
|
|
|
|
|
|
#16 |
![]() |
Nice work =) I don't have the PSP to test it on yet, but I'm going to have a look at it soon. I was going to do something like this soon...
My concept is something like a square on the left side of the screen (height of 100% of the screen with equal width) will be the movement area. I'm working on putting a background image of some grass for now.. with a static picture of a guy moving on it.. the left over on the right will keep track of debug information like x/y coords and eventually HP/MP and level... Perhaps we could work on it together some time.
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#17 |
![]() |
Send me an email or AIM (youaremylast) I can send you some updated code that has the beginnings of the BMP code and such
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#18 |
![]() |
Some updated code, in case anyone is keeping track.
It uses a new menu with BMP image display (all just placeholders for now). Press triangle to get back to the menu. I need to use double buffering to get rid of the flicker, but using pg.c doesn't seem too easy? Suggestions are welcomed. This is good code if you're just starting PSP programming, see how object oriented should work with respect to the menu system.. http://www.framerate.info/psp/rpg_test.zip
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#19 |
|
hey, i haven't gotten a chance to im you yet, but the zip you just uploaded is still you're original code you posted a few days ago.
i'd like to see what you're doing with bitmaps, i haven't taken the time yet to learn how to call images |
|
|
|
|
|
|
#20 | |
![]() |
Quote:
Images really aren't that hard, www.psp.to/tools has a tool to convert them to a c file which you can call from your program (I call an image in my menu(); function, check it out! I'm just trying to figure out how to do the map images.. if you take an image off the upper left hand corner (by moving the background to make the impression of movement) the PSP locks up... So I think I'm going to have to redraw the frame every time? I'm thinking (if anyone has any thoughts) read in a txt file that has something like: GGGGGRGGGG GGGGRGGGGG GGGGGRGGGG GGGGGBGGGG GGGGGRGGGG (where G would be interpreted as a grass tile, R as a river, B as a bridge, T as a tree etc) Then the character would stay stationary in the center and when you moved it would take your location and update the screen by redrawing the shifted tiles to give the impression of movement... (flicker is going to be REALLY bad I'm sure.. if anyone can point me towards some simple double buffering tutorial or other way to lose the flicker I'd appreciate it)
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
|
#22 |
![]() |
SEe my edit.. you were right. I uploaded the wrong one =(
But I fixed it now!
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#23 | |
![]() |
Quote:
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
|
#25 |
|
Hi there,
I'm just trying to get to grips with the Primitive Graphics stuff and was wondering if you could answer a quick question. Why does the text not appear in white in the following code? Code:
// Modified Hello World - My First App for the PSP
#include <pspkernel.h>
#include <pspdebug.h>
#include "pg.h"
#include "colors.h"
PSP_MODULE_INFO("Hello World", 0, 1, 1);
#define printf pspDebugScreenPrintf
// Callback init and stuff skipped for clarity
int main(){
//pspDebugScreenInit();
SetupCallbacks();
pgInit();
//pgScreenFrame(2,0);
//printf("Hello World");
pgPrint(10,10,white,"Test PG Print!");
pgScreenFlipV();
sceKernelSleepThread();
return 0;
}
Also, is my makefile correct? Im using: Code:
TARGET = hello CFILES = main.c pg.c OFILES = main.o pg.o OBJS = main.o pg.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Hello World PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak S.
|
|
|
|
|
|
|
#27 |
![]() |
Update.. I reworked the menu program.. if anyone's looking for a neat way to do a menu, I did:
printMenu(int selected): where you pass the selected option of the menu to a switch statement. It then prints the whole menu UNSELECTED and uses the switch to print the one you're on as the SELECTED color.. menuAction(int selected): is just a switch statement with the options of the menu and what functions they call and menu()": contorls both above (something like this) void menu() { if (menuFlag==1) { menuFlag=0; } int menu_selected = 1; SceCtrlData control; pgFillvram(BACKGROUND_COL OR); printMenu(1); while(menuFlag==0){ sceCtrlReadBufferPositive (&control, 1); printMenu(menu_selected); pgWaitVn(5); if ((control.Buttons & PSP_CTRL_UP) && menu_selected > 1) { menu_selected--; } if ((control.Buttons & PSP_CTRL_DOWN) && menu_selected < 4) { menu_selected++; } if (control.Buttons & PSP_CTRL_CROSS) { menuAction(menu_selected) ; } } } I'm working on adding the txt file map input and the simple graphic tiles right now... with the sprite in the middle and movement.. but it looks horrible on the single buffer. IF ANYONE has a good example using pg.c and double buffering, please let me know. The Tank demo I've already seen... thanks! I should have an updated release soon!
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#28 |
![]() |
I know it's not much, but if anyone wants to play around with this screen, please do...
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#29 |
![]() |
Not a lot of interest in a 2-D RPG I guess =(
Oh well.. Coming along nicely =)
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
![]() |
| Tags |
| engine , project , rpg |
| Thread Tools | |
|
|