playMaker

Author Topic: Is a "Homeworld-RTS-Like" Camera Control possible?  (Read 7287 times)

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Is a "Homeworld-RTS-Like" Camera Control possible?
« on: October 11, 2013, 07:26:44 AM »
hello there,

I just tried really hard to script/code a homeworld like camera running – but just failed on that one. It works – kind of – but not 100%. Seems a bit too tough for a first project…
I am not familiar with Unity.API and my C# is… kind of “noob-ish” at best ;)
 
So I wonder, if it’s possible to get a “hw-cam clone” up and running with Playmaker?

  • The Camera should perform like a true 3-D RTS Cam, with no plan (ground) or floor
  • Cam can center+move close to a GameObject, when GO is ALT+clicked left Mouse (then it rotate and zooms around this GO)
  • When moving away (star pan again) from target GO, the rotate arounf "World axis" again (break from target)
  • Cam can Rotate free 360 degrees, if it don’t have a target
  • View could be pan(ned) when moving Cursor to Screen-Boundaries (speed adjust)
  • All rotation and transitions, moving etc. is done smooth (in a “LERP/SLERP way”)
  • Variables can be adjusted (speed, limits, etc.)
Is this easily doable with the standard Playmaker Asset?
Any proof / own experiences, someone is willing to share here?



Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #1 on: October 12, 2013, 07:40:37 AM »
Oh, so it. ist Not possible? I guess no answer means "No Way"?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4003
  • Official Playmaker Support
    • LinkedIn
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #2 on: October 13, 2013, 08:02:58 AM »
It's certainly possible in playmaker. My advice is to use a separate FSM for each camera feature, and a master camera controller that sends events to these FSMs.

Break each camera feature down into the required states (including states like Disabled, Transitioning to New Target, etc). Try to have each state do just one thing. Then implement and test each feature separately before combining them. Turn features off and on manually before figuring out the rules to do it programmatically.

It's a fairly complex system, so you should break it down into smaller parts that you can implement separately. I think as you implement each part it will become more obvious how they work together...

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #3 on: October 13, 2013, 02:17:45 PM »
Hi,  I started using playmaker bout 6 months ago. And I can tell you, it can definately do any RTS style cam you want. I would think a homeworld style cam is reasonably do-able.   I'me working on a regular ground based rts, but have my camera zooming about quite nicely, all done with playmaker.

You do need a good understanding of programming and physics, to get good results. But its doable , so good luck

« Last Edit: October 13, 2013, 02:57:03 PM by muppetpuppet »

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #4 on: October 13, 2013, 04:27:44 PM »
Ah ok. So i got to do a Lot Programming?

I thought, playmaker got some ready to use things for that task.

Thanks for reply

muppetpuppet

  • Junior Playmaker
  • **
  • Posts: 77
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #5 on: October 13, 2013, 04:37:03 PM »
No, it makes programming simpler, but it does not provide a ready made game. There are entire kits in the asset store though. And Playmaker integrates a lot of the asset store packages very well.

But in essence if you need some programming skills to make hi quality games. Thats just a fact of live, but I believe playmaker is the easiest way to get started. 


Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #6 on: October 14, 2013, 02:37:43 AM »
Ok, i see.

I thought, there are some, if not all camera-actions pre scripted in playmaker
and one can just put the ones needed into to game / assign them to a camera.

But when reading the answers here, it seems there are some more assets to buy, to fill playmaker with pre-scripted things?!

Sorry, if i dont get the concept right - that´s just my guessing..
« Last Edit: October 14, 2013, 03:14:17 AM by Onkelpoe »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #7 on: October 14, 2013, 07:20:01 AM »
Playmaker comes with a huge amount of "Actions". The majority of those Actions are very generic in purpose, allowing you to do simple things on a variety of objects, variables and scripts and then build from there to make huge, complex machines doing whatever you want very specifically. You can use some Actions to manipulate other scripts you've downloaded from the asset store and there are also the Get Property and Set Property actions which are extremely versatile in reaching into any scripted component and giving you a very simple list of variables to manipulate.

This is all completely useless if the end user does not take advantage of it. The point of playmaker is allowing someone to use these actions to create state machines that "do" things, and being how generic most of those actions are, the limit of capability for the asset is actually pretty hard to reach. The answer to your question is yes, you could do this with playmaker without touching a script. Is that the best way? Maybe not, a coder could make this just as easily, I'm sure.

