jME3 : I think I get it now


This is just a note to re-emphasize the use of controls rather than extended geometry and spatials, and to thank those who started to make this clear. I finally have my player controls done and an entity movement type control that can be plopped on any entity regardless of what it is, and I can just slop the single player control around to whatever I want to manipulate. I think I get it. This way is definitely a lot more flexible.

Now I just need to convert a few more specialized geometries over to controls and I’ll be set! :stuck_out_tongue:

Is there ever a time when you’d want a specialized gemoetry/spatial over a control though? I mean, the way I’m starting to see it, there’s really no point in it ever happening.



1 Like

So repeated use and pointers brought you to this realization. Do you think we could make the recommended practices of controls more clear somehow?

  • Inserts on related wiki pages
  • More example code
  • Controls for Dummies

    Would be great if you could give us an idea of what “supplements” would be worthwhile, especially if you can provide the first draft :wink:

I’d love to see controls for dummies, I have a hard time understanding them as well (yeah, with a afternoon or so I should be able to get away with it but still, love easy references)

Hello again!

Well, I began thinking about it when I was running into continuous problems with having custom spatials laying around for everything. It becomes a chore after a while managing all of them, and in some ways, controls offer all of the customization at a more modular level. Not to mention it’s much easier to grab the control you need applied to a spatial by using that getControl method. Now, having said that, it’s probably sub-optimal for the case where you have more than one of the same control, but from what I’ve seen so far that rarely happens. It usually ends up being a melody of different controls with no duplicates, so using the get to find a control usually ends in one result anyway.

I’ve been in a bit of a rut lately, mostly just cleaning code and thinking about ways I need to handle some game specific scenegraph stuff. Mostly just thinking. :stuck_out_tongue:

But last week there were these two posts:

Embarrassingly, I actually forgot the source for MonkeyZone was on GoogleCode, so I studied it for a little while last week, and honestly I still am. I’m not sure if I understand what each of the levels of abstraction with the interfaces of controls that @normen has laid out, but I understand at least what it is getting at/end result.

So taking that as gospel for a bit, I tried to realign some of my code to the more control oriented philosophy. In my case, I had a player spatial. Now, since I’m working with a sprite based game, I had the player as a node, that contained a node container for the sprites and some other nodes for some other purposes. Also, internally it handled it’s own user controls and physics objects. It all worked great, but it was getting clunkier and clunkier as I kept adding DAS POO POO ( crap ) to it.

So the first thing I did after reading all of that was I took the controls out and made that a control all by itself. I suddenly realized that by doing this I could technically apply the playerControls control to any entity if I designed it that way. I’m not sure if I have a need for it in my game, but it’s definitely more flexible. Then I started to realize that most of the movement related things could also be a control, that of course the playerControls would have to lean on. But, also like in MonkeyZone, you could write AI control methods that interact with the movement control to allow the computer to control an entity. Pretty neat idea. Basically, it keeps snowballing downhill from there. I realized that pretty much everything I put into the custom player node could become a control of some sort.

The only exception being the sprite itself, as I’ve got some weirdness there I need to work out, but I’m confident that it could also become all controls if I play my cards right.

Oh mah gad, I typed too much. I should go back and remove the line breaks so it becomes wall of text crits your ocular nerves for 2300 damage!


EDIT: I’m not sure if I’m really qualified to discuss the inner workings of controls. :stuck_out_tongue: I understand them at the level of “voodoo” where I know where to put stuff and then magic happens, but past that I have no idea how the magic happens. It just does! :stuck_out_tongue:

Also, whenever I goto edit posts now it tries to remove line breaks from my posts. I almost pulled off what I was joking about before my signature by accident :stuck_out_tongue: