playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Red

Pages: 1 ... 3 4 [5] 6 7 ... 38
61
Are there any options that are less finicky that the two above? Since the character controller is tied to the move/simple move action I believe it's important to make jumping as simple as everything else within Playmaker.

I'm not sure if this is what you'd be looking for but for the system that I've been working on recently I've had to re-roll my own physics system in a sense (mainly because when jumping I felt that the physics was a little too floaty and didn't give me the level of responsiveness I really wanted.)

I'm not sure how easy this would be to apply to your own system but what I did was as follows. That said, keep in mind that this is for a side-scroller so I only needed to input one axis for the horizontal movement and limited vertical movement (such as when the character is on a ladder.)

First off, I scrapped the character controller entirely and used only a rigidbody. Not set to kinematic or anything but I froze the rotations in all the axes other than the one that would let me rotate the character.

Secondly, I took the inputs for both vertical and horizontal and fed those into the appropriate variables that I'd use to control the character. Right as things are now since I have both the horizontal and vertical movement controlled in separate FSMs I stashed them in two floats. In the "input monitor" system I have it always getting those two with the "Get Axis" action and feeding them to the appropriate other FSMs with the "Set FSM Float" actions set to every frame (since the "Input monitor" system is always in the idle state... because, well, it's always getting that data from the player inputs.)

In the horizontal movement I've got a basic float compare taking that horizontal axis information being fed to it from the "Input Monitor" system and always testing... If it's in the positive, I tell it to move the character to the right... if negative, to the left. In there I use the "set velocity" to the object. That gives me the movement.

To get to the jumping, I have a basic calculations for gravity... Since it has a rigidbody and I'm making my own gravity solution I tell the rigidbody not to use it's own gravity. And in each active state in the vertical where I want it to have gravity affect it I have a three actions (in order...)

Get Velocity. Getting the vertical (Y) and storing it in a float variable.

