:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Wed Apr 08, 2020 1:08 pm
All times are UTC + 0
 Forum index » Modding Central » OpenRA Editing Forums
Mechs with Turrets
Moderators: Global Moderators, OpenRA Moderators
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
ivicok
Civilian


Joined: 10 Nov 2019

PostPosted: Sun Jan 05, 2020 9:06 pm    Post subject:  Mechs with Turrets Reply with quote

While there are many nice mech models in the forums, both the old engines and OpenRA make their animations aesthetically lacking in comparison to things like this:



In C&C games, the turret hovers at a constant height over the legs. Would it be possible to add a feature to sprite renderer or something like that, which would make the turret tilt along the vertical axis when playing the move sequence?

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Mon Jan 06, 2020 12:59 am    Post subject: Reply with quote

i agree and would appreciate something like that.

Though tilting may not be possible since they are 2D sprites and not voxel.

One way i imagine could work is, if the modder can set the parameters for  the size and height of an infinity 8 curve along which the turret offset moves. As this resembles the body's sway and bob during a walk cycle.
With 2 parameters for lateral width and height, this could be adjustable for many types of walk cycles.

e.g. setting its width to 0, and only the height, the turret offset only moves up/down in center by the specified height

if you set height and width, the turret offset moves along this infinity curve and thus gives it the swaying movement, just like the legs under it.

The curve would perform a full loop for every walk cycle.
A few keys may be necessary to give the modder the chance to adjust the starting position along the curve, to match the start position of the walk animation.
_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
ApolloTD
Commander


Joined: 19 Nov 2003

PostPosted: Mon Jan 06, 2020 8:27 am    Post subject: Reply with quote

That particular gif example from mech warrior 2d game(?) is rendered with a fixed (non-rotating) turret thus whole unit had to turn face target in exchange for this 'animating' up and down side motion.

Being a norm in all 2D games to choose the trade off as sprites are not 3d models and can not tilt. There is not single one 2D game I know of that animated such up and down/side motion with a separate rotating turret.

Idea is good food for thought but practical side is problematic thus why it has not been done apart from 3d model games that are entirely different ballpark.

LKO's outlines some nice thought into it but would be very finicky system trying ensure a sync between separate turret and body as neither is aware of the other's doings and usual scenario is it often would have a motion sync fail and do nonsensical things if player suddenly turns during cycle etc.

In Tiberian Sun we already saw the failure of the voxel barrels allowing them rotate vs target without limiting system and if was too close, the whole barrel would end up disconnected visually from the sprite body.


It would need some coded sync frames that tell where turret should be during this particular body walk cycle but thats some major headache coding for nice visual purely only.

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyörgy, Hungary

PostPosted: Mon Jan 06, 2020 9:40 am    Post subject: Reply with quote

I can imagine something could be plausible, say, with a BobbingTurreted child class of Turreted which defines the bobbing offsets and and speed, and enabled with the moving condition.

Take note that this wouldn't affect artwork and it should be the modder which would sync BobbingTuttered with the artwork bobbing. ORA has a clear mindset that artwork should not bleed back into game logics (with make animation's length defining it's effect's length being a legacy exception rather than the norm).
_________________



AS Discord server: https://discord.gg/7aM7Hm2

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
ivicok
Civilian


Joined: 10 Nov 2019

PostPosted: Mon Jan 06, 2020 1:47 pm    Post subject: Reply with quote

I couldn't find a suitable gameplay video from MechCommander, the idea came to my mind as I played the more recent game called Brigador, which seems to be also sprite-based (I don't have the code though) - https://youtu.be/7A-8eclQwLE?t=97

so you mean OpenRA.Mods.Common/Traits/Turreted.cs to be the right place to try? the moving condition would cause the bobbing and when it's false, then the default position (WVec?) would be restored

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyörgy, Hungary

PostPosted: Mon Jan 06, 2020 2:44 pm    Post subject: Reply with quote

There is no function currently for this, but i can imagine something could do.

I'm at work atm, but yes, I'd try creating a wobbling offset which I'd add to to Turreted.Offset in a child class.
_________________



AS Discord server: https://discord.gg/7aM7Hm2

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
pchote
Grenadier


Joined: 06 Feb 2015

PostPosted: Tue Jan 07, 2020 3:08 pm    Post subject: Reply with quote

The engine supports the features needed for mods to implement frame-specific offsets, but the default sprite and sequence parsers do not use it because (1) the implementation details depend too strongly on the specific file format, and (2) it would break our philosophy of making sure that gameplay simulations can be done without requiring the game assets.

It is fairly straightforward for mods to add this, following the example from KKnD.
  1. Read the offsets/angles while parsing the frames inside your ISpriteLoader implementation, then expose them as an array in the metadata dictionary.
  2. Fetch these offsets when loading the frame inside your ISpriteSequence implementation and store them in whatever way you find the most convenient to access later (I would personally have used a private array and exposed a public Offset GetEmbeddedOffset(int frame) for consistency with GetSprite)
  3. Read the offsets stored in the sequences from your traits (I would personally have offset the turret itself rather than just the model, but KKND's combat logic models everything relative to the unit center)

This can all be done in your mod dll within a standard mod SDK project, without touching any low-level engine code.

If you can model the motion programatically (e.g. using a sine curve) then you can skip most of the complexity about by adding this directly in a Turreted (or WithSpriteTurret) subclass.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
 Forum index » Modding Central » OpenRA Editing Forums
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1430s ][ Queries: 10 (0.0187s) ][ Debug on ]