Is there any reason to have exactly same battlefields as in H3? Implementing similar algorithm would be easy but creating _same_ algorithm is almost impossible IMO.
Yes it is. Many custom scenarios depend on the battlefield that gives a player huge advantage in some battles vs AI.
Warmonger is right, compatibility is a must, there are few chances someone starts to create new top maps for VCMI, it must improve playability with previous ones.
I contacted PhoMM and sent him here, to give infos about his tool. He made a special editor where we can see each square configuration.
I think we should keep the same BF as in table only for classic terrain or even only for classic (H3M) maps.
If you add new terrain, such TR don't have to have similair BF as original. If we depend on map format it is even easier (but converting could be a problem).
If mods adds new obstacle types for classical TR the map should trigger if use classic or new set (new set = new algorithm) for each terrain independently.
AVS
Joined: 25 Feb 2011 Posts: 153 Location: Russia
Posted: 2012-04-18, 08:55
Warmonger, how to identify objects in maps if IDs are dynamic or MOD-local?
If you mena scripts, they should return map object serial (or wrapper) when it's added to the map. or we cna poll the engine for an object with specific coordinates for example.
If you mean map editor, it should be initalized the same way as modded game, and from the outside we don't need to know object IDs - but of course can check them, as they are part of object itself.
AVS
Joined: 25 Feb 2011 Posts: 153 Location: Russia
Posted: 2012-04-18, 10:54
Warmonger wrote:
What do you exactly mean by "identify"?
If you mena scripts, they should return map object serial (or wrapper) when it's added to the map. or we cna poll the engine for an object with specific coordinates for example.
If you mean map editor, it should be initalized the same way as modded game, and from the outside we don't need to know object IDs - but of course can check them, as they are part of object itself.
I mean map editor & game itself.
"it should be initalized the same way as modded game" - nearly impossible - this requires that both editior and all game installations where map will be used must use exactly same mods (not just have required, but don`t have other. Also this brakes possible forward compatibility between map and newer versions of mod - adding new object change IDs of objects in other mods). So it`s a very bad idea to use dynamically allocated IDs in map file.
Yes, that's exactly what I mean. Obviously you need to have all the mods installed and configured before the map using it runs.
But the trick is to configure mods automatically (including turning unnecessary mods off), according to information included in the map itself.
Now it works just the same way, just you need to have separate installation for each map-mod and pray it's correct :P
AVS
Joined: 25 Feb 2011 Posts: 153 Location: Russia
Posted: 2012-04-18, 15:43
Warmonger wrote:
Yes, that's exactly what I mean. Obviously you need to have all the mods installed and configured before the map using it runs.
Does mods that map not using explicitly are really "unnecessary" for a player? I wish to able to play (f.e. ) a map with random towns with new town that I just created.
Warmonger wrote:
But the trick is to configure mods automatically (including turning unnecessary mods off), according to information included in the map itself.
Now it works just the same way, just you need to have separate installation for each map-mod and pray it's correct :P
BTW, no separate installation is needed with ERAII.
Yes, that's exactly what I mean. Obviously you need to have all the mods installed and configured before the map using it runs.
Does mods that map not using explicitly are really "unnecessary" for a player? I wish to able to play (f.e. ) a map with random towns with new town that I just created.
I believe it's good idea to give mapmaker an option: allow custom mods or allow ONLY mods used for map.
But we're not going to see map editor anytime soon :P
Age: 21 Joined: 08 May 2009 Posts: 631 Location: Ukraine
Posted: 2012-04-20, 15:23
*reads this page*
And this is why I'm against numeric id's - it requires too much magic like "correct load order".
regarding wiki:
Quote:
Discussion: How to differ between numeric IDs, string IDs and wrappers in convenient way? Which of them should be default for user? Which one is recommended?
Numeric Id's - not recommend but available.
Strings - for access to specific object\creature
Wrappers - for cases where string id may be unknown (iteration over all creatures, to get creature type in slot #X of hero army)
I may repeat myself a bit but:
1) Accessing all creatures in game - for example increase HP for all level 7 creatures:
Code:
for creature in engine.creatures.all()
if (creature.level == 7) #or get_level(creature). Whatever
creature.hp += 10
Id's are not needed here (neither numeric nor strings). Modder can't know what mods user have installed and how many creature he has.
2) accessing specific creature - by string
Code:
unicorn = engine.creatures("UNICORN") # I prefer lower-case here but doesn't matters much
unicorn.hp += 10
Numeric ID's are a bad idea here - if modder will add or remove creature he will have to check all usages of specific id's in his mod
Resolving conflicts of string id's:
1) mod does not have access to string id's of other mods (unless they're marked as required or something like "optional")
2) all id's are prefixed by mod name. If this ID doesn't have any conflicts it will be aliased to short version without prefix (typing modname.creature each time will be annoying)
Maps can be considered as mod. All objects on (saved) map will keep their id's as string so there won't be need to have specific load order for mods or to have exact same versions for them and so on.
Quote:
I believe it's good idea to give mapmaker an option: allow custom mods or allow ONLY mods used for map.
Good point but it shouldn't be strict. What if map have some bugs that were not fixed by author and somebody released patch as separate mod? Some warning would be enough.
Id's are not needed here (neither numeric nor strings). Modder can't know what mods user have installed and how many creature he has.
I see you're mising the point. Modders may know well what does their own mod contain, but there are also scripts. A script should be universal, at most allow checking if some other mods are avaliable.
A script (such as growing banks, Artificer) may not know exactly the list of packages installed, but should be able to handle it with backward and forward compatibility. Forward copatibility makes no use of string IDs over numeric IDs.
The scripter may need IDs, the modder shouldn't. The author of package can just have wrappers all the time.
Quote:
if modder will add or remove creature he will have to check all usages of specific id's in his mod
Well, that's why there are multiple conversion / access function - they return ID at run time. Also, every "create" function also returns new ID. You should know that good programming practice already ;)
Also, there is another isue - ERM handling. In ERM only numeric IDs are avaliable and people are used to them, so they should stay just for that reason.
The same is true for VCMI. Armed instances, dwellings - they all use numeric IDs to store information about creatures. If we want to read or change teh creature type, it still will be integer.
Code:
unicorn.hp += 10
Bah, no such thing. It's all handled by Bonus system.
AVS
Joined: 25 Feb 2011 Posts: 153 Location: Russia
Posted: 2012-04-26, 09:15
[quote="Warmonger"]
Quote:
A script (such as growing banks, Artificer) may not know exactly the list of packages installed, but should be able to handle it with backward and forward compatibility. Forward copatibility makes no use of string IDs over numeric IDs.
I don`t think that Artificer can be fully forward compatible (It has settings for particular artifacts), but will be backward compatible with string IDs and will work with new artifacts but ignore them.
But Artificer generally upgrades/changes arts for a price. The script can read tables about artifacts and use it properly independently what is inside.
So if some artifacts belong to same group (ie. Artifact Set) and can be sorted by some value (ie. Artifact Merchant cost), it can surely work with this (most actual upgrades in artificer already work this way, but stuff is precalculated).
AVS
Joined: 25 Feb 2011 Posts: 153 Location: Russia
Posted: 2012-04-26, 12:12
majaczek wrote:
But Artificer generally upgrades/changes arts for a price. The script can read tables about artifacts and use it properly independently what is inside.
So if some artifacts belong to same group (ie. Artifact Set) and can be sorted by some value (ie. Artifact Merchant cost), it can surely work with this (most actual upgrades in artificer already work this way, but stuff is precalculated).
Agreed, this approach is possible. But my message was that even hardcoded string IDs can ensure backward and partial forward compatibility.
You cannot 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