MEH_Tutorial_01_Gravity_Marker
Michael E. Harris mharris@fgi.net
unlimited rights to Serious Sam developer Croteam, all other rights reserved
A Few Opening Words
If you have not already done so, locate the .gro files that came with and were installed by Serious Sam and the software
development kit. Rename them to .zip. Then unzip them to the Serious Sam directory (currently "C:\Program Files\
Croteam\Serious Sam ...."), making sure to use directory/folder option to assure that their directory/file contents get
automatically dispersed to the appropriate root or subdirectory locations within it. This provides numerous textures,
entities and enemies that can then be utilized within the editor.
If you have not already done so, work through the Navigation and Basic Room tutorials that accompanied the editor (it is
contained in the editor's help file), several times, to develop basic familiarity and proficiency with the editor. Keep a
copy of the editor keyboard shortcuts and the basic room tutorial (and other tutorial/reference material) handy, both in
hardcopy and online help form. Also load up and explore and study the compatability test's Karnak level.
Finally, before attempting major projects, do these and other tutorials and then do modest high risk low cost
experimentation, to prove out concepts that you are interested in employing. The editor lends itself to this superbly.
Given that no compilation of levels is required and that one can quickly launch a test of the level currently being edited,
from within the editor, one can rapidly and repeatedly modify and test, modify and test, modify and test........ (Often, will
be faster to try and test, than to bug Croteam and others with questions...... save asking for the big original
questions/problems.) Save often, using a consistent naming scheme. I tend to embed a date/time stamp in my file names,
in the format of YYMMDDNN, where YY is two digit year, MM is two digit month, DD is two digit day and NN is a
sequentially assigned two digit number that I restart at 01 each day and increment with each successive save during that
day.
Gravity Marker
This tutorial focuses on the use of a gravity marker for assigning unusual gravity to an area (sector) within a Serious Sam
world.
Specifically, we are going to set up a hollow wheel and axle, then assign cylindrical gravity (radiates from/to the
wheel/axle axis), such that we can run all the way around the wheel, literally turning head over heels as we go around it.
And have an opponent chase us, doing the same.
Let's get started.
File | New (start a new level) and File | Save As (establish a file name).
Toggle shadows off (H), so that you can see what you are doing until you light the world.
Create the basic world
Carve a horizontally oriented cylinder (the wheel) out of the solid universe:
Create Conus Primitive (via Num Enter or red toolbar menu button)
Primitives
W 32, L 32, H 32
BaseVtx 8
Room (select)
Position
X 0, Y 0, Z 0
Heading 270, Pitch 270, Banking 0
Select/assign a texture
(I used Textures\Ages\Egypt\Walls\Karnak\Wall06.tex)
Add (via Num +).
Add a smaller diameter horizontally oriented cylinder (the central hub/axle):
Create Conus Primitive (via Num Enter or red toolbar menu button)
Primitives
W 16, L 16, H 32
BaseVtx 8
not Room (de-select)
Position
X 0, Y 0, Z 0
Heading 270, Pitch 270, Banking 0
Add (via Num +)
Light the interior of the wheel. In the process of doing so, toggle shadows on (H), so that you see what the actual lighting
will look like.
Place a player marker and an enemy on top of the central hub/axle. (This isn't the best place for these, given the "feet
out, head to center" orientation/gravity we're going to start out with, but works, and will prove useful when we later
switch to "head out, feet to center" orientation/gravity.)
Now, the good stuff.
Set up "cylindrical gravity"
Place a gravity marker (in the entities palette, appears as a red apple with a blue arrow) at the center of the wheel and use
the tab and/or arrow keys or Q (tools info) to rotate/orient it to Heading 270, Pitch 270, Banking 0, so that it's arrow
points along the wheel's axle (axis of rotation).
Select the gravity marker and set its properties:
FallOff 50 (default)
HotSpot 50 (default)
Torus Radius 100 (default)
Name Gravity Marker for Wheel
Strength -1 (results in "feet out, head in toward center")
Type Cylindrical
Select the world (world base entity), by hitting E to assure that you are in entity mode and clicking anywhere on one of
the wheel's surfaces (all should turn blue), and make the gravity marker available for use within the world:
Gravity 0 Gravity Marker for Wheel
Select the wheel sector (the empty volume of space within the wheel), by hitting S for sector mode and clicking anywhere
on one of the wheel's surfaces (all should turn green), and hit Q (tools info) assign the now available for use gravity
marker to it:
Force Gravity Marker for Wheel
Test it
Test, by hitting T, playing and seeing how the gravity works (you and the enemy should fall from the central hub/axle to
the outside of the wheel and be able to run all the way around it), then hitting Esc to return to the editor.
If gravity isn't working properly, double check the above settings.
You may notice a tendency for yourself and the enemy to slide toward the edges of the panels (polygons) making up the
floor. If you consider that Serious is simulating cylindrical gravity, this makes sense. Such gravity will always tilt you so
as to be perpendicular to the axis of the wheel. At the center of a panel, that happens to be the same as being
perpendicular to the panel. The further you go toward the edge of the panel, the more it must tilt you to keep you
perpendicular to the axis. Another way to say it is that, from the perspective of the gravity marker, when you are in the
center of a panel you are on a level surface, but when you move toward an edge you are increasingly on a downward
slope. What you are experiencing is a realistic mis-match between a cylindrical force and a less than cylindrical
surface.......which could be improved by making a smoother wheel through the use of a Base Vtx value greater than 8
(perhaps 16 or 32). In real life, one might get nauseated by walking in such an unusual environment.....and
rounder/smoother would probably help.
Invert the gravity
To invert/flip the gravity, so that you and the enemy run around "head out, feet in to center" on the central hub/axle, type
E to assure that you are in entity mode, select the gravity marker, change Strength from -1 to 1 and hit T to test.
Try backing away from the enemy and note that it follows you. It is smart enough to follow you over the horizon as you
back away from it on the central hub/axle, even though you have not supplied it with any paths, logic or AI. Note how
the enemy's golden bullets/projectiles bend/orbit around the hub/axle.
Other geometries
Want to try a sphere? Carve out a spherical space, insert a sphere in its center, place a gravity marker in its center, set
gravity to "central", rather than "cylindrical", etc. Depending on which way you set gravity strength (1 or -1), you and the
enemy can quite literally run all over the outer spherical area or the inner sphere.
There is no requirement that gravity be matched to shape.....it just proves common, convenient and non-nauseating. Then
again, weird gravity vs. architecture conflicts could prove interesting (and hopefully not too nauseating, once players
acclimate.....just as astronauts acclimate to weightlessness).
Wasn't that neat!
And that's it! Pick your jaw up off the floor! Quit whining about how much work you invested in trying to accomplish
this in Quake and Unreal! Then, consider that this is only one of many of Serious Sam's features. Planning on getting
any sleep in the next 72 hours? Maintaining a personal life?
Remember all the science fiction stuff that you wished would come true? Remember the old saying: "Be careful what
you wish for, because you just might get it"? Well, you got it!
Soon, every kid on the block is going to be editing multi-gravity levels. What effect do you suppose a generation raised
on routine immersive exposure to multi-gravity is going to have on entertainment, art, architecture and the funding and
pursuit of space travel and physics/gravity research?
Future topics
Gravity Router:
Providing an area (sector) of a world with changeable gravity through the use of multiple gravity markers controlled by a
gravity router and switches. As an example, the wheel that we just created, with the ability to use a couple of switches to
switch between walking "feet out, head in to center" on the outer wheel area or "feet in to center, head out" on the inner
axle/hub.
Multigravity:
Carving a world up into multiple volumes of space (sectors) and assigning each its own different/appropriate gravity. As
an example, a "hypercube-like" world consisting of a large cubic volume of space, with diagonal struts running from its
corners through the center, with a smaller hollow cube (with openings in each corner) suspended/centered on those struts,
with an even smaller sphere centered within that smaller hollow cube where the struts intersect.........with the player and
enemy having the ability to walk on and between the outer surfaces of the hollow cube ("walk on cube"), on and around
the surfaces of the struts, between the outer and inner surfaces of the hollow cube and the central sphere via the struts, on
and between the inner surfaces surfaces of the cube ("walk on walls") and all over the central sphere ("walk on sphere").
And we're just getting started, folks.
Don't forget
Have fun. But don't forget to have a life. Take care of yourself, your family and your friends.
Let me know what you think
Please send suggestions, comments, criticisms, questions, etc. to me at mharris@fgi.net.