Models

Models

1-How to Export Models to Dark Age
In order to make models for Dark Age you need a modelling program like 3ds Max,Blender,Milkshape etc. and an exporter which can export the model to Direct X *.x format.
Here is the one we use for 3ds max : kwxport Max Exporter

a) Static Models
Static Models don't contain any animation.They don't have any bones and no skin modifier.They are usually much easier to export to the game.We usually model every static object as one mesh and use one material.Then we use the unwrap uvw modifier in 3ds max to wrap the texture map on the mesh.This is better than having lots of different meshes and materials.However if you model a building like the one below as one mesh collision detection inside the game will only use the bounding box of this mesh.So if you want to have different collision bodies in a model you have make them seperate meshes.Here is an image explaining this :


As you can see there are lots of different meshes(editable poly in max) here.Each of them can be collided in the game.Because there is no mesh at the entrance the player can get inside but he/she can't pass through walls.
Here are the kwxport settings I used to export this scene to Dark Age.


That's all for static models.Read part 2 to learn how to include the model in the game.

b) Animated Models
Animated models are harder to get right,because the exporter sometimes acts weird.Here are some tips to make it easier :

  • Use one mesh and one material.
  • Before adding bones and the skin modifier set the pivot of the mesh to world origin(0,0,0).
  • Add bones and apply skin modifier.
  • Make vertices rigid.One bone effects one vertex.
  • Make sure every vertex is assigned to a bone.
  • Animate model.
  • Export.

    Here are the settings I used to export the current character model with kwxport.

    If you are making a character model follow the table below for animation set names,because the game chooses animation sets in this order.The name is not important but it is better if its set like this.The important part is the Anim Set Number.If you don't make it like this then the character may play running animation when idle or attack animation when running etc.As you can see in the image above the 0 th animation set is the one at the bottom.

    Animation Set Name Anim Set Number Start Length
    Idle 0 0 345
    Run 1 346 40
    Melee 2 387 9(will probably change)
    Ranged 3 450 50
    Die 4 ?? ??

    If the model only has an idle animation,for example the wind mill model has only one animation set which is idle,then just export it with one animation set.The length,start values are not set in stone,infact we will have to change them in the future,but the length of an animation set effects the animations speed in the game so its important to have it same for each character model or everyone will run at different speeds or attack at different speeds.It also has to be same for the weapon models of characters or the weapon and the character will not be in sync.

    2-How to add the models to Dark Age
    After exporting the model you have to add it to the game to actually see it on the map.All the models and their textures are stored under the Data/Models folder inside game folder.After exporting the model copy the *.x file and the texture inside this folder.If you used an existing texture from that folder you only need to copy the *.x file.

    Next you have to add the model to one of the text files located inside the model folder :
    There are three txt files they are called entityList.txt,modelList.txt and dungeonList.txt.Generally you only have to add the new model to entityList.txt.modelList.txt is for items and dungeonList.txt is for new dungeon models.
    There are 4 columns in entityList.txt seperated with commas.Here is an example :
    House,house5.x,BUILDING,Buildings

    The first string is the name of the entity that will be seen in the game,second is the name of the model file,third is the type of the entity,the game will behave differently based on this type.For example BUILDING and OBJECT types have collision detection but TREE types don't etc.The last string is the name of the treeview where the entity will be placed.The world editor places the House entity under the "Buildings" tree view.

    After you add the new model to one of the text files start the world editor and go to the entity tab.Then expand the tree view,you should see the model file name in the tree view.

    Click on it and then click on the map to add it to the map.If everything went well you should see the model on the map.If the model was animated you should see it in idle animation set.You can change the different animation sets from the floating entity information dialog box.

    If you have any problems exporting or integrating models please contact us.

  • Comments

    Looks great, thanks for

    Looks great, thanks for sharing the way for do it. I will try it.

    File Format for Models

    Just wondering. Which file format do you use for storing models and texture information ?

    We are using directX *.x file

    We are using directX *.x file format for models.To convert models to the X file format we use two exporters one is : http://kwxport.sourceforge.net/
    And the other one is : http://www.andytather.co.uk/Panda/directxmax.aspx
    Sometimes one of them doesn't export the mesh correctly so we have to use the other one.
    All the texture files are stored in the same folder as the models,the file formats can be any common image format like : jpg,png,bmp,tga etc.