Float Operator. Taking the vertical velocity variable and adding the gravity value. The gravity value is a negative float value... And this does require a little tinkering to be sure you have the value you want to get the responsiveness you want... I do that and then put it in the same vertical velocity value (I don't know if this is the best way to do it though as this system that I'm working on is still relatively new-ish and I'm learning a fair amount as I go.)

Set Velocity. Simply take the vertical velocity that was extracted and run through the operator and re-applying it to the character.

This requires a collider, of course... because when you remove the character controller component it takes the controller itself off.

And to make it jump... When I enter into the "Jump" state I simply put in a new value for the vertical velocity and use "Set Velocity" to do it... And yes, I also still use the three gravity functions listed previously... You could have it exit that state ASAP once you've added the velocity to make it jump and of course this does require some fiddly work to get it to the level you'd want of it... But since you have far more control over things like how strong the jump will be, how strong the gravity will be and all that, you can get a lot more responsiveness.

This does, however, run on the "Every frame" mechanic so if you have a LOT of systems that are working and pulling the framerate down to an abysmal level this might not be the most ideal way of doing it... If that is the case you might want to make each state that uses the gravity to instead of using the "Every frame" option you could then instead put in a "Wait" action with real time and set it to the iterations you want... So, maybe a time of "0.01" or something... That's pretty fast though and it kinda requires even more finicky bits to get it to work just right (and I'm sure there's a far more elegant way of doing it) but that's been working somewhat for me.

Given all that, however, it does require some additional work... So, if you want to confirm that the character is grounded you'll probably want to create a set of raycasts that go only a small bit down from the characters feet to ensure that they're connecting. But that's not too hard to do, just make sure that you set the viewline distance to be far enough to only extend a little bit past the character's feet.

And if it has a collider and everything that it's going to interact with has a collider, that might be a way to prevent it from passing through things as long as it's velocity isn't blazingly fast (I've tested this and if the object is moving fast enough the collision systems might not be able to work fast enough to catch it... Since the collision system seems to work like a force field as opposed to a mass... The way I view it is like it's not a mass at all but more like a paper thin shell that only pushes outwards... So, if it breaks through that shell, it doesn't know what to do with it while it's within the system.

Does any of this make sense? I know it's kinda detailed on paper but in practice it's actually fairly simple. (I'll get a web-player build started to show you the system in action... It's for a side-scroller though but I'm sure the concept can be extended to incorporate a full XY planar style movement.)

62
Yeah, it's an old galaxy tab that a roommate gifted me with when he upgraded. It's old, small and perfect for stress-testing for mobile development.

With that being said, I have no idea what direction to go in to figure out what kind of process I'd need to learn to be able to use PlayMaker to develop something with this.

So, who here that has experience with tablet/mobile development using PlayMaker? What direction would you suggest I (or anyone that's reading this and also wanting to know) go in?

This isn't really about what kind of game to make... It's more about what kind of things one would need to understand about developing for a mobile device that developing for the PC market might not really give them.

63
PlayMaker Help / Re: Run FSM: How to get it to return variable data?
« on: August 06, 2014, 07:02:50 AM »
Yeah, I know it's probably not the best example... :lol:

I guess what I kinda want to know is how the system handles it such that I can understand better when to use it and when to use different systems. If I can parse what it does on a more fundamental level I assume that'd help me to understand when it's appropriate to use it.


64
PlayMaker Help / Re: Working with variables and conditions
« on: August 05, 2014, 10:20:22 AM »
If you're working with the four suits I'd probably break that up first.

So, keep the "each card has an identifier" approach (so, say, the ace of hearts is 1 whereas the ace of diamonds is 14) and if you take the random variable you can do a test to see if it's below 13, below 26 and below 39 to determine the suit... Assign that "what suit is it" to an int value which would be from 0-3... Take that random number, subtract 13*i (unless the initial test is saying that the suit is "0" in which case you simply skip the multiplication bits to prevent a div-by-0 error) where i is the suit identifier and stash this new int in a working variable (eg. "i") and then run it through an int-switch to determine what value card it is.

Here's a test screenshot... I think in the suit-sorting system that the action sequence option should be on just to be sure that each int compare is running in sequential order so as to prevent any accidental mis-sorting...

So, this would take the random int you set up and turn it into the value of the face card and have an int that determines the suit of the card itself... So, you have a random value being made of... "23" it will then give you a suit of 1 (clubs) and a ID of "10" so it's the ten of clubs. (in this example I'm assuming that the ace is 1... some people might want to make the ace the higher card so tailor that to your own purposes.)

EDIT: in this example I over-wrote the initial "card ID" int value... If you need/want to keep that value unique you could make a new int value of "Card face value" or something like that where you assign it's face value... So you'd have "Random card", "Suit" and "Face Value" integer values being created for this kind of thing.

65
PlayMaker Help / Re: Start animation on random frame
« on: August 05, 2014, 09:59:59 AM »
If this is with Mecanim, I'm not 100% sure this would be the right action to use specifically (as I haven't a scene that I can test it with at the moment) but would the "Set Animator Playback Time" be the right action to use here?

It seems to be able to give you the ability to set what time the playback is supposed to go to so if you feed it a random float value that might be something worth trying... That said, I don't have a scene open that I can test this with so this is more of a shot in the dark kinda thing... But if it's with mecanim that might be worth checking out. (and it's also with the mecanim action set that you'd have to DL from the wiki.)

66
PlayMaker Bug Reporting / Re: Some transitions changing.
« on: August 04, 2014, 04:05:54 PM »
Graph events... Mostly it would happen if I add a new event and change things around such as adding in a new event that's a better name than what I had previously... then changing it and then removing the old event... And the new event is inserted into other FSMs

For example, I had a set of states with "initialize" and changed one FSM separate from those... When I logged back in the next day those "Initialize" events were changed to the new event. So, it might be something in the way that the events are handled like an address system (I suspect it may be that events are handled on a sort of identity basis in the event browser or the events list in the graph editor and the changing around is not updating the right event identifyer or something like that.)

I know it's a shot in the dark and it's not a common occurrence but when it happens I tend to be floundering around the systems trying to hunt down what has changed and what hasn't.

It usually happens with items that are made into prefabs as well... So, is it possible that that prefab apply issue mentioned a while back is what's manifesting here?

67
Lane:
   Not sure what UMA is... can you linky-link me up?

Jean:
   Yeah, I was going all kinds of batty trying to work with this both in Unity and Max (when I decided to try it.) Then someone on reddit suggested adding in a dummy object to give some measure of separation which was the trick that did it (though they were thinking adding it in in Unity but that, I suspect, would really throw the animation data off since it would be changing the hierarchy.) So, taking that same inverse scaling magnitude thingamabob and applying that to the dummy object between the bones in Max gave me enough wiggle room to have the scaling matrices be regular whilst preserving the hierarchy of the bones themeslves. It's a bit of setup and had me agonizing over the code-elements... But it produced some decent results (That said, the preview panel in the animation tab in the inspector was showing the scaling as being off... But in the scene itself the animation was what I wanted it to be. So, if you take a look see at the animation that you can export from the linked file the data seems safe... but the preview panel might look off.)


Thank you for the responses.

That said, since I was facing a lot more difficulty with this in Unity I tried applying the same principles to a rig in Max... And that resulted in the behaviour that I wanted.

So, as much as this could still be a great topic (as I can see many other ways that dis-inheriting the scaling that a child object inherits from it's parent would come in handy) I'm going to link to the max file I have uploaded to my site to show you the rig itself...

Note, the usual disclaimers apply... I take no responsibility for crashes, loss of data or time or whatever if you use this... And it's only offered as-is to learn from... But this gave me a stretchy bone rig that has a (somewhat) preserved hierarchy that is unity compatible.

Oh, and I am sorry to any maya/blender users... I don't know how you'd do something like this. But if you can replace or alter the scaling control systems in your hierarchy, you could apply the same kind of "1/parentObjectScale" approach... But I make no promises... I'm a max-head through and through after-all.

http://www.badseedgames.com/SharedFiles/UnityStretchyBoneRigPrototype.zip

68
If in the end this is soemthing that I'd have to tackle in Max then I guess I could figure something out... A way to have the scaling inherited but having an expression controller on the bones to offset the scaling so that the inherited scaling is factored into the animation... But that's some seriously beefy Maxscripting mojo right there and the more complicated it gets, the greater risk it is that the rig simply won't be compatable with Unity or the exporting tools.

And to be completely honest, if this was a max-only thing that's not really going to help the others that I know are out there that are looking for ways to make a stretchy bone rig Unity compatible. Mainly because modern-gen facial animation is much more impressive when it's bone-controlled as opposed to morph controlled. Far more flexibility and much more animator-friendly.

69
Since I'm researching this, I wonder if this reference page would be what I'd need to learn about using to get this done...

http://docs.unity3d.com/ScriptReference/AnimationUtility.html

Basically, it looks like I could use either AnimationUtility.GetAllCurves, *.GetFloatValue or maybe *.GetEditorCurve... No idea though because the reference manual is all about programming and this is well over my head.

For example, if I needed to make this fetch the current animation frame that the game object is currently on... Then reference the animation curve data (since it does have all three scale axes separated in the "animation" window so it is present) to get what that value ought to be... Then take that data and over-write the scaling by factoring that information into the algorithm to get what that scale should be without the inherited offset...

I know this might be asking more than what Unity can even do... And if Unity can't do it it's not likely that PlayMaker can either.

70
I guess what I would like to know is this...

Is there a way I can reach into the animation data to get the scale data of a particular frame? IF I could, that would (hopefully) lead me to being able to get this up and running.

If I open the animator window, I can see the data for scale right there... So in some manner this information is there to be used (and abused.) But I'm at a loss for knowing what I can do to get that data.

71
PlayMaker Help / Re: Reverse animation in Mecanim?
« on: August 03, 2014, 10:34:05 AM »
Just working with a proxy object (since I'm hashing out some animation stuffs myself) I tried it and it seems it will take a -1 value in the speed of the mecanim animation system... And it did play in reverse.

That said I have no idea if this is wise or if the computer particularly likes handling it... But it does seem to be able to.

72
PlayMaker Help / Dis-inheriting scale (a rather "out-there" question.)
« on: August 03, 2014, 10:27:41 AM »
So, I'm asking this here because I'm looking to see if I can get a stretchy-bone system into Unity that has a hierarchy to it... Since scaling is inherited, that leaves the resulting rig a total mess.

Thing is, what I've been able to hash together is a system that will nullify that scaling by essentially dis-inheriting the scaling information of the parent.

The formula is basically:

ThisObject.scale = 1/ParentObject.scale

That works to reduce the scaling back to 1,1,1... But that over-writes any scaling I might have animated into the rig that that particular bone is doing (And it only seems to work with objects that are not scaled up or down. That isn't a big issue though because you can scale things in the import settings much more cleanly.)

What I want to do, assuming it's even possible, is to take from the animation track the scale of what it should be, take the parent scale and apply the inverse values only... So that the bone, if it's animated in scale, will still animate in scale but not inherit the relative scaling that it'd get from it's parent.

... Is something like this even possible with Playmaker? With Unity? I've tried using the "Get Property" action to peek into what data I could potentially extract for this but all I see is position and rotation... No scale (even though it does animate scaling at least with the generic setting of Mecanim.) I've even tried that with the legacy animation system and there's even less data I can extract with that (no position or rotation data at all.)

Anyone want to throw me a bone here? I'm kinda wondering what I can do because all my current examples hasn't resulted in the most reliable results... Mainly because all the actions that I know of to use for something like this would over-write the scale directly and that'd only work on the first frame... So, I'd need to get the data out of the animation system itself for what the scale is supposed to be for each bone that this system would affect each time this algorithm cycles through (so I can prevent any additive scaling messes.)

73
I'd like to formally request a set of actions that will allow me to convert a numerical value to/from the various modes like Binary, Hexadecimal, etc...

I have an algorithm that I've been nursing and I think it's about time I actually put into practice to see if it'd work as I hope it would... But it requires the ability to convert a binary number to and from an int (but the other modes would be helpful for other systems I suspect.)

74
PlayMaker Help / Re: Optimizing CPU drain.
« on: August 01, 2014, 01:08:00 PM »
I think I know that UDK scene you're talking about (was it featured on Polycount in the last few months?)

And yeah, I've also used a couple tricks too... One such way is if I need a collection of "key items" where all you ever have is a boolean value of "have it/Don't have it" I've figured out a bit of an algorithm (in my head... not in practice yet) on stashing that as an int value. Basically, each item has a value of one or zero... Each item has it's own unique space in the inventory (so, say "Red key" is always the first item, "Blue key" is always the second.) Then take those boolean values, treat them as binary, collect them together and convert it to an int.

So, eg:

Red key, Blue key, Skeleton key, magic gem, magic book, macguffin.

Player has the Red key, Skeleton key and Macguffin...

So, 101001 would be the "binary" number... Then convert that to an int... 41

The process is a little complicated in encoding and decoding it to apply it to the inventory... And it's likely not the most ideal way of doing it I'd imagine...  but the theory is that it can cut down the costs of having a lot of boolean values for items the player will only ever have one of... Or of power-ups... that kinda thing. (And I'm sure there's probably a way to convert that int to a bin, take the raw value and go iteratively through each digit... So, instead of having to test for each possible combination you could just go "scan first digit... is it a one or a zero? scan second digit... is it a one or a zero?" kinda thing.

75
PlayMaker Help / Re: Run FSM: How to get it to return variable data?
« on: August 01, 2014, 12:58:24 PM »
OOh, nice!

Hadn't thought of that.

In the interests of modularity, though, how do these "nested" FSMs get treated? For example, what would I have to do to set up a routine in a "nested" FSM (one that's only ever used within an FSM with the "Run FSM" action) so that it will detect what it's "parent" is so that I can have, say, a couple different objects all using this template but each one having slightly different values that it needs to pass back?

For example, say in a multiplayer game you have the game instance running with the main player character and the instanced visiting player characters... Each character has the same general FSM that's controlling things like the position, rotation, etc... But in the case of the visiting player's gameObject it reaches in, grabs it's identity (as either a host or visiting controlled) and then determines what subset of nodes to run through?

I dunno... I know that this idea may not be the most ideal for this kind of situation... But communicating between parentFSM and childFSM is something that I think would surely help in being able to parse and understand so as to know how to address this kind of setup.

right now I'm thinking that the most ideal use I can think of right now would be using these FSMs to have controls for the camera system I'm working on... Since it has multiple modes and both horizontal and vertical being separate I'm wondering if it would shave down time, energy and CPU cost if I had each mode running an instance of the movement and having a way of detecting "This is the vertical controller" or "This is the horizontal controller." Since there are some minor differences between the two but the over-all modes behave nearly identically in how they do their thing.

Pages: 1 ... 3 4 [5] 6 7 ... 38