Mod from scratch tutorial

From Achron Wiki
Jump to: navigation, search

First think about what you want to do. Making a mod requires making many design decisions and you as a mod maker must have some way to come up with answers. Why you want to do a mod, what will you be creating and what is your goal.

Here we want to do a similiar kind of game than Achron but we just want to do it with our style. We want to build as much as we can by ourselfs to make the mod us much ours as possible.

We will want to use the resequence engine but we do not want to actually code a new game. We just want to do a total conversion mod. The simplest way to do this is to simply make maps that use assets we ourselfs have made.

We could apporach this with a topdown approach first figuring out what all files we need to create or bottomup creating files for assets we know we are going to use. This tutorial approaches bottomup to service also those that only do those portions.

So our game being an rts sure needs units. And units need appearances.

Contents

Modeling a unit

A units 3D-geomtery is stored into a "unitname.robj" file. With it there are data on various poses of the unit which are used as a basis for creating animations. Such a file is generated by a 3D modelling software. Hazardous software has provided a python script capable that works with a freeware 3d modelling software Blender. Their plan is that models made in other software can be first converted into a format blender understands and then their script can be run on that data to produce a .robj. If you are familiar and know how to use a 3d modeling software you need to find either with its documentaion of Blenders documentaiton how and to what extent their files can be made compatible (you can also write a pulg-in for your modeler to export .robj s straight from it). If you do not have a 3d modeling software downloading blender might not be the worst decision.

creating mesh and animation data in Blender

The units appearances will form entirely of 3 triangles glued together. In blender language one such triangle is called a face (surface) with its sides called edges (lines) and the edges meeting at 3 vertexes (points).

Make a new object place it at the center of the grid (at (0,0,0)) go to edit mode and edit the mesh to look like your unit.

Select old things and press E (extrude) to make more of the geometry. You can move selected things with G. Make connections between things with F (vertexes connect with an edge or a face where appropriate). Design the model such that it uses the red-green plane as floor and faces into the direction of the green axel (these are object relative directions (check that coordiantes are set to relative instead of absolute))

When the shape is done ensure that the faces "oriented" the right way by selecting Transform->Normals->Calculate Outside. Also ensure that all forms are indeed triangles (and not quads) by selecting transform->Faces->Quads to Triangles.

At this point you should have a "statue" of your unit.

Next up is making the different poses the unit will have. Make an actuator, make it have a skeletal bone structure that matches your unit, name the bones identificiably and make the actuator a parent to the mesh. Next, in the mesh, form vertex groups with the same names as the bones. Turn off bone envelope deformation (or use ti if you like). Use the timeline and armature pose mode to go to various places, rotate the bones as approapriate and make a keyframe with I. When moving about the timeline you should see the model being interpolated between the various pose extremes. It is possible to delete a keyframe. You should aniamte every action the unit will take sequentially on the timeline. When satisfied with the animation. Adjust the start and end times of the timeline so that all your animation falls within it but that it doesn't contain too mcuh idle time.

At this pont you should have all the animations for your unit.

Creating textures for your unit in Blender

Select the mesh, go to edit mode, and select edges so that they make a sensible place to fold the surface. Mark it with ctrl+E as a seam (you can unseam edges). When you have divided the mesh into sensible areas, select the whole of the mesh and use "UV unwrap". Open up the image editor mode in Blender. You should see a the pieces of surface you made arranged inside a square. Make a new picture with the "UV test grid" button pressed down. You should see a grey/lighgrey texture with colorfull "+" signs in it applied to your model. Check that the + signs do not show up distorted. Manipulate the pieces of surface in image editor so that the UV test grid is shown without distortion. Use an option called "save UV layout".

Now you should be able to make a good .robj file with the file->export->Resequence Object (*.robj).

You can additionally try to "bake" a good look for your model. Have the result as a UV texture and save it via the picture editor. Another option is to otherwise draw the texture whihc might be viable if it is easy to see what surface piece belongs where and the is not much distortion.

To ease making an icon move/make the camera into a good shot of your unit. Render a picture, then use file->Save Rendered picture As.. .

The coloring of your unit will be contianed in many files. if your unit name is X x-rgb.png will contain the surface color. x-a.png will contain how transparetn a surface is white being fully opaque and balck being fully transparent (excessive tranparency drops performance). X-c.png will contain how much of active camounfalge the surface contains black being no camounflage. X-g.png will contain data on glossiness (has something how light behaves with respect to the surface). X-s.png will contain how shiny the surface should be with 0 being totally shineless. X-h.png will contain data on how high a point of the surface should be (bumps and such). A perfectly grey picture should be used if no height information is provided. X-t.png will portions of the surface which should be colored in team colors in white. These all can be created by using an appropriate picture imposed on the UV layout.

you will also need X-icon-rgb.png X-icon-a.png and X-icon-t.png.

These files need to be flipped vertically because of diffferences how Blender and Achron define coordinates.

Defining a model

Save the X.robj and pictures in the same folder. Provide footprint information in a text file with an extension of .csm. the first line should read lenght=4 where 4 can be any integer indicating how big grid is used to express the footprint. Then there should follow as many rows containing as many instances of zeros or ones separeted by spaces. a One means occupied space a Zero means a free space.

Write a text file with extension .as The first line should read "model X". Next follows an indentened block of information. Scale and a float number announces how much the model should be scaled, adjust this if the model is too big or small. Anchor should not be needed but might need to be used if wacky modeling was done.

Next should follow at least one animation. A standard animation would be "animation stand". the animation information is spesified by a set of keyframes. For each keyframe first is listed the part of the animation that this keyframe occurs in. 0.0 means at the very beginning and 1.0 means at the very end. next f15 would mean that the frame 15 of the robj animation data whould be used as the pose. Optionally one can spesify translate 0.0 0.0 0.0 and rotation 0.0 0.0 0.0 360 to adjust how the pose is fitted into the unit volume.

Projectile definitions

When the folder contians all the files use AchronModelCompliler.exe to open the .as. Check whether the unit is as should and repeat the modeling phases or .as modifications as needed. Save as a .mdl when ready.

Now you should have the graphical part of your unit done.

Defining the game attributes of a unit

Make a corresponding ObjectClass instance in ocs XML. Need sound?

Making a map

Landmass of the map

Use map editor to make mountains and valleys

Making tiles

use XML compiler to make a .til

Object layout

Game logic

Make skins with skin language.

Scenario monitor

Make a scenario monitor with ReScript.

Test and evaluate

Distribute