View topic - documentation on modrules.lua?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 20 posts ] 
Author Message
PostPosted: 10 Sep 2010, 12:12 
User avatar

Joined: 28 Jul 2008, 05:51
Location: Australia
In every mod I've seen so far this file seems to have been copied from another mod. But where is the documentation on what everything means?

My mod never had this file and it used to work, now I get errors.

Checked the wiki and searched the forums. Searched Google too. Nada.

The only place I haven't checked yet is the source code but I know from experience it isn't always easy to work things out just by reading it.

Is there something I missed?


Top
 Offline Profile  
 
PostPosted: 10 Sep 2010, 15:55 
Imperial Winter Developer

Joined: 06 Feb 2005, 13:42
Location: Indianapolis
Here's ours from IW. I documented it as best I could from reading the source. However, it looks like I last messed with this file in late 2008 so the information might be outdated and there is likely new stuff by now.

Code:
local modrules = {
   reclaim = {
      multiReclaim = false,      -- boolean - allow only 1 or >1 unit to simultaneously reclaim a feature/corpse
      unitMethod = 1,         -- int, 1
      unitEnergyCostFactor = 0,   -- float, 0
      unitEfficiency = 1,      -- float, 1
      featureEnergyCostFactor = 0,   -- float, 0
      allowEnemies = true,      -- bool, true
      allowAllies = true,      -- bool, true
      reclaimMethod = 0,      -- 0 is gradual reclaim (ie a small % is reclaimed every tick)
                  -- 1 is current behaviour - ie one large hit of resources at the end of the reclim period
                  -- >1 is chunky behaviour - reclaim happens in n equal sized chunks
   },
   repair = {
      energyCostFactor = 0.75,   -- how much of the original cost it requires to repair something.
   },
   resurrect = {
      energyCostFactor = 0.5,      -- default: 0.5
   },
   capture = {
      energyCostFactor = 0,      -- default: 0
   },
   transportability = {
      transportGround = true,   -- defaults to true   --Can [x] units be transported?
      transportHover = true,   -- defaults to false
      transportShip = false,   -- defaults to false
      transportAir = true,   -- defaults to false
   },
   flankingbonus = {
      defaultMode=0,      -- defaults to 1
   },            -- 0: no flanking bonus
               -- 1: global coords, mobile
               -- 2: unit coords, mobile
               -- 3: unit coords, locked

   experience = {
      experienceMult = 1.0,   -- defaults to 1.0

      -- these are all used in the following form:
      --   value = defValue * (1 + (scale * (exp / (exp + 1))))

      powerScale = 1.0,   -- float, 1.0
      healthScale = 0.7,   -- float, 0.7
      reloadScale = 0.4,   -- float, 0.4
   },
   fireatdead = {
      fireAtKilled = false,
      fireAtCrashing = false,
   },
   construction = {
      constructionDecay = true,   -- bool, true
      constructionDecayTime = 8,   -- float, 6.66
      constructionDecaySpeed = 1,   -- float, 0.03
   },
   sensors = {
      los = {
         losMipLevel = 4,   -- int, 1, must be -1 < n < 7
         losMul = 1,      -- float, 1
         airMipLevel = 2,   -- int, 2, must be -1 < n < 31
         airLosMul = 1,      -- float, 1
      },
      requireSonarUnderWater = true,   -- bool, true
   },
   nanospray = {
      allow_team_colours = false,
   },
}

return modrules


I'd also look at CA's modrules file since they're probably more up to date.


Top
 Offline Profile  
 
PostPosted: 10 Sep 2010, 22:51 
Moderator

Joined: 19 May 2009, 20:10
SpliFF wrote:
In every mod I've seen so far this file seems to have been copied from another mod. But where is the documentation on what everything means?

Any specific questions?

Quote:
I'd also look at CA's modrules file since they're probably more up to date.

Last time I checked it was complete, I even added stuff set to default values (because people look at CA first).
I used rts/Sim/Misc/ModInfo.* as reference, it doesn't really have much more comments.

Edit: typo


Last edited by SirMaverick on 11 Sep 2010, 15:09, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 11 Sep 2010, 06:07 
User avatar

Joined: 28 Jul 2008, 05:51
Location: Australia
The comments in the the above mentioned examples tell you what values are allowed. They don't tell you what the values do.

