Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 9:01 pm
All times are UTC + 0
Modding questions
Moderators: Global Moderators, OpenRA Moderators
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
EVA-251
General


Also Known As: evanb90
Joined: 20 Feb 2005
Location: o kawaii koto

PostPosted: Sun Jan 22, 2017 6:37 pm    Post subject:  Modding questions Reply with quote  Mark this post and the followings unread

So, it's that time of the year where I try to make a Classic RA mod for OpenRA...

What I've been working on is adding National bonuses back to the game (German gains +10% firepower, French get +10% ROF, etc)

I added the bonuses as upgrades inherited by all the base unit types, like this:
Code:
^NationalBonuses:
   FirepowerMultiplier@GERMANY:
      UpgradeTypes: GermanyFP
      Modifier: 110
   DamageMultiplier@ENGLAND:
      UpgradeTypes: EnglandARM
      Modifier: 90
   ReloadDelayMultiplier@FRANCE:
      UpgradeTypes: FranceROF
      Modifier: 90
   SpeedMultiplier@UKRAINE:
      UpgradeTypes: UkraineSP
      Modifier: 110
   GlobalUpgradable@France:
      Upgrades: FranceROF
      Prerequisites: FrenchROF
   GlobalUpgradable@German:
      Upgrades: GermanyFP
      Prerequisites: GermanyFirepower
   GlobalUpgradable@England:
      Upgrades: EnglandARM
      Prerequisites: EnglandArmor
   GlobalUpgradable@Ukraine:
      Upgrades: UkraineSP
      Prerequisites: UkraineSpeed
^Vehicle:
   Inherits@1: ^ExistsInWorld
   Inherits@2: ^IronCurtainable
   Inherits@3: ^SpriteActor
   Inherits@4: ^NationalBonuses
   Inherits@5: ^CrateBoons

This part works fine, my questions relate to Russia's bonuses, and how to grant the other nation's bonuses.

Regarding Russia's: is there no way to modify unit prices? I checked the wiki and unless I missed something, it seems that giving Russia discounted prices would involve making variants of every unit/building with a 10% markoff.
Right now, I'm using Faction specific production queues to give them a 10% build speed bonus on everything.

Regarding the other nation's bonuses: Is there a way to grant these upgrades on game start? Right now, my approach is to grant them with this code on the Construction Yard
Code:
ProvidesPrerequisite@ENG_Flavor
      Factions: england
      Prerequisite: EnglandArmor
      ResetOnOwnerChange: true
   ProvidesPrerequisite@FRA_Flavor
      Factions: france
      Prerequisite: FrenchROF
      ResetOnOwnerChange: true
   ProvidesPrerequisite@GER_Flavor
      Factions: germany
      Prerequisite: GermanyFirepower
      ResetOnOwnerChange: true
   ProvidesPrerequisite@UKR_Flavor
      Factions: ukraine
      Prerequisite: UkraineSpeed
      ResetOnOwnerChange: true

