ModelHolder2

 ModelHolder2 -- Means of placing non-player/non-enemy model (object created with external modeler such as 3D Studio Max, LightWave, MilkShape, etc. and prepared for Serious usage in Serious Modeler model assembly utility) into the world.  See ModelHolder3, down in Other Entities (not present in tree by default), for similar entity for use with models prepared via Serious SKA Studio.  As of the April 2002 v1.07 patch for Serious Sam - The Second Encounter, use of only Serious SKA Studio is recommended for the creation/usage of new models for Second Encounter and subsequent Serious Games (First Encounter only supports models from Serious Modeler).

 

(New as yet undiscussed properties:  Max Tesselation and Texture Animation)

 

 

ModelHolder2  (Davor Hunski)

The main entity class used for placing models into a level. Each content model (not enemy or item) that needs to be placed in level will have one model holder. To add a model into world, drop ModelHolder2 entity and adjust its properties to fit your needs. Use Model property to browse and select model. Class auto loads textures as lastly saved in Serious Editor. You can browse and select texture via Texture property. Modelholder2 class allows you to adjust model's shading, to set destruction behavior, turn on collision, stretch it, adjust mipping (level of detail) distance switching,...

 

Active

-flag property. If you set this flag off, model will be invisible in game, but will still be visible in Serious Editor. You can set it visible inside game by sending Activate event to it.

 

Ambient color

-color. Models in Serious Editor are lit with ambient color and diffuse light color. In un-customized model shading mode, light direction, ambient and light color are calculated as resulting influence of the lights that surround the model. This shading model allows models to fit the world seamlessly as long as the level doesn't feature over-brightening. Due to older hardware's inability to apply over-brightening onto interpolated shading, models can't have over-brightening, as world's polygons can. That's why sometimes it seems that models are darker than surrounding environment. Sometimes you want to add more drama to the lighting of a model and it can get tricky trying not to spoil the level's lightning. ModelHolder2 allows you to set your own shading for models. To do so, you have to set custom shading property to "Full customized". Then you adjust ambient shading component with the Ambient color property that we are describing here, change diffuse light component with "Light color" property and adjust light direction with "Light direction" property.

 

Light color

-color. Here you set diffuse component of light when you use customized shading as described in description of previous property.

 

Light direction

-vector property. This property is used to define the direction which will be used to lighten model.

 

Apply RND stretch

-flag property. When you set this property, model is resized according to random stretch factors. Flag is automatically cleared, so this property serves as some kind of  'Randomize again' button.

 

Attachments

-flag property. If this flag is set (by default), model automatically loads attachments that are saved within the .ini file saved when Serious Modeler saves a model.

 

Bump

-file property. You can browse and select bump texture for your model here. Bump texture adds detail to model's main texture (i.e. wood skin).

 

Classification stretch

-float property. Serious Engine uses a model's bounding box (box that collects all of the model's vertices) to classify it into sectors. When rendering sectors, if a sector becomes visible, models that are classified into it also become visible and are added to rendering queue. Sometimes you wish to 'unclassify' a model from some sectors. For example, if you create yard sector with 8 meters surrounding walls, and you have palms that are 12 or more meters high, they will be classified into both the yard sector and the sector above it. The sector above the yard sector is visible from a huge distance and, because the palm is classified into it, whenever this high sector is visible, the palm is rendered. That's the case if you don't tweak (read cheat) the model's classification. This property, classification stretch, is used to tweak model's classification. It represents number, actually ratio ranging from 0 to 1, that will be used to scale down model's bounding box before it is used for classification. If you set classification stretch of 0.5 to our 12-meter palm, it will be classified the same as a 6-meter palm would be. Now it will be classified only into yard's sector, and will be contained into upper sector.

 

Colliding

