Tutorial 007
Tutorial 007
Go to Customize > Units Setup and make those adjustments: US Standard Feet w/Fractional Inches 1/1, Default Units as Feet.
And for System Units Setup, make those adjustments: 1 Unit = 1,0 Feet, check Respect System Units in Files, Origin:
16777215'0", Distance from origin: 1'0", Resulting Accuracy: 0'0".
Adjust your home grid as follows, which will match perfectly the FPSC 40x40 map editor size: Grid Spacing 100'0", Major Lines
every Nth Grid Line 10, Perspective View Grid Extent: 20, check Inhibit Grid Subdivision Below Grid Spacing, and check Inhibit
Perspective View Grid Resize.
Now create a box in this size: Length 100'0" Width 100'0" and Height 1'0" and name it as fpsc_segments_size_base:
This is exactly the fpsc segment size, i already imported it on Segments Editor and it matches perfectly
Now using the 3dsmax viewcube, change to top view, and you will see the FPSC Map Editor inside 3dsmax:
I recommend you set your level ambience to a pure white, so there will be no shading in the 3dsmax viewport, so you will be
able to see the entire textures the way they will appear in FPSC Map Editor.
So now model your level, whatever you want, always taking into consideration the FPSC segment size base object you created,
to don't create things without proportion. As i worked as 3d artist, i have with me a lot of models, objects, props, textures,
some were created by me, while others i purchased, or downloaded free for internet (turbosquid), but as this tutorial is
merely for study purposes, and i am not distributing anything here, i think there is no problem to show them here.
So here is a level i created in 3dsmax (using both my models and other's), based into a middle-east setting. It's a both exterior
and interior level. When navigating inside your level, the script caled handycam that comes with game level builder maxscript
is an amazing piece of work that helps too much your work by simulating a 1st person camera inside 3dsmax:
So now we need to organize the level. Let's hide all the level props and only show the level geometry:
If you see, something very good to use to create the sense of perspective, is to create what i call skybox texture and skybox
billboards. Skybox texture is one plane object in which you will "project" a panorama of a scene that fits in this setting, in this
case of my level, this is the skybox texture (i am not talking about the fpsc skybox itself). As you can see, i modeled it in a kind
of v vision, so if you look in this direction, you see a kind of deep. This is the way pros do:
This is just some photo i got from internet and created a kind of panorama view using photoshop and some action scripts.
As you see, it helps to immerse the player in your environment.
Another thing is very good to do is to created what i call skybox billboards, which are some very low poly models to place close
to this skybox texture to complete the setting, because the skybox texture is just a photo applied to a plane, however, the
skybox billboard models, continue the 3D scene making it match good with the skybox texture:
Again, these billboards models need to be a extension of your level geometry:
Now look how everything fits perfectly and creates a sense of perspective and infinity:
I created the level geometry applying multiple textures, and for one who works with 3d for advertising, architecture (any use
except games), is better and faster using multi/subobject materials than having to unwrap the model, edit the UV coordinates,
then go in photoshop and fill this uv layout with your textures (which is what game designers do)
Now i will export the skybox texture object to FPSC as a x-file. But before exporting, we need to center it's pivot to (0,0,0) in
3dsmax:
And this is the fpe config. The appearnocol fpi is just a copy i made of the appear1 and added the command coloff to turn off
collision. And the scale 80 is what i found to be realistic. Because the exact size you see in my level inside 3dsmax is the same
size you see inside FPS Creator, however, even then is not very realistic, the player seems to be a bit shorter than the objects,
so because this i set 80 for the entity size. But for you have an idea before exporting the level definetively to FPSC, you just
export your entire level geometry as one unique dynamic entity with no collision (name it as level size), and walk inside our
level to see. Come close to the doors, windows, and by your own eyes, try to see if the character seems to be shorter than the
level geometry, or taller, then you can change the fpe entity size of this provisory entity (level size) untill you find a size that
fits better for your scene. So after you found the best size for your entities, you will use this scale for all entitites. Now coming
back to the skybox_texture:
;header
desc = skybox_texture
;ai
aiinit = appearnocol.fpi
aimain = default.fpi
aidestroy = disappear1.fpi
;spawn
spawnmax =0
spawndelay = 0
spawnqty =0
;orientation
model = skybox_texture.x
offx =0
offy =0
offz =0
rotx =0
roty =0
rotz =0
scale = 80
fixnewy =0
defaultstatic = 0
materialindex = 1
collisionmode = 0
strength =0
isimmobile = 1
soundset =
soundset1 =
;visualinfo
textured =
effect =
castshadow = 0
;Animationinfo
animmax =0
anim0 = 0,0
Now open FPS Creator and place this object (skybox_texture) exactly at (x:19,z:19), which is the exactly the (0,0,0) of 3dsmax.
Click "B" key twice on the keyboard to snap to FPSC grid, so you can position it exactly at the center of the world:
And you need to repeat this procedure to the skybox billboard models (because they will also be dynamic entities with no
collision). However, as they are dynamic, they will not be affected by the lightmapping of your scene, so you will need to
further adjust their texture illuminance to match the light of the level (further when we begin to light the level).
It's very impotant that now you fill the entire FPSC map with the common floor segment, to be able to walk over your entire
map and check if everything is working good, however, make a copy of this segment and change it's texture to a 100% black
one, so it will be transparent, which is what we want. Later on, you will only let segment floor on areas over which you want
your enemies to walk, because the player can walk over any entity.
Now coming back to 3dsmax, is very important remember that the floor objects (of your custom level) over which you want
the enemies to walk above must be separated meshes, and dynamic entities (this is Rolfy`s discovering):
As i modeled my level geometry using multiple textures, we need to separate those objects, or better saying, we need to
separate the polygons and group them by texture, meaning, the polygons (faces) which share the same textures, must be
exported together as static entities to FPS Creator. For this work, i attached all my level geometry objects and then run the
script DetachbyID to separate the polygons and group them by texture (materials).
Now you will show only the level geometry and hide everything else:
Now you need to select all these level geometry objects and set their pivot to (0,0,0) and run the maxscript BatchExport, to
export them all to x-file in one go, instead of going one by one. Export them to the FPSC Entities folder where you want to
work, also the texture files must be placed in the same folder of the x-files.
However, depending on your level geometry, the way you modeled your scene, how complex it is, is better that you export
each piece of your level one by one, placing it one by one inside FPSC, and testing the colision as long as you are adding these
pieces, instead of importing all parts in one go and testing it after everything is placed inside FPSC Map Editor.
Also, is very good if you take sometime slicing these already sliced parts into smaller parts (in example, if you have one entire
corridor, deatch each one of these four walls and export each one of them, instead of exporting all of them together). It helps
to improve the performance a lot (also avoid some collision bugs).
Now here comes a bit tedious part, you need to make each of these pieces one static entity with this config below. Remember
that Static Entities in FPSC need to have their textures specified inside their fpe files (only dynamic entities can have embeded
textures):
;header
desc = level_geometry02
;ai
aiinit = appearl.fpi
aimain = default.fpi
aidestroy = disappear1.fpi
;spawn
spawnmax =0
spawndelay = 0
spawnqty =0
;orientation
model = level_geometry02.x
offx =0
offy =0
offz =0
rotx =0
roty =0
rotz =0
scale = 80
fixnewy =0
defaultstatic = 1
materialindex = 1
collisionmode = 1
strength =0
isimmobile = 1
physics =0
soundset =
soundset1 =
;visualinfo
textured = texture_0.tga
effect =
castshadow = 0
;Animationinfo
animmax =0
anim0 = 0,0
Is time to import them in FPS Creator, one by one. Now for the alignment, it will fit perfectly, because all their pivot points is at
(0,0,0), so you just place one by one inside FPS Creator at x:19,z:19, and it will fit perfectly.
Now make a test game just to see how the level is looking, walk over it to see if everything is ok.
If you see in example some polygons with backface invisible, just come back to 3dsmax, identify which level_geometry part is
having this problem, apply a shell modifier with inner ammount and outer ammount 0'1", and re-export. Indeed, is very
important you check your model before exporting. If the part you exported has only one face, it`s obbligatory to apply a shell
modifier to create the backface of the polygon. If you don`t do it, besides of having your polygon with backface invisible, this
invisible face will have no collision. In example, if you have one wall with only one face (one plane), so the external part of this
wall will work perfectly, but the back part will be invisible and the player will be able to pass through it. And also you will have
a lot of bugs, like the game will freeze sometimes when you pass through those invisible faces.
If you see some performance breakdown (fps drop suddenly on some areas of the map), try to identify which part of the map
is causing this drop down by looking in test game, also delete the part you think is causing this drop down until identify. After
you identify the part, in example, level_geometry_05, so come back to 3dsmax and slice this part down in more pieces, and re-
export those pieces (also try other colision methods). It's important test, test and test.
* Again, always remember that for level geometry objects is better exporting one by one to avoid collision problems and
optimize it as long as you are adding them to the scene. Also is very good that you small it into smaller pieces, because you will
interact with them directly, and if you let these pieces too much large, maybe you will get stuck on one of them.
Now let's place the floors, as dynamic entities, using these configurations below. This is similar to what rolfy discovered in an
old post named FPSC Hidden Tips and Tricks. In fact, when you place a normal fpsc floor segment, and place over it a dynamic
entity, the character ai will treat this dynamic entity as an obstacle, over which he will try to pass over, so his feet collide with
the fpsc standard floor segment, but the dynamic custom floor you created will be like a obstacle, so the enemy will contour
almost perfectly this dynamic floor, thus, walking over dynamic entitites!
;header
desc = floor_01
;ai
aiinit = appearl.fpi
aimain = default.fpi
aidestroy = disappear1.fpi
;spawn
spawnmax =0
spawndelay = 0
spawnqty =0
;orientation
model = floor_01.x
offx =0
offy =0
offz =0
rotx =0
roty =0
rotz =0
scale = 80
fixnewy =0
defaultstatic = 0
materialindex = 1
collisionmode = 2
strength =0
isimmobile = 1
physics =0
soundset =
soundset1 =
;visualinfo
textured =
effect =
castshadow = 0
;Animationinfo
animmax =0
anim0 = 0,0
So to avoid the tedious work of selecting each floor object, center it to the origin (0,0,0), export it to a X-file, then come back
to the original position, the maxscript Batch Export does this for you. Just run it with the default options:
Now place them in FPSC. This must be done by hand, is not like the level geometry which it aligns everything just placing on
the center of the map (x:19,z:19). I recommend you to place them normally in top view, then right-click on the entity and
adjust its position, using the arrow keys to move, and also holding ctrl while moving them, also using pgup and pgdown, until
you make them fit altogether:
Also, bear in mind that if you grouped all the floor objects as a group inside 3dsmax, for the sake of organizing your scene (i.e),
you need to ungroup them, because FPSC will read the pivot point of the group instead of reading the pivot point of the
individual floor objects, thus you will lose collision on these floor objects, which means, it will not work! For this, is better that
you don`t group your objects.
But here we need to do another trick for the custom floors entities that stand above the ground (2st floor, 3rd floor, and so
on...). You must model your level taking into account the segment height, so if you want your enemies walk over the 2nd floor
of your building, this floor entity must be placed only some units above the standard fpsc segment. If your custom floor is not
in this position (i.e, if it is too much higher than the segment ground, it will not work!
Now, after all floor objects placed correctly in the map, let's place an enemy character and do a test game to see how the guy
will walk perfectly over the custom floor we just created:
It`s very important that you optimize your level geometry polygons, check in 3dsmax if there are no unused verticed or edges,
and try to split into smaller parts those level geometry objects, to have a very good performance.
Also remember that when placing characters is essential that you spawn them through a trigger zone, so you won`t have too
much characters in scene, which causes a huge performance breakdown. Also don`t place them exactly on your custom floor,
place them some untis above (higher) than your custom floor entities.
Another important tip, you must increase the maximum size of the render shrouder inside FPSC Map Editor, and also maybe
sometimes you will need to press TAB key three times to be able to see inside your models (cull the top part of polygons),
because maybe that the roof of some building will avoid you seeing what is under it, so because this you need to use the TAB
key to see what is below your custom model.
Besides being sometimes a bit boring the process os slicing the meshes into smaller pieces to import in FPSC, but, believe me, i
tested extensively, i know what i am talking about, you gain almost 100% of performance, even more perfomance than if you
had created the level using traditional segments room. The more pieces you slice your level, the more performance you will
obtain.
Also, never hasten when creating a game. If you visit some game modding community (like counter strike), you will see that
some members, sometimes even take months until creating a very good and consistent map, so, what about if you are a solo
developer? You need to know that indeed, it will take a lot of time, however, the results are worth doing.
I confess that i have taken too much time to create this level, but much of this time was spent on discovering and developing
this technique, for testing what works and what does not work. Now, as i already implemented this aproach and already know
how to slice the level correctly, i am sure that if i do this for other levels, i will take half of the time.
After all the hard work of slicing the level models making them small static entities (the more you break down the model into
smaller pieces the better for avoiding collision problems and for better performance), i ended up with a level made of almost
1000 entities, however, the memory usage did not reach 1300 MB (the memory cap is 1800 MB), and i got almost constant 60
fps! It`s explainable because the resulting mesh models (x-files), are very low poly, and the file size are very small, from 3 kb to
50 kb!
Now it`s time to bring up some lights on the scene. Is better that you place lights now before adding the level props, for this
will render the lightmaps quicker, and you can setup the base lights, before adding the additional lights on scene to simulate
the global illumination effect.
My recommendation, for those who are familiar with 3dsmax and/or any other 3D Software, is that you make the lighting
inside 3dsmax first, ant then you repplicate this lighing in FPSC (manually). I do this because you can have a faster way of
previewing your lighting in 3dsmax, because i have a very good maxscript, called Vray Sun, which works just like the Daylight
System, which is a plugin that ads real sun light in just one click!
Just to you have an idea, look at some render tests i did inside 3dsmax showcasing the light that we are going to reproduce in
FPSC:
Now one very important thing to you realize, is that dynamic entities are not affect by lighting, they don`t cast shadows, they
are not affect by the lightmapping, so it means that your dynamic floors entities will not receive nor light not shadow, they will
look flat and ugly. So you have two options (i tested both):
1) You let your floor as dynamic entities but use baked textures in them, light them inside 3dsmax and then render to texture
the shadows and lights, so this way you will have the floor already lighted and shadowed (independent from the FPSC lighting).
2) Instead of using the floor as dynamic entities, you can let these floor as static entities, however, you must break them into
smaller pieces (if you can break them into 100x100 units, the same size of the segments, is better), but again, you need the
invisible ground segment below these custom floor entities you created. If these pieces are very small, the character will walk
perfectly over them, just like he would walk over the big dynamic floor entity, he will collide with the fpsc ground segment
beneath, and he will contour the floor entity. However, if you let the static floor entity very big in size (if you don`t break this
floor into smaller pieces), the npc`s will just fall over this floor, he will not collide with your floor entity.
The first method has the advantage of giving you better visual results, because you will create the lighting in 3dsmax and then
export it to FPSC, so what you see on screen rendered (better if you have a good lighting plugin like Vray) is what you get
inside FPSC. The disvantage of this method is that it will give you more time to render (bake the textures), the blood of the
characters will not splat in this floor entities, and you need to adjust very well the lighting in FPSC to match perfectly these
baked textures, and also to slice these floor objects in very small parts.
The second method of using the floor as static entities is that it will be faster, since it will use the lighting you created inside
FPSC, so there is no need for external lighting work, this way, the lighting will match perfectly altogether, and the enemie`s
blood will splat perfectly on these floor entities. The disvantage of this method, is that i noted that the characters npc`s walk
perfectly over these static floor pieces, just like they walk over the dynamic floor entities, however, the player (you) does not
walk perfectly over these static floor pieces (especially if you hold shift to run), you can`t walk smoothly over these pieces, you
always find a kind of lag whenever you cross from one piece of your floor to the other (especially if your floor has some height
differences). But also, i have noted that if you slice these floor objects into smaller sizes like the same size of one segment unit
(you will have a lot of work here), it seems that everything fits perfectly and works flawlessly (no collision problems, nor for
you nor for the enemies).
Another important trick to avoid unwanted gameplay (and other glitches, is that you place invisible static entities to act as
invisible walls, to avoid the player getting into places where you don`t want him to reach. In example, we don`t want the
player to reach the "backwards" area of our level, in where is located the skybox billboards!
The decision is upon to you. In my case, i decided the first method, because i want to use all VRAY Lighting power. However, if
you want to use this method, is advised that you make all your floor meshes dynamic entities, to avoid having differences in
the lighting (baked x fpsc lights).
Now you need to convert all your scene materials to vray shaders. You must do it using a maxscript called MultiConvertor that
will do the job for you.
Now assign VRay as your default renderer
So after you converted all the materials, now is time to bring some lighting to the scene. For this you can use the maxscript
VRay Sun that will create a very realistic and beautifull sun light. It is perfectly for outdoor scenes.
Also you must add some lights to increment the scene. You need to have a good understanding on how lighting works to
simulate a believeable lighting scene.
After all lights setup, now is time to bake the textures on the floor objects that will be exported as dynamic entities to FPSC
(just hit "0" to open the Render to Texture dialog).
Here is my scene already baked (i baked the shadows on other objects as weel for purposes of testing, however, you only need
to bake the lights on the floor objects):
Now come back to FPSC and lets try to replicate this lighting inside FPSC. As we can`t do very well a single light point inside
FPSC to make it as a Sun Light (it will not work very well), we need to place a lot of lights alongside the map simulate the sun
lighting.
Always begin with adding light in the position you want them to cast shadows. In example, my scene in 3dsmax, one wall is
casting shadow in the floor this way:
So i need to place the light in FPSC this way:
And repeat this until you get the desired results.
Now comes something that will add more beauty to your visual. We will try to simulate global illumination inside FPSC. Now,
what is global illumination? The term globlal illumination, in short words, it means that everything emmits light. To you see it
in real life, get a coup of cafe and place it in an area under a soft shadow (not to dark shadow), until you can see one side of
the coup a bit dark because of the shadow. Now take a piece of white paper and take it close to this coup of coffe on the side
of the coup which is dark because of the shadow.
You will see that this dark side which is affected by the shadow will become more lighter as soon as you take the paper close
to it. It means that in real life, whenever the light hits something, the light ray is splitted in millions of other light rays
(secondary light bounces) and each of these other rays is also split into more and so on.
The real results you will see in the final, is that the shadows will be less dark, and you will see a kind of color bleeding (in
example, in global illumination, a red box will make the scene more red, and if one object is close to this box, it will receive a
bit of red light).
To simulate in FPSC is very simple, just a question of idea, althought it is not perfect, but it works very good.
> Below each of those lights you placed to cast shadow, place one secondary light to act as secondary bounce. Color it with the
color of the wall behind it, and set a low value for the intensisty this way:
Ok, now is time to add the internal lights in the scene. They are preety simple, and you can also place the secondary light
below it.
So after you add your lights in scene, you need to add the baked floor objects:
Now you need to add the level prop objects (export each one individually as static entities with box collision):
That`s all folks. I hope you may find this tutorial usefull, and thanks for the patience on reading this long and extense tutorial.
My last words: in FPSC anything is possible, so long as you achieve the skills needed...
007.