Fangame How-to:SonicGDK/Set up sidescroller (2.5D) sections
From Sonic Retro
| This article is a work in progress.|
Its content and location may change completely and frequently until this notice is removed.
Sidescroller 2.5D mode isn't enabled by default, you have to place and configure a set of objects/actors in your map to somewhat cancel the default 3D mode. To follow this guide, basic knowledge of Kismet usage is required.
The key to setting up a sidescroller section is in the paths and the camera. To get you started, the basics of SGDKSplineActors, SensorActors and ForceVolumes will be explained:
- SGDKSplineActor: Ties Sonic movement to a existing path defined by splines, smooth piecewise-polynomial functions used to define curves that allow for a finer degree of control over a target's positioning information. UDK has SplineActors; SonicGDK uses SGDKSplineActors, which are based on the previous ones. When a player touches an invisible SGDKSplineActor node, the player pawn mesh will snap to this navigation path and adjust gradually its movement.
- SensorActor: Triggers events upon player touch and untouch. It works like UDK's TriggerVolume but there are two extra output nodes in its related Kismet node Sensor Touch, which generates 3 types of events: "Touched" (player pawn is whithin the sensor), "UnTouched (Front)" (pawn is in front of the sensor) and "UnTouched (Back)" (pawn is behind the sensor). So this object can essentially be considered as two separate triggers in one. The attached red arrow points to forward and the blue one points to backward.
- CameraInfo: Holds information related to a camera behavior.
- ForceVolume: Ensures that if Sonic collides with this volume, it will give Sonic a gentle nudge back onto the mainstream pathway. It's mainly used to push Sonic to another path (allowing parallel paths) or used where splines don't adjust Sonic's movement quick enough.
- SeqAct_SetCameraStyle: With the help of a CameraInfo, you can change the player's camera mode. This is the "Set Camera Style" Kismet node.
- SeqAct_Touch: This is the "Trigger Touch" Kismet node; this action triggers touch events between targets and the given actor.
... (tutorial will continue) ...
- You can't make a cusp or "C" arc in a spline path with just 2 nodes, or the path breaks. The green spline nodes have to either be in a straight line or in a curve... but no given node in the path can be greater than a 90deg angle, otherwise Sonic will snap orbit and he'll look like he's teetering between swimming and jumping.
- In order for Sonic to recognize the path and not assume full 360 movement, he has to touch the SGDKSplineActors, the spline curves can't be detected.
Old version of the guide
UDK has SplineActors; SonicGDK uses SGDKSplineActors, which are based on the previous ones.
First you should use SGDKSplineActors to define the 2D constrained path, the straight purple arrows of the SGDKSplineActors must point to the background.
To change the camera, you have to use a Trigger, TriggerVolume, SensorActor or similar. The SensorActor is like a TriggerVolume but is able to generate 3 types of events:
- "Touched"; pawn is whithin the sensor.
- "UnTouched (Front)"; pawn is in front of the sensor.
- "UnTouched (Back)"; pawn is behind the sensor.
The attached red arrow points to forward and the blue one points to backward.
Copy CameraInfo_6 from the SonicGDKTestMap to your map and use it for the "Camera Info" param of a new "Set Camera Style" Kismet node (New Action>SGDK>Set Camera Style); attach an "All players" object to the "Target" param. You have to trigger the node with a Trigger, TriggerVolume, SensorActor or similar.
Test, if the camera zooms out then you're doing it well. Change the "Camera Offset Vector" of the copied CameraInfo to adjust the camera location.