RTS 4X game design

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
kohansey
Posts: 14
Joined: Tue Apr 01, 2008 3:18 am

Post by kohansey »

If I wanted the meshes for my space object to be replaced with a billboard when the camera zooms out (level of detail?), would I have to write a draw/render method for my space object to display the billboard, or would I create the billboard mesh and let Irrlicht's scene manager draw/render with the drawAll() method?
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

You'll always rely on drawAll() to trigger the drawing of your visuals.

Whether you have to do the actual rendering yourself depends on whether a basic Irrlicht billboard does what you want. Irrlicht billboards are point aligned billboards that always face opposite to the camera's view, and they don't support rotation, so they will always look the same. If you need to rotate them (around their centre or around an axis of rotation) then you'll have to create a custom class. There are plenty of examples, or we can write a custom class to do exactly what you want fairly rapidly.

Generally, you'll just 2 visuals and make one of them visible at a time, or use remove() / setParent() to take them out and put them back into the scene tree.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
kohansey
Posts: 14
Joined: Tue Apr 01, 2008 3:18 am

Post by kohansey »

I am have a problem with the mesh culling when it is on the side of the screen, I included a screen shot to show you what I mean. Two problems actually, thus to screen shots. The first one, the sphere is no longer a sphere, but looks more like an ellipse. The second one, I guess, is the scene manager culling the whole triangle instead of the part thats off the screen. Is there anyway to improve on this?
http://www.warcorpsoftware.com/ellipse.jpg
http://www.warcorpsoftware.com/culling.jpg
Last edited by kohansey on Sat Apr 05, 2008 4:21 pm, edited 1 time in total.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

I can't the images.

The issue of elongation of objects at the edges of the screen is an inherent problem with any perspective camera matrix. It's not common to Irrlicht, and AFAIK there's no solution, despite the occasional unsubstantiated claims from the sort of users who think the CIA is spying on them via their dental work. However, you can ameliorate it by using a smaller FOV, e.g. 60 degrees.

Culling whole triangles sounds like a known issue with the software driver. What driver are you using? If you need a software driver, EDT_BURNINGSVIDEO doesn't have that issue, and is substantially faster.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
kohansey
Posts: 14
Joined: Tue Apr 01, 2008 3:18 am

Post by kohansey »

Thanks rogerborg, I was originally using EDT_SOFTWARE, but switching to EDT_BURNINGSVIDEO and the culling problem went away. I changed the FOV setting from PI / 2.5 to a 30 degree angle. Now objects keep their shape at all corners of the screen.

Just to give a little update on the original concept. Anyone feel free to correct me if I'm wrong or if there is a better way to do this.

Scene Hierarchy:
- Unverse will be the Root Node, in essense a sub-class of the Scene Manager
- Each solar system will be a child of the universe
- Each planet, asteriod field, nebula, and space ship will be a child of the solar system they are in (I am assuming this is how you seperate the scene into areas or regions)
- Each planetary space station, moon, and other planetary structures will be children of the planet.

each object is a sub-class of ISceneNode, therefore, depending on the camera distance, I can choose to display the node's children or just display a billboard for the node.

I need some advice about scene nodes and meshes. Would it be better to have scene node for every mesh, or should I only have one scene node for each "area" and have each "area" contain multiple meshes.
Post Reply