-flag property. If this flag is cleared, players and other moving entities won't collide with the model. A modern engine should be able to perform two collision detections: 'normal' physical collision (model to model and model to brush) and ray cast (bullet hit) collisions. Serious Engine's physical collision engine is based upon colliding with a model's oriented collision box, which is approximated with group of spheres. It is important to note the 'oriented' collision box, a mechanism that allows multiple gravities and a whole range of other physical effects. For ray cast collision, you can choose between exact, per polygon ray cast, and approximate, but much faster, ray cast algorithm.

 

Custom shading

-enumerated custom shading types. Here you can take control of model holder's shading and adjust shading parameters manually. In addition to normal un-customized shading model (where shading is left for engine to handle), there are two more shading models: fully customized and so-called constant shading. Up to now, we described fully customized shading where you provide separate color for ambient and color for diffuse shading component. Sometimes, however, you would like to erase shading effect and leave only lighting influence. In that case you should use "constant shading" setting.

 

Destruction

-entity pointer. An interactive engine should provide gamers the ability of destroying models. For example, one should be allowed to blow up trees, stones, statues, torches,... Modelholder2 implements destroying feature through model destruction entity. With this 'Destruction' property, you can target model destruction entity. This entity holds 'exploding data' info. When certain criteria are achieved, such as if model is hit so bad that destroy health provided by model destruction is reached, model 'explodes'. The engine then uses data stored in model destruction to form an exploding effect (i.e. type of debris) and to switch to next destroy phase, because model destruction points to next model holder 2 that can have its own model destruction. Through this model holder-model destruction chain you can have as many destruction phases as you wish (i.e. statue without head, statue without head and upper part of torso,...).

 

Destruction target

-entity pointer. When an model is destroyed, entity linked trough this property is triggered with trigger event. You can use this feature for numerous purposes. For example, you can activate secret door when a statue is destroyed (or you can spawn some enemies :).

 

Light animation

-enumerated animations. A model's shading can also be animated, so you can have all kinds of model's lighting behavior (i.e. flickering, colored light dancing, pulsating,...). Model holder's model can be animated using the same interface as for animating light: with one property you browse light animation file and with another (described here) you select one animation from animation file. Light animation can be changed later within game using animation changer. Just to remind you, a light animation file can be edited and manipulated with the light animation editor from within Serious Editor.

 

Light animation file

-file property. Here you browse and select one of your animation files as described in previous property section.

 

Mip Add

-float number. Serious Engine uses level of detail (LOD) for the models, and we call it mip-modeling (term is based on texture's mip-mapping effect, where texture switches to lower mip map on certain distance). Mip models are variations of the same model that differ in number of polygons. To speed up rendering of a model, engine uses lower mip model (one with less polygons) for rendering when model reaches certain distance. Since model is smaller on the screen, it doesn't need so many polygons for rendering. If model is even further away, engine will take next available mip model, and so on, and so on. These mip switching distances are defined within Serious Modeler, but sometimes you want to adjust this distance. Mip add and Mip mul properties are used for this purpose. Mip factor is number that engine uses to determine which mip model to use for rendering. Mip factor is heavily dependent upon model's distance from camera, but is also changed when resolution is changed. For the sake of simplicity, we can calculate that mip factor is a logarithm of base 2 of current model's distance. So, if model is 64 meters away, mip factor will be around 6. Let's imagine an unrealistic example where we have 10 mip models, each switching at next whole mip factor value (1,2,3,4,5...). So, for mip factor value of 6, engine would display mip model no 6. If we set this mip add property to certain value greather than 0, let's say 2, 2 will be added to original mip factor before determining which mip model to use for rendering, add we would get mip model 8 (6+2=8) instead of 6, so we achieved earlier mip switching by increasing mip add factor. To be more precise, we scrolled mip switching towards camera. Mip mul factor is used to stretch mip switching factor, not to scroll them. This way, if we set mip mul factor to 1.5, at distance that is represented with mip factor 6, engine will choose mip model 9 instead of 6 (6*1.5=9).

 

Mip mul

-float number. Explained under previous section.

 

Mip Fade dist

-float number. There is another way to setup mip model disappearing that will result in rendering speedup. It is implemented trough "mip fade dist" and "mip fade len" properties. These two also act using current mip factor (explained under "Mip add" chapter). They are used to define mip factor where model will start to disappear (using blending) and mip factor where model will completely disappear. If we use example from previous chapter, and set "Mip fade dist" to 6, "Mip fade len" to 2, model will start to disappear at mip factor (cca 64m) 6 and will completely disappear at mip factor 8 (cca 256 m). This can be very useful for larger number of objects. For example, if you would like to render an area full of trees, you could use this fading interface. You can set tree model's fading out distance (which is much more tolerable than mip model's "plopping") and add some haze to cover it. You will get smoother disappearing and much faster rendering.

 

