Isometric 2.5D Engine Journey - Help needed :(

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Isometric 2.5D Engine Journey - Help needed :(

Post by soggie »

Okay this might sound crazy, but I'm going to build a 2.5D isometric engine using Irrlicht. Or at least try.

The idea is this. I have ground tiles and environmental props rendered in 2D quads, while characters in 3D. The choice to use 3D for characters (e.g. Total Influence Online, FOnline, Temple of Elemental Evil, etc) is to reduce the sprite work which grows exponentially when you want to show equipped items on the character. Additionally, making it a 3D model would give me much more flexibility in adding more animations, as well as some time savers like animation retargeting and blending.

Next, I'd love to try my hands on per-pixel lighting in this scene. This is the general high-level idea:

1) Render all diffuse maps into a render targets
2) Render all normal maps in world space into another render target
3) Depth sort all pixels by height and write into depth buffer
4) Use a shader that samples all render targets to figure out light intensity

Basically, a deferred rendering technique without polygons. Or so I read.

Thing is, I have completely no idea on how to achieve this. Seriously. I know how to do a full 3D scene, and I've written my own top-down tiled 2D game too. I understand 2D isometric draw orders and such, but right now I'll be using Irrlicht to attempt this engine.

This thread will hold my journey of discovery as I stumble and fumble through the dark. I appreciate all help I can get from experienced members here.

Here's the mockups that I did in photoshop to illustrate my eventual goal:

Day Time

Image

Night Time

Image
Last edited by soggie on Wed Sep 29, 2010 2:18 pm, edited 1 time in total.
My Game Development Diary: Splintered Core CRPG Diary
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Post by soggie »

Milestone 01

The first milestone would be to display a basic isometric scene with the correct camera setup, grid helper, texture splatting and shader-enabled texture blending modes.

Tasks:
  1. Set up Irrlicht [done]
  2. Set up skeleton application framework
  3. Set up camera control, lock to X and Y axis
  4. Set up configuration file reader to control initial camera properties
  5. Set up material configuration file to prevent re-compiles when testing textures
  6. Set up isometric wireframe grid
  7. Set up grid-aligned textured isometric quads
  8. Set up support for multi-layered ground textures
  9. Set up texture splatting with alpha mask
Last edited by soggie on Wed Sep 29, 2010 4:48 am, edited 1 time in total.
My Game Development Diary: Splintered Core CRPG Diary
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Post by soggie »

reserved for in-engine screenshots
My Game Development Diary: Splintered Core CRPG Diary
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

I think this topic would get the attention it deserves in project announcements, rather than beginners help
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Post by soggie »

Lonesome Ducky wrote:I think this topic would get the attention it deserves in project announcements, rather than beginners help
Too bad I'm just a beginner here, and I think my discoveries would benefit beginners more than experienced developers. :oops:
My Game Development Diary: Splintered Core CRPG Diary
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

soggie wrote:
Lonesome Ducky wrote:I think this topic would get the attention it deserves in project announcements, rather than beginners help
Too bad I'm just a beginner here, and I think my discoveries would benefit beginners more than experienced developers. :oops:
Beginners Help forum is more for Q&A. Your post deserved to be moved to Project Announcements as it fits the requirements.
milkshakeman
Posts: 27
Joined: Mon Aug 14, 2006 12:36 pm

Post by milkshakeman »

You say props are in 2D and chars in 3D. It will be interesting to see how you handle the fact that a char can be standing behind, in front or partially behind and in front of a prop :)
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Post by soggie »

milkshakeman wrote:You say props are in 2D and chars in 3D. It will be interesting to see how you handle the fact that a char can be standing behind, in front or partially behind and in front of a prop :)
Right now I have a few ideas in mind. Not sure if they would work though. One of them involves a custom depth buffer...

But I'll update this thread on my findings. :D
My Game Development Diary: Splintered Core CRPG Diary
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Post by soggie »

