Warcraft II Forum

Warcraft II => Mods & Development => Topic started by: Lambchops on December 20, 2016, 01:26:54 AM

Title: A collaborative PUD editor.
Post by: Lambchops on December 20, 2016, 01:26:54 AM
Following the discussion on THIS (http://forum.war2.ru/index.php/topic,2835.msg47915.html#msg47915) thread, I thought a collaborative project to make a PUD editor might be a good first step to get all the geeks with ideas working together.

This would be made using ASM, and with as many people as are interested contributing, and the source code being publicly available to all.

I want to use ASM as any real game modding beyond the basic substitution of constant values in the exe requires an understanding of machine code, and a simple project such as this would be an ideal way to create a common platform/language that we can collaborate with.

ASM is actually pretty easy to use. Once you get your head around it there is actually a lot less syntax and fewer rules to learn than higher level languages i.e. C++, java etc.

Ideally people who have some programming experience would be helpful, but it is not necessary to know ASM. I can get it started and show you how to impliment things that you are familiar with from other languages.

Project components:

  - Define/develop an internal container for PUD files.
  - Load/Save PUD files to/from this container.
  - GUI to display the PUD, Select objects/regions etc.
  - Individual editing modules to perform editing tasks
     i.e.
          - Unit properties editor
          - Map properties editor
          - add/remove units
          - ???specialised tasks???

  - Other utility modules to perform non-editing tasks
     i.e.
          - Make a BMP from a pud
          - Dump PUD statistics to a file
          - ???Whatever else anyone can come up with???.

I have a few ideas, and I know there's at least a few others out there who have good ideas/skills. This is an easy way for people to learn to program in assembly, and as the PUD format is well known and documented nobody has to worry about others taking advantage of their research, or using it to develop hacks.

By the time we have done this, we should have the common ground and communication we will need if we are ever going to have a go at collaborating for some genuine WC2 modding/improvement.

Anybody who wants to be involved, please reply to this thread.
Please leave a rough description of where you're up to:
i.e.
        "I am helpful, learn fast, and have lots of enthusiasm"
        "I have some programming experience"
        "I'm quite experienced in programming but not so much in ASM"
        "I'm a freakin guru"

Unless you are best described by one of these two:

        "I could help, but I have more fun trolling"
        "I just like trying to sound important, but dont actually contribute anything"

In which case just go join one of Dellam's chop games and let the adults talk.  ;)
Title: Re: A collaborative PUD editor.
Post by: Igognito on December 20, 2016, 06:08:34 AM
That is a big project man!

You can count me in...

I'm an experienced programmer and in the far past I even wrote in Assembly so it would not take me that long to get unrusty. I never though modified existing compiled programs so that will be new to me.

A bigger concern is my time availability. I will offer what I can ????
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 20, 2016, 06:39:40 AM
That is a big project man!

You can count me in...

I'm an experienced programmer and in the far past I even wrote in Assembly so it would not take me that long to get unrusty. I never though modified existing compiled programs so that will be new to me.

A bigger concern is my time availability. I will offer what I can ????

Nice. Time is the big one for most of us. A simple PUD editor shouldn't be too hard, once the basic framework is in place I'm hoping that people will add bits on one at a time until its got all the cool features.

Modifying wc2 is pretty much our only option if we are ever going to make the sort of features people want really happen, but for starters the editor will just be a standalone app.

I'll give it a few days for the people that are interested to see this and sign up, then we can start talking turkey :D
     ( please spread the word around the nerdy types )

Thanks for your support.




Title: Re: A collaborative PUD editor.
Post by: tupac on December 20, 2016, 08:59:07 AM
Sure! Not sure what I could do to assist you all, not really familiar with ASM. But if you teach I shall follow.

I know easycompany is not a programmer but I will be showing him basic languages as vb.net, vb6, etc. He is a great reverse engineer! That's just as important as a programmer.

Edit: We already made a unit editor, etc.
Title: Re: A collaborative PUD editor.
Post by: easycompany on December 20, 2016, 09:03:45 AM
i can go back to looking around in the pud...its got promise as bnet's puds are different from dos.

the 2 engines will do different stuff :P why shooting ballistas wasnt found in dos..

my main objective is to find the object size of ships and birds..... but still elusive  :(
Title: Re: A collaborative PUD editor.
Post by: iL on December 20, 2016, 09:27:14 AM
Great idea!
Not sure i can help, at least i have no time for most projects, but i'd be glad to help with something if i can.

Lambchops, are you ASM-programmer? I'd never make such project on ASM, i just mean C would be easier to use, but i'd look at such ASM program with interest.
Title: Re: A collaborative PUD editor.
Post by: salvadorc17 on December 20, 2016, 02:51:19 PM
Why you want to use asm programming, unless you want to change game executable??
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 20, 2016, 04:47:15 PM
Sure! Not sure what I could do to assist you all, not really familiar with ASM. But if you teach I shall follow.


Awesome :)

I know easycompany is not a programmer but I will be showing him basic languages as vb.net, vb6, etc. He is a great reverse engineer! That's just as important as a programmer.


... and nobody puts in more time or is more comitted to messing with WC2.

Edit: We already made a unit editor, etc.


Cool, it will no doubt be easy for you to create a unit editor module for this project.


i can go back to looking around in the pud...its got promise as bnet's puds are different from dos.

the 2 engines will do different stuff :P why shooting ballistas wasnt found in dos..

my main objective is to find the object size of ships and birds..... but still elusive  :(


hehe... you're going to love this.

Yeah birds, ships and flyers can only exist at even numbered co-ordinates... like (2,6) or (20,12) but never (7,12) .... strangely it appears oil patches can only exist at odd numbered co-ordinates, but gold mines are not restricted.

Great idea!
Not sure i can help, at least i have no time for most projects, but i'd be glad to help with something if i can.

Lambchops, are you ASM-programmer? I'd never make such project on ASM, i just mean C would be easier to use, but i'd look at such ASM program with interest.


Great :) I'm hoping once people see how it comes together, they will get enthusiastic about adding things to the project.

Why you want to use asm programming, unless you want to change game executable??


Well.... because, my friends:

   a) ASM rocks ur momma's socks off! Nothing is faster, smaller or sexier than ASM
   b) Like I say, we DO want to mod the .exe

Everybody has ideas about what they want WC2 to be able to do, and they almost all end up being things that require modding the exe. We have lots of people with ideas, some with coding skills, but as far as being able to look at a disassembly and have any idea what it is doing ... before today it seemed to be only me... (Now I know igognito has done some ASM and perhaps others will appear too)


BUT, I don't think this is because I'm smarter than anyone else here, indeed on the whole, the WC2 community is made up of some very clever people (much as it pains me to admit it in some cases lol), its just because nobody else has been exposed to it very much.

The thing is... it's dead easy, it really is, but the establishment (M$ and whoever else) don't want people poking around in the internals of executables. When you start doing that you realise that .dlls are just the same and the whole OS is just made up out of a big pile of them, and they DO NOT want anybody poking around in their operating system. So the whole thing just gets obscured by 10 layers of hokus-pokus and gobbldeegook. For me, the lower you go, the simpler everything is. 99% of all code is made up of maybe 20 common instructions.

So... why use ASM for this project? Mainly so I can get everyone else here thinking in terms of how .exe files are actually put together and how machine code actually executes. So when I start talking about stack frames, calling conventions, memory models, flag registers or whatever, you all have half a clue WTF I'm talking about lol.

