Post if you use Behaviors, Please
by Charlie Patterson · in Torque Game Builder · 02/06/2012 (10:41 am) · 24 replies
Hi everyone. I'm feeling kind of lonely in my use of behavior scripts. Does anyone else use these?
I ask partly because I've run into a handful of bugs with them and am getting the sinking feeling that they were never finished and even abandoned, although nobody told me. :P
Thanks.
I ask partly because I've run into a handful of bugs with them and am getting the sinking feeling that they were never finished and even abandoned, although nobody told me. :P
Thanks.
#2
02/06/2012 (1:47 pm)
Heh. Thanks @Scott. I'm thinking it be only me and your demos that use behaviors. :)
#3
I've got focusFrame, focusFrameObject, lookAtAble, pickupAble, genericButton... on and on. I use them a lot.
The bugs you are talking about... are likely the things we've coded around and gotten used to.
:)
02/08/2012 (12:22 am)
I use them all over the place...I've got focusFrame, focusFrameObject, lookAtAble, pickupAble, genericButton... on and on. I use them a lot.
The bugs you are talking about... are likely the things we've coded around and gotten used to.
:)
#4
02/08/2012 (1:01 am)
I just wrote another two behaviours (Dock-style panel and buttons) half an hour ago. I will tell people they are stupid if they don't use behaviours :)
#5
02/08/2012 (6:07 am)
I am using Behaviors all over the place in the platformer kit. Have just started wrapping my head around creating my own behaviors so I am still learning.
#6
02/08/2012 (11:15 am)
I use the hell out of behaviors, specially in PSK titles.
#7
02/08/2012 (11:22 am)
I use behaviors to create all GUI behavior in scenes.
#8
..and yes I experience issues with them as well. ..so I hack away until it works.
02/08/2012 (1:41 pm)
I use them in ways that should be rated WHOA! :P..and yes I experience issues with them as well. ..so I hack away until it works.
#9
02/09/2012 (5:57 am)
I use them mostly just for prototyping though as I start to feel like I've lost control over my code when I add multiple behaviors to an object.
#10
02/09/2012 (9:23 am)
Haha. Thanks @Patrick. I feel the *opposite*. I've never written a game with "class scripts" before but I feel like I'd copy and paste a lot of code and it would get more difficult to debug. I don't know though.
#11
02/09/2012 (9:43 am)
@Charlie, Is Twillex all behaviors?
#12
I'd be interested to know if you are hesitating playing with it, so I'll know how to "market" the idea better.
02/09/2012 (9:47 am)
@Patrick, there are no behaviors in Twillex. It is just a TorqueScript "class" file. You put it in your gamescript directory, exec() it from your game.cs and make calls to it. I tried to make it as easy as possible to get loaded.I'd be interested to know if you are hesitating playing with it, so I'll know how to "market" the idea better.
#13
It would definitely be nice to have a current list of known bugs tho as I dig deeper into behaviors :)
02/09/2012 (9:51 am)
I recently started using them and haven't had any problems...yet.It would definitely be nice to have a current list of known bugs tho as I dig deeper into behaviors :)
#14
02/09/2012 (11:14 pm)
I use behaviors quite a bit actually. That's what they are there for, after all.
#15
See cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
The design in TGB is sort of between hierarchical, classic class-based design and component containers. The container is the sprite or whatever, which can be an inherited class (static or animated sprites). The way Unity does it is one step beyond with just a GameObject at the core for everything, and all the action is customised in components. If it needs physics, add a RigidBody. If it needs input, make an onUpdate() script to read input.
The preferred way I build components in TGB is to make them as generic as possible, so specialised buttons based on sprites+behaviours should still have a method based on the object name for the click action (ButtonName::method(%this)). You could, in cases where you work with completely programming-illiterate level builders, make less generic behaviours with drop-down menus of actions you've already prepared (for buttons), or different ways to react to the player (for enemy objects). Drag, drop, combine - finished level without any code.
Not using behaviours at all means your code is old-fashioned and should be put down ;)
02/10/2012 (12:08 am)
Behaviours are great if you want to be sensible and use component-based design :)See cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
The design in TGB is sort of between hierarchical, classic class-based design and component containers. The container is the sprite or whatever, which can be an inherited class (static or animated sprites). The way Unity does it is one step beyond with just a GameObject at the core for everything, and all the action is customised in components. If it needs physics, add a RigidBody. If it needs input, make an onUpdate() script to read input.
The preferred way I build components in TGB is to make them as generic as possible, so specialised buttons based on sprites+behaviours should still have a method based on the object name for the click action (ButtonName::method(%this)). You could, in cases where you work with completely programming-illiterate level builders, make less generic behaviours with drop-down menus of actions you've already prepared (for buttons), or different ways to react to the player (for enemy objects). Drag, drop, combine - finished level without any code.
Not using behaviours at all means your code is old-fashioned and should be put down ;)
#16
02/10/2012 (6:45 am)
@Charlie, I downloaded Twillex pretty much the second you posted it but haven't had time to dig into it. Since it is obviously very heavily influenced by the Flash tweening concept, maybe try marketing it a bit in forums where Flash game devs are reading? Ideally getting Emanuele Feronato to blog about it... :)Quote:Uh oh... Time to get the shotgun.
Not using behaviours at all means your code is old-fashioned and should be put down ;)
#17
FWIW, T2D has "components" as well as "behaviors" in the engine, but they appear to be completely unused. I imagine the coders were attempting to move all the physics and stuff to a component model but backed out. In the meantime, I'm a big fan of behaviors and they appear to be even more powerful than the Unity3D model (which I've only watched a video on so I'm not certain).
@Patrick: thanks for the link to Emanuele Feronato. I'll start following that blog. Twillex is *heavily* influenced by Flash, yes. Lately, I was looking at Unity3D (as 2D) and Flash and seeing what were the diffs between those and T2D. And I was jealous of the tweening concept. So I read through a few APIs and gleaned what I liked. Then I kept it all TorqueScript so others could use it.
02/10/2012 (12:19 pm)
@Ronny: thanks for that link! I agree and use behaviors pretty much exclusively. I may be addicted. However, there are a few ways I wish they were different and I changed my version of t2d to take advantage of that. I was kinda polling to see if anyone would be interested in testing these changes with me.FWIW, T2D has "components" as well as "behaviors" in the engine, but they appear to be completely unused. I imagine the coders were attempting to move all the physics and stuff to a component model but backed out. In the meantime, I'm a big fan of behaviors and they appear to be even more powerful than the Unity3D model (which I've only watched a video on so I'm not certain).
@Patrick: thanks for the link to Emanuele Feronato. I'll start following that blog. Twillex is *heavily* influenced by Flash, yes. Lately, I was looking at Unity3D (as 2D) and Flash and seeing what were the diffs between those and T2D. And I was jealous of the tweening concept. So I read through a few APIs and gleaned what I liked. Then I kept it all TorqueScript so others could use it.
#18
02/10/2012 (12:22 pm)
If we are working on an internal project and the team is not heavily using behaviors, I punish them.
#19
02/10/2012 (12:27 pm)
@Michael, LOL! Send them to Seattle for punishment. They are enjoying the Vegas sun too much.
#20
02/10/2012 (12:29 pm)
Components are just the C++ version of behaviours, I think.
Associate Scott Burns
GG Alumni