• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Compressing object data, removing unnecessary fields

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,685
Hey, could it be possible that if you create an ability based on a hero ability like channel and change some fields but then decide to make it to a unit ability that the fields which only concern a hero ability stay changed?
If so, is there a tool which removes all changes which affect fields which are not important for the unit ability anymore.
The same goes for unit -> item abilities.

It seems that I have a lot of string entries from such fields which are hidden since the abilities are unit abilities now. I'd like to reset/remove them.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I avoid this problem by generating abilities with a special script that can read in object data from text files.

raw4=ABlk
baseid=AEbl
type=abilities
aher=0
alev=1
amcs1=0
anam=Blink(Spirit)
aub11=Teleports the Spirit a short distance.


It's basically a wrapper on top of objectmerger.
Since I have this I can just delete whatever abilities I want to refresh and they'll be back after the next save. Have to close and open the map, but that's not a problem for me.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Well, I do not know if you can generally say that a field is obsolete. E.g. there are 3 different unit types: normal units, buildings and heroes. Only buildings show the "Can be upgraded to" field, yet there are a couple of maps that use this feature successfully and still revert it to a normal unit to gain the traits of both, may not be so obvious what can be useful in the end.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Well, I do not know if you can generally say that a field is obsolete. E.g. there are 3 different unit types: normal units, buildings and heroes. Only buildings show the "Can be upgraded to" field, yet there are a couple of maps that use this feature successfully and still revert it to a normal unit to gain the traits of both, may not be so obvious what can be useful in the end.
In which case the field "can be upgraded to" should be available to all units. Not so much an unused field, but rather an incorrectly hidden field.
 
Level 25
Joined
Feb 2, 2006
Messages
1,685
I've fixed some stuff in the latest version of wc3lib and used the compression for my modification's map and it reduced a great amount of strings since I did not rely on auto generated Object Data. I am wondering now if I should go further and check if the objects are used at all in the map script or better in multiple map scripts since the object data is shared between many maps.

I guess wc3optimizer does the same already but only with one single map script. Besides my goal is not to optimize the map for playing only but to optimize it to reduce the strings in the war3map.wts file further to make the translation process easier.

If anyone is interested in using the current version of my object editor:
- I ported wc3lib to Qt5 and removed dependencies to KDE4 and KF5, so it should be easier to compile it on Windows.
- Unfortunately I still get undefined references for the Boost Libraries on Windows: Using Boost 32 bit libraries on Windows with MinGW32 leads to undefined references
- Linux users should not have any problem compiling it. I will update the RPM soon and upload it here: wc3lib

What do you think of a better search and redo/undo functionality for the Object Editor?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
The strings themselves are represented pretty much the same way in w3a as they are in string tables, with the exception that they are named.
In cases where a string exists in multiple places the string table would be more efficient... except that it isn't, because the optimizer doesn't fix this issue.
I've tested that the string table doesn't detect duplicates at all and neither do optimizers.
I'd like to see an optimizer that deduplicates things within the string table. That would give my use case way more benefit than moving strings into the object data files.
 
Level 25
Joined
Feb 2, 2006
Messages
1,685
I've discovered already two fields of object data which have been compressed by my wc3lib object data compressor but have actually been changed and used:
  • AItx - DataA1
  • Arsg - UnitID
I've checked "AbilityMetaData.slk" in the archive "War3Patch.mpq" and there are no entries for 'AItx' or 'Arsg'.

So I will fix the bug in wc3lib to compress fields which have no entry in "AbilityMetaData.slk" at all. I am just wondering what the field IDs are then.

Btw. I'd like to add a validate/warning function which checks tooltips for not existing object/field IDs or warns if the IDs are not from the current object or anything related. This could help to find wrong entries much faster.
 
Status
Not open for further replies.
Top