Like I say its not hard, and once you get your head around the basic concepts its really simple. There's pleanty of people here with the brains to do it... I'm quite sure iL could code rings around me in C++, I hate bloody C, it's a pain in the ass.

I'm sure when you've finished with this project, most people will go back to using whatever language they're most familiar with, but I absolutely guarantee you that if you can learn some ASM, when you go back to C or whatever else you will have a whole new understanding of what your code is actually doing....
          ..... and there's really no other way anyone is going to understand what WC2 is doing, unless someone can convince Blizzard to hand over the source code (gl with that).

Anyway, thanks to all of you for showing an interest :) Watch this space for a crash course in ASM and .PUD files. I just spent an hour or 2 setting out and commenting the bones of a basic ASM windows app that we can use as a starting point.

In the meantime download MASM32 from one of these:

           AUSTRALIA (http://www.masm32.com/download/masm32v11r.zip)
           USA (http://website.assemblercode.com/masm32/masm32v11r.zip)
           EASTERN EUROPE (http://www.oby.ro/masm32/masm32v11r.zip)
Or apparantly this site:
           WESTERN EUROPE (http://www.codingcrew.de/masm32/index.php)

 has a version with German language support, athough I don't know how good it is, because I dont speak German.

..and have a go at how fast the installer (entirely coded in ASM, of course) unpacks the whole thing from a 4.8MB download and completely builds all the .lib files from scratch. Damn that's sexy  :fro:





Title: Re: A collaborative PUD editor.
Post by: xboi209 on December 21, 2016, 02:35:12 AM
So... why use ASM for this project? Mainly so I can get everyone else here thinking in terms of how .exe files are actually put together and how machine code actually executes. So when I start talking about stack frames, calling conventions, memory models, flag registers or whatever, you all have half a clue WTF I'm talking about lol.
It's a good idea to do this as a learning opportunity, but nothing more. If you want an editor with long term support and quicker development, you should really consider a high level language.
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 22, 2016, 03:06:14 AM
Quote from: Lambchops on December 20, 2016, 04:47:15 PM    So... why use ASM for this project? .....

It's a good idea to do this as a learning opportunity, but nothing more. If you want an editor with long term support and quicker development, you should really consider a high level language.

In the nicest possible way.... Sheesh, get with the program lol.

I don't especially want another PUD editor.
I have already written an editor in a high level language, so have pleanty of others
This IS a learning opportunity.

The end goal is to get people up to speed and capable of developing WC2 and adding real features.

And BTW I reject your assertions. "Quicker development"... maybe slightly for some jobs, but the trade-off is speed, effiancy and reliability.

"Long term support" must be a joke. ASM was around before any other language and it's not going anywhere, because it literally CAN'T, not unless the world is going to stop developing new processors. ASM code is just as maintainable as any other sort of code, and is less likely to attract the kind of script-kiddies who just want to crudely hack in something with their own name on it.

With the greatest of respect, these are the sort of standard arguments that are often used by people who can't program in assembly to make excuses because their egos feel threatened. My response to them is "nobody is saying you should learn assembly, do whatever you want, but please don't start talking about a subject you clearly know nothing about"

I'm not suggesting that you are one of these people, I don't know you at all, maybe you have just been listening to some of them, but if you are ever looking for support around the ASM community, I would highly reccomend you don't start by espousing those sort of opinions ;)


Anyway, it sounds like you have some amount of programming knowledge, so please feel free to join in with this exercise and contribute. You never know, you might find you like ASM a whole lot better than you thought you did.   :)

Title: Re: A collaborative PUD editor.
Post by: xboi209 on December 22, 2016, 07:45:43 AM
The end goal is to get people up to speed and capable of developing WC2 and adding real features.
Fair enough.

"Quicker development"... maybe slightly for some jobs, but the trade-off is speed, effiancy and reliability.
C++ compilers are usually able to achieve the same, if not, better speeds than hand written assembly. High level languages offer way more reliability than assembly as well.

"Long term support" must be a joke. ASM was around before any other language and it's not going anywhere, because it literally CAN'T, not unless the world is going to stop developing new processors. ASM code is just as maintainable as any other sort of code, and is less likely to attract the kind of script-kiddies who just want to crudely hack in something with their own name on it.
What I meant by that is finding contributors, you'll have a hard time finding people willing to write assembly code over code in a high level language in their free time. If you don't want script kiddies contributing, just put your code in a repository and review all pull requests.
Then again, this is supposed to be a learning opportunity, so no need to argue anymore.
Title: Re: A collaborative PUD editor.
Post by: I hate naggers on December 22, 2016, 11:51:18 AM
http://wiki.teamliquid.net/starcraft/Chaoslauncher (http://wiki.teamliquid.net/starcraft/Chaoslauncher)
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 22, 2016, 12:20:37 PM
[url]http://wiki.teamliquid.net/starcraft/Chaoslauncher[/url] ([url]http://wiki.teamliquid.net/starcraft/Chaoslauncher[/url])


Yeah the Koreans have done some fully INSANE stuff with SC1. I tried to research it all about 10 years ago but everything was in Korean, they may have some better user docs by now, but I doubt they'll have translated and published their source, although I'd love to hear about it if you find anything.
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 22, 2016, 12:23:21 PM
C++ compilers are usually able to achieve the same, if not, better speeds than hand written assembly. High level languages offer way more reliability than assembly as well.

hmmm....

I must learn what those magic "C++ only" instructions are that can't be coded in ASM... then I would be a GOD!
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 22, 2016, 12:25:29 PM
          PART 1 HERE

Ok I have written a short intro to ASM which is in the attached PDF file.

Also here is the source and make file i have written for a bare-bones windows app that we can use as a starting point.

Have a look if you're interested in this stuff  :)

Title: Re: A collaborative PUD editor.
Post by: salvadorc17 on December 22, 2016, 02:50:15 PM
Maybe the post title could get people confused, this seems not only oriented to edit maps but also game in general, so you will need to clarify about that..
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 22, 2016, 10:05:10 PM
Maybe the post title could get people confused, this seems not only oriented to edit maps but also game in general, so you will need to clarify about that..


This project is to create an editor for Warcraft II .PUD files in ASM.

That is what this project will be making.


The actual goal of the project is to teach people about PE files, and how programs look when they are decompiled and why, to increase the human resources we have to add new features to the wc2 exe. That is why I want to do it with ASM and using the particular methods that I am planning to use. A PUD editor seemed to be a good vehicle for this, because it is on-theme for our shared interest (WC2), and the PUD format is very simple, so an editor for PUD files is not a particularly hard thing to make.

This is WHY I want to do this project, in this way, but this project is just making a PUD editor.


Title: Re: A collaborative PUD editor.
Post by: salvadorc17 on December 23, 2016, 04:15:18 PM
Ok, now i understand, thanks for clarification, seems good way to have people some asm lessons, i dont want also do another pud, but is good starting to learn how to code for the epic process of change executable.
Title: Re: A collaborative PUD editor.
Post by: easycompany on December 23, 2016, 06:50:27 PM
yall are beyond me..im thinking more on terms of html/java script. lol

but o well i hope everyone has a nerdgasm!

had a couple myself but in the drought right now :(
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 24, 2016, 12:49:19 PM
yall are beyond me..im thinking more on terms of html/java script. lol

... each to their own, but I swear ASM is 100x easier than javascript

but o well i hope everyone has a nerdgasm!

had a couple myself but in the drought right now :(

awww...
Nuture your inner nerd... they need love too! :)



In the meantime, i have got together a bit more of the editor... I've made an internal storage container and have routines to load/save PUD files, and to access/update the raw data for each section.

I'm almost finished with a neat little framework for modules that should make it very easy for anyone to add a module to the editor.

There's a template file that people can copy then customise to make their own module window pop up and do something with a part of the PUD.

That way people can start out small and just make a simple module that just changes one thing, then expand on it once they get more familiar with whats going on.


will post an update soon....


Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 25, 2016, 09:24:59 AM
          PART 2 HERE

Have updated the project. You can get it HERE (http://forum.war2.ru/index.php?action=dlattach;topic=2852.0;attach=979)

It now has routines for loading/saving PUD files, an internal pud object container, a module framework, a template for creating new modules and a simple module to edit the map description.

Have also add a couple of bits to the ASM intro pdf (http://forum.war2.ru/index.php?action=dlattach;topic=2852.0;attach=980).

Merry Christmas beautiful people :)

( :-* for any ladies standing under the mistletoe )
Title: Re: A collaborative PUD editor.
Post by: easycompany on December 25, 2016, 10:04:27 AM
merry christmas lamb!
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 25, 2016, 06:36:13 PM
merry christmas lamb!
Cheers mate  :) right back at you
Title: Re: A collaborative PUD editor.
Post by: salvadorc17 on December 29, 2016, 02:32:48 PM
Good work with this example version, now im wondering what else you can achieve with asm into the game executable..
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 30, 2016, 05:10:10 AM
Good work with this example version, now im wondering what else you can achieve with asm into the game executable..


Lots of things.

FYI. The AH version started as something I did in ASM. I had a working prototype AH client and server that tested ok. It did things like send a copy of the player's mini-map back to the server so you could see instantly if they were mapping.

 This was around the time my daughter was born (my son was 16 months) and I was saving to buy our house - working long shifts etc., so I couldn't put the time in.

I had to have a few years off WC2 at that stage. Before I left I sent blid the source code and notes, instructions, tools etc. to continue with. I'm not sure if they ended up using that as a base for the AH we have now or not, but that's how it started.

... and to start with I made my little build-hack detector, just so people knew I wasn't talking shit about being a programmer. It's not very sophistocated but if someone tries to do a dellam you get an instant alarm.

Oh No!
I was just about to insert a link to the original thread on the old forum which had a description of the build hack detector and eek!:

The old forum at http://war2.warcraft.org/forum/ (http://war2.warcraft.org/forum/)has gone :( or at least its down right now. All I can get is the homepage of warcraft.org (http://warcraft.org) but all the links on it are broken. Anybody know if there's a backup/archive of this anywhere? Would be a shame to lose all that history (lame-ass flame wars and all)

Might do a seperate post about that....

.... anyway the build hack detector... I'll re-write a short description here. I named it "anticrap" (http://forum.war2.ru/index.php?action=dlattach;topic=2852.0;attach=982) for lols. It was just a fairly simple proof-of-concept thing. It checks all newly made buildings to see if the player has the pre-requisites - or at least used to have them.

Because of the glitch/feature where you can, for instance, target placement of a dragon roost but not click to place it, then have your fort destroyed then click and place the roost with no fort, it just checks if the player has had ever had a fort, not if they currently have a fort.

There are ways to do it properly, but as this was just a simple demo (i think i wrote it over 2 evenings after work) it just does a quick reality check. If it detects something "suspicious" it sounds a chime and displays a message like "Player Dellam has built a suspicious Dragon Roost" or whatever. You have to tab out to see the message, but you can hear the alarm in game.

It also has a check-box so you can make black display as hot pink on the mini-map, without changing the color of the units themselves.

.... and being ASM its only 7.5KB - and most of that is the icon and the list of name strings for all the buildings.

There has been a bit of discussion about a new client front-end lately, which is something I would dearly love to do, however there is the small matter of my ex having me evicted out of my own home in about 9 days time that I really should attend to. Sadly that might cramp my style for a while. Cest la vie.


Title: Re: A collaborative PUD editor.
Post by: easycompany on December 30, 2016, 07:08:45 AM
asm has compatability issues? cant run on my win7  ??? dam u and tupac and ex's
Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 30, 2016, 11:32:51 AM
asm has compatability issues? cant run on my win7  ??? dam u and tupac and ex's
What are we talking about here? The PUD editor, or the anticrap thingy?

Ok, first ASM itself doesn't have compatability issues with operating systems, it can't. It can only have compatability issues with processors, and I usually build random stuff like this for the 80486 instruction set which means it will run on anything made after about 1989.

That being said... if individual program that you write in ASM interacts with the OS (and almost everything does), then like in any language, it can have OS dependant compatability issues.

If we're talking about anticrap (and I think we must be) then I wrote it in December '09, and I no longer have the source. So IDK, I could have even used 586 or 686 instructions, but that still wouldn't be an issue unless ur using a VM that is simulating an old 486 processor or something. Anyway no big deal I could probably re-write it easily enough.

At the time I think I got 3 people to test it - feature, sg and someone else who's name I wasn't really familiar with (it was all on the old forum), and it worked fine for them.

Having a quick look at it now, I can see I used my own custom method of compacting the code, data and import sections together, then using non standard importing/thunk tables that sidestep the system loader importing.

Why? because it worked, it made the file smaller and more secure, and I thought I was being terribly clever lol. However that particular bit of devilry is probably going to be the only thing that could cause issues on more recent puters, PARTICULARLY ON 64-BIT SYSTEMS.

It runs fine on my XP-32bit system and my Win7-32bit system, I'm guessing your Win7 machine has a 64bit processor? Try 32 bit compatability modes or VMs or whatnot.

... anyway that issue is just related to a bag of non-standard tricks of my own creation, not because it was coded in ASM.

The exe in the 2nd PUD editor update should run on pretty much anything ya?

Title: Re: A collaborative PUD editor.
Post by: Lambchops on December 30, 2016, 02:24:14 PM
ok i did a really quick and nasty rebuild on the anticrap thing, gutted half of it and wired it up to do standard importing. Which should fix any compatability issues (i hope).

It does the mini-map black to pink thing, it knows if you're in a game and lists the players, and AFAIK it should detect build hacking, but I can't test that because for the life of me I can't find a copy of that crap build hack program - I havn't even looked for the stupid thing since I was doing all this stuff 7 years ago.

So if someone can test this version and see if it actually works, that would be cool. Just start anticrap then make a server game and build hack something at the start... you should hear a "ding ding ding ding..." then if you tab out there will be a message on it's window telling you ur a naughty boy (or girl).

Anyway, its here: anticrap0.3b (http://forum.war2.ru/index.php?action=dlattach;topic=2852.0;attach=986)

Where's fkn dellam when u need him? xD
Title: Re: A collaborative PUD editor.
Post by: easycompany on December 30, 2016, 02:29:05 PM
ok that one owrks :P
Title: Re: A collaborative PUD editor.
Post by: iL on December 30, 2016, 09:05:47 PM
FYI. The AH version started as something I did in ASM. I had a working prototype AH client and server that tested ok. It did things like send a copy of the player's mini-map back to the server so you could see instantly if they were mapping.

 This was around the time my daughter was born (my son was 16 months) and I was saving to buy our house - working long shifts etc., so I couldn't put the time in.

I had to have a few years off WC2 at that stage. Before I left I sent blid the source code and notes, instructions, tools etc. to continue with. I'm not sure if they ended up using that as a base for the AH we have now or not, but that's how it started.

I think i have that source code. Not sure, i saw several antihack projects, one of them (client-server one) was interesting, but i'd prefer to implement it together with author. But i had no access to author, so my one implemented into war2ploader is one i made myself.
Also, i don't remember any AH projects written on ASM.

Would be very interesting to talk about antihack ideas with you.

The old forum at [url]http://war2.warcraft.org/forum/[/url] ([url]http://war2.warcraft.org/forum/[/url]) has gone :( or at least its down right now.

Looks like it's gone. All we have now is a static copy of a small part: http://occult.war2.ru (http://occult.war2.ru). Not sure if it's possible to find that there.

Might do a seperate post about that....

.... anyway the build hack detector... I'll re-write a short description here. I named it "anticrap" for lols. It was just a fairly simple proof-of-concept thing. It checks all newly made buildings to see if the player has the pre-requisites - or at least used to have them.

Because of the glitch/feature where you can, for instance, target placement of a dragon roost but not click to place it, then have your fort destroyed then click and place the roost with no fort, it just checks if the player has had ever had a fort, not if they currently have a fort.

There are ways to do it properly, but as this was just a simple demo (i think i wrote it over 2 evenings after work) it just does a quick reality check. If it detects something "suspicious" it sounds a chime and displays a message like "Player Dellam has built a suspicious Dragon Roost" or whatever. You have to tab out to see the message, but you can hear the alarm in game.

It also has a check-box so you can make black display as hot pink on the mini-map, without changing the color of the units themselves.

That project definitely deserves a separate topic here. Looks great!
I also had plans to make monitoring for build hack the same way.
With dropping the hacker by all the clients using my "anticrap".

I didn't plan to deny allowed buidlings on destroying something (or to just make a big timeout, like 1 min).
The main reason for build-hacking is to build dragons right after game starting or w/e. So, not a big deal, but difficult to handle it properly if someone build after destroying the required building. But warning is a good way to handle that.

Unfortunately that project should take much more than 2 evenings after work for me, so i thought to use my time to make antihack for everything instead.

So, i would appreciate your help with that.
I think, i can read a list of buildings for war2 memory (didn't try though and that should require much time for me), but i have no idea how to activate event on placement a new building. I'd just make a timer to check it every second or w/e.
Also, i have no idea if that's easy for several clients to drop one and to keep sync between each other (and probably clean clients with no "anticrap").

I also looked into your anticrap3 with IDA and understood nothing... Is it packed as anticrap2? Did you fix it without the source code and without unpacking?
Would be great to look into your project with comments about addresses in war2 memory.
My dream is to include this (or such) project into my loader for war2.

Also, black2pink on minimap as 1 checkbox is also great solution! Would be a good way to remove the whole black2pink patch from combat at all.

P.S: you looks very experienced in war2 process memory. I tried and i know how difficult for me to find all these addresses. Would be glad to see you as a part of our war2 development team!
Title: Re: A collaborative PUD editor.
Post by: tupac on December 30, 2016, 10:40:41 PM
@il

If you don't use my codes and ideas in your antihack feel free to release them too the public. I think lambchops is like tupac, il, lance combined! This guy is a genius!!! He can make us all experienced! We have a very powerful member here and idk why he wasn't around the last few years when I was working hard and had lots of time.

@lambchops

Yea man I was talking too my boss at work and he said if you are willing to teach ASM I should follow you! Also most of the good mods and hacks where made in ASM for starcraft. I think its a hard language but once I learn it it will be a great learning experience!
Title: Re: A collaborative PUD editor.
Post by: Szwagier on December 31, 2016, 08:53:58 AM
It would be nice if u add mission objective also
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 05, 2017, 04:02:25 AM
Hi peeps,

Thanks for all the positive comments. As some of you may be aware, my delightful ex has been dragging me through the courts for some time now. As a result there are now federal court orders to have me evicted from my own home in a few days time. I am fighting them, but I don't like my chances, the legal system here is SO corrupt its unbelievable. I don't even know where I am going to go. Anyway I may drop off the map for a while, but I will be back - eventually. Would be nice to find someone had written another module or 2 for the PUD editor when I get settled ;)
Title: Re: A collaborative PUD editor.
Post by: tupac on January 05, 2017, 08:11:16 AM
Hi peeps,

Thanks for all the positive comments. As some of you may be aware, my delightful ex has been dragging me through the courts for some time now. As a result there are now federal court orders to have me evicted from my own home in a few days time. I am fighting them, but I don't like my chances, the legal system here is SO corrupt its unbelievable. I don't even know where I am going to go. Anyway I may drop off the map for a while, but I will be back - eventually. Would be nice to find someone had written another module or 2 for the PUD editor when I get settled ;)

Ive been through all of that and I'm still recovering! I hope you can get settled somewhere soon. If you want to add me of facebook pm me.
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 05, 2017, 09:04:55 AM
Yea man I was talking too my boss at work and he said if you are willing to teach ASM I should follow you!


Look at the PUD editor. Look at the template file, copy it as per the instructions then experiment with your own module. Don't worry if you only half understand what you're doing to start off with - once you start using it, you will start understanding it. That's the whole reason I made this.

I think its a hard language but once I learn it it will be a great learning experience!


hehe. Like I keep saying, it's a DEAD EASY language. It has less syntax than any other language (that I can think of). It's just a differen't way of thinking.

Once you start thinking about a program in terms of what your CPU is doing instead of as a bunch of "friendly" words in a text file, everything becomes much simpler.

I mostly find that the complicated parts of anything I am writing are where it has to interface with the OS or other 3rd party software. Windows, particularly can be a nightmare to deal with, but honestly when I started seriously using ASM to interface with the OS was when the layers of gunk got scraped away and suddenly I found Windows much easier to understand too.

Most people who use a bit of ASM do it as in-line code in C++ apps, i.e for the critical bits that really need the power of hand coded instrutions. This makes sense from one angle, because you can get the power where you need it, then use the more comfortable medium of the C++ syntax for everything else.

But I think that often C is more comfortable simply because people learn it first. A good C programmer really already understands things 90% from a CPU perspective anyway... use of pointers, bitwise operations etc. You need to understand and learn those concepts not because they are C concepts, but because they are CPU concepts, and C is a thin veil between the programmer and the device they are programming. But it is still a veil. Even most very skilled C programmers still just hit the "compile" button and a magic "exe" file pops out the other side, which they have little understanding of.

But, in fact most of these programmers have a much better understanding of the actual program than they realise, they're just being robbed of the opportunity to see how their code works because they allow themselves to be distracted into letting the compiling process to remain a "black box".

HERE (https://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx) is the specification for PE/COFF. It's freely available to download from M$ at any time, but like most of the real information, even finding this link is obfuscated behind 20 layers of obscurely worded claptrap.

Hit download and the last file in the list is called "pecoff.docx". The current version - "revision 10" is 69 pages (over 25,000 words) describing virtually EVERYTHING about EXEs, DLLs, OBJs, OCXs etc. But its all carefully worded to provide all the information if you already know what you're looking for but absolutely no information on how to use or understand it.

My first introduction to this subject was from an paper called "Peering inside the PE" written by Matt Pietrek (http://www.wheaty.net/) in 1994 and published in MSJ. This was not too long after the format was started, like Windows 3.1 days. With little more than the original header field names the guy pretty well reverse engineered (and published!) a big chunk of how the guts of windows works, and this was before Windows95 was even released.

So what happened? Well of course, Bill Gates hired him. You'll note his website mentions joining the M$ VS team in 2004, however clearly his affilliation with Bill started earlier than that as in 2002 (by which time MSJ was well on the way to being swallowed by MSDN) he published an MSJ article called "An In-Depth Look into the Win32 Portable Executable File Format". Part one of this article was called "Peering inside the PE", the same name as his original 1994 paper.

Within a year of this happening it was impossible to find the original paper as all the search engines now returned links to the 2002 article. The 2002 MSJ article was a sanitised version of the original - it was about twice the size but with all the really juicy tidbits of information removed. I assumed at the time (and still do) that he had taken a deal, part of which meant he had to stop giving away all of Bill's secrets - fair enough too, to be set for life and provide the best for your family, who wouldn't?

Despite Matt no longer being quite as candid about the really tasty stuff, I can still highly reccomend reading anything he has written (the guy is a freakin' GOD), also I have just discovered, to my joy :) that the 1994 paper was "Copyright © 1994 by Miller Freeman, Inc." who used to own MSJ, and they must have recently realised what they had and have re-published it. I will attach a copy of it to this post.

The 2002 MSJ article is still linked from Matt's Wikipedia page (https://en.wikipedia.org/wiki/Matt_Pietrek), but coincidentally if you follow the link you will now find that they only offer back issues back to 2003 - so now you can't get that one xD Funny stuff....

... and yes Matt Pietrek is a-dyed-in-the-wool C programmer. There's nothing wrong with that, C is a great language. It was originally a thin layer of convenience over the top of ASM, but it has now expanded into a tumor of gargantuan proportions, with every generation of all that VisualStudio and .NET framework bloatware further obscuring the actual mechanisms that are running on YOUR computer.

Like I keep saying. Learn some ASM, then go back to C++ or whatever, and suddenly you will start realising why the fundementals of C are constructed the way they are .... enjoy the LIGHTBULB moments. YW :)
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 05, 2017, 09:16:10 AM
Ive been through all of that and I'm still recovering! I hope you can get settled somewhere soon. If you want to add me of facebook pm me.
Thanks mate. I appreciate it. Ill PM you my email (which is also linked to my FB account ) friend me there if you want although I hardly ever login to FB, so don't take offence if I dont accept for 6 months or so lol.
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 05, 2017, 09:24:30 AM
dam lamb wish you the best. :(
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 05, 2017, 09:52:53 AM
dam lamb wish you the best. :(
Thanks mate. I hope I don't end up a complete hobo with no PC access, but feel free to email me if I'm not around - I assume you can get my email from my forum profile, which is fine, or also mousey should have it.
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 05, 2017, 10:26:00 AM
well dayum if ya turning hobo get ya a tent and camp out here ...we ll play mario kart get drunk and stuff :P
Title: Re: A collaborative PUD editor.
Post by: Igognito on January 10, 2017, 06:59:58 AM
Hello all,

wow...

I went for holidays and you Lambchop did so much!
I will be busy this week with catching up with my work, but from next week I intent to review your code and get started ;-)

Good luck Lambchop with your accommodation.
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 16, 2017, 05:50:34 AM
well dayum if ya turning hobo get ya a tent and camp out here ...we ll play mario kart get drunk and stuff :P

That sounds very inviting, but I'm thinking there's probably an airfare I can't afford anymore required.... Oh well, maybe next year - and if you're ever in AUS you can share my dumpster NP. I'll probably be doing Mario Shopping-Kart ;D

I will be busy this week with catching up with my work, but from next week I intent to review your code and get started ;-)

Too cool  8)  I tried to set it up so people could easily add their own bit without having to modify my stuff .... although feel free if you want - if its all good, its all good.

Good luck Lambchop with your accommodation.

Yeah, thanks... The little princess turned up with a couple of cops trying to make me leave last week. I have lodged an appeal and an application to stay the orders, although technically the orders still stand until the stay is granted - which they will probably refuse anyway.

The only reason I'm still here is because they are federal orders and the cops are state officers, so they can't enforce them. But she only needs to take the orders to the local magistrate's court and get an eviction notice, which she will probably have done in the next day or 2 if she hasn't already, so I'm basically just waiting for a knock on the door. Not a nice feeling  :(
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 16, 2017, 11:20:27 AM
 :( ahh man. gotta rv or just one u haul +battery converters or just dc!, low wattage led  lights,effecient laptop etc.. and a little spot of land somewhere, family?


u can teether a net connection from a phone. or just use a wifi enabling box for 2g,3g,4g etc.

this is the exact setup i want for war2 conventions lol.

Title: Re: A collaborative PUD editor.
Post by: tupac on January 16, 2017, 12:53:57 PM
You just need to find a new women! You seem very smart so i guess you make enough money to get an apartment. How many kids  do you got?
Title: Re: A collaborative PUD editor.
Post by: mestereaga_andrei on January 21, 2017, 12:59:55 PM
Hello guys. I was searching for this for a long time :)

I think this is a good place where I can post the following:
I`m looking to make one warcraft 2 map in order to add a new mode like DOTA that is already in WC3. So, the wc2 can be easy set to work on tablet or phone, and my ideas is to have this mode to play togheter with my friends using the phones. How crazy sounds this to you?

Here: strong knowledge in C programming language (I`m working in automotive domain, but I think it can be used as well for this project).
good ASM language knowledge (to be honest I worked with AVR processores, but I think I can handle too the x86).
Also C# good knowledge

I have some knowledge in these Warcraft2 hacking tools, but after a long analysis, I think this is not enough to create this DOTA mode, and there should be write some code starting from zero, or to find another way to reuse the existing code.

So, adding this to your PUD project will be great :)
Let me know what do you think about this!

here is my contact mestereaga.andrei@gmail.com


Title: Re: A collaborative PUD editor.
Post by: iL on January 21, 2017, 05:27:08 PM
I`m looking to make one warcraft 2 map in order to add a new mode like DOTA that is already in WC3. So, the wc2 can be easy set to work on tablet or phone, and my ideas is to have this mode to play togheter with my friends using the phones. How crazy sounds this to you?
Hi!
I'm not too experienced in programming to consider making such modification would be easy. I'd look to wargus for that. I had an idea about wargus on phone/tablet devices. Looks much more easier than war2 there. Unfortunately looks like wargus development team have no experience in mobile device programming.
Not sure about dota on war2, how many changes should be made in it's code to use.
Title: Re: A collaborative PUD editor.
Post by: salvadorc17 on January 21, 2017, 05:52:39 PM

I'm not too experienced in programming to consider making such modification would be easy. I'd look to wargus for that. I had an idea about wargus on phone/tablet devices. Looks much more easier than war2 there. Unfortunately looks like wargus development team have no experience in mobile device programming.
Not sure about dota on war2, how many changes should be made in it's code to use.


There is warcraft 2 for android version made from wargus, i have played it.
http://play.mob.org/game/warcraft_2_tides_of_darkness.html (http://play.mob.org/game/warcraft_2_tides_of_darkness.html)
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 21, 2017, 06:06:00 PM
i think wargus can do custom ai stuff(dont ask me how i dont know yet :P) but i played a map and your buildings auto created for you and you was a hero (very dota like) as time progreesed more advance units where made ..i forgot what this map is called if i find again ill post.
Title: Re: A collaborative PUD editor.
Post by: iL on January 21, 2017, 06:12:06 PM
There is warcraft 2 for android version made from wargus, i have played it.
[url]http://play.mob.org/game/warcraft_2_tides_of_darkness.html[/url] ([url]http://play.mob.org/game/warcraft_2_tides_of_darkness.html[/url])

Yes, there were 2 or 3 old and abandoned builds for wargus/stratagus, but i'd be happy to see ios/android branches for current project.
Stratagus is still active and placed here: https://github.com/Wargus/stratagus. It became much more stable than years ago.
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 21, 2017, 06:13:15 PM
Hello guys. I was searching for this for a long time :)

I think this is a good place where I can post the following:
I`m looking to make one warcraft 2 map in order to add a new mode like DOTA that is already in WC3. So, the wc2 can be easy set to work on tablet or phone, and my ideas is to have this mode to play togheter with my friends using the phones. How crazy sounds this to you?

Here: strong knowledge in C programming language (I`m working in automotive domain, but I think it can be used as well for this project).
good ASM language knowledge (to be honest I worked with AVR processores, but I think I can handle too the x86).
Also C# good knowledge

I have some knowledge in these Warcraft2 hacking tools, but after a long analysis, I think this is not enough to create this DOTA mode, and there should be write some code starting from zero, or to find another way to reuse the existing code.

So, adding this to your PUD project will be great :)
Let me know what do you think about this!

here is my contact mestereaga.andrei@gmail.com



posting again..nice man!u may would want to use wargus instead of blizzard,but i think help is like very hard to get...im own my own just reading thru the script files and c++ source.
Title: Re: A collaborative PUD editor.
Post by: mestereaga_andrei on January 21, 2017, 07:42:54 PM
Hi guys again!

As I mentioned, I spent some time on this topic, and of course I know about this Wargus/stratagus. But to be honest, I`m a little bit sceptical to use it because I had some problems on my phone ( I use an unpopular model, Lenovo 7010). Too many crashes and at least it wasn`t working as well as I expected. At least I got good results using dos box emulator on my phone and original warcraft II game. No more crashes, and everything was working fine. So, I prefer to start from zero, and why not, if I have the posibility, maybe I can start to write this game directly to Java.

I started to write up one AI program. It is 60-70% working, it still need improvments. The next step is to change the war2.exe. First step is to create one building unit from where you can create differents playable units, like heros. This was a blocking point for me because I have some problems with war2hacker / war2draft program. It refuses to write commands on building units, building like barackas. The only thing that I can do is to change the icon of training units, but I need more than this.

@tupac: I think there I need your help. Please let me know when you have a free time slot for this topic.
Thanks for your quick answers :)
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 21, 2017, 09:48:42 PM
why make when it already exist? dosbox has been ported to java also(maybe slow on a phone idk) :P,,ahh yeah trying to find the units..its possible cause i had gold mines producing foots.im not building a new one just bugging the old till it tells me what it is.

ahh yeah as il has stated,wargus has crashes...one answer maybe to get the new stratagus and rebuild it back into war2....

mmm if you could do bnet to java that would be cool!

well good luck in whatever yall do  :D
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 22, 2017, 03:28:01 AM
(http://i67.tinypic.com/35jwd29.jpg) theres wargus ive really forgot how to connect it old pic
Title: Re: A collaborative PUD editor.
Post by: mestereaga_andrei on January 22, 2017, 04:06:03 AM
Quote
ahh yeah trying to find the units..its possible cause i had gold mines producing foots.im not building a new one just bugging the old till it tells me what it is.

If you can tell me how you did this, will be great :)
Title: Re: A collaborative PUD editor.
Post by: easycompany on January 22, 2017, 10:09:19 AM
well in the exe, when u get into  repeating values ie which building allow a certain upgrade (hopefully units)etc,

the "value holder" will be  repeated over and over,i have just found icons about like you...to bug it find what value is changing and put in some bull shit all 00's etc and it will hopefully crash on the changed,be some bizzare effect..etc

but this is not always the case and trying to find single values is a tuff job lol.
and its not a giving that units are in the exe....could be some other blizz file.

but the best way i found yet is like beer and sitting back looking at pictures and just pretend ;D

u may want cheat engine,so u can find values before hand! tupac is extreamly good at it.
Title: Re: A collaborative PUD editor.
Post by: iL on January 22, 2017, 12:44:59 PM
As I mentioned, I spent some time on this topic, and of course I know about this Wargus/stratagus. But to be honest, I`m a little bit sceptical to use it because I had some problems on my phone ( I use an unpopular model, Lenovo 7010). Too many crashes and at least it wasn`t working as well as I expected.
Yes, that is related to my previous post: "there were 2 or 3 old and abandoned builds for wargus/stratagus, but i'd be happy to see ios/android branches for current project."
I mean, that 3-5 years old abandoned builds are full of bugs and crashes too many times.

I also tried last versions (in Aug-Sep 2016). That became much more stable and pleasant. (No even one crash for me, improved gameplay and game dynamic, much closer to original war2, i tried under windows though). That's why i want this current development version of wargus/stratagus on mobile/tablet devices. Try that yourself! Maybe you will find this new wargus pretty better than that old and ugly one and you can make branch/fork for ios/android?

War2 requires both left&right mouse buttons and some hotkeys, what is not playable on touch screen. And i'm sceptical to adapt war2 to mobiles without source codes.
I think stratagus adaptation for mobiles would be much easier.
I even think mobiles is almost the only way for wargus. (war2 works excellent with both Windows/Linux, so no reason to use wargus for that).
The same for dota: i don't think that would be easy to find and change everything you need in war2.exe binary code.
So, i think if you want some sufficient changes with war2, your way is stratagus.
Title: Re: A collaborative PUD editor.
Post by: salvadorc17 on January 22, 2017, 03:37:13 PM
Yes, for all cases seems that using wargus could get better results, the only big problem there is that you will need to create your own server to allow people play multiplayer, forget about war2ru compatibility, is totally diferent protocol.
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 23, 2017, 04:56:02 AM
So, adding this to your PUD project will be great :)
Let me know what do you think about this!

Hi Andrei,

That's a nice idea, however I think to add the functionality you want it would mean modifying the WC2 executable, not just the .PUD (map) files. This project is just to make a map editor to edit PUD files, which won't actually add anything new to the game that can't already be achieved with existing .PUD editors - although it would be nice to have all the known possible features available in one editor, as against scattered throughout a heap of different apps.

The aim of the project is more to get people working together than an actual need for another PUD editor.

I have considered making this style of game available by having a bot host playing the "CPU" player....

I have had an idea rattling around in the back of my head for a while for something called "The Necromancer". It would involve a PUD set up so that the bot host had a heap of halls and temples, and would then make lots of peons, group them, kill them with d&d, then do raise dead and send mass waves of skeles at the players... and also maybe script some other stuff like maybe haste-d&d attacks or haste/unholyArmor/lusted skeles etc.

You could do this sort of stuff with a smart unit-aware bot. It could host the game, wait for players to join then try to smash them with skeles... the DOTA stuff could also be done with this approach... just another idea I'll impliment one day when I have time (hopefully before I turn 90 lol)


Title: Re: A collaborative PUD editor.
Post by: easycompany on January 23, 2017, 06:05:23 AM
 :blank: nice lamb!!! and just force the game to heros ..changing grps,stats boom done! and just  let the cpu/bot control 1 or 2 units.

or get 2 cpus around center where one attacks up the other down.
say barraks with 3,4 farms for each and high hp on thier buildings.

this could just be done on the pud side.

but yeah a bot would be even better!
Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 23, 2017, 07:19:06 AM
Quote from: mestereaga_andrei on January 21, 2017, 12:59:55 PM

    So, adding this to your PUD project will be great :)
    Let me know what do you think about this!

Quote from: Lambchops on Today at 04:56:02 AM"

Hi Andrei,

That's a nice idea, however I think to add the functionality you want it would mean modifying the WC2 executable, not just the .PUD (map) files. This project is just to make a map editor to edit PUD files,


.... and BTW, this project is actually a working PUD editor, it just has only one module written so far - which edits the desctription string (WOW! 1337 eh? XD lol).

I have written it in such a way that it should be pretty easy for others to add individual modules to edit different PUD sections (check out THIS POST (http://forum.war2.ru/index.php/topic,2852.msg48073.html#msg48073) for more info), so if you have some coding experience and want to contribute, please make a module to do any small job editing some part of a PUD file and post it :)





Title: Re: A collaborative PUD editor.
Post by: Lambchops on January 23, 2017, 07:43:18 AM
:blank: nice lamb!!! and just force the game to heros ..changing grps,stats boom done! and just  let the cpu/bot control 1 or 2 units.

Thx EC, i thought u'd like it :) I even made a PUD a while back. It's sort of half tower defence, half RPG.

The bot has a Lair of Evil (muhahahahahaha..) at the top which is mostly walled in by rocks, but the halls can pop peons out from behind them and the dks can cast on them and send.

So to start with the players would have to build while copping waves of skeles, and maybe the odd daemon (although theres no way to make more of them - but I figured I'd up their stats and make them bosses that attack when certian trigger points are reached). Also perhaps a lazy dragon every now and again, just to keep people honest, but not too much of that...

.... anyway, saps and alch/inventors cost oil, and theres only 2 oil wells in little ponds so you can make just enough saps to open the Lair of Evil and win, but the players would have to co-operate to do it, defending oil wells etc. It is also technically possible to win without using saps, although it's a long hard maze under fire to get there, and I'd like to have it balanced so this is the harder option to win.

I could actually make this happen just using the tools I currently have, the only missing element is the time to do it ..... and to do more modules for the PUD editor .... and build a Hi-Res front end for the client .... and ... um ... what was that other one? ... oh yeah - manage my federal court appeal so I don't lose my house, 75% of my superannuation and never see my kids again. BTW I am amazed that I am still here, I figure my ex must have had a holiday planned or something, but I'm pretty sure I'll be homeless some time this week...

Anyway, it's a cool idea. Maybe in a year or so when my great steaming turd-pile of a personal life settles down  ;)
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 25, 2017, 02:58:53 AM
Good morning ladies,

Having noticed the somewhat deafening silence following the initial enthusiasm to this project, I have added another module (http://forum.war2.ru/index.php?action=dlattach;topic=2852.0;attach=1066). It does the starting resources for each player. For this I have also added some support routines for a few things including converting decimal strings to integers and vice-versa, which anyone considering doing something here would probably have been looking for.

I did post the last update right before Christmas, so anyone with and actual life may have missed it, so....
                                                 *BUMP*

  ... have a go and even if you havn't got a working module, if you post your initial code here, I will help.  :)
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 04:40:22 AM
lol we all scattered

Hehe ... from what i could decipher of that post, ima upgrade "scattered" to "fully baked" - lol good for you. wp ;) But thanks for replying, EC, you're a trooper.

is it gonna be able to draw a pud and with added grime cut copy etc.....i mean this can be a master pud maker.

Well it can be whatever we want it to be... its only a matter of time and effort. No part of any PUD editing app - from the Blizz editor right the way through the list - is particularly complicated or technically challenging, its just a matter of making it happen.

I don't really want to devote big hours to sitting around coding the architypal PUD editor on my own, but I'm happy to contribute if others are willing to do so also. If a few people got enthusiastic about it, there's no reason why we couldn't produce a really slick PUD editor that does everything that we want to do with PUD files... i.e. all the things we can do with all the various tools all in one editor.

Then as it will be and open source colloboration, any time anyone comes up with a new idea (like say the "unbreakable wall" thing I did a while back) they can write a module to do it and add it into the editor.

At some stage I am planing to have it render the maps with the correct background terrain and unit graphics, as the Blizzard editor does. Not so much because this is really necessary for editing PUDs, just because it looks Uber Kewl 8) AND because I could then use that code as the basis for a new hi-res front end for the client.

I will do the graphics bit, when time allows, but as for most of the functions - like adjusting the unit properties or whatnot - these can be done as individual "modules" like I have done with the first couple of simple demo modules I made: For editing the Description string, and the starting resources.

ok on the makeit.bat ,system cannot find file??? i take this this is how you compile to it?

Yes. If you unpack the zip file into a single folder, you should just be able to double-click makeit.bat to compile the source. If it can't find a file this is probably because you don't have MASM32 installed on the computer. It's not a big download, and it's quite unobtrusive - dosn't mess with your OS and install everything AND the kitchen sink. I think its about 12MB download IIRC. Anyway, the make file expects it to be installed to "C:\MASM32" if you install it on a different drive, just use notepad to do a find/replace on "C:\" to "D:\" of whatever drive its on. (.BAT 'batch' files are just text files - right click and select 'edit').

... and of course there is a compiled .exe included in the zip file if you just want to have a look. Its just the source that's there compiled using that .bat file on my puter yesterday.

Have a look at the "modules" menu and then look at the corresponding PUDxxxx.inc source file..... and look at the PUDtemplate.inc file for instructions on how to go about making a module.

80 (00) value =01 bnet 00= custom map<--- very important this is set for custom maps

This could be a simple module: just have a single combobox with the 2 titles in it ... or maybe just use 'radio buttons' - whatever you like - to select "bnet" or "custom". Then have the code set the appropriate byte to 0x00 or 0x01, depending on what the selection is. Probably this would be included in a "Map Properties" module that would also set the map size, forest or winter... etc., but there's no reason why it can't be a module on its own either.


Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 05:31:12 AM
hex(h)
80 (00) value =01 bnet 00= custom map<--- very important this is

Ok. Not really sure, but I'm assuming the "80" at the start of this line is a file offset, i.e. the position in the PUD file where this value should be set ya??

Not sure, but i should give a quick description of how PUD files are formatted - perhaps you already know this IDK.

PUD FILE FORMAT

The PUD file format is like a simplified RIFF format (which, incidentally is what an AVI file is). It consists of sections. each section is formatted like this:

Code: [Select]
DWORD        4CC
DWORD        Size
(Size bytes)  Data

A '4CC' is a "four character code". It's just used like a name for the section, but it always contains exactly 4 characters ('DIVX' is a 4CC). 4CCs are kind of cool because they are easily readable by a human, and usually kind of describe what they denote, but also because they are exactly 4 bytes, and 4 bytes is a DWORD (32bit value) they can be handled by the processor as a single number and don't need to be processed as a string.... anyway, its a name that has 4 characters (letters).

i.e. the section that contains the starting gold for each player is called 'SGLD', and the section that contains the list of all the units on the map is called 'UNIT', while the section that contains the unit data (specs for each unit type... HP damage etc.) is called 'UDTA'

Most of the sections appear in all PUDs, some don't. i.e. the restriction section that allows a player to train certian units/upgrades but not others is called 'ALOW'. A 'normal' PUD that does not have any restrictions (you can have all the unit types) does not have an 'ALOW' section at all, however if this section is present WC2 will look at it and only allow the specified units/upgrades as per this section.

If you run my GrimEdit editor, and select Edit->Clipboard from the menu, you will see a list of common PUD sections. You can select the 4CC for each and it will display a (very) short description of what it is. You can then go to Modules->Player Properties, select a player, click one of the the "Units Allowed" etc. buttons and deselect a few things then click [Ok]. If you then go back to the "clipboard" you will see that an 'ALOW' section has been created and added to the PUD.

Many of the common sections that can appear towards the start of a PUD have a fixed length (i.e. 'SGLD' is always 32 bytes) which can make it appear that certain values occur at certain file offsets, because the sections are commonly written in the same order, however this is an illusion as the sections can be written in a different order or entirely new sections inserted into a PUD. ( this is how it is possible to create a file that is both a playable .PUD file and an executable .EXE file).

Also there are certianly sections whose length will vary from PUD to PUD... i.e. the size of 'UNIT' will depend on how many units are placed on the map.

It is by changing the sections that a PUD file is edited. If you look at the map description module in the ASM source you will see it loads/saves the 'DESC' section, while the Starting Resources module edits 'SGLD', 'SLBR' and 'SOIL'. There are (or used to be) descriptions of the common PUD sections floating around on the web.
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 05:41:47 AM
great i'll look at it....and see if i can change your shit around so i can use my stuff :P

The project - simple as it is - can already load and save a PUD file and we can create modules to do anything we want to it. So if you have a 'trick' etc. that you can only do with a hex editor, I can help you make a module so you can use the editor easily to do it for you...
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 05:43:20 AM
yea but its e0 (06) i was just bringing a example...i wouldnt use it at all....totally useless :P

Yeah, sweet. NP. I get it :)
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 06:55:04 AM
Oh Hey, here ya go, found the section definitions. I downloaded this from somewhere in like 2002 or something   :D

PUD Format
Spoiler
Nope lol sorry was too big... so I attached it instead ;)

So your offset 0x80 is the very start of the data for the 'UDTA' section.
You can see it here - random cusom PUD is Mini BGH (SS of my trusty Hex Editor - I wrote that golden oldie in '97 - been using it ever since  :P).

(http://ss.war2.ru/ss/9156.gif)

So the red box shows the section 4CC 'UDTA' the blue box contains the dword length of the data for that section - in this case 0x1640 bytes (5696 in ape numbers), and following that inthe green box is the value you are setting, which is actually a 2-byte 'WORD' value, but as it is either 0 or 1, the high byte (which comes second) is always 0, so only the first byte is modified.

As you can see from the included file:

------------------------------------------------------------
6: Section 'UDTA', Unit Data

        word            use default data (0 no, 1 yes)
        110 words       overlap frames
        508 words       obselete data (ignore it) was .....
-------------------------------------------------------------

... it's that first WORD value "use default data"

and just to illustrate the issue with using file offsets for this type of file, here's the same information from an earlier description of PUD internals, which is entitled "PUD Maximum File Format"
-------------------------------------------------------------------------
00:006A-00:006B   W Era number
        0=Forest,1=Icelands,2=Wastelands,3=Swamps
        *4-255=forest
00:006C-00:006F   $ Header description "ERAX"
00:0070-00:0073   L Expansion era data length ( 2 B)
00:0074-00:0075   W Expansion Era number
        0=Forest,1=Icelands,2=Wastelands,3=Swamps
        *4-255=forest
00:0076-00:0079   $ Header description "DIM "
00:007A-00:007D   L Dimensions data length ( 4 B)
00:007E-00:0081   W Map X and Y dimensions (0 ?? .. 128max)
        *Map is always loaded only by Y size
        *i.e. Y*Y map size
00:0082-00:0085   $ Header description "UDTA"
00:0086-00:0089   L Unit data length ( 5950 B )
00:008A-00:008B   W Set if Should be used default data
        0=no,1=yes

00:008C-00:0167   W Overlap frames for each unit (0..109)
        * group to belong number
        * see "UNIT" section for units order
00:0168-00:0265   W Obsolete General grafix frames
-------------------------------------------------------------------

However as you can see here the value is denoted as being at offset 0x8A because the PUD file being described also contains the optional 'ERAX' section.

The only thing that can be guaranteed is that it is the first WORD in the data for the 'UDTA' section.


The data lengths in each section header construct the file i.e. as the 'UDTA' section in the Mini BGH PUD here is 0x1640 bytes long and starts at 0x80 then the next section header will be at 0x1640 + 0x0080 = 0x16C0, and indeed if you go to offset 0x16C0 in this PUD you will find 'UGRD' the "Upgrades" section 4CC followed by the DWORD 0x0000030E because the data for this section is 0x30E bytes long...
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 11:03:30 AM
Simon Pelsser (Scorpions)....i got this dudes editor its good...
Oh good one. Havn't seen this before. Has a nice feel to the interface - big and easy to look at. I like that the player properties / starting conditions are all on the one dialog.

Although I have to say that my old editor does everything that this one does plus a whole lot more ;) Mind you, I did have all of Mr.Pelsser's research which he so kindly published to work with so big credit to him for that  8)

i can compile now!!! but the site had a big ass warning to new people loool i'm just mainly reading your code..and may steal :D im a terrible code pirate.

Oh cool Masm is a good thing. The DASM.bat batch file is handy too, just drop an .exe file on it and you get an instant disassembly in a text file.

No need to worry about big-ass warnings compiling this project. The only thing you could possibly mess up with it is a PUD file, and I'm sure you know how to make a backup copy of a PUD. Also you have all of the source code, and the guy who wrote it is happy to explain what every bit of it does ... until you get bored listening to him and head for the music thread lol :)

... and yes I'd be really happy if you reach the point where you can pirate bits of code from this project and use it for your own purposes ... go for it! After all the whole point is to to get people understanding ASM.  :fro:
 
Title: Re: A collaborative PUD editor.
Post by: Lambchops on February 26, 2017, 01:31:08 PM
i'm just mainly reading your code..


and you will probably want to have a look at the intro to ASM .pdf (http://forum.war2.ru/index.php?action=dlattach;topic=2852.0;attach=980) I posted a while back, if you haven't already, this will help you understand what's happening in the source.

Remember: You don't need to understand it all first off. You wont. That's normal. Just mess around with it and ask questions... the pieces will fall into place as you go.
Title: Re: A collaborative PUD editor.
Post by: easycompany on February 27, 2017, 07:09:54 PM
kk man still studying it,lots of pushing and pulling!
Title: Re: A collaborative PUD editor.
Post by: tupac on February 27, 2017, 07:37:42 PM
I'm going to try this out. Just been so busy with my new career. I never would of thought being a developer in a bussiness world would take all my free time and kill my motivation to finish programming old projects I started years ago. I even purchased a $1,200 alienware desktop and when I get home I don't even use it. So hopefully when I find the desire to return you will still be here.
Title: Re: A collaborative PUD editor.
Post by: easycompany on February 27, 2017, 09:28:56 PM
yeah keeping  u exhausted..well break on fellers not like we in a rush,someone got there half gal of fruit juice, gone back to listen to some music.


i think i found some more people to play sc1 tupac
Title: Re: A collaborative PUD editor.
Post by: Igognito on April 03, 2017, 09:07:29 AM
Lambchops, accept my sincere apologies. I took a 2-3month brake from war2 and forum for real life issues.
I'm returning now, so I will start re-reading the post when I find some time (as this is long!).

I hope I will be able to help out with it :-)

Cheerios
Title: Re: A collaborative PUD editor.
Post by: Lambchops on April 06, 2017, 04:50:59 AM
Hi peeps  :)

I'm not much help right now as I only have my phone - no puter  :'(  Hopefully I will get that sorted out before too long.
If you're interested I'd recommend reading the latest README and source comments more than reading this post.

(Edit)
... and the PUD file format i attached a couple of replies back