Proposal for creature config

Values from cranim.txt? They may cause some incorrect positioning but nothing else.
I know how to get correct values from hota files - will fix this later.

Kinda. Right now engine will crash if neither msk nor msg were found.
But these files are almost unused - all vcmi needs is width and height of the object. Which can be moved somewhere else if needed.
Think this should be part of new objects for adventure map format instead of creatures. Unless you really want to get rid from them.

Fixed mod with Pirate sounds and teleporting Nymph.
HoTAmod.rar (2.41 KB)

One more update: dl.dropbox.com/u/22372764/vcmi/ … atures.zip
Changes:

  • correct projectiles for pirates\sorceresses (note that pirates bullet is small and hard to notice)
  • imported values from cranim.txt
  • test map is part of mod, does not need manual placing into maps directory
  • proper plural names for creatures

Meh, still buggy :o

-Fixed Ayssid large icon
-Fixed Corsair -> Seadog upgrade

dropbox.com/s/wq28dkdsnrcot … ackage.rar

Minor change in format with rev 3005:
Instead of

"creatures":

    { ... },
    { ... }
]

VCMI will work with this:

"creatures":
{
    "creature1" : { ... },
    "creature2" : { ... }
}

Updated json in attachment
mod.json.zip (2.93 KB)

Here my feedback on the current format present in the Wiki Pages:

  • “cost” : [1500, 0, 0, 0, 0, 0], - gold first (and it can be gold only). keeps file and file reading shorter/faster. More verbose does not mean always better. I think it is quite easy format to use.
// normal growth in town or external dwellings
	"growth" : 0,
 
	// growth bonus from horde building
	"hordeGrowth" : 0,

The 2 above are not creature properties but building properties.

// initial size of creature army on adventure map
	"advMapAmount" :
	{
		"min" : 0,
		"max" : 0
	},

Again not a property that a creature should have.

// Creature is 2-tiles in size on the battlefield
	"doubleWide" : false,

DoubleWide hints to 2 hex creatures only. (Now not supported but multihex creatures should be possible). So rename to “footprint” and values should be: SINGLEHEX, DOUBLEHEX, 232, etc.

  • One new stat entry: Initiative (see/discuss here)
"cost" :
{
    "gold" : 1000
}

Looks fine for me. You do not need to specify all 7 resources.
Another option is to allow singe number (for gold) instead of structure but definitely “no” to array:

"cost" : 1000

Possibly but:

  1. This is how H3 handles this. We would need to think of some workaround for H3 creatures
  2. growth is used also for growth of external building, including some creatures like gold golems who have no town buildings.

I agree with you on hordeGrowth but I don’t see any need to invent workarounds to move this value in towns. Something to think about when we’ll work on configurable buildings.

Why? If you consider this to be property of adventure map object then this would need to wait until map modding will be implemented.

"cost" :
{
    "gold" : 1000
}

Is indeed ok. I was under the impression that array and the possibility to use only gold was ditched in favor of the verbose specification.

For creature growth like in H3. I see this “creature structure” as VCMI’s and independent of H3. Without knowing the internal constrains I would say that VCMI shout have the structures that make sense and from where those get the info (different H3 files) is another thing. (IF the goal is just to copy mod files and the mod will work than that is another thing altogether). (Backwards compatibility is a bi**h…)

Regarding the attributes that are temporary there, it would be better to mark them as so.

Agreed that in future growth, horgeGrowth should become bonus of town/dwelling (but not only).
This allows more clear implementation of f.e.

  • wog`s mithril enhancements in case of dwellings.
  • wog`s creature generation by artifacts.

and also generalization of growth handling in towns.

All values not present in config will be replaced by default value during loading. For numbers default is 0, for strings default is empty string and for boolean this is “false”.

Take a look on creature configs in “cove” mod - for most creatures only gold is specified for cost, some optional parameters like hordeGrowth are also missing.

As for growth: it will definitely stay at least till both configurable buildings and map modding will be implemented. But why should a modder specify growth separately for town building and adventure map object? From my point of view having growth as creature property is more logical.

Horde growth is another thing: right now you just can’t move it to buildings - configurable buildings must be implemented first.
After this will be done - “hordeGrowth” will most likely remain as default value for town hordes. The field is likely to remain at least internally but may be removed from json config. Still a bit too early to say.

I usually place TODO mark near fields that may be removed\changed. Probably missed this one.

Both can and should be handled by script rather than a config, which is static and cannot change during game.

