1 Introduction. 1

2 Installation. 1

3 Disclaimer. 1

4 Basics. 2

5 Quick tutorial 2

6 Features and limitations. 4

6.1 Light features. 4

6.2 Surfaces. 4

6.3 Keyframing. 5

6.4 Textures. 5

7 Level tips and hints. 5

7.1 Perception. 5

7.2 Lights and shading. 5


1 Introduction

This document is a short tutorial on how to create new levels for the game of Snok. It does not contain any tutorial for learning LightWave or any similar 3d modelling programs. Any reader/user of this document should be more or less experienced with 3D modelling applications and techniques. This package does of course not include the LightWave application, and neither do we distribute it, as it is a commercial product protected by copyright laws.

 

This is "betaversion" of the levelediting tutorial. I just wanted to release it as fast as possible so someone could start testing it. Information will be added to this document, and released on our website whenever I have the time.

 

If you end up with a level or two you're satisfied with, send it to me (maybe not mail, but send me an url and I can download it), and maybe I'll stuff it into the next release of Snok!

 

Information will soon be added, making you able to model your own skins, heads and tails too. :-)

 

Torbjørn Vik

15th of June, 2000

2 Installation

This levelediting package is simply meant to be unzipped directly into the directory where you previously installed Snok. Whenever there's a question saying "Do you want to overwrite?", answer "yes, please".

3 Disclaimer

We, the developers of Snok, does not take any responsability for any harm this package may do to you, your software or your hardware. Any sideeffects of the knowledge gained by reading this document, is not our business.

4 Basics

The engine behind Snok is entirely based upon the Lightwave object (.lwo) and scene file (.lws) formats. All features that are supported from the lightwave formats are listed under section 5 (features). Note that the new fileformats produced in Lightwave 6 format is NOT supported. Do NOT try to use any of these tools on files saved in this format.

 

New levels are added to Snok through a simple textfile named levels.txt. This file contains enough information about all the levels in the game. The textfile originally looks like this:

 

{

Title=Boxie

Path=levels\boxie\scenes\room01.scn

Description=A very large room with plenty of space. Very easy to reach maximum snok-length.

}

 

To add a new level to Snok, simply add a new block similar to the two above. The three fields Title, Path and Description must all three be provided for each block, in exactly the order as above. The new levels.txt could look like this:

 

{

Title=Boxie

Path=levels\boxie\scenes\room01.scn

Description=A very large room with plenty of space. Very easy to reach maximum snok-length.

}

 

{

Title=Hall

Path=hall\scenes\hall04.scn

Description=A nice hall with several nice objects to crawl around.

}

 

There are several limitiations and syntax stuff you've got to know about this textfile:

 

-         It must be saved in plain text. Preferably use textpad/wordpad.

-         The three fields Title, Path and Description must consist of only one line each. That means you can not have a description ranging over two lines.

-         The title can not be longer than 12 characters.

-         The path can not be longer than 256

-         The description can not be longer than 128 characters. One single word in the descriptoin can not exceed 18 characters (strange, ey? :-)

-         All three fields must be included for each level-block.

 

It's fully possible to break all these rules, without Snok detecting it. Breaking them will probably result in a massive crash.

5 Quick tutorial

Here goes a VERY quick tutorial on how to create a level in LightWave. It's just to make you see this is not impossible at all. This is probably not very understandable for people who have never tried Lightwave before.

 

-         Create a simple object in the modeler. Like a box where sides range from –60 to +60 on all three axis, centered around origo.

-         Flip all the polygons.

-         Subdivide the object two times.

-         Give it a material.

-         Save this object.

-         Create a 256x256 pixel RGB (not grayscale) jpeg-picture in whatever gfxapplication you may have. Draw some nice figures with lots of psychedelic colours on it. :-)

-         Enter LightWave and load both the box and the picture.

-         Apply the picture to the material as a standard texturemap, automatic sized on the Z-axis.

-         Change the light from "distant" to "point". Tag the "intensity falloff" button and set the maximum range to 120.

-         Add a null object to the scene and name it SNOK_Start. This name is case-sensitive, so please spell it right! Place it in origo.

-         Add another null object to the scene and name it SNOK_Bonus. This name is also case-sensitive, so please spell this one right too. Place it in (0, 0, 25).

-         Save all objects, and save the scene.

-         Enter a command shell (DOS prompt).

-         In your Snok-directory, there is now an executable file called "clws.exe". Run this file with the path to your lightwave scene-file as parameter. If  you saved the scene to "d:\myscenes\snoktest.lws" and the game is located in the directory "c:\largo\snok\", write the following: "c:\largo\snok\clws d:\myscenes\snoktest.lws" on the command prompt. If you now enter the directory where you saved your scene (i.e. d:\myscenes\), you'll notice a new file has appeared, named "snoktest.scn". This is the converted file that Snok uses as levelformat.

