Page 1 of 2
Nebula X Worklog
Posted: November 3rd, 2013, 3:51 pm
by t0rxe
[center]Nebula X - Worklog[/center]
Hi. I thought I would start a worklog on my game that I'm working on and the problems I encounter.
My previous topic can be seen here:
http://www.psxdev.net/forum/viewtopic.php?f=61&t=308
Do not bother trying to play the releases after R1 in an emulator. They wont work. Use
REAL hardware.
Release 1 Download (01/JUNE/2013):
http://www.psxdev.net/forum/download/file.php?id=138
Here is a YouTube video showing proof of concept of the game running (Release 1).
In this old version, I used VAG audio for the title theme. Now however, I'm using a mix of XA, VAG and VB/VH.
There is a bug on the title screen in the video that shows a blue underline under the 'Press any button' image. This was because I accidentally used a background with the image still on it and not blanked out
[youtube]
http://www.youtube.com/watch?v=QEOMc6hSRMA[/youtube]
I have recently coded in the use of 'malloc3'. This means that all files are pulled off of the CD-ROM and stored with a pointer in RAM. This way, once an image is copied to VRAM and initalised, I can free it from RAM, thus freeing a lot of memory for other things.
One problem I found was that I was using math based rotation for the ship sprite. A single 22x26 pixel sprite was loaded into the framebuffer and rotated every ten degrees. The problem with this was that the ship would become 'distorted' at odd angles due to the nature of software based rotation. It was decent as you can see in the video, but far from perfect. The new approach to this I thought was to use 36 sprites hand drawn from scratch and rendered in 3D software. I would like to use a 3D engine to animate and move my ships, but I think 2D will do fine for now, though I may look into it anyhow
Another difficult problem that I had to face was programming the use of a MULTITAP for support of up to 4-players. While I got it all working, you can only have two DUALSHOCK controllers vibrating at once time due to the limits of the PlayStation hardware. If you make a DUALSHOCK controller vibrate, the two motors inside draw a certain amount of current (the larger motor on the right drawing more of course). The limitation is that the PlayStation hardware can only put out a certain amount of current until a fuse blows. How much it is, I'm not sure, but a multimeter on the controller voltage line in series would find out.
I will keep this topic updated with images, problems and information as I progress

Re: Nebula X Worklog
Posted: November 3rd, 2013, 9:24 pm
by t0rxe
Ship sketches:
Sprite rendition:

Re: Nebula X Worklog
Posted: November 3rd, 2013, 10:19 pm
by jman
Hey, I like that ship

Good luck with your project.
Re: Nebula X Worklog
Posted: November 3rd, 2013, 11:23 pm
by Shendo
Awesome.
Re: Nebula X Worklog
Posted: November 4th, 2013, 1:22 am
by CosmoGuy
Damn nice

Very nice sketches, i love to see artwork, the more it is, the better

.
This site is slowly becoming next gamedev.net but directed to psx

.
Likes x 1000

Re: Nebula X Worklog
Posted: November 7th, 2013, 7:56 pm
by t0rxe
I'm just having trouble at the moment with the sprite sheet u and v coordinates.
GsSPRITE in LIBGS.H is part of a defined structure that contains u_char u, v. It is assigned to an unsigned char (u_char). A signed char gives me the -128 to 127 value, and unsigned 0 to 255, so I can't use an image greater than 255x255. I have tried to make it an integer, but it just messes the sprite up. For now, I will have to go ahead and make a 256x256 image sheet and make sure my 30x30 sprite doesn't exceed 256

Re: Nebula X Worklog
Posted: November 9th, 2013, 9:46 pm
by t0rxe
Here is the test sprite sheet. 256x256 image with 36 frames in a 30x30 grid array.
The left over room can be used for explosion animations, bullets, weapons, etc.
I have plenty of room in the framebuffer for more textures as I plan to make this game full out AWESOME

Re: Nebula X Worklog
Posted: November 10th, 2013, 1:56 am
by Shendo
Nice, keep us posted. Really looking forward to seeing that ship you drew ingame.
Also, If you need a true black on your .tim files you can use bmp2tim utility from PSXSDK.
It has an option to use magic pink (255, 0, 255) as transparent so your true blacks (0, 0, 0) are preserved.
I've been using it to convert my .bmps to .tim.
Re: Nebula X Worklog
Posted: November 10th, 2013, 2:42 am
by jman
t0rxe wrote:Here is the test sprite sheet. 256x256 image with 36 frames on a 30x30 grid.
The left over room can be used for explosion animations, bullets, weapons, etc.