BTW I didn`t mention “config”. I think that scripts should use bonus system too (in this case change bonuses on-the-fly).

Now that you’ve mention it… The growth rates could be separated to allow more freedom :D. (Pyre problem comes to mind). But there should be a limit until someone requests it specifically.

So we were in agreement there: same growth for both, we just do not agree where to specify the growth :D. Logical ^^ would be in the config for the specified dwelling. And that one will be propagated automatically to town when you instantiate a dwelling inside. (We agree to disagree :slight_smile: )

How about “forseeing” initiative? No opinions on that ?

It will be possible to make town dwellings function as both dwelling and horde at once or any other combination of functions.
So if you have creature with growth 10 and want to give town dwelling growth of 7 you will:

  1. Turn building into dwelling (total growth=10)
  2. Turn building into horde with growth -3 (total growth=7)

This is not how our system works internally. You don’t “instantiate” a dwelling. Instead town is essentially a dwelling and shares most of mechanics with external dwellings.

And what happens when creature is available in multiple dwellings? In H3 you can recruit elementals in 3 different dwellings:

  1. One shared elemental conflux
  2. Big version of dwelling, coming from RoE IIRC.
  3. Small version of dwellings, placed as random dwellings for Conflux.

Growth of which dwelling town building should choose?

I won’t mind but somebody would need to implement this. Somebody who more familiar with this area than me.

Maybe we use same name for different things but here my problem with that. Horde building as in H3 horde building is and extra building that:
1: increases said creature production
2: makes said growth immune to plague.

So it is not good to use this horde dwelling trick (for Pyre for example).

Here I am not so knowledgeable. From memory I think that like for every other castle there is one building exactly like the one present in town. That one should be used. To turn this around for you, if you have 3 different buildings and the growth is stored in creature config, how do you make the 3 have different growths?

I doubt that this part (plague immunity) is implemented right now. Interesting - is this a bug or feature of H3?

Anyway - all growth-related objects (castle, grail, hordes, legion parts\statue) use exactly same code. So plague immunity should be a separate option, not a part of “bonus growth” mechanics. So -3 horde is still valid.

Not anymore - see HotA :stuck_out_tongue:
There is no direct connection between town and external dwellings so there is no “exactly same” dwelling or primary dwellings or anything like that. What we have is

  1. Town which is (by itself) dwelling that produces some creatures
  2. Dwelling(s) that produce creatures and give +1 bonus to growth in towns

Why would someone do that? All creatures are connected to some towns (or are neutral). Town does not need to have more than one dwelling of a creature.
Yes - you can set creature as recruitable in another town but I doubt someone will use that - this creatures will be “alien” to town.

In short:
There is no easy way to connect dwellings and towns. The only viable option is to make town growth and external dwelling separate but this may be confusing to modders.

Standard H3 feature. If it started as bug… do not know. I consider it adds a little more depth to the game then if all creatures plagued.

Maybe if you indulge a last attempt from my side. I think I am still not understanding something. Here my understanding of how town (should produce)produces units, maybe you can spot out what I did not get.

Town by itself produces 0 units, but it has dwellings that will produce units. Town has some extra structures (citadel/castle/horde dwelling/grail) that modify these numbers. The same number produced by dwelling in town is produced outside town, because in fact they are another instance of the same building.

I just used your example of con-flux with 3 buildings for elemental. In your case (growth in creature config) all share same growth.

Here is short description on how dwellings\towns work in VCMI:
We have two c++ classes:

class Dwelling: public MapObject
class TownInstance : public Dwelling

So town is always a single dwelling. When you build some creature-producing buildings list of available creatures will be modified but there won’t be any new objects created.
On new week game will calculate growth based on presence of some buildings.

For external dwellings behaviour is mostly same but growth and available creatures are constants.

So you don’t instantiate dwellings - towns and dwellings are completely independent structures.

Yes - all external dwellings will always use the same growth. And there is no way to change that.
However I don’t remember requests like this anywhere. It seems that most people are satisfied with current situation.

And don’t forget scripts - this is what we should use for something significantly different from H3.

Does editing standard (those already added) creatures with mod’s .json files already work? Or are we just limited to adding new creatures for now? If editing the old ones is possible, then how to do this properly? I’m trying to change some values and names, but game crashes on startup if I use existing creature identifier (like “pikeman” or “archer”…). It crashes even on simpliest code like:

{
“pikeman”: {“name” :{“singular”: “Peasant”, “plural”: “Peasants”}},
}

or:

{
“pikeman”:
{
“attack” : 1,
},
}

It’s strange, because it doesn’t crash for newly added creatures.

Right now only new creatures can be added. Support for editing existing creatures will be implemented later.