Warcraft II Forum

Warcraft II => Mods & Development => Topic started by: tupac on June 24, 2016, 02:28:18 AM

Title: Remove unit limit map editor
Post by: tupac on June 24, 2016, 02:28:18 AM
From dijhkahn @ occult forums

   Fix for War2 Map Editor 'Player X has too many units.'
I'm guessing no one cares, but here it goes...

The Map Editor only lets you save maps with a certain amount of units per color. The limit seems to be 600/#colors. So for an 8-player map the limit is 600/8 = 75 units per color.

But, there is a way to get rid of this limit:

- Make a backup copy of "Warcraft II Map Editor.exe", in case something goes wrong
- open "Warcraft II Map Editor.exe" in a hex editor
- look at byte location B9E5, and verify that the value is 02
- change the 02 to a 40
- save the file

Or, I'll upload the modified EXE sometime, if people actually want it : )


for non-English languages, search for the byte sequence b8 58 02 00 00 99 f7 ff and change the 02 to 40
Title: Re: Remove unit limit map editor
Post by: salvadorc17 on June 24, 2016, 08:31:06 PM
Good finding, still the problem should exist in the game, so better will be to find how to remove pop cap in game..
Title: Re: Remove unit limit map editor
Post by: Tilogour on July 03, 2016, 08:29:50 AM
It will be helpful if you upload exe
Title: Re: Remove unit limit map editor
Post by: tupac on July 05, 2016, 01:28:09 AM
It will be helpful if you upload exe
It's very simple.
Get warcraft 2 map editor .exe
Download Hxd editor
Open the map editor exe with Hxd
Search for these bytes

 b8 58 02 00 00 99 f7 ff

Should take a second

Replace 02 with 04

Then click save.

You just patched your war2 editor to not have a limit on units. But war2xed editor already capable of this. Over a certain amount they won't appear when you play the map.
Title: Re: Remove unit limit map editor
Post by: easycompany on July 05, 2016, 01:33:57 AM
yeah i tested it with minions thought i could bypass...800 or so it stops.

there is maybe another way but would be alot of work.
Title: Re: Remove unit limit map editor
Post by: tupac on July 05, 2016, 02:10:09 AM
yeah i tested it with minions thought i could bypass...800 or so it stops.

there is maybe another way but would be alot of work.
We could try to locate the one on the exe side. Been so lazy never even looked. Been reading about our map editor.
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 11, 2017, 06:37:21 AM
okey i try to change 02 -> 04 but if i change and click save then reload its still 02
Title: Re: Remove unit limit map editor
Post by: easycompany on January 11, 2017, 02:30:45 PM
unit cap can exceed 200 units, with the -1 value set on farms ...but havent looked at it in awhile or is it even needed.

but this is in exe not the map editor.

