Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
Macron1 topic for different stuff
Author Message
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-09-28, 23:40   Macron1 topic for different stuff

AI/FIGHTING VALUES CALCULATOR v. 0.0.1

Finally my first version of program, which loads values from creature JSON (one creature must be in one separate file, and must not have syntax errors reported by VCMI) and then calculates AI/Fight values and writes them back to file (backup copy of source json is created with json_back extension.

Original formulas of AI/Fight Value are given by GrayFace (http://wforum.heroes35.net/)

Instructions from program:

Quote:

1) Click "Start" and select JSONs for creatures (each
creature must be in separate file).
REMEMBER THAN IF THERE SOME
ERRORS/WARNINGS IN JSONS REPORTED BY
VCMI, CORRECT THEM FIRST.
2) Program will save backup copy (with extension
.json_back), and then
will replace fight value/AI value for selected creatures by
new values.

Program just replaces some first found substrings, not
working with JSON format.
So needed values ("attack","defense","damage", etc)
must each be on one
line in file.

WRONG:
"attack":
3,

RIGHT:
"attack" : 3,

WARNING!
Program now only uses attack, defense, hit points and
damage (min/max)
vaues to calculate AI/Fight Value.
In future some bonus in % to AI/Fight Values is through.
when some
abilities is available.


Currently program doesn't know anything about JSON, it only loads first mention of parameters (like "attack", "defence", "hitPoints" etc) and replaces then first mention of "aiValue"/"fightValue").

Sources are included.

Program is written in Borland C++ Builder 5 (my previous program is written about 1-2 years ago, so I used things I remembered from past, don't expect superb code).
Formulas were given by GrayFace from Wog Forum (http://wforum.heroes35.net/).
I plan to improve it someday).

PS I didn't checked it with antivirus (I'm using build-n Windows 8 antivirus), hope that I have no "guests" on my PC.

AI_Fight_Values_Calculator_V0.0.1.zip
AI/Fight Values Calculator v. 0.0.1
Download 425 Time(s) 23.38 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
Last edited by Macron1 on 2014-03-30, 09:12; edited 1 time in total  
 
     
Randjan 
like games,I study C

Joined: 15 Sep 2012
Posts: 106
Posted: 2013-09-29, 13:17   

Do those values have anything to do with the messages? Because when I played the sw knight mod, it said that lots of peasants were very strong or something like that, and I had quite an army.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-09-29, 13:30   

Randjan wrote:
Do those values have anything to do with the messages? Because when I played the sw knight mod, it said that lots of peasants were very strong or something like that, and I had quite an army.


Yes, you are right. This program corrects AI/Fight Values for monsters. Copy jsons of creatures to temporary folder and run this program on all of them to correct issue.
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-10-01, 20:52   MACRON1 BALANCER v. 0.0.1

MACRON1 BALANCER v. 0.0.1