Okay I was a little disappointed. :(

I tried this first method:

Image

But got this results:

Image

Compared to my mockup here:

Image

There's a world's difference in the sharpness of the ground tiles. I used this code:

Code: Select all

void buildScene( IVideoDriver* driver, ISceneManager* sceneMan, IGUIEnvironment* guiEnv )
{
	// Create a camera pointing down the Z-axis
	ICameraSceneNode* camera = sceneMan->addCameraSceneNode( 
		0, 
		vector3df( 1.0f, 1.0f, 1.0f ), 
		vector3df( 0.0f, 0.0f, 0.0f ) 
	);

	// Get the scene's width and height
	dimension2d<u32> size = driver->getScreenSize( );
	
	matrix4 clipMatrix;
	clipMatrix.buildProjectionMatrixOrthoLH( size.Width * 2.0f, size.Height * 2.0f, -1000.0f, 4000.0f );
	camera->setProjectionMatrix( clipMatrix, true );

	// Create a ground plane
	IAnimatedMesh* terrain = sceneMan->addHillPlaneMesh( 
		"ground_plane",
		dimension2d<f32>( 100.0f, 100.0f ),		// tile size
		dimension2d<u32>( 80, 80 ),				// tile count
		0,
		0.0f,
		dimension2d<f32>( 0.0f, 0.0f ),
		dimension2d<f32>( 15.0f, 15.0f )		// texture repeats
	);

	// Prepare the multitextures
	ITexture* alpha = driver->getTexture( "../media/alpha.tga" );
	ITexture* texture1 = driver->getTexture( "../media/dirt-floor-moss1.png" );
	ITexture* texture2 = driver->getTexture( "../media/grass_20_d.jpg" );

	// Add it into the scene
	IAnimatedMeshSceneNode* terrain_node = sceneMan->addAnimatedMeshSceneNode( terrain );

	terrain_node->setPosition( vector3df( 0.0f, -90.1f, 0.0f ) );
	terrain_node->setMaterialTexture( 0, texture1 );
	
	terrain_node->setMaterialFlag( video::EMF_LIGHTING, false );
	terrain_node->setMaterialFlag( video::EMF_ANISOTROPIC_FILTER, true );


	// Create the hooman
	IAnimatedMesh* mesh = sceneMan->getMesh( "../media/sydney.md2" );
	IAnimatedMeshSceneNode* node = sceneMan->addAnimatedMeshSceneNode( mesh );
	node->setScale( vector3df( 3.0f, 3.0f, 3.0f ) );

	if ( node )
	{
		node->setMaterialFlag( EMF_LIGHTING, false );
		node->setMaterialFlag( video::EMF_ANISOTROPIC_FILTER, true );
		node->setMaterialFlag( video::EMF_TRILINEAR_FILTER, true );
		node->setMaterialFlag( video::EMF_ANTI_ALIASING, true );
		node->setMD2Animation( scene::EMAT_STAND );
		node->setMaterialTexture( 0, driver->getTexture( "../media/sydney.bmp" ) );
	}
}
Even with anisotropic filtering on the textured ground, still it cannot match the sharpness of pure 2D tiling. This means that I need to change my rendering method to:

Image

where I disable the z-buffer and sort the scene node's z-order using my own scene manager.

Any tips on improving the sharpness of the texture?
My Game Development Diary: Splintered Core CRPG Diary
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Any tips on improving the sharpness of the texture?
Try disabling filtering (bilinear/trilinear/anisotropic) and also mipmaps :)
soggie
Posts: 7
Joined: Tue Sep 14, 2010 9:53 am

Post by soggie »

mandrav wrote:
Any tips on improving the sharpness of the texture?
Try disabling filtering (bilinear/trilinear/anisotropic) and also mipmaps :)
Well it did improved the sharpness of the ground textures, but at the cost of the model's texture. Is it possible to selectively enable mipmapping for specific scene nodes only?

EDIT: Also, turning off mipmapping seemed to reduce the FPS from 800+ to 500+. :?

EDIT: Well I figured it out. The key is to make a bigger tile size. I kept anisotropic and trilinear turned on, and this is what I got:

Image

It's a wrap for today! :D
My Game Development Diary: Splintered Core CRPG Diary
Post Reply