HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] In engine cut scenes  (Read 3997 times)

cheyennecloud

  • General Accounts
  • *
  • Posts: 10
    • View Profile
[Resolved] In engine cut scenes
« on: Jul 08, 10, 11:32:18 PM »

What would be the most ideal way to do an in engine, script controlled cut scene?  Or is it even practical? 
« Last Edit: Nov 02, 12, 08:24:34 PM by HE-Cooper »
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: In engine cut scenes
« Reply #1 on: Jul 09, 10, 08:00:04 AM »

What would be the most ideal way to do an in engine, script controlled cut scene?  Or is it even practical? 

The typical way to do this is to set up a path, set up a pathfollower on a b-spline, and then attach a camera to it.   At each waypoint you have the opportunity to instruct the camera in a variety of ways, look at something specific, zoom, roll, etc.  Depending on your needs, you may do this in a gameplay area itself or an alternate area with a more specialized setup.

https://wiki.heroengine.com/wiki/Waypoint_Paths
https://wiki.heroengine.com/wiki/Camera_commands

~Christopher
Logged
Christopher Larsen
CTO
HeroEngine

cheyennecloud

  • General Accounts
  • *
  • Posts: 10
    • View Profile
Re: In engine cut scenes
« Reply #2 on: Jul 09, 10, 08:43:16 AM »

Let's say I set up an area or areas to serve as cutscene hosts.  Since cutscenes are basically independent play for each client and really should be as much client-based as possible, how would I set it up to minimize resources on the server as much as possible?  Spawning an instance for each client to view so they would have their independent viewing seems like it would be a lot of overhead.  Am I way off track here?
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: In engine cut scenes
« Reply #3 on: Jul 09, 10, 09:19:45 AM »

Let's say I set up an area or areas to serve as cutscene hosts.  Since cutscenes are basically independent play for each client and really should be as much client-based as possible, how would I set it up to minimize resources on the server as much as possible?  Spawning an instance for each client to view so they would have their independent viewing seems like it would be a lot of overhead.  Am I way off track here?

An area handling a cutscene would reasonably be expected to handle many many users simultaneously as the server is doing very little.  The main difference would be that you would modify the area to not introduce users to each other (i.e. no replication would be initiated for user A's character to user B's client).  In this fashion you could have hundreds of characters standing on top of each other, and each user's client would be ignorant of the fact that they existed...knowing only about their own character and other things you introduce.

~Christopher
Logged
Christopher Larsen
CTO
HeroEngine

cheyennecloud

  • General Accounts
  • *
  • Posts: 10
    • View Profile
Re: In engine cut scenes
« Reply #4 on: Jul 09, 10, 12:59:01 PM »

How would it work for NPCs acting in the cutscene?  Would each client get their own set of NPCs?


Thanks for all the useful info!
Logged

gregoberfield

  • World Owners
  • ****
  • Posts: 10
    • View Profile
Re: In engine cut scenes
« Reply #5 on: Jul 09, 10, 01:24:53 PM »

No - all players would see the same NPCs, they just wouldn't see each other.  You'd just spin up an instance for each party/group that needs to see the cutscene so they'd all be in sync.
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: In engine cut scenes
« Reply #6 on: Jul 09, 10, 01:30:47 PM »

How would it work for NPCs acting in the cutscene?  Would each client get their own set of NPCs?

Being able to share some/all is of course better, but you could do unique ones for every client if it were necessary to achieve the behaviors you wanted.  

Depending on what the NPC is doing, it is possible to share the same one in many cases by having it do stuff locally on the client rather than on the server (replicated to those aware of the npc).  It requires a different code path than is normally taken for replication of NPC actions, but it quite doable. 

If the npcs actions are leveraging a lot of your server game code, such as full blown combat then it is harder to share the same NPCs unless everyone is watching together (like going to a movie, everyone sits down and then it starts).

~Christopher
Logged
Christopher Larsen
CTO
HeroEngine

cheyennecloud

  • General Accounts
  • *
  • Posts: 10
    • View Profile
Re: In engine cut scenes
« Reply #7 on: Jul 09, 10, 03:09:03 PM »

Depending on what the NPC is doing, it is possible to share the same one in many cases by having it do stuff locally on the client rather than on the server (replicated to those aware of the npc).  It requires a different code path than is normally taken for replication of NPC actions, but it quite doable. 

^^This is what I'm getting at essentially.  How would you have things like NPCs do stuff locally so they could be reused among multiple clients who are viewing different points of time in a cutscene at the same time in the same area?  Assume the NPCs are independently scripted away from the other game scripts that control the game.

Logged

cheyennecloud

  • General Accounts
  • *
  • Posts: 10
    • View Profile
Re: In engine cut scenes
« Reply #8 on: Jul 15, 10, 08:28:06 AM »

Is there a way to have NPCs behave locally for each client?
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: In engine cut scenes
« Reply #9 on: Jul 15, 10, 10:02:32 AM »

Is there a way to have NPCs behave locally for each client?

Yes, though it ranges from easy to complex depending on the behavior you want.

The simplest method is to send a behavior command which results in the playing of an animation sequence.

Code: [Select]
// Using the external function Behave(), preferred as it is faster
npc as noderef of class HBNode = <some_id>
Behave( npc, "input Emote Wave" )

// Using the Parameter Interface
npc["Behave"] = "input Emote Wave"

What inputs you can modify depends on how your animation agent is written, which in turn relies on the animation sequences available for a particular character specification (and ultimately on the animations created by your artists).

https://wiki.heroengine.com/wiki/Animation_Agent_Script
https://wiki.heroengine.com/wiki/ASQ

That will get you only so far however, more complicated interactions will require a level of AI and pathing.  Pathing requests can only be made on the server, which is generally done by whatever AI you have written for controlling the NPCs.  However, in this case you want to effectively run AI on the client making modifications to the (npc's) character controller locally to cause it to navigate/turn/act as needed without replicating any of that information to other clients in the area.

The character controller for your game is (by default) handled by E_ACCControllerClassMethods (https://hewiki.heroengine.com/wiki/Advanced_Customizable_Character_Controller). 





Logged
Christopher Larsen
CTO
HeroEngine

cheyennecloud

  • General Accounts
  • *
  • Posts: 10
    • View Profile
Re: In engine cut scenes
« Reply #10 on: Jul 15, 10, 06:12:38 PM »

Excellent, thank you Christopher.
Logged