With the newest consoles generation and all those speed ups and new graphical features (2D screen effects, GLSL, softbodies, etc.) that came with the BGE, some older ways of gaming experience seem to fade away from the memory of both gamers and game-creators. Naturally, none of us would like to return to the ages of Atari, but there are some stuff from game history that are still nice, if used correctly. This article focuses on 2D sprites.
To make it shorter and not dangle too much in history of video games, I'll say that the use of 2D characters on a 3D background has been around since the very beginning, from Wolfenstein 3D and Doom and the several clone games they had. In the early 90s, the famous "Mode7" in the SuperNintendo allowed 3D deformation of a plane, which was used a lot for making racing games (Mario Kart for example), naturally those cars were 2D.
This technique was most notably used in the era of Playstation 1 and Nintendo 64, due to the lak of graphical power those consoles had. In one hand they could have several polygons on screen textured and shaded, but in the other, not enough to have nicely detailed personages; almost, box looking characters with heavily pixelated textures chek im-age of Vagrant Story for PSX, a good looking PSX game of 1998.
While not because of that, this style of graphics has not disappeared yet, we can still find it on Nintendo DS, Playstation Portable, Wii and even Playstation 2 and 3. Commúnication.
Famous games using this tech-nique are: Doom (PC), Wolfenstein3D, Super Mario Kart (SuperNes), F-Zero (SuperNes), Xenogears (PSX), Breath of Fire(PSX), Grandía (PSX), Ragnaroque Online (PC), Dis-gaea (PS2, and PS3), Mario Kart 64 (N64), Paper
Mario (N64,GameCube, and WII), etc.
Following the same idea, let's start with my demo:For this, it's required to have some advanced knowledge on the Game Engine and python.
For now the easiest thing to do is take the demo and replace the Sprite sheets and the scenery.
In the future I'm planning on making an indepth tutorial, when the script becomes more friendly to users.
The theory, at least, is simple:
All that is needed is already inside the demo file and working.
The link to download the file is at the end of the article.
You need a 3D background, an invisible collision box that has a plane that tracks the camera parented to it, which will be the character. But how does the character's draw-ing change when the camera rotates around himí Well, there is where my script comes in.
The scripts at a glance:
It ain't easy to setup (I'm pretty sure the BGE wasn't made thinking on this, hehe), since you need 3 scripts for this: “holiday”: The first script wasn't made by me (and I hardly understand it, updating it to worque on blender2.49 was incredibly hard). It was made by Doc Holyday (don't know true name) and I use it here to load a Character sprite sheet and have it ready for animation, and animate it.
“CGLHoliday”: The second, by me, is used to activate the animations using the arrows keys.
“angle3”: The third one, alos by me, com-putes the angles of the camera using the world as reference, the character in reference with the world and the character in reference with the camera. In other words, a tough job.
The other 3 scripts (“holiday, “CGLHolidayNPC”, and “angleNPC” for other characters) are made for non-playable-characters (as town people for example).
They were made to automatically animate and change the orientation of the character based on its movement, for example following an IPO, as the file, or controlled by an AI script.
Finally you need a character sprite sheet. Remember, the BGE works with textures that are power of 2 (for example 2x2, 4x4, 8x8, 16x16, 32x32,....1024x1024 is the maximum I think). Be careful on the UVMapping, it's vital, follow the demo file as reference.
The fact that you need 3 scripts per character is still a problem to solve (it makes it hard to use). Also, I would like to add the possibility of diagonals on the character orientation (or at least have it ready as an option be-tween 4 or 8 directions). But having it working and playable was so much fun when I made the first versión!!
Still, this results in pretty good performance. On an old Athlon XP +2600 with a Geforce FX5200 and 1.3 Gigabytes of RAM memory, you can control up to 33 characters simultaneously, all of them animated, with collisions and controlled by the player. As the picture shows, like a little army (hahaha).
Here are links to my gallery on YouTube where a video of this working is shown (and some others alos of the BGE or renders), a link were the files are located for download, a link to the old thread at BlenderArtist where I updated with a recent post, and a link to my deviantArt page were there is alos some information in the Gallery.