-         Start Notepad and load "levels.txt" which is located in your Snok-directory.

-         Write a new levelblock to the end of the file, in the similar syntax as the first one. After editing, levels.txt could look i.e. look like this:

 

{

Title=Boxie

Path=levels\boxie\scenes\room01.scn

Description=A very large room with plenty of space. Very easy to reach maximum snok-length.

}

 

{

Title=Test

Path=d:\myscenes\snoktest.scn

Description=This is just a test.

}

 

-         Save the file, and start Snok. When trying to start a singleplayer game, you should be able to select the newly created level.

-         And voila. That's it.

 

That wasn't so hard, now was it?

 

I'll try to explain the most important steps. The step where you run "clws" is where the actual conversion happens. This must be done whenever you change the scenedata/objectdata and want to test it again in the game/viewer. As all games, there are several limitiations when modelling gamelevels, compared to standard modelling and animation. If you still haven't got tired, please the "features and limitations" section. That section describes i.e. how to achieve different material settings, and in general what features in the lightwave model/scene fileformat that is supported.

 

In the package there's also included a file simply called "s.exe". This file is an executable with the entire 3d-engine inside. Just write "s d:\myscenes\snoktest" to test your level without starting the game. This will be a lot faster than starting and quitting the game all the time. This application does not feature any gamelogic at all, it just runs the actual cameraanimation saved with the scene. Very useful when testing the visual aspects of a level. The videosettings for this application is by the way the same as for the game itself.

 

No try to load the lightwave scene that is included in this package. Note that you'll have to set Lightwave's datapath to your Snok-directory before loading. This scene demonstrates a lot of the features in the engine, so study it, get some hints/tips and create some great Snok-levels.

6 Features and limitations

6.1 Light features

-         All lights are dynamic, that means they be moved around with standard keyframing.

-         Light colors(RGB)

-         Light intensity (with animated envelope)

-         Light types = distant, point or spot

-         Intensity falloff (with animated envelope)

-         Spotlight cone angle (with animated envelope)

-         Spotlight edge angle (with animated envelope)

-         Ambient light is NOT supported. I recommend you set this value to zero, such that the rendered pictures in lightwave matches the actual result in Snok.

6.2 Surfaces

-         Surface colors (RGB)

-         Color texture. See section about texturemaps.

-         Luminosity value. (not texture)

-         Diffuse value (not texture)

-         Transparency value (not texture)

-         Additive flag (does not have exactly the same effect as in Lightwave)

-         Smoothing flag

 

Just to make it perfectly clear, these surface settings are NOT supported:

-         Bumpmapping

-         Double sided flag

-         Specular value

-         Reflectivity value

-         None of the "Advanced options"

6.3 Keyframing

-         ParentObject for both objects and lights

-         TargetObject for both camera and lights

-         Any number of polygons, vertices, surfaces, textures and lights.

-         Zoomfactor (with animated envelope).

-         Morphtargets (with animated envelopes). It's also possible with "multiple" morphtargets where A morphs to B. B morphs to C, C to D etc etc. When using this feature, the objects MUST be located in the objectlist in reverse order than the morph-sequence. In the example, the objects should be ordered D, C, B, A to get this working. Don't ask why. :)

-         Object dissolving (with animated envelope). This one SHOULD be used whenever using morphtargets. It's very rare that the morphtarget actually needs to be visible in the scene.

-         Texture width and heigth MUST be in power of two. That means 2, 4, 8, 16, 32, 64, 128 etc. Width and heigth does not to be the same though.

6.4 Textures

There are a few things that should be mentioned about the textures. As 3D cards only support texturesizes with width and heigth in the power of two, this forces you to ONLY create texturemaps with size = 2, 4, 8, 16, 32, 64, 128 and 256. Width and heigth does not have to be equal though. On many cards, the textures may also be larger than 256 pixels, but some 3dfx cards does not. Just keep this in mind if you want your level to be played by 3dfx-people.

7 Level tips and hints

7.1 Perception

We have discovered that there's a problem in Snok for the player to "feel" the distance to walls and objects. To help the player "understand" the depth in your level, you should always have textures with some kind of pattern on it. Do not have large, single colored textures with any contours at all.

7.2 Lights and shading

Even though the Snok engine supports as many lights as you want, it's a good idea to keep this number relatively low. Actually, the number of static lights doesn't have any influence on framerate. With "static" I mean lights that only have ONE keyframe and no parents.

 

All shading in Snok is done on a per-vertex-basis. That means large polygons will not get very nicely shaded. The only way to achieve better shading is to subdivide the polygons in your models.