From 3D to 2D to 3D again...

Miscellaneous Forums/General Discussion/From 3D to 2D to 3D again...

When I first started to learn BB, I could only make small 2D programs. I moved to 3D as soon as I could. Although there's been some difficulty along the way, 3D has been fun for awhile.

Now I have ideas for games that would just be fit for 2D more. Hope that makes sense. In other words, I want to start making 2D games. I have a book on how to, my only question is if it's a good idea right now. Will it still be good practice for my future 3D development? Is it harder to create games in 2D, than it is to in 3D? I know buffers and crap can be confusing and I still have more to learn (animation, collisions, etc.)...

Thanks a bunch. One of the biggest reasons I have decided to switch is because building 3D games from scratch is just messy. It's a good thing I bought Blitz3D, which has all the 2D functions with it :)

Just make whatever you're inspired to make ... it's all the same IMO.

2D should be easier to make the graphics for at least.

I tend to agree with Jeremy. Besides the distinction between 2D and 3D are a little blurry these days. Just figure out what point of view and graphical style suits your game idea best, and if it's within a reasonable degree of complexity for you to handle, go for it.

i have a hard time making up my mind as well... and because of that, it's been almost 4 years since i started work on my obsession...

... make up your mind, or forever be lost.

:)

seriously though, both points above make very good sense and i'd have to agree with, and reitterate both of em.

--Mike

Everything these days is in 3d - at least from DirectX 8 up - 2d in 3d. ;)

Some games just don't work aswell in 3d - but because things are now 2d in 3d can look very impressive. For instance, alpha transparency can smooth edges and is very useful for particle effects. Take a look at Anthony's Cletus Clay for a good example:

http://www.squashysoftware.com/cletus.php

Just out of curiosity, is there a quick and easy way to apply the alpha transparency to the edges of sprites or is it a time consuming manual job?

Back on topic, I think some of the best games are still 2D so I don`t see a problem with it. In fact, I would rather buy a 2D game over a 3D one anyday.

Jason.

QuickSilva, using SetBlend(ALPHABLEND) with SetAlpha(1.0) and perhaps scale a PNG alpha-sprite in BlitzMax will soften the sprite enough without any photoshop work at all. But run your blur paintbrush around the edge to give extra softening if required.

Yeah actually I was thinking along the same lines, how DO you make a alphe blended PNG sprite anyway!

Well Grey in photoshop at least just create a new image with a transparent background (rather than white) and you have a checkerboard background. Then draw your sprite and save as a PNG - simple as that!

Or if you already have a sprite then create the new transparent image as before - then copy and paste your sprite ontop.

Load in using something like (in BlitzMax at least)...

gfx = LoadAnimImage("sprite.png",64,128,0,8,FILTEREDIMAGE|MIPMAPPEDIMAGE)

For hand-drawn sprites or 3D-renders without antialiasing the best way is probably to draw/render them big, delete the mask colour and then scale down to half the size in photoshop or gimp or whatever. Then the blurred edges won't look out of place with the rest of the sprite.

In PSP 9 I create the image on a medium GREY ( I like RGB: 96,96,96 most times) background... perhaps a little darker... then when it satisfies me I carefully cut it and paste it onto a MAGENTA cell... (a square of PURE MAGENTA (HTML: #ff00ff ; RGB: 255,0,255 ; HSL: 212, 255,128 ) The cell is not much bigger than the image perhaps 5-7 pixels at the most.

Alpha is off the MAGENTA. Works fine. Don't create the image on WHITE background... you always get the little sparkly spots...

Hmm, I'm still confused. I know how to make a transparent sprite (i.e solid or 100% see through) and I also made my own "home-made" anti-aliasing/alpha blending code for BlitzPlus that read in a special greyscale version of the sprite and decided how transparent the main sprite pixels were based on if the greyscale value. But BlitzMax won't be able to use my greyscale sprites will it?

Steve: So if I make a sprite with a transparent background and save as PNG and load it into Max, surely it'll still have a jagged outline? Or am I missing something here, does Max anti-alias the edge to transparent? If so COOL.

Also how do I say make a sprite that has MORE transparency than normal, going deeper into the sprite than just the outline? Is there some way to control this with PNG? For example for a particle effect (say a circle) I might want it almost totally transparent at the edge and more solid in the middle. How can this be done?

Many thanks in advance. Maybe I should start a different thread?

Also how do I say maybe a sprite that has MORE transparency than normal, going deeper into the sprite than just the outline? Is there some way to control this with PNG? For example for a particle effect (say a circle) I might want it almost totally transparent at the edge and more solid in the middle. How can this be done?
With an alpha layer. In PSP/PS, you can view/edit it as a separate layer, I think. I just looks like a greyscale version of the main sprite/image, where black is fully transparent, and white is fully opaque. You can then save it as a single PNG file.

Big10p: Cool, My PSP 4 (true) crashed on me a while back after 5000-odd days of free trial so I'm using Corel Paint 10 right now. I'll have to see if it does that. Basically, the method you described is the one I hand-coded, except mine were two separate files and it was well CPU intensive, so if Max handles it automatically that will be F'ING GREAT!

Let us know how you get on Grey Alien as I would be interested in seeing too.

Jason.

OK, I'll try some soon as it pretty essential for my next games.

Max reads the alpha channel from the image, no channel, no alpha :( If you apply you alpha mask as the alpha channel in your paint package and export the image as a .png it should work a treat.

this sounds cool. It's a speedy auto version of my hard-coded effects.

IKG: Why not combine ? Take the best from both worlds.
Thats what I usually do these days. Why render a lot
og images of like a rotating block when you can do that
part with a 3D sprite on top of your 2D world. Works
like a charm. JFK made a IMHO genious tiny little piece of
code that makes 3D sprites act pixel-correct in a 2D world.
Mail him and ask for it if the snippet's not posted recently.
Also intros and hiscore-boards and that type of stuff
are cool to make in freaked 3D even if your game is not.
There are also other stuff from 3D you can apply like
putting a black sprite very close to the camera and
change it's alpha to make the screen fade in and out.

The list goes on...