Playmaker can be used as a coder's accessory, doing some things faster while he may prefer to code a majority of his work. On the other hand some people - myself included - will do everything in playmaker, using no outside scripts. If I really need something custom due to the lack of coding knowledge I might just go and make a custom action to do it for me and move forward with that since they're pretty easy most of the time.

I hope this clarifies. Playmaker isn't one of those assets you buy and then have buyer's remorse about for weeks to come, its a hugely capable tool limited only by the end users ability to find ways to develop within it and those end users come from a wide variety of backgrounds and use Playmaker for very different things.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #8 on: October 14, 2013, 07:34:23 AM »
Wow, yes - that clarifies a lot. Thank you !

So one could build something like "If Alt+left mouse clicked on a GameObject, then move camera there and center on this object" just from already existing actions, shipped with Playmaker?

One more thing, i´d like to ask:

You said: "If I really need something custom due to the lack of coding knowledge I might just go and make a custom action to do it for me and move..."

So, you make a custom action without coding? But how?
By combining pre-scripted code/actions?
Buy from Asset Store?


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #9 on: October 14, 2013, 07:53:25 AM »
Quote
You said: "If I really need something custom due to the lack of coding knowledge I might just go and make a custom action to do it for me and move..."

So, you make a custom action without coding? But how?
By combining pre-scripted code/actions?
Buy from Asset Store?

There are some custom actions in the asset store but it's fairly easy to make your (especially if you need something super specific) own by looking at similar actions code and copy-pasting it into a new action. That's about 90% of how I do it, the rest is just cleaning up the flow and maybe adding a few extra lines manually.

So one could build something like "If Alt+left mouse clicked on a GameObject, then move camera there and center on this object" just from already existing actions, shipped with Playmaker?

Yes, while you won't find a "Move Camera" action, you'll find Get Button Down, Bool Switch, Get Main Camera, iTween Move To, Look at, and Smooth Follow instead. More generic actions that when combined could get you to the goal just the same.

Or you could build a "Move Camera" action yourself but frankly the Homeworld RTS camera system is a very robust and complicated system. It won't be a matter of simply throwing a couple of actions in and getting what you want, its probably going to take a lot of experimentation, iterating and failure to get nearer to what you're going for.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #10 on: October 14, 2013, 08:19:10 AM »
Ah, thanks again Lane!

I never imagined, that the hw-cam system ist sooo complicated and complex.
I mean it´s pan, rotate and zoom + a center on object... sounds not toooo extraordinary to me - but ok, i guess you got much more experience than I, so if you say so, I tend to believe it ;)


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #11 on: October 14, 2013, 08:23:14 AM »
Hi,

 Indeed, I can confirm that Camera work is difficult to get right and exactly how you want. Each games has its own small feature and details that makes almost any "generic" camera work not suitable...

 The key is to start simple and add complexity only when required. And not fear starting from scratch yet again, sometimes these small new requirement calls for a different approach and that's part of the development routine.

 Bye,

 Jena

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #12 on: October 14, 2013, 12:53:45 PM »
Ok, can someone Point Out, How to do this homeworld style RTS Camera with playmaker (Tell me the right structure and how to Start)?

Then my purcase is just a Click away... :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #13 on: October 15, 2013, 03:21:42 AM »
Hi,

 Ok, Please find a working sample of this RTS style camera control. It's basic but shows  one way to get there:

http://fabrejean.net/projects/Unity/PlayMaker/Samples/RTSCamera/RTSCamera.html

you can get the package attached to this thread to see how it was done.

However, it's quite advanced, so I would not suggest you tackle this as your first task within PlayMaker, and start with more simple problematics. It also features a custom actions that you can find on this forum as well:

http://hutonggames.com/playmakerforum/index.php?topic=272.msg1087#msg1087


Bye,

 Jean

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Is a "Homeworld-RTS-Like" Camera Control possible?
« Reply #14 on: October 15, 2013, 05:46:20 AM »
WOW Thank you very much !!!

As soon as I am home, I´ll test it.

Seems, I got my 1st task in playmaker :)