Original formulas of AI/Fight Value are given by GrayFace (http://wforum.heroes35.net/)

This is my improved version, based on AI/FIGHT VALUE CALCULATOR from first post in this theme.
Now AI/Fight Value is calculated with creature abilities accounting.
For example, TWO_HEX_ATTACK_BREATH is accounted as Max Damage doubled etc.
Other non-direct damage abilities are accounted by some % bonus to final AI/Fight values.

If "Balance creatures abilities" check box is checked, program will also correct attack, damage, defence, hit points and map quantity of creatures lev. 1-7 based on standard creatures boundaries of these parameters. So your parameters will not make your faction too strong.

PS Program is not working 100%, so in some cases after it's work creatures JSONs must be corrected manually for syntax errors to disappear.

So backup your creatures JSONs before using this program on them.

Macron1_Balancer_V0.0.1.zip
Macron1 Balancer 0.0.1
Download 437 Time(s) 39.7 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
Last edited by Macron1 on 2014-03-30, 09:12; edited 1 time in total  
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-10-08, 18:36   DEF CHECKER v. 0.0.1 (Windows only)

DEF CHECKER v. 0.0.1 (Windows only)

Another small utility which was very-very helpful for me to correct a lot of issues.
Run this program, press Start button, and select JSON files of creatures (they must be located in your mod structure, for example, in folder "<name of mod>/config/<name of mod>-creatures/"
Program searches for values of "battle","map","iconsBig","iconsSmall" and checks, that these files are present in "<name of mod>/Sprites/<path from value>/" folders.

Now it works only, if values are on the same line as identifiers.

Example of good JSON information:
Quote:

"animation" : "abode-creatures/battle/Prophet.def",
"map" : "abode-creatures/map/AVWProphet.def",
"iconSmall" : "abode-creatures/iconsSmall/Prophet.bmp",
"iconLarge" : "abode-creatures/iconsBig/Prophet.bmp",


This helped me to figure out a dozens of wrong paths to map animation DEFs, missing missiles DEFs and icons.

PS In plans I have improving of this utility to check existence of sound files also.

PPS This works only with mods, where "Content" folder is not zipped. To use it with zip first unpack contents of "Content.zip" to <name of mod>/Content/

PPPS There were problems with adding attachments, now they are fixed, so I share this tool.
I think I will add later also checking of DEF/Graphics files for heroes JSONs, faction.json and structures.json. But now I don't have time for this.

DEF Checker v 0.0.1.zip
DEF Checker 0.0.1
Download 369 Time(s) 18.53 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-10-12, 18:53   How to ban creatures and heroes

As I wrote earlier, modding system allows to replace all 9 standard towns by new towns.
I think i'll write some FAQ with files and examples later.
The thing is to turn off standard heroes and creatures by setting "special":true to them.
Here you can download "ban-mod", that sets all standard creatures and heroes as special.
Standart heroes will not appear in taverns and on map, if not directly set by map editor.
Creatures will not appear of map if also not set directly on map. Still they will be in standard banks (there is no modding for banks and dwellings yet).

PS This mod is for technical demonstration.
But I think it can be used to play map, where only few heroes set by map creator will fight. And their death will lead to defeat :-)
Mod needs "wog" to run, cause it turns off level 8 creatures also,

ban-mod.zip
ban-mod
Download 371 Time(s) 6.66 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-11-23, 07:24   

MACRON1 PUZZLE TEMPLATE FOR PAINT.NET

I'd like to share PDN multi-layer file for Paint.NET, that I'm using to easily create puzzles for new factions.
It's not classic, I tried only to make easy and quick way for puzzles, not bother with H3 puzzle style.

1) Place picture of correct size (596X546) on "Picture layer".
2) make layer 47 visible (other numbered layers must be hidden). "Save as" 8-bit 00.bmp.
3) Hide 47 layer, make 46 layer visible. repeat this until you have 00-47.bmp on your disk.
JSON puzzle file for them also in archive.
Just rename "mytown" by your town identifier.

PuzzleTemplate.zip
Macron1 Puzzle Template for Paint.NET
Download 400 Time(s) 37.05 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
Last edited by Macron1 on 2014-02-07, 07:39; edited 1 time in total  
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-11-23, 07:31   

STUFF TO MAKE TOWN ICONS AND HALL BACKGROUND

There are 32bit transparent PNGs that can be used to make town icons (they have border and checks on them). Create 2-layer file, on 1st layer place town icon, on second place one of these files.

Also there is multi-layer template (Paint.NET format) for creating town hall backgrounds.
It already has lot of hall icons variants on diff layers.
Remember, that it must be saved as 8-bit PNG file.
Now it's only 8-bit graphics because of limitation of VCMI engine, so if you place picture of background on "background" layer, it can become corrupted in game.
I hope 32-bit support for town icons background is on it's way.
UPG In 0.94b/c/d you can already use 32-bit Hall background, so you can add a layer with background picture under hall icons layer, and get nice looking hall background.

Standard Things.zip
Stuff to make town icons and hall background
Download 377 Time(s) 1.07 MB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
Last edited by Macron1 on 2014-02-07, 07:40; edited 1 time in total  
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2013-12-14, 12:57   VCMI 0.95 MIGRATOR SCRIPT v. 0.2

