Jump to content

Conjoined Entity Actors / Grab Attacks / Tank Turrets


Recommended Posts

After some lurking in #0ad-dev, i've finally decided on actually starting a forum topic to discuss "howto" approaches to a game mechanic that i wanna use for my own little hobby project.

Here's my noobish technical idea on what i want to do:

What i want is: an ability to attach an Entity A's Actor as a prop to Entity B's Actor, so that they are animated in sync. Bonus points if attachment is adjustable as per it's completeness (so either snap-to-prop-point without inheriting transform, or different animation name for "prop" actor to be allowed bitmask-style) - and then animate the conjoined entity seamlessly.

Since i think the information flow between Simulation and Rendering is allowed to only be one-way, i cannot achieve this by simply snapping one entity to a specific position in the game world, so some way to tell the rendering to animate the models in this way is required?

And here's what i want to do actually:

1) Grab Attacks. Imagine a vampire capturing its victim in stranglehold and then slowly extinguishing its life unless killed - all the while they both struggle in sync. (this is where the noobtech suggestion of "separate animstates" is relevant, so that vampire plays "grabbing" animation and victim plays "grabbed".

2) Tank Turrets. Imagine the "carrier" unit having its own rotation, while the Turret is both separately targetable and destroyable, as well as able to pick its own targets. This is where snap-without-transform noobtech idea is relevant, because turret should have at least one axis of freedom.

There are likely ways to implement this that are completely different to my noobtech approach - and i'll gladly hear them out (as well as pointers of how to implement my approach if it's actually the only/the optimal one)

Link to comment
Share on other sites

As far as syncing animations goes, there is some kind of support for that in the Visual component:

ICmpVisual::SetAnimationSyncOffset

ICmpVisual::SetAnimationSyncRepeat

I have not used those functions before, but I imagine you could send a message from the "vampire" entity to the "victim" entity to tell it at which point in time the animations should be synced against.

Link to comment
Share on other sites

Just to bump a bit: Did i say tanks? Did i say tanks? Ignore that boring modern crap.

Here's something vanilla 0ad could definitely use: chariots that don't snap the whole cart-horse assembly towards enemy when shooting, but instead only let the guys turn.

Persian Chariots or Archer cavalry, i dont know XD Edited by Lion.Kanzen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...