don't click here

SonicGDK 1.30.000

Discussion in 'Fangaming Discussion' started by Xaklse, Feb 10, 2010.

  1. Bones setup? No idea, I'm sure you can find any related info in the UDK forums.

    That video segment looks like level streaming, they didn't use a single straight runway though.

    1.) No, you can't. I'll code a Kismet node that will let you play/stop a music track, that's all I can do.
    2.) Use a CameraInfo for it, change "Camera Point Definition" to PD_RelativeOffset, change the "Camera Offset Vector" (300 for X might be good) and set "Smooth Location Rate" to zero.
    3.) Only actors can be spawned; spawned meshes would look like shit without their static lightmaps.


    Another section of the WIP tutorial finished!
  2. Azu


    I must be stupid. Member
    What about Archtypes?

    This is pretty much The book for learning uScript?
  3. Sorry for the delay.
    No, you use archetypes to spawn objects, so again you would get the same problem with lightmaps/shadowmaps.
    That book isn't useful to learn UnrealScript.


    New 1.10.024 version is up!
    Source Code (requires UDK May 2012): BF / FF / Or / PL / RS / TB / Up

    What's new?
    • Created the "Start Music Track" Kismet node.
    • Shield materials and moves are configurable through the editor.
    • Added classic sounds for Classic Sonic.
    • SonicPhysicsVolumes can be applied to certain actors only.
    • Revamped the included code of SGDKHudGFxMovie (Flash HUD).
    • Pickups' messages can be disabled easily through code.
  4. Azu


    I must be stupid. Member
    Thanks for the update! I've been learn some things about kismet. I actually want to turn this into a Generation's styled engine.

    I'm trying to add the RedRings in. I'm basically just copying the ChaosEmeraldActor and changing things around. However, get this error when do a full compile.

    RedRingActor.uc(112) : Error, Unrecognized member 'RedRing' in class 'SGDKPlayerController'

    This is at line 112. SGDKPlayerController(P.Controller).RedRing++;

    Code (Text):
    2. //================================================================================
    3. //                  3D Sonic Games Development Kit (SonicGDK)
    4. //                          by  Javier "Xaklse" Osset
    5. //
    6. //  Read SGDKGameInfo.uc file for details about permission to use this software.
    7. //================================================================================
    8. // RedRing Actor > RingActor > SGDKActor > Actor
    9. //
    10. // This actor is the typical RedRing found in all Sonic games which can be
    11. // collected.
    12. //================================================================================
    13. class RedRingActor extends RingActor
    14.     ClassGroup(SGDK,Visible)
    15.     hidecategories(RingActor);
    18. /**The material instance to change its color.*/ var MaterialInstanceConstant MeshMaterialInstance;
    20. /**The index number to indicate a color; goes from 0 to 6.*/ var() byte ColorIndex;
    22. /**The RedRing pickup music track.*/ var SoundCue EmeraldSoundCue;
    23.       /**A reference to a music manager.*/ var SGDKMusicManager MusicManager;
    26. /**
    27.  * Called immediately after gameplay begins.
    28.  */
    29. event PostBeginPlay()
    30. {
    31.     local LinearColor NewLinearColor;
    33.     super.PostBeginPlay();
    35.     MeshMaterialInstance = RingMesh.CreateAndSetMaterialInstanceConstant(0);
    36.     RingMesh.SetMaterial(0,MeshMaterialInstance);
    38.     switch (ColorIndex)
    39.     {
    40.         case 0:
    41.             NewLinearColor = MakeLinearColor(1.0,0.0,0.0,1.0);
    43.             break;
    44.         case 1:
    45.             NewLinearColor = MakeLinearColor(1.0,1.0,0.0,1.0);
    47.             break;
    48.         case 2:
    49.             NewLinearColor = MakeLinearColor(0.0,1.0,0.0,1.0);
    51.             break;
    52.         case 3:
    53.             NewLinearColor = MakeLinearColor(0.0,1.0,1.0,1.0);
    55.             break;
    56.         case 4:
    57.             NewLinearColor = MakeLinearColor(0.0,0.0,1.0,1.0);
    59.             break;
    60.         case 5:
    61.             NewLinearColor = MakeLinearColor(1.0,0.0,1.0,1.0);
    63.             break;
    64.         case 6:
    65.             NewLinearColor = MakeLinearColor(0.5,0.5,0.5,1.0);
    66.     }
    68.     MeshMaterialInstance.SetVectorParameterValue('ColorParameter',NewLinearColor);
    69. }
    71. /**
    72.  * Resets this actor to its initial state; used when restarting level without reloading.
    73.  */
    74. function Reset()
    75. {
    76.     //Disabled.
    77. }
    79. /**
    80.  * Stops the RedRing music track.
    81.  */
    82. function StopMusicTrack()
    83. {
    84.     MusicManager.StopMusicTrack(EmeraldSoundCue,1.0);
    85. }
    88. //The RedRing is visible and standing still.
    89. state Pickup
    90. {
    91.     event BeginState(name PreviousStateName)
    92.     {
    93.         //Triggers an event.
    94.         TriggerEventClass(class'SeqEvent_PickupStatusChange',none,0);
    95.     }
    97.     /**
    98.      * Called when collision with another actor happens; also called every tick that the collision still occurs.
    99.      * @param Other           the other actor involved in the collision
    100.      * @param OtherComponent  the associated primitive component of the other actor
    101.      * @param HitLocation     the world location where the touch occurred
    102.      * @param HitNormal       the surface normal of this actor where the touch occurred
    103.      */
    104.     event Touch(Actor Other,PrimitiveComponent OtherComponent,vector HitLocation,vector HitNormal)
    105.     {
    106.         local SGDKPlayerPawn P;
    108.         P = SGDKPlayerPawn(Other);
    110.         //If valid touched by a player pawn, let him pick this up.
    111.         if (P != none && P.Controller != none && ValidTouch(P))
    112.         {
    113.             SGDKPlayerController(P.Controller).RedRing++;
    115.         if (DestroyedSound != none)
    116.         P.PlaySound(DestroyedSound);
    118.             //Triggers an event.
    119.             TriggerEventClass(class'SeqEvent_PickupStatusChange',P,1);
    121.             GotoState('Sleeping');
    122.         }
    123.     }
    124. }
    127. defaultproperties
    128. {
    129.     Begin Object Name=RingStaticMesh
    130.         StaticMesh=StaticMesh'GDKMesh.SMesh.RedRing'
    131.         Scale=0.5
    132.     End Object
    133.     RingMesh=RingStaticMesh
    136.     bIgnoreEncroachers=false  //Don't ignore collisions between movers and this actor.
    137.     bMagnetic=false
    138.     bNoDelete=false           //Can be deleted during play.
    139.     bPushedByEncroachers=true //Encroachers can push this actor.
    140.     PickupSound=none
    141.     RotationRate=(Yaw=8192)   //Change in rotation per second.
    143.     ID=0
    144.     DestroyedSound=SoundCue'GDKMusic.Sounds.SE_Redring_Cue'
    145. }

    At the end of SGDKPlayerController

    Code (Text):
    2. defaultproperties
    3. {
    4.     CameraClass=class'SGDKPlayerCamera' //Class of the PlayerCamera object.
    5.     CheatClass=class'SGDKCheatManager'  //Class of the CheatManager object.
    6.     InputClass=class'SGDKPlayerInput'   //Class of the PlayerInput object.
    8.     MinHitWall=0.0 //Minimum dot product value between HitNormal and Velocity vectors to get HitWall events from the physics; 0.0 equals to 90° angle.
    10.     bBehindView=true    //Third person camera as default camera mode.
    11.     MinRespawnDelay=5.0 //Minimum time before player can respawn after dying.
    13.     bIgnoreLookInput=1 //Ignores look input; uses stacked state storage.
    14.     bIgnoreMoveInput=1 //Ignores movement input; uses stacked state storage.
    16.     bSpecialMove=false
    17.     bUnJump=false
    18.     bUnSpecialMove=false
    20.     PitchMaxLimit=1.5
    21.     PitchMinLimit=-1.0
    22.     PitchRotation=0.25
    24.     CameraDistance=200.0
    25.     DistanceMaxLimit=500.0
    26.     DistanceMinLimit=-25.0
    28.     MaxPlayerInput=1900.0
    30.     ChaosEmeralds=0
    31.     RedRing=0
    32.     Lives=3
    33.     Score=0
    35.     DrowningMusicTrack=SoundCue'SonicGDKPackage.Music.DrowningSoundCue'
    36.     GameOverMusicTrack=SoundCue'SonicGDKPackage.Music.GameOverSoundCue'
    37.     SuperMusicTrack=SoundCue'SonicGDKPackage.Music.SuperSonicSoundCue'
    38.     VictoryMusicTrack=SoundCue'SonicGDKPackage.Music.ActClearSoundCue'
    40.     SpecialStageFOV=90.0
    42.     BoardMoveJumpZ=384.0
    43.     BoardMoveSpeed2D=400.0
    44. }

    I managed to fix it. Turns out it was space/tab error. However, I am getting these warnings and I'm haven't touched these files.

    Code (Text):
    2. ShieldActorClassic.uc(18) : Warning, Unknown property in defaults:     BubbleBoost=800.0 (looked in ShieldActorClassic)
    3. ShieldActorClassic.uc(19) : Warning, Unknown property in defaults:     BubbleBounceFactor=1.15 (looked in ShieldActorClassic)
    4. ShieldActorClassic.uc(20) : Warning, Unknown property in defaults:     FlameBoost=1000.0 (looked in ShieldActorClassic)
    5. ShieldActorClassic.uc(21) : Warning, Unknown property in defaults:     FlameGravityScale=1.0 (looked in ShieldActorClassic)
    6. ShieldActorClassic.uc(22) : Warning, Unknown property in defaults:     FlameHomingRadius=0.0 (looked in ShieldActorClassic)
    7. ShieldActorClassic.uc(23) : Warning, Unknown property in defaults:     MagneticBoost=540.0 (looked in ShieldActorClassic)
    8. ShieldActorClassic.uc(24) : Warning, Unknown property in defaults:     MagneticRingsRadius=120.0 (looked in ShieldActorClassic)

    Also, is this the book?
  5. Remove the file ShieldActorClassic, it's not needed anymore.

    Yup, that's a very good book for learning UnrealScript.
  6. Azu


    I must be stupid. Member
    Okay, thanks. Now then.

    I have a few questions in the spoiler.
    So, I'm trying to do something like this. I want to draw a image on the screen when you get close to danger, like a QTE, but without the button pressing. I saw a method, but it was of iOS and I'm not interested in iPhone development nor do I have a iOS device. I looked at the Draw Text under Action > Misc and that worked, but it only wrote the text. I used the UI XBOX360 font in UIFonts in UDK and it still drew the text.

    Also, what would be a good method to have the Giant Rings look like this?
    A render texture and cubemap? The giant rings have there own reflective maps.

    I've read around and people says that you should learn some other OOP language like Java before learn UScript. I'm not sure if I want to learn Java, then UScript.

    I've been messing around with a few things. Seeing what can be done in Kismet all thogether and what needs to be done with UScript. The Rockets (from Speed Highway) and Ziplines can be done in kismet. Thrusters on a rocket doesn't seem to work all too well. Having Sonic Generations opened up makes studying some of the gimmicks much easier.

    Grinding will have to be scripted, but I'm not sure if I should edit the GDKSplineActor and give it some some options for grinding for copy it and make a new grind spline combine with a keep moving forward option. I'd add a option to select an animation as well.

    Trick Rings/Ramps would be either a new Kismet event to trigger the trick sequence or a new object.
  7. P3DR0


    b0ss Member
    The warning thing, I guess that can be done with a volume that, when Sonic goes through it activates a Kismet node to show information on the screen. Like, you would have to make it an object on the HUD, I dunno. Maybe Xak will be more helpful.

    The ring thing is mostly doable with texture and cool materials instructions to look nice. But yeah, I would use cubemaps for the reflections, not just they're cheap, but they also look more like reflections due the 3D depht into it instead of a rendered texture.
  8. Azu


    I must be stupid. Member
    So, I'm working on a a little test map of all the things possible/doable in Kismet. So far...


    Code (Text):
    1. class SeqAct_ChangePlayerMesh extends SequenceAction;
    3. var() SkeletalMesh newMesh;
    4. var MaterialInterface defaultMaterial0;
    5. var() AnimTree newAnimTree;
    6. var() array<AnimSet> newAnimSet;
    7. var() PhysicsAsset newPhysicsAsset;
    9. event Activated()
    10. {
    11.     local int I;
    12.     local UTPlayerController PC;
    13.     PC = UTPlayerController(GetWorldInfo().GetALocalPlayerController());
    15.     PC.Pawn.Mesh.SetSkeletalMesh(newMesh);
    16.     PC.Pawn.Mesh.SetPhysicsAsset(newPhysicsAsset);
    17.     PC.Pawn.Mesh.AnimSets=newAnimSet;
    18.     PC.Pawn.Mesh.SetAnimTreeTemplate(newAnimTree);
    20.     for (I = 0; I < PC.Pawn.Mesh.SkeletalMesh.Materials.length; I++)
    21.     {
    22.         PC.Pawn.Mesh.SetMaterial( I, defaultMaterial0 );
    23.     }
    24. }
    26. defaultproperties
    27. {
    28.     ObjName="ChangePlayerMesh"
    29.     ObjCategory="Change Player Mesh"
    30.     VariableLinks.empty;
    31. }
    I found this kismet code that will let you change the player mesh. What would I replace to get it work with SGDK's pawn actor? If half-works, butyou won't have the super sonic mesh.


  9. Go here, I didn't try it but that's what you need. Skip the "The Gametype" section, you won't get mouse events or camera animations but that's fine. Use a Trigger with the custom Kismet nodes when you want to show/hide the warning.

    Learning Java should help a lot, plus the knowledge of it never will hurt, but try UnrealScript first with good tutorials/book.

    Well, grinding mechanic should work first before you add options that may not work.

    How to add grinding mechanic to SonicGDK:
    • Place SGDKSplineActors above the grinding mesh, connect them and select CM_Custom1 in Constraint Type in their properties.
    • Open SGDKPlayerPawn.uc file, search for "function CheckSplineMovement" and "function vector GetAccelerationInput"; in both functions I check for the type of constrained movement there is (ConstrainedMovement == CM_Custom1 in your case) and do the magic. This shit is pretty hard to understand though, be warned.
    • The segments of the visual grinding mesh should "Trigger Touch" (Kismet) the corresponding SGDKSplineActor upon touch/bump.

    Where the goal ring is, I would put an ambient sound (AmbientSoundSimpleToggleable), and just "toggle off" it with Kismet upon ring touch.
    To change music tracks, use the "Start Music Track" Kismet node that I recently coded (I guess that's for your hub world).

    It only changes the current mesh of the current pawn for the current map. To change Sonics like you want, in my case I would create a Kismet node that switches pawn classes, by creating a new pawn, possessing it and destroying the old pawn. That way everything should work as expected. In the special stage code, I create a new pawn and possess it, if you need an example.

    Looks good; don't increase MachDashMaxRecharge to 200, it doesn't really make sense.
  10. Azu


    I must be stupid. Member
    Oh kay. I'll do that. However, I hear the best way is look at source does.

    Grinding mesh? I should make a like a collision grinding mesh, or the grind rails themselves?

    I actually just added an Attenuation node to the Sound Cue.

    Ah. I will look in that.

    I just testing the mach dash thing. :V

    I've also noticed that Sonic won't really keep the same rotation as the handle actor when he's on it.
  11. P3DR0


    b0ss Member
    I'm currently going through a few personal issues so I can't be as active as I used to be, but whenever I can, I try to study a thing or two.


    Vertex Painting. Is there anything cooler than that?

    For those of you who doesn't uderstant what does that mean, it means that you can not just have prettier meshes in your game, but have actual variation onto 'em. As you can see, the picture on the bottom is the original mesh with its original textures while the picture on top is with a mossy texture applied to it using information from its normal map. I can control how much of this second texture I want applyied to my model, where I want it and the density of it.

    And if this didn't blew your mind already, for this particular example I've only used one of the three avaliable channels. In other words I can still have another two kinds of variation on this texture, like... I could give it a wet feeling as well, I could push the vertices up and down to create variation in the mesh, could give extra destruction to the original texture, etcetera... In this particular case, for the sake of demonstration, I've only used the grass texture from a previous demonstration that I made (Tropical Hedgehog) but the possibilities are endless.

    What does that mean for the players?

    Pretty shit to look at. Like this:

    What does that mean for developers?

    - Possibility to reutilize meshes and still have some variation in each of them, which can trick the player's mind to believe that's a different object that they're looking at.
    - Full control of the texture variation, not having to jump into your image editor each time that a texture doesn't look correct ingame.
    - Capacity of creating cool enviroments that doesn't look boring or repetitive (For example, if Green Hill Zone had only the checkboards patterns it would be very borings, but on top of the patterns it have holes and bumps to add some variation, making stuff cooler to look at and less boring or repetitive)

    Vertex Painting is actually pretty easy to do and is a cheap effect since it treats your mesh as a canvas where you're painting colors (red, blue and green) into it, except for the fact that those colors are the actual textures. And on top of that you can even use your normal map information to make it look more natural. I'm planning to do a tutorial for that, as Azu previously requested, I just have to find the time to do it. But yeah... UDK is awesome. :3
  12. FeliciaVal


    wow holy shit p3dr0, at first I thought it was real painting! now I see what you did there. Awesome work!!
  13. Azookara


    yup Member
    Oh wow. Oh wowowowowow. Okay, this would be very helpful. Thank you for bringing this up.
  14. Andrew75


    Technical Artist Member
    Project AXSX(Sonic Xtreme) + Misc Projects
    Vertex painting is very useful feature, one of the main reasons I moved to UDK.
  15. Azu


    I must be stupid. Member
    I'm working a few voiced (if I can get my mic to work) tutorials. I'll probably release them in a few days. It will cover some basic things as well as something I'm starting to work on soon. "SGGDK" :V .
  16. The visual grinding mesh should be placed in the map, but it shouldn't use a StaticMeshActor, it should use a new type of actor that detect touch/bump events and trigger kismet sequences.

    What? I don't understand you.

    I hope you don't try to clone Sonic Generations, I think we already have enough with the official game and its new mods.


    New 1.10.048 version is up!
    Source Code (requires UDK July 2012): FS / PL / RS / Up

    What's new?
    • Created a type of ForceVolume which can be moved ingame.
    • Added configurable MaxJumpImpulseTime field to playable pawn.
    • Created the "Start Animation", "Destroyable Event", "Enemy See Player" and "Reached Patrol Point" Kismet nodes; enemies can be done with Kismet and Matinee alone.
    • Enemy templates can configure HearingThreshold, PeripheralVision, SightRadius, Hits, MovementSpeed and TurningSpeed.
    • Created the "Touch Accepted" Kismet node; every interactive object throw this event now.
    • Better handling of "Set Material" Kismet node for pawns.
  17. Azu


    I must be stupid. Member
    I don't plan on fully copying Generations. Just pretty what Blitz Ultra Sonic engine (which just seems to messing grind and trick rings) and a few other things like the Iron swing bars. It seems like quite a few things can be done with kismet met like the pully.

    By the way, think you can help me with my animation issue?

    Also, can I get the camera to rotate with Sonic instead of using the mouse?
  18. Aerosol


    Not here. Moderator
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Why not clone generations? There are things we'll NEVER be able to do bar some x86 guru disassembling the game.
  19. Azu


    I must be stupid. Member
    That was my initial plan being that even though you remake Unleashed stages (or any stages) in Sonic Generations, you won't get everything. However, not sure if I'd step on some land mines doing that. What I was plan on doing was adding the basic common stuff in Generations, then people and add anything the want by kismet or scripting.
  20. Aerosol


    Not here. Moderator
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Land mines? What land mines?

    I hope you're not afraid of Sonic Fan Drama. Because it's stupid bullshit. If you want to clone Generations, I see no reason why you shouldn't.