Some may be obvious, others not. For example flankingBonus requires an understanding of how the engine handles flanking (and knowing what flanking even means in a global context). You need to know how mip levels relate to line of sight. Understanding reclaim and nanospray requires a knowledge of Total Annihilation.

Are both files even complete lists?

Anyway I don't have any specific question except where is the documentation? Is there a specific file in the source code where these things have further explanation or has it been assumed everybody knows what they mean?

If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.

I don't mean to come off as whiney, I expect there actually isn't any documentation, I'm just urging Spring devs to document these changes as they move things out of the engine or we'll end up with thousands of meaningless configuration options that get set through trial and error. That's no way to make a game.


Top
 Offline Profile  
 
PostPosted: 11 Sep 2010, 11:53 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
SpliFF wrote:
If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.


Shouldn't do that in 0.82+. This works fine for me:

Attachment:
A.sd7 [309 Bytes]
Downloaded 40 times


Top
 Offline Profile  
 
PostPosted: 11 Sep 2010, 15:15 
Moderator

Joined: 19 May 2009, 20:10
SpliFF wrote:
Are both files even complete lists?

As I wrote CA's list seems complete. Source code hasn't changed after last time I checked.

Quote:
Anyway I don't have any specific question except where is the documentation?

Afaik no further documentation.

Quote:
If I have any specific question it's whether or not this file is required. I didn't have it and spring crashed expecting a table to be returned. Can I return an empty table? Many of these values are meaningless to my game. I'd rather leave out what I don't need to keep the mod 'clean'.

Returning empty table sets default values.


Top
 Offline Profile  
 
PostPosted: 12 Sep 2010, 01:14 

Joined: 20 Feb 2010, 12:17
the

Code:
   transportability = {
      transportGround = true,   -- defaults to true   --Can [x] units be transported?
      transportHover = true,   -- defaults to false
      transportShip = false,   -- defaults to false
      transportAir = true,   -- defaults to false
   }


could use a

allowEnemies = true, -- bool, true

so people could disable transports kidnapping enemy units.


Top
 Offline Profile  
 
PostPosted: 12 Sep 2010, 01:25 

Joined: 17 Nov 2005, 00:52
Location: Canada
See the transportByEnemy unitDef tag.


Top
 Offline Profile  
 
PostPosted: 23 Sep 2010, 23:22 

Joined: 20 Feb 2010, 12:17
trepan wrote:
See the transportByEnemy unitDef tag.


[opens the wiki]

http://springrts.com/wiki/Units:FBI
...
http://springrts.com/wiki/All_FBI-varia ... lt%2C_type
...

it isn't there ._.

But it shows up on some posts.

There's a post by smoth from 2007:
Quote:
transportByEnemy=0;

Fixes all unit naping.


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 19:30 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
18+ month bump:

http://springrts.com/wiki/Modrules.lua

Go forth and find errors, my minions. 8)


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 21:56 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
allow_team_colors just got removed:
https://github.com/spring/spring/commit/25aad4b1341f0132f38b02438a2c2006e0d99158


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 22:25 
User avatar

Joined: 13 Dec 2010, 10:26
We use nano spray tag in tech annihilation . As nano spray is colored per faction not per team. Removal of tag was unwelcome imho


Top
 Offline Profile  
 
PostPosted: 03 Apr 2012, 23:43 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Is there a way for gamedevs to replace this? If it exists, please post it for the xta guy and drama avoided.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 02:02 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Quote:
s nano spray is colored per faction not per team.
i guess the nanoColor tag in unitdefs still works


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 05:09 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Nevermind, changing that was stupid. Who is "RT?"


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 06:40 
Moderator

Joined: 12 Oct 2007, 08:24
I think allowUnitCollisionDamage = false disables all damage caused by unit-wreck, unit-unit and unit-ground collisions.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 08:17 
User avatar

Joined: 13 Dec 2010, 10:26
Just checked and team color nano spray overrides any unidef setting.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 13:37 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
knorke wrote:
Quote:
s nano spray is colored per faction not per team.
i guess the nanoColor tag in unitdefs still works
Forboding Angel wrote:
Nevermind, changing that was stupid. Who is "RT?"


if the tag knorke cited works then I don't agree forb.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 14:01 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
It works but the players team-nano setting takes priority over it <-- should be fixed.


Top
 Offline Profile  
 
PostPosted: 04 Apr 2012, 23:32 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
agreed


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.