Mip Fade Len

-float number. Explained under previous section.

 

Model

-file property. Here you can browse and select model holder's model. Once you select it, engine will try to open model's .ini file and automatically set textures that model was saved with from Serious Modeler. If model holder's attachments flag is set (defined via attachments property), engine will also try to automatically add attachments that were attached to most recently saved model.

 

Model animation

-enumerated model animations. When you browse and select a model via 'Model' property, animations that are featured for selected model appear under this property and can be selected. You can change these animations later with animation changer. For example, you can have statue of liberty model holding torch up and when you activate a switch, lady can start waving with the torch. Important point: in Serious Engine, animations do not take any time to calculate. So you can have thousands of animated models and they will take exactly the same time to render as if they weren't animated. So, make your levels alive (all trees can move affected by the wind, flags can wave, ...).

 

Reflection

-file property. Here you can browse for and select reflection texture for a model.

 

Shadows

-enumerated shadow casting types. Models can cast different types of shadows: no shadows, cluster shadows and polygonal shadows. When you choose cluster shadows, models will behave exactly as if they were built as brushes, casting their shape onto the shadow map, and shadow will be blurred. If you choose polygonal shadows, all of the model's polygons will be projected onto polygon nearest to the model holder's handle and you will see the exact shape of the model. Edges will be sharp, and some polygons will be overlapped and will produce darker shadow areas.

 

Specular

-file property. Here you can browse specularity texture for a model.

 

Stretch All/X/Y/Z

-float factors. When you browse for and select a model, via the 'Model' property, the model will have a size that was defined inside Serious Modeler. Usually you want to stretch model to better fit your world. If you want to decrease the model's size, you should set value less than 1 for "Stretch All". If you want to double model in size, set 2 for "Stretch All".. You can stretch one or more components of a model. This way you can create taller or fatter models. If you set negative value as a stretch, let's say stretch x = -1, model will be mirrored around given axis (around x). This way you can create two mirrored guardians, each one to guard one side of an gate. Resulting stretch will be combination of all influences: if axis stretches are x=2, y=1, z=1, and Stretch All=3, model will be stretched 6 times along x, 3 times along y and z.

 

Stretch RND All/X/Y/Z

-float factors. These factors are used to define how much of random stretch will be applied to original stretch defined using Stretch All/X/Y/Z properties. Random factors define percentage, percentage of original stretch that is allowed random range. For example, if you set "Stretch RND All" to 0.1, you allowed random in range of +-10% of original model's stretch. If we have a palm that is 12 meters high, and we set "Stretch RND All" to 0.1, we allowed stretch sized from 12-1.2 up to 12+1.2. Random x,y,z  work in the same way, but are applied only to according coordinates. Random stretch is not applied when these properties are changed, but when "Apply RND stretch" flag is set. You can think of this flag setting just like pushing "Randomize again" button.

 

Texture

-file property. Here you can browse and select model's main texture.

 

Texture animation

-enumerated main model's texture animations. All textures in Serious Engine can be animated.  So can model's main texture. Sometimes a texture file holds more than one animation and here you can select one of animations available for main model's texture.

 

Obsolete

Background

Name

Parent

Spawn flags

Targetable