Posted: Sun Jan 05, 2020 9:06 pm Post subject:
Mechs with Turrets
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? QUICK_EDIT
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
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. QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Mon Jan 06, 2020 9:40 am Post subject:
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). _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
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 QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Mon Jan 06, 2020 2:44 pm Post subject:
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. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
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.
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. QUICK_EDIT
thank you all again for the hints, I finally had time to look at the matter
I followed the second pchote's suggestion: inspired by Hovers and WithVoxelWalkerBody, I added an ITick interface to WithSpriteTurret, which gradually offsets the turret while the unit is walking or turning, sacrificing the turret recoil
the code is attached, but I guess you could finish it more neatly, my programming talents were spent at TurboPascal lessons
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