I'll be publishing some for-sale robust Unity character controllers built around the Spine runtime bundled with Spine project sources really really soon. Just a heads up
Some advice [Unity]
I'm working on a text-based Animation Graph right now that drives a SpineSkeleton if that sounds interesting to you.
It's very programming heavy right now, but I already have it working in my game engine and it lets me do things like combo chains, pause one animation to play another then resume, contextual adaptation between 20% and 80% of an animation, etc... but it doesn't do Blend Trees well. Here's a preview if you're interested.
Some Vocab:
Branch = a thing that decides to move from one Stance to Another
Stance = basically a Mechanim State with extra properties
Signal = a message passed to the BranchProcessingMachine
List<Stance> StanceList = new List<Stance>()
{
// Ground Movement
new Stance { Name = "Idle", Animation = "Idle", Looping = true, BundleNames = {"Ground Common", "Ground Common - Echelon Only"}, },
new Stance { Name = "Idle Look Up", Animation = "Idle Look Up", Looping = true, BundleNames = {"Ground Common", "Ground Common - Echelon Only"}, },
new Stance { Name = "Run Forward", Animation = "Run Forward", Looping = true, BundleNames = {"Ground Common", "Ground Common - Echelon Only"}, },
new Stance { Name = "Run Backward", Animation = "Run Backward", Looping = true, BundleNames = {"Ground Common", "Ground Common - Echelon Only"}, },
}
Stances are connected to each other by branches like these. The really cool thing here is that you can just any code you want inside the Condition of a branch to allow it to trigger.
// Stance:Branch Map
Dictionary<string, List<Branch> > StanceBranches = new Dictionary<string, List<Branch> > ()
{
{
"Idle",
new List<Branch>()
{
new Branch {
Condition = context => { return context.Units["Source"].Unit[PS.InputUpward] > 0.5f; },
NextStance = "Idle Look Up",
},
// + Ground Common
}
},
{
"Idle Look Up",
new List<Branch>()
{
new Branch {
Condition = context => { return context.Units["Source"].Unit[PS.InputUpward] < 0.5f; },
NextStance = "Idle",
},
// + Ground Common
}
},
{
"Run Forward",
new List<Branch>()
{
new Branch {
Condition = context => { return context.Units["Source"].Unit[PS.InputForward] < 0.1f; },
NextStance = "Idle",
},
// + Ground Common
}
},
{
"Run Backward",
new List<Branch>()
{
new Branch {
Condition = context => { return context.Units["Source"].Unit[PS.InputForward] > -0.1f; },
NextStance = "Idle",
},
// + Ground Common
}
},
Some branches have "Actions" (Func<MyArg, bool>) which are called when that branch is taken by the machine.
{
"Ground Common - Echelon Only",
new BranchBundle()
{
Name = "Ground Common - Echelon Only",
Branches = new List<Branch>()
{
new Branch {
Signal = Signal.DoJump,
Condition = context => { return context.Units["Source"].Unit[PS.Grounded]; },
Action = DoSparkJump,
NextStance = "Jump Start",
},
new Branch {
Signal = Signal.DoDash,
Condition = context => { return ( Time.time >= fLastDash + DashCooldown ); },
Action = Dash,
NextStance = "Blink Out",
},
}
}
},
And finally, some branches have "automatic" transitions:
// Air Stuff
{
"Jump Start",
new List<Branch>()
{
new Branch {
On = 1.0f,
NextStance = "Jump Upward",
},
new Branch {
Condition = context => {
var src = context.Units["Source"];
return Mathf.Sign(src.Unit.GetCurrentVelocity().y) != src.Unit.GetUpwardDirection() ;
},
NextStance = "Jump Falling",
},
// + Air Common
// + Air Common - Echelon Only
}
},
In this case, as soon at the jump start animation stops running, it begins the "Jump Upward" looping animation... or if for some reason a monster pushes you down, it cancels the "Jump Upwards" animation right away and beings playing a "Fall" animation.
The technique driving this style of state machine is very similar with Mechanim, with a programmer-oriented focus and was used by studios that made God of War and Capcom fighting games, so if deep combo chains are something you want, it might be just right for you.
@Mitch I'm very interested for this kind of product, I wonder what features will have the character controllers?
In my opinion for minimum character controllers will be much appreciated to have at least basically trigger states like:
idle->walk->run->jump->crouch (not in a specific order) => from here I think will be more easy for us to build and customize the scripts :yes: . Thanks & keep up the good work !
@Xelnath thanks a lot for your explicit answer, I will give it a try for sure :time: & will let you know what I did, Thanks !
Have a nice weekend friends,
:beer: :beer: :beer:
Dorin
The two controllers I'm planning on releasing very, very shortly are
Brawler-type (Idle, Walk, Run, Jump(multi jump), Bounce on enemies, punch combo, up attack, down attack, up attack, wall jump, one way platform support, moving platform support)
Run-gun type (idle, walk, run, jump, jetpack, bounce, various weapon equips along with a method to dynamically swap rig for the arms for different weapons efficiently, and the same platform support)
both controllers will be compatible with eachother so they can co-exist in the same game. both also come with proto-characters that flesh out the animation and gameplay for each type.
My hope is that it starts the Spine+Unity community on making some badass platformy type games faster / with a solid base
I think after reading what you said I might have to include a basic / stripped Idle Walk Run Jump Crouch one with all of the packs.
Obviously building complex controllers like the ones I described is hard to do modularly, so I went the route that simply kept them functional and tweakable.
Anyway, I'll post some playable demos later today I hope You can catch a glimpse of it at the end of my Skeleton Ghost demo video
https://youtu.be/xvmw0YsSmk4?t=176
Ahhh, Mitch's secret plan is revealed - and suddenly it becomes clear why his tools are so good!
No. His tools are so good because shut up.
Excelent news Mitch, how soon is "soon" ? :rofl:
BTW the character control from video looks insane, can wait to test it :rock:
P.S Will be compatible with mobile devices ? Right now I'm developing my game for mobiles, wondering for performances reason...
Performance wise it'll be fine... But platforming in general on mobile is rough just because of speed and the design/latency/awkwardness of touch controls. Fair warning
"Soon" is mid-June at the earliest at the moment.
Hi Mitch,
I wonder if it's possible a beta or a pre-order release because I need a good working controller script for my project as soon as possible
Thanks in advance !
Sent you a PM
Waiting for this!! I need the controllers too!
Thank you Mitch, keep us informed.