it should set swaz. u using hxd?
Title: Re: Remove unit limit map editor
Post by: easycompany on January 16, 2017, 03:46:09 PM
ahh i see what he is saying! program files likes to make sure people dont mess with them..take the file out and doit in c:\new folder etc..
and take off read only on the folder...dam these newer windows is nothing like win98 days  >:(
there it is if u wanna try it.i havent.

Title: Re: Remove unit limit map editor
Post by: Szwagier on January 16, 2017, 05:16:18 PM
thank you  :D
yes my main w2bne is in program files
Title: Re: Remove unit limit map editor
Post by: tupac on January 16, 2017, 07:49:27 PM
The other war2 editors don't have a unit cap. I was bored one day and filled every spot with a cpu unit. When I load the map most units are gone. But open editor and they are in the map. I think we would have to hex war2 unit limit also for this to fully work.
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 16, 2017, 08:45:17 PM
would be nice if u try add ai in ai.bin i tried but failed many times ^^
Title: Re: Remove unit limit map editor
Post by: tupac on January 16, 2017, 09:02:22 PM
would be nice if u try add ai in ai.bin i tried but failed many times ^^
That's easy! Use wardraft 2 export the AI and create it. Then get a MPQ editor rename the file to ai.bin and place where the old one I'd in mpq then load ur map it plays your custom AI.
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 17, 2017, 05:50:36 AM
Ok i will try it, i was copying in hex one ai i thought it will double it and icould change it

ok it isnt work. how u are doing it? i can save files as "aaa" but i still cant add(for example last ai is orc 3 how to add orc 3d?

(http://s5.ifotos.pl/mini/lastaipng_aeeqpxr.png) (http://ifotos.pl/z/aeeqpxr/)

This is last ai in file human 9d(white) how to make 2 ai ?for example human 9d(white) human 9E(white)?
Title: Re: Remove unit limit map editor
Post by: tupac on January 17, 2017, 11:49:00 AM
https://web.archive.org/web/20150424013642/http://www.warlords-of-warcraft2.com/index.php/new-computer-ai (https://web.archive.org/web/20150424013642/http://www.warlords-of-warcraft2.com/index.php/new-computer-ai)
Title: Re: Remove unit limit map editor
Post by: easycompany on January 17, 2017, 02:56:19 PM
[url]https://web.archive.org/web/20150424013642/http://www.warlords-of-warcraft2.com/index.php/new-computer-ai[/url] ([url]https://web.archive.org/web/20150424013642/http://www.warlords-of-warcraft2.com/index.php/new-computer-ai[/url])

 mmm 2014 i wonder who these dudes was.
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 17, 2017, 05:10:38 PM
ok  i see u dont understood ...
There are 4 basic ai LANDATTACK SEAATTACK AIRATTACK AND PASSIVE, and i want make for example
LAND ATTACK SEA ATTACK AIR ATTACK AND PASSIVE +LAND ATTACK2 LANDATTACK3 LANDATTACK4 SEAATTACK2
so it was 4 ai now i want to be 8 how to do it ?? (without replace ai from campaign)
Not replace LANDATTACK with new sets but make new ai and save it as new ai

This link show how to write new ai and save as LAND ATTACK SEA ATTACK AIR ATTACK AND PASSIVE
Title: Re: Remove unit limit map editor
Post by: easycompany on January 17, 2017, 05:19:56 PM
tupac usually post info,
i dont know  if anyone has messed with the ai besides you in a long while.
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 17, 2017, 05:53:45 PM
i said would be nice if he try and he said its easy but he gave link how to replace not how to add new, its rlly hard when u got one ai for 3 enemies and they got the same ai and 2 of 3 get stuck cause they cant get ogres casue no mound but 1 can -_-(ofc i can give them also but it is not fun when there will be 3 the same ai, same time attack, same group etc)
Title: Re: Remove unit limit map editor
Post by: easycompany on January 17, 2017, 07:44:33 PM
ug following other people is never easy war2 isnt that easy .....like me u just gotta pop a beer get a joint and let it tell you how its made.
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 17, 2017, 08:30:19 PM
mini map looks nice :P also i got question how to add mission? i understnad that must be wall of txt and some1 should say that :P but how to change that last wall of txt will be after 13 mission not 12?(dark portal got only 12 missions)
Title: Re: Remove unit limit map editor
Post by: tupac on January 17, 2017, 09:21:18 PM
i said would be nice if he try and he said its easy but he gave link how to replace not how to add new, its rlly hard when u got one ai for 3 enemies and they got the same ai and 2 of 3 get stuck cause they cant get ogres casue no mound but 1 can -_-(ofc i can give them also but it is not fun when there will be 3 the same ai, same time attack, same group etc)
Yes i understand you now. I'm sure those other AI are not new they are blizzards campaign AI with a different name. Correct me if I'm wrong but making a new AI and not modifying one. Should be as simple as changing the name and adding the new name to the MPQ file holding those names. Havent tried but I think that's how it would work or close to it.

When I have time I can try, maybe this weekend idk. Give it a shot and go explore it.
Title: Re: Remove unit limit map editor
Post by: tupac on January 17, 2017, 09:28:00 PM
i said would be nice if he try and he said its easy but he gave link how to replace not how to add new, its rlly hard when u got one ai for 3 enemies and they got the same ai and 2 of 3 get stuck cause they cant get ogres casue no mound but 1 can -_-(ofc i can give them also but it is not fun when there will be 3 the same ai, same time attack, same group etc)

Did you use the map editor to set each player to the AI you created?
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 18, 2017, 04:40:32 AM
Yes and no, 2 players got another ai but one got the same and he is going stuck, i used even land air sea and passive in my campaign
Title: Re: Remove unit limit map editor
Post by: Lambchops on January 18, 2017, 07:31:01 AM
Mostly just to distract myself from more important stuff I should be doing, I made a little exe to patch/unpatch the map editor (any version).

Also the source code is attached if anyone's interested.

Title: Re: Remove unit limit map editor
Post by: salvadorc17 on January 18, 2017, 04:37:26 PM
The other war2 editors don't have a unit cap. I was bored one day and filled every spot with a cpu unit. When I load the map most units are gone. But open editor and they are in the map. I think we would have to hex war2 unit limit also for this to fully work.

Talking about this hack, will also alow to increase game population capacity??
Title: Re: Remove unit limit map editor
Post by: easycompany on January 19, 2017, 09:20:22 PM
yes u can salv but i forgot loool u got to set something to -1 and it will keep going forever....welcome to the exe
Title: Re: Remove unit limit map editor
Post by: easycompany on January 19, 2017, 11:39:03 PM
i did it in section 2 of that post "im back" ...but its still isnt really useful...until some one can make a big map.


in wargus u can..currently studying it.
--  All player food unit limit
SetAllPlayersUnitLimit(200)
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 22, 2017, 12:45:33 PM
did u try add ai?
Title: Re: Remove unit limit map editor
Post by: easycompany on January 22, 2017, 06:55:25 PM
ive not messed with ai,i played a map with custom ai..in wargus it is probably in the ai folder in scripts folder.
Title: Re: Remove unit limit map editor
Post by: Lambchops on January 23, 2017, 04:34:55 AM
I've never looked for it, but in theory the 200 food max per players cap should be pretty easy to lift, of course all players would have to be using the same modded exe version or it would just desync and drop.

The global max unit limit is another matter however - that's the "unable to create unit" or whatever message you get sometimes in huge games. There's physical limit of 1600 (i think, from memory) units in any one game hard coded into the exe. This includes everything, "units", buildings, gold mines, dead bodies etc., and I assume the "unable to create" limit cuts in with a bit of leeway like maybe at 1500 or so...

So for example, a 2v2 player game where everyone has a 300 food cap could be achievable, but it's unlikely to make much difference to big 4v4 games as you will still hit the global cap. Worth looking at tho :)
Title: Re: Remove unit limit map editor
Post by: salvadorc17 on January 25, 2017, 03:58:59 PM
Yes, that would be really cool, to have ultra big armis in multiplayer matches like a GoW dm. Sadly i have tried chance population in savefile, but is not find as exact value, must be calculated from the total farms you have.
Title: Re: Remove unit limit map editor
Post by: easycompany on January 25, 2017, 06:52:09 PM
well its maybe possible.....let me check theres 1650 of them :P
Title: Re: Remove unit limit map editor
Post by: tupac on January 25, 2017, 09:16:29 PM
Yes, that would be really cool, to have ultra big armis in multiplayer matches like a GoW dm. Sadly i have tried chance population in savefile, but is not find as exact value, must be calculated from the total farms you have.

Did you hit the max then save the map, then sav the map with just a few units? Compare the files it will narrow down then value. It might be easier to scan the memory location and remove the 004 and you now have the offset.

Some value is most likely increasing or as decreasing. So I would recommend you scan for changed and not changed in memory since you have no clue what the true value is.

Cheat Engine
1. Make units scan for Unknown Value
2. Kill a unit next scan for changed value.
3. Kill a unit, walk around, build a different unit, scan for unchanged value. (This will filter alot of stuff you don't need.)
4. Repeat the steps over and over. You will most likely find the location.

Edit: the other map editors war2xed for example has no limit on the units you can put down but playing the map then the exe will not display all the units. I only hope the unit cap limit is not hard coded like 64x64 - 128x128 (map size limit).
Title: Re: Remove unit limit map editor
Post by: salvadorc17 on January 29, 2017, 02:54:38 PM


Did you hit the max then save the map, then sav the map with just a few units? Compare the files it will narrow down then value. It might be easier to scan the memory location and remove the 004 and you now have the offset.


Dont know what youre talking about, cheat engine does can edit that in ram easy, but in save there is no value for current population, that one is calculated from the units counter..
Title: Re: Remove unit limit map editor
Post by: Szwagier on January 31, 2017, 03:44:52 PM
ai bulid

why when computer is allying me he is making farm next to hall, but when it is enemy he will bulid 2 squares away?

(http://s10.ifotos.pl/mini/compallyp_awppsah.png) (http://ifotos.pl/z/awppsah/)

(http://s2.ifotos.pl/mini/compenemy_awppsax.png) (http://ifotos.pl/z/awppsax/)

Title: Re: Remove unit limit map editor
Post by: Lambchops on March 24, 2017, 02:45:28 AM

Forgot about this thread....

I only hope the unit cap limit is not hard coded like 64x64 - 128x128 (map size limit).

I'm pretty sure it will be - but that's OK because its likely it will only be one instruction, so if we find that its just 1 change.... For map size there will be a whole pile of checks, calculations and arrays all over the place. Unit cap is just.... Too many units? no training for you then....
Title: Re: Remove unit limit map editor
Post by: easycompany on March 26, 2017, 10:04:48 AM
u may can try to find the value of global is and raise it also.i took a guess at 600? crashed the game :P

Programmer(s)    
Bob Fitch
Jesse McReynolds
Michael Morhaime

just 3 people... grabbing my beer and gone back in...im still looking for popping dif units out and ship object sizes,i have made farms go -1 but yeah the global cap is all that will get ya.
Title: Re: Remove unit limit map editor
Post by: tupac on March 29, 2017, 09:35:17 PM
Someone should try and look for this.... follow the steps I said above that would put you on the right track to finding the memory location...

If I find time I'll try it.. but my motivation for this game is finally dying. I think soon enough I will release a few projects and separate from the community..

Projects I plan to release.

1. A host bot that will trigger cheats codes. (Even a few game modes) This will be only be given to admins.

2. A Warcraft 2 Battle.net EXE editor.

3. A map editor to modify units.
Title: Re: Remove unit limit map editor
Post by: easycompany on March 30, 2017, 11:43:16 AM
yup hate to say it,crossed the finish line.

messing with vb6 though..but idk to expect much,ive been reading c++ books since 2003 and still dont get it :P
Title: Re: Remove unit limit map editor
Post by: XuRnT on June 24, 2017, 08:10:31 PM
Can you upload castles free 214 with no unit cap? I would like to be able to play 3vs3/4vs4 style games