So VCMI 0.94b is out. I corrected this migration script to convert buildings/faction/structures.jsons to new format and used it on VCMI towns until they converted without errors.
To convert town buildings place this script in one folder with buildings.json/structures.json/faction.json.
To run program without actual correction of initial files you must input command (this will be helpful to look to output of console and see if process had no mistakes):

Code:
./VCMI095_Migrator_Script.pl 0


To run program with changes of files you must input command:

Code:
./VCMI095_Migrator_Script.pl 1


I've tested it, and didn't get errors on my files.

Perl script uses only regular expressions and works only with text, requires no special Perl modules. Script was tested on Debian and Windows 8.1.

PS If there will be more changes in VCMI modding system , I will correct script to fit new expectations...

VCMI095_Migrator_Script_v02.zip
VCMI095_Migrator_Script_v02.zip
Download 342 Time(s) 2.71 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
Last edited by Macron1 on 2014-01-11, 12:52; edited 2 times in total  
 
     
Ivan 
VCMI programmer

Age: 26
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2013-12-14, 13:15   

Quote:
VCMI 0.95 may be out in February 2014

Fixed.
Quote:
PS If there will be more changes in VCMI modding system , I will correct script to fit new expectations...

There is a reason why we have wiki:
http://wiki.vcmi.eu/index...dding_changelog
Complete list of changes since 0.94
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2014-01-11, 23:40   VCMI095 Creature Migrator Script V0.1

VCMI095_Creature_Migrator_Script.pl

This is pure Perl script I wrote to automate migration of creatures JSONs to 0.94b (0.95 actually).

It comments strings in "sound" section, that point to "" (no sound file).
Also it adds "idle":1 to "animationTime" section.

To run program you must write:
VCMI095_Creature_Migrator_Script.pl <path to creature JSON file>
It saves backup copy to same folder and then tries to migrate file to new format.

VCMI095_Creature_Migrator_Script_v01.zip
VCMI095_Creature_Migrator_Script
Download 306 Time(s) 1.36 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2014-02-08, 23:18   BAN MOD v.0.2

BAN MOD v. 0.2 for VCMI 0.94d

Now this mod not only removes standart factions heroes and units from selection, but also removes all standard factions from selection on start!
You can comment in mod.json only those factions that you want to play with.

Now this will work only with maps, where no standard towns are placed in editor.
So if you want to play only with factions of your choice, you must find good map.

ban-mod.zip
ban mod
Download 301 Time(s) 8.49 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2014-10-03, 23:45   

Next version of Macron1 puzzle creation.
Now you need to install ImageMagick on your computer and then do things as described in readme.txt.
You must prepare 596x546 picture to be inserted as puzzle. Then it will be cutted to set of PUZxx.png files. You can quickly make 32-bit puzzles then :mrgreen:

puzzle_generator.zip
Puzzle Generator
Download 233 Time(s) 41.26 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2015-01-16, 19:53   DEF Recoloring Program v. 0.0.1 from Macron1

DEF Recoloring Program v.0.0.2 from Macron1

This program allows to change colors in DEF palette. You can load creature or map object def, and change one colors to anothers. After saving resulting DEF you will get recolored thing.
Now you have mechanism of automatic recoloring using previous recolors.

PS Program is written in Borland Builder C++ 5.0. Program was made quickly, so there is a ugly quickly written code (bydlokod :mrgreen: ).

DEF Recoloring Program v.0.0.2.zip
DEF Recoloring Program v.0.0.2
Download 250 Time(s) 122.53 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
Last edited by Macron1 on 2015-02-14, 00:00; edited 2 times in total  
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 578
Posted: 2015-02-05, 22:11   

BAN MOD v. 0.3 for VCMI 0.97b

Now standard dwellings and banks from HMM3 (not WOG) also banned from map.

ban-mod.zip
Download 280 Time(s) 9.57 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Display posts from previous:   
Reply to topic
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.04 second. SQL queries: 14