But this creates a few problems..
-Nations don't get their bonuses without a deployed construction yard.
-ResetOnOwnerChange can be bypassed by producing an MCV from a captured War Factory, allowing for players to get multiple national bonuses. (ResetOnOwnerChange isn't desirable on the WF itself)

Is there a more effective way to grant the upgrades that doesn't suffer from these two issues?

Unrelated to these issues, more of a general curiosity:
What is ORA's default tickrate for unit logic? Searching through the GitHub suggests 25, but many values in the base RA mod are directly copied from RA and its 15/s rate.

_________________
YR modder/artist, DOOM mapper, aka evanb90
Project Lead Developer, New-Star Strike (2014-)
Former Project Lead Developer Star Strike (2005-2012), Z-Mod (2006-2007), RA1.5 (2008-2013), The Cold War (2006-2007)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
pchote
Rocket Infantry


Joined: 06 Feb 2015

PostPosted: Sun Jan 22, 2017 7:40 pm    Post subject: Re: Modding questions Reply with quote  Mark this post and the followings unread

EVA-251 wrote:
Regarding Russia's: is there no way to modify unit prices?
Nothing has been implemented yet, but it would be relatively straightforward to implement an interface and modifier trait for unit values/prices.  The main thing is to work out the desired behaviour when the price modifier changes in the middle of building a unit.

EVA-251 wrote:
Regarding the other nation's bonuses: Is there a way to grant these upgrades on game start? Right now, my approach is to grant them with this code on the Construction Yard
You should be able to define these on the player actor to make them available for the entire game.

EVA-251 wrote:
What is ORA's default tickrate for unit logic? Searching through the GitHub suggests 25, but many values in the base RA mod are directly copied from RA and its 15/s rate.
It is indeed 25 ticks per second at the default game speed.

Back to top
View user's profile Send private message
EVA-251
General


Also Known As: evanb90
Joined: 20 Feb 2005
Location: o kawaii koto

PostPosted: Mon Jan 23, 2017 4:04 am    Post subject: Reply with quote  Mark this post and the followings unread

Thank you, putting that code on the Player actor fixes the issue I was having completely!

_________________
YR modder/artist, DOOM mapper, aka evanb90
Project Lead Developer, New-Star Strike (2014-)
Former Project Lead Developer Star Strike (2005-2012), Z-Mod (2006-2007), RA1.5 (2008-2013), The Cold War (2006-2007)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
EVA-251
General


Also Known As: evanb90
Joined: 20 Feb 2005
Location: o kawaii koto

PostPosted: Thu Feb 09, 2017 8:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

I ran into another issue, this time related to England's damage multiplier bonus.

So I'll present two scenarios, Scenario A and Scenario B
In A, it's Base E1 vs Base 1TNK
In B, it's Base E1 vs English 1TNK (.9 damage multiplier)
E1's weapon is 15 damage, 25% vs Heavy armor


with RA,
A) results in 4 damage per hit (15 * .25 = 3.75 = 4); a modded 1TNK with 60 HP took exactly 15 hits to die
B) results in 3 damage per hit (15 * .25 * .9 = 3.375 = 3); a 60HP 1TNK took exactly 20 hits to die


in ORA, I know the damage calculation's result is directly stored to an integer, so
A) results in 3 damage per hit (15 * .25 = 3.75 = 3)
but curiously
B) results in 2 damage per hit, which to me suggests damage multipliers are applied as part of another calculation
(15 * .25 = 3.75 = 3; 3 * .9 = 2.7 = 2)

Sure, for most weapons, this only results in a minor discrepancy:
2TNK vs Light armor yields 22 damage when it should be 23, and vs English light armor yields 19 when it should be 20, for example.
But for mods that have weapons balanced around high ROF, low damage, this can have a noticeable impact.


I've already gone ahead and multiplied all damage/strength values by 10 to help work around this issue on my end, but the behavior with damage multipliers seems off, so I figured I'd still post about it.

_________________
YR modder/artist, DOOM mapper, aka evanb90
Project Lead Developer, New-Star Strike (2014-)
Former Project Lead Developer Star Strike (2005-2012), Z-Mod (2006-2007), RA1.5 (2008-2013), The Cold War (2006-2007)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Fri Feb 10, 2017 6:47 am    Post subject: Reply with quote  Mark this post and the followings unread

See https://github.com/OpenRA/OpenRA/issues/11425 which is an actual case where this was the issue and the discussions in https://github.com/OpenRA/OpenRA/issues/11719 and https://github.com/OpenRA/OpenRA/pull/11852 regarding your solution (which I consider appropriate, but apparently some doesn't).

To answer your initial question - yes, warhead verses and falloff multipliers are calculated during the warhead trigger, and only the result of that calculation gets passed to the actual actor's Health trait which will apply the damage multipliers in another run. I wouldn't call this behavior a bug to be honest, because the two calculations should indeed be separated (especially if multiple healths ever happen).

_________________
"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...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
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.1407s ][ Queries: 11 (0.0078s) ][ Debug on ]