newbie questions about map making and iiredit

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
panch20
Posts: 3
Joined: Wed Dec 06, 2006 7:28 pm

newbie questions about map making and iiredit

Post by panch20 »

Ok so I've found a host of tools to start making maps and i've come up with a few questions:

1.) Why do the scenes i create in IrrEdit seem so small when run them using the engine?

2.) How do I orient my starting place to be somewhere on the mesh that I imported into IrrEdit?

3.) Using the tutorial for collision detection I was able to fill in a blank project with all the code to work for the Q3 maps, but I can't seem to get it working for irrEdt stuff. I think i have everything but the proper line for:

IAnimatedMesh* q3levelmesh = smgr->getMesh("c:/a/water.3ds");

Thanks in advance!

4.) Does Visual Editor work with the 1.2 engine, and if so, which engine does every1 recommend?

5.) Also are most of the games designed on Irrlicht designed on Q3 maps?
esaptonor
Posts: 145
Joined: Sat May 06, 2006 11:59 pm

Post by esaptonor »

Well i don't use irrEdit too often so i can't help you too much.

1: No idea, but just make your scene bigger, or make the camera move less each frame so it 'feels' bigger.

2: maybe use a script? but i have never used scripts so i actually have no idea. You could just do it within your main program by getting the active camear and then set position.

3: no idea
4: no idea, but the latest version of the engine is the one to go for. Thats why its the latest.

5: no, I am making a space RTS game and I made my own level editor which has its own format.
Q3 maps are probably easier, especially for a first person game. But its up to you.

hmm, i wasn't much help, but at least i may have helped a little bit...?
panch20
Posts: 3
Joined: Wed Dec 06, 2006 7:28 pm

Post by panch20 »

yup a little bit, thank you :)
bgsteffens
Posts: 39
Joined: Wed Oct 04, 2006 8:00 am

Post by bgsteffens »

1) Scaling the level mesh itself also works:

Code: Select all

// Double the level's size in all directions evenly
levelMesh->setScale(vector3df(2, 2, 2));
2) If you're planning to have multiple levels, you might consider an ini or dat text file that sets certain information about each level. Then when you go to launch a level, read the starting position from the file and just camera->setPosition(vector3df(x, y, z)); as esaptonor said. Or, if you decided to go with your own scene file format, you could have that information packed neatly inside :)

3) You said you need the proper line of:
IAnimatedMesh* q3levelmesh = smgr->getMesh("c:/a/water.3ds");
That code looks fine to my noob eyes. Wouldn't the problem lie somewhere in the creation of the triangle selector or binding the animator to the camera/mesh?

5) [to elaborate on esaptonor's response] This is completely up to you, but generally it depends on the size/complexity/custom nature of your project. If you just want to put together a working demo quickly and are less worried about the specifics, I'd go with Q3 maps. They're easy, look good, take very little work, and there's a lot of example code all over the forums and wiki. If you're going for a more custom feel, adding a lot of things, want outdoor scenes with skies and terrain, or just want to make a full-fledged game, you may consider your own file format, even if it really just serves as a spot to consolidate all of the loading and positioning within the level.

ie:

Code: Select all

level1.txt

heightmap=heightmap.jpg
terraintexture=terraintexture.jpg
mesh=house.obj
mesh=tree.obj
super_evil_scary_murderer_you_must_kill!=badguy.x
Personally, I would play around with all different methods of generating scenes. Once you have a good grounding in the pros and cons of the different methods, either choose the one that works best for you or conjure up your own mix-match.[/quote]
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

2.) How do I orient my starting place to be somewhere on the mesh that I imported into IrrEdit?
If I remember right, you should be able to insert a camera node into the scene. If you do that, you don't need to write code to place a camera, it will appear where you put it in irrEdit.
3.) Using the tutorial for collision detection I was able to fill in a blank project with all the code to work for the Q3 maps
You might do a search for collision and irrEdit. There are several ways to do it. You can load the entire scene, and then create collision information later, or you can create collision information as the scene is loaded.

If you choose the first method, you need to write code to find the scene nodes that you want to do collision with. You can easily search for scene nodes by name or by id using the methods provided by the scene manager. You can use the getType() method to figure out what the actual type of the scene nodes is. Once you've got that, you can cast it to the appropriate type, get the mesh, and add collision information for it.

The second method involves writing your own user data serializers to pass to saveScene() and loadScene(). You would need to open and save .irr files that come straight out of irrEdit because they don't have any user data fields in them. Anyways, one serializer would insert an attribute into the output file, and the other serializer would read that attribute back in and add collision information much like the first method did.

Travis
panch20
Posts: 3
Joined: Wed Dec 06, 2006 7:28 pm

Post by panch20 »

many thanks! i'm sure to have more questions in the near future ;)
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

about the camera

Post by Athlon_Jedi »

after you add the camera in Irredit, take note of its position and round the values to the closest whole number,

then in your code you have to add a camera scene node in that same exact position, otherwise the camera ends up being static ( meaning you can see with it but not move it)
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Until Niko adds a button to add the Maya and FPS cameras from the interface, you have two choices. You can open up the .irr file yourself and change the node type to "cameraMaya" or "cameraFPS", or you can take advantage of the scripting system and do it yourself.

The following script will add buttons to the toolbar and the menu for creating the two derived camera types. You can move them around in the editor and everything. Then you don't need to create any camera in your code...

Code: Select all

/*
 * save this as a file autostart_camera.nut and put it in
 * your scripts directory.
 */
 
function irrAddCameraSceneNodeMaya()
{
  irrAddSceneNode("cameraMaya");
  editorUpdateAllWindows();
}

function irrAddCameraSceneNodeFPS()
{
  irrAddSceneNode("cameraFPS");
  editorUpdateAllWindows();
}

// add the hello function to the tool menu
editorRegisterMenuEntry("irrAddCameraSceneNodeMaya", "Add maya camera");
editorRegisterMenuEntry("irrAddCameraSceneNodeFPS", "Add fps camera");

// add the hello function as toolbar icon
editorRegisterToolbarEntry("irrAddCameraSceneNodeMaya", "Add maya camera", "resources\\sceneNode_cameraMaya.bmp");
editorRegisterToolbarEntry("irrAddCameraSceneNodeFPS", "Add fps camera", "resources\\sceneNode_cameraFPS.bmp");
Of course this will require that someone writes serializeAttributes() and deserializeAttributes() for those cameras so that you can edit their settings... I'm writing that code now.

Travis
Athlon_Jedi
Posts: 156
Joined: Wed Jul 21, 2004 4:29 am
Location: Mishawaka, In

differing methods

Post by Athlon_Jedi »

I am in no way contradicting Vitek here but " hard coding" the camrea scene node in the way I describe works just as well and if you arnt to strong in xml is a bit simpler so acculy both methods are viable :lol: :lol:
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I agree. The only reason I wouldn't want to hard-code the camera position is if I was making many levels. I wouldn't want to have to setup a different camera position for each level outside of the level file.

Of course soing it my way has disadvantage that you can't currently use a non-default Maya or FPS camera because someone was to lazy to write the serialize/deserialize code for the derived cameras. Not only that, but it appears Niko is using a custom version of Irrlicht for IrrEdit so you can't just throw a fixed Irrlicht 1.2 dll in there and have it work.

Travis
Post Reply