Perhaps you mean a
10x10 grid or did I miss something?
However, good idea of putting as many sprites as possible into a 256x256 image.
Re: Nebula X Worklog
Posted: November 10th, 2013, 4:21 pm
by Shendo
I believe he meant that his sprite consists of 30x30 pixel textures.
Re: Nebula X Worklog
Posted: November 10th, 2013, 8:15 pm
by jman
Shendo wrote:
Also, If you need a true black on your .tim files you can use bmp2tim utility from PSXSDK.
It has an option to use magic pink (255, 0, 255) as transparent so your true blacks (0, 0, 0) are preserved.
I've been using it to convert my .bmps to .tim.
By the way
I have the same issue. I have to use a "fake" black - not less than [8,8,8] - in order to be able to "pierce" and discard the background once importing the file into TIMTOOL. Not always I am able to do an effective work, often I generate "dirty" sprites.
I'll try using bmp2tim: it would be much easier to edit the image changing the background [0,0,0] into magenta where it must be discarded.
Re: Nebula X Worklog
Posted: November 11th, 2013, 12:55 am
by Orion_
The psx can't handle texture and sprite bigger than 256x256 so you will have to deal with it.
Also, why not use the rotation feature of the sprite on the psx ? instead of making each rotation in your texture file ?
I know the rotation is not very clean on the psx, but still, it will save you a lots of vram space
Re: Nebula X Worklog
Posted: November 11th, 2013, 1:12 am
by t0rxe
I was using the rotation feature in R1 (see the first YouTube video). I didn't like how it drew the ship.
Besides, I need hard sprites because how else will I animate the ship exploding

For now I have lots of free VRAM (let's hope I didn't type so soon, lol).
Re: Nebula X Worklog
Posted: November 11th, 2013, 3:03 am
by jman
t0rxe wrote:
Besides, I need hard sprites because how else will I animate the ship exploding
Upon collision you could make the ship start spinning fast and faster and then make it disappear (just kidding)
Re: Nebula X Worklog
Posted: November 11th, 2013, 9:37 am
by inc^lightforce
@t0rxe
this " stand alone " Win Based Tool creates animated Explosions and other good things if you know how to use.
http://www.saschawillems.de/?page_id=253
support:
dds files and transparent png files.
many dds files can be found in DOOM 3 or QUAKE 4. open the gamefiles called .PAK with winrar and find some good DDS.
also nice playing with png files.
SHORT OVERVIEW by Sascha Willems:
So here is a quick list of the application’s features :
° Create countless different explosions. Each explosion is randomized and all important parameters can be changed
° Exports to PNG complete with an alpha channel. No more black backgrounds and additive blending for your explosions anymore. ° The result texture inlcudes a full alpha channel
° Different texture sizes (from 256×256 up to 4096×4096, depending on wether your graphics card can manage that)
° Different grid sizes for setting the number of animation frames on a texture (4×4, 8×8, 16×16)
° Use your own particle textures. Either use the included ones I made from scratch or create your own particle textures and use them
° Change the parameters. All parameters used to calculate the explosion animation can be changed to make each animation unique
° Watch your explosion within the application. After generating a texture, it’s shown in realtime together with a preview of the animation
cheers
Re: Nebula X Worklog
Posted: November 11th, 2013, 10:11 pm
by t0rxe
Thanks for the suggestions!
Currently I am having trouble with the 'freezing' of the game sprites. What I mean by that is, when I remove the controller from port 1, the game should freeze. No sprites should move whilst a message is displayed telling the user to re-connect the controller. How to freeze the sprites (all objects being drawn) I'm having trouble with. While I can get them to freeze, they slowly continue to move because eventually the drawing happens. I have tried to disable the updating of the sprites in the ordering table, but it isn't working.
Any help is appreciated (C, pseudocode... whatever)

Re: Nebula X Worklog
Posted: November 12th, 2013, 4:46 am
by Yagotzirck
what about BreakDraw and ContinueDraw?
Re: Nebula X Worklog
Posted: November 12th, 2013, 4:55 am
by Shendo
In your main loop segment each part like this:
Code: Select all
DrawBackground();
DrawEnemies();
DrawPlayer();
if(ValidController)
{
HandleInput();
MovingCollisionEtc();
}
else
{
ConnectControllerMessage();
}
If you do it like that, game will appear frozen because input and moving logic isn't running.
Re: Nebula X Worklog
Posted: November 12th, 2013, 6:10 am
by Yagotzirck
I've added this on inc's stars demo to test:
Code: Select all
PadStatus = PadRead(0);
if (PadStatus & PADRdown){
breakdraw_return_value = BreakDraw();
for(;;)
{
PadStatus = PadRead(0);
if (PadStatus & PADRright)
break;
}
ContinueDraw(breakdraw_return_value, breakdraw_return_value);
}
X freezes the screen, O resumes it... works like a charm. You can adapt it to your needs quite easily I guess
EDIT: disregard that... it works even without BreakDraw and ContinueDraw, it freezes just because it enters in a loop without executing updating functions. shendo is right
Re: Nebula X Worklog
Posted: November 12th, 2013, 11:31 am
by inc^lightforce
i have to check my code. i made similar like t0rxe, long time ago and had never freezing-problems with a removed and replaced Game PAD.
update soon
EDIT:
just a quick IDEA. not tested yet...
do you have a correct PAD Definition for "Pad 1" and "Pad 2" in your Source Code and have verified it?
Definition like this:
taken out from my Source Code:
Code: Select all
if (PADstatus & Pad1x) // ---> Pad1x is "Pad 1" in Slot 1 and get noticed when "X" is pressed on PAD 1