Fangames > Engines
RegalPrime-UnityEngine v1.4.1 - 8-18-15
RegalPrime:
New update today - Guy took off his skates and put on his climbing shoes :p
- Guy is more controllable now and slower (not even trying for 100% replication yet, just slowly getting it close). I modified the controller a bit but it still needs complete rewriting.
- Added Jumpthrough Platforms - Able to fall through via down arrow if prefab variable is set (platform room updated)
- Added Climbable Objects - Anything with tag "climbable" is ummm climbable. Vines / Ladders are prefabbed (spinny things lol have fun /spin)
- Added climbing animations and updated the animator (hopefully I got the logic correct)
- Basic camera functions added (just the basics, no fancy stuff atm)
- Recreated level building prefabs and redid all the maps so they look better and consistant
- Trap trigger script enhanced (added start delay + delay between individual objects)
- Various other scripting
First post is updated with new download link.
RegalPrime:
After last weeks update I decided to work on making the guy move more properly. I started by emulating the way gamemaker does it and needless to say there was a few major issues in doing this in a physics based engine. On sunday I finally scrapped that thought process and went back to physics based movements. After rewriting some of the code I finally came to the realization on why I was having problems before. I believe I have emulated pixel perfect movements. Tonight I ran some data to make sure things are actually coming out as expected.
Luckily, Unity allows for frame by frame diagnosis.
This data was taken from a part of a jump cycle.
The first column is the position of the character in Unity Units.
The second column is the vertical velocity calculated from the first column
- The data is multiplied by 100 because in unity when you import sprites the default conversion is 1 Unit = 100 Pixels
The third column is the gravity force calculated on the 2nd column
As you can see it hits the standard of 0.4 pixels per frame
(click to show/hide)
--- Code: --- Change Per Frame Gravity Force
Position Y x100 for pixel/unit per frame
-2.152787
-2.087924 -6.4863
-2.027054 -6.0870 -0.3993
-1.970191 -5.6863 -0.4007
-1.917327 -5.2864 -0.3999
-1.868468 -4.8859 -0.4005
-1.823605 -4.4863 -0.3996
-1.782737 -4.0868 -0.3995
-1.745874 -3.6863 -0.4005
-1.713013 -3.2861 -0.4002
-1.684149 -2.8864 -0.3997
-1.659284 -2.4865 -0.3999
-1.638420 -2.0864 -0.4001
-1.621558 -1.6862 -0.4002
-1.608694 -1.2864 -0.3998
-1.599830 -0.8864 -0.4000
-1.594966 -0.4864 -0.4000
-1.594103 -0.0863 -0.4001
-1.597239 0.3136 -0.3999
-1.604376 0.7137 -0.4001
-1.615513 1.1137 -0.4000
-1.630647 1.5134 -0.3997
-1.649783 1.9136 -0.4002
-1.672922 2.3139 -0.4003
-1.700059 2.7137 -0.3998
-1.731192 3.1133 -0.3996
-1.766328 3.5136 -0.4003
-1.805469 3.9141 -0.4005
-1.848605 4.3136 -0.3995
-1.895742 4.7137 -0.4001
-1.946873 5.1131 -0.3994
-2.002009 5.5136 -0.4005
-2.061152 5.9143 -0.4007
-2.124288 6.3136 -0.3993
-2.191418 6.7130 -0.3994
-2.262554 7.1136 -0.4006
-2.337698 7.5144 -0.4008
-2.416834 7.9136 -0.3992
Average -0.4000
--- End code ---
Data taken from a high fall
Same format as above
As you can see fall velocity is limited at the correct fall speed
(click to show/hide)
--- Code: --- Change Per Frame Gravity Force
Position Y x100 for pixel/unit per frame
2.470159
2.462159 0.8000
2.450159 1.2000 -0.4000
2.434159 1.6000 -0.4000
2.414159 2.0000 -0.4000
2.390159 2.4000 -0.4000
2.362159 2.8000 -0.4000
2.330158 3.2001 -0.4001
2.294158 3.6000 -0.3999
2.254158 4.0000 -0.4000
2.210159 4.3999 -0.3999
2.162158 4.8001 -0.4002
2.110158 5.2000 -0.3999
2.054158 5.6000 -0.4000
1.994158 6.0000 -0.4000
1.930158 6.4000 -0.4000
1.862158 6.8000 -0.4000
1.790158 7.2000 -0.4000
1.714158 7.6000 -0.4000
1.634158 8.0000 -0.4000
1.550158 8.4000 -0.4000
1.462158 8.8000 -0.4000
1.372158 9.0000 -0.2000
1.282158 9.0000 0.0000
1.192158 9.0000 0.0000
1.102158 9.0000 0.0000
1.012158 9.0000 0.0000
0.922158 9.0000 0.0000
0.832158 9.0000 0.0000
0.742159 9.0000 0.0000
0.652159 9.0000 0.0000
0.562159 9.0000 0.0000
0.472159 9.0000 0.0000
0.382159 9.0000 0.0000
0.292159 9.0000 0.0000
0.202159 9.0000 0.0000
0.112159 9.0000 0.0000
0.022159 9.0000 0.0000
--- End code ---
Staggered block data
This data is proving pixel alignment
A stair of blocks was created and each block was humped by the guy.
Second column is the X value position of the guy when he hit that blocks side
Third column is the number of pixels he traversed between the blocks (of course it should be 32 but just made sure)
After humping each of the blocks I moved as close to the 0 X-axis as I could
Bottom part first column is as close as I could get to 0 in Unity units
2nd column is converted to pixels.
(click to show/hide)
--- Code: ---Block1 -2.6500
Block2 -2.9700 -32.0002
Block3 -3.2900 -32.0000
Block4 -3.6100 -32.0004
-0.0100 -1
0.0000 0
0.0100 1
-0.0100 -1
--- End code ---
RegalPrime:
Feedback on how the guys controls feel after this update would be greatly appreciated.
Also, I need ideas of other things I can add to the engine. My list of "things to do" is shrinking and its not always fun to program one thing for an extended period of time.
-- TestGuy UnityEngine 1.03 --
- Rewrote most of the 2D controller, solved the problem, and according to initial data, the controls are now pixel perfect.
- Time / Water / Climbing fixed due to changes in 2D controller
- Music / Sound Effects volume can be changed in the main screen and are saved to "GameSettings.dat" (located in base game directory)
- Audio routed through the AudioController is effected by users preferences (hopefully all effects were changed)
- Added various script functions that will hopefully be useful later
- A bug fix relating to rapidchanging of songs
+1 Scene - Simple spike room to test the guys new controls.
Seems Unity is going to release a GUI editor in their next update. Wont have to code GUI objects anymore (they were kinda a pain).
Will be pretty easy to make a good looking save / load screen.
RegalPrime:
I spent this entire week creating a script that allows for creation of dynamic objects / effects
Initially this was meant to ease the creation of a avoidance type situations (like a boss) but many of the functions can be used to create other basic effects without the need to dig up the complicated code each time you create a new script.
Most of the functions in the script are below (if your into what is actually in the script)
(click to show/hide)Pretty much every coroutine below has multiple variables that change how it works
- When the coroutine is triggered
- Delay of individual object manipulation (creation / destruction)
- Size / Speed / Direction / Etc
The following "shapes" are created by a set of subobjects (ie a circle made from 30 apples of a certain radius)
The subobjects are added to a list for later manipulation in other functions
Just for note, a subobject can be ANY prefab. You could create a line from point A to point B made out of blocks / platforms / deadly apples / or even monsters that have their own scripts attached to them.
CreateCircle - Creates a circle of a certain radius made from X objects. (can do semi circles or parts of circles)
CreateSquare - Creates a square of a certain X/Y width made from X objects
CreateTriangle - Creates a triangle of a certain X/Y width made from X objects.
CreateLineInDirection - A line of X objects is created of a certain length in a certain direction
CreateLineToTarget - Creates a line of X objects from this object to the targeted object
CreateLineToPlayer - Creates a line of X objects from this object to the players current position
-- The following are manipluation functions that effect the parent object --
C_RotateTwordsObject - Make this object "face" another target location (instantly or overtime or forever)
C_RotateToDegree - Sets the object to X degrees (instantly or overtime)
C_RotateObject - Rotates in a certain direction X degrees or Forever rotation (instantly or overtime)
C_StopRotation - Stops all rotations
C_MoveInDirection - Moves object in a certain Vector3 direction
C_MoveToPosition - Move this object to a certain point
C_LaunchAtPosition - Throws the object in the direction of the targeted position
C_LaunchAtPlayer - Throws the object in the direction of the player
C_StopMovement - Stops all movement
-- Object Effects --
C_ChangeScale - Makes the overall creation Bigger/Smaller. Can keep the subobjects the same size or grow / shrink with the parent
C_WaveEffectWhole - Creates a wave effect in X/Y direction for the child objects
C_WaveEffectObject - Creates a wave effect in X/Y direction in one object
C_StopWaveEffect - Stops wave effects
C_MorphToSquare - Morphs the current collection of objects into a square shape over time
C_MorphToCircle - Morphs the current collection of objects into a circle shape over time
-- These are finishers that end up destroying the object --
C_BreakToPosition - Breaks apart the entire object and launches them at a target location
C_BreakToPlayer - Breaks apart the entire object and launches them at the players location
C_BreakRandomly - Breaks apart the entire object and launches them randomly in every direction
C_BreakCircleBurst - Breaks apart the entire object and creates a circle burst at every subobject
-- These are one shot objects that are non manipulatable by other functions --
C_FollowPlayer - Creates a single object that follows the player until the object dies
C_ShootDirection - Shoot X objects in a certain Vector3 direction
C_ShootPosition - Shoot X objects at a certain target location
C_ShootPlayer - Shoot X objects at the players location
C_SprayInDirection - Creates a set spray of objects in a certain general direction (like a fountain)
C_ShootFromRightScreen - Random objects come from off the screen
C_ShootFromTopScreen - Random objects come from the top of the screen
C_CircleBurst - A single circle burst at target location.
Circle burst = A set of objects at a point that expand rapidly in the shape of a circle.
Using the new script, these are the commands I used in creation of the avoidance screen (I attached this script to 2 empty objects on the scene).
The variable TEST is just a location in the scene. The first variable in each call is the time delay of the action.
Its pretty simple to see what is supposed to happen at each step. This is the point of this weeks script.
(click to show/hide)StartCoroutine (CreateLineInDirection (1, 0.1f, 12, new Vector2(-1, 0), 4));
StartCoroutine (C_WaveEffectWhole(2, 0,0,0.5f,1));
StartCoroutine (C_StopWaveEffect (7));
StartCoroutine (C_MoveToPosition(7, TEST, 4));
StartCoroutine (C_MorphToCircle(7, 1, 1, 0f, 4));
StartCoroutine (C_RotateToDegree(9, 1f, 90, false));
StartCoroutine (C_ShootFromTopScreen(11, 10, 0.5f, 2));
StartCoroutine (C_ChangeScale(11, 2f, 1, true));
StartCoroutine (C_ChangeScale(13, 1f, 1, true));
StartCoroutine (C_ChangeScale(15, 2f, 1, false));
StartCoroutine (C_ChangeScale(17, 1f, 1, false));
StartCoroutine (C_RotateObject(19, -1f, 0, true));
StartCoroutine (C_MoveInDirection(20, new Vector2(0,-1), 1));
StartCoroutine(C_ShootPlayer (20, 10, 0.2f, 2));
StartCoroutine (C_StopMovement(22f));
StartCoroutine (C_StopRotation(23f));
StartCoroutine (C_RotateToDegree(23.1f, -4f, 0, true));
StartCoroutine (C_MorphToSquare(23.5f, 1f, 1f, 2));
StartCoroutine (C_BreakCircleBurst(25f, 10 ,0.5f));
StartCoroutine(C_SprayInDirection (33, 45, new Vector2(0f,1), 0.1f, 5));
StartCoroutine (C_CircleBurst(40.2f, TEST, 10, 2));
StartCoroutine (C_CircleBurst(41.3f, TEST, 20, 2));
StartCoroutine (C_CircleBurst(42.4f, TEST, 30, 2));
StartCoroutine (C_CircleBurst(43.5f, TEST, 40, 2));
StartCoroutine (EnableExit(45));
RegalPrime:
So that script from last week, ya, Im still working on it and its bigger and stronger than before.
I feel there is no real reason for me to upload the new "game" because it would look much the same.
Also on the same note, I will be gone this week for 5+ days (away from my computer :/). Im not sure what I can get done, but Im hoping to rework all of the screens soon to be more legit, like a game. Maybe the release 2 weeks from now that will be a reality.
- Minipatch notes
Added a nice color changing of the projectiles. Nice smooth transitions too, not the swap X object that is a color with Y object of another color. Of course unity did not like the default red apple because it tints and color change the existing color (was like shades of crap and brownish crap). Made a simple White Apple and colors look wonderful.
Simplified coroutines / combined some of them / made functions to call the coroutines / overloaded the functions for user simplicity.
Made a 2nd script that uses the first script function calls to create multiple of these objects and manipulate them on the screen.
It worked out well, simple and clean.
This is a simple scene I made (just for testing some things). If your into this type of thing the copy / paste code is below
Multiple objects being manipulated independently based on time.
Also, since this object in created in a function call, it too can be called on a timer using the "invoke" command (a simple way to subdivide animations).
(click to show/hide) void Object3()
{
NewObjectSpawner Object1 = CreateNewObjectSpawner ();
Object1.SetProjectile (Projectile1);
Object1.SetColor (0, Color.blue);
NewObjectSpawner Object2 = CreateNewObjectSpawner ();
Object2.SetProjectile (Projectile1);
Object2.SetColor (0, Color.red);
NewObjectSpawner Object3 = CreateNewObjectSpawner ();
Object3.SetProjectile (Projectile1);
Object3.SetColor (0, Color.green);
Object1.CreateCircle (1, 0.1f, 25, 1, 1, 2f);
Object2.RotateToDegree (0, null, 0, 180, true);
Object2.CreateCircle (3.7f, 0.1f, 25, 1, 1, 2f);
Object1.RotateDegrees (7, null, 2, 180, true);
Object2.RotateDegrees (7, null, 2, 180, true);
Object1.LaunchAtTarget (9, UpperLeftCorner, 2);
Object1.StopMovement (10);
Object2.LaunchAtTarget (9, UpperRightCorner, 2);
Object2.StopMovement (10);
Object1.MorphToSquare (9, 1, 1, 0f, 2.5f);
Object2.MorphToCircle (9, 1, 1, 0f, 2.5f);
Object1.ChangeColor_Children (10, Color.red, 1);
Object2.ChangeColor_Children (10, Color.blue, 1);
Object1.MorphToCircle (12, 1, 1, 0f, 2);
Object2.MorphToSquare (12, 1, 1, 0f, 2);
Object2.MorphToCircle (14, 1, 1, 0f, 2);
Object1.MoveToPosition (14, CenterOfScreen, 2);
Object2.MoveToPosition (14, CenterOfScreen, 2);
Object1.ChangeScale (16, 2, 1, false);
Object1.RotateDegrees (18, null, 1, 0, true);
Object2.RotateDegrees (18, null, -1, 0, true);
Object1.StopRotation (21);
Object2.StopRotation (21);
Object3.MoveToPosition (0, BottomLeftCorner, 0);
Object3.CreateLineToTarget (21, 0.002f, 30, UpperRightCorner);
Object1.ChangeColor_Children (21, 1);
Object2.ChangeColor_Children (21, 1);
Object3.BreakRandomly (22, 0.02f, 4);
Object1.ChangeScale (24, 0.5f, 3, false);
Object2.ChangeScale (24, 0.5f, 1, false);
Object1.RotateDegrees (25, null, 1, 0, true);
Object2.RotateDegrees (25, null, -1, 0, true);
Object1.BreakRandomly (26, 0.1f, 2);
Object2.BreakRandomly (26, 0.1f, 2);
Object1.ChangeScale (26f, 3f, 1f, false);
Object2.ChangeScale (26f, 3f, 1f, false);
Object1.StopColorChangeEffect (28);
Object2.StopColorChangeEffect (28);
Object1.SprayInDirection (30, 40, new Vector3 (-0.25f, 1), 0.1f, 3);
Object2.SprayInDirection (30, 40, new Vector3 (0.25f, 1), 0.1f, 3);
Object3.SprayInDirection (30, 80, new Vector3 (0.5f, 1f), 0.05f, 7);
Object1.EnableObject (33, Exit);
Object1.PlayClip (33, ExitClip);
}
hmmm Maybe a new screenshot - I think I can handle that
Running the game through the editor - Those pretty shapes :p
(click to show/hide)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version