wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Warcraft Editing Tools
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-01-2009, 06:38 PM   #31
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Quote:
Originally Posted by Rising_Dusk
Somehow this Mr.Malte character has done the struct method with GMSI and without hashtables here.
I know you know now, but to save anyone else the trouble, he's wrong.
PurplePoot is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-01-2009, 07:18 PM   #32
Mr.Malte
User
 
Mr.Malte's Avatar
 
Join Date: Apr 2008
Posts: 286

Submissions (2)

Mr.Malte is on a distinguished road (11)

Default

I am not wrong. You are wrong.

Do these changes:
  • Having nicer names for the members
  • Add minDamage and maxDamage
  • Return structs instead of having many functions. And make the struct members currently added visible in sth. like a comment.
  • Add a static list thing where data are loaded into structs after they've been gotten the first time. Very important. And please credit me for that (since it's my idea)
  • Writing //! LoadData armor is better than //! LoadData fd43

And I'll approve of this tool (don't know if approve of is the right expression. Looked it up in a dictionary).
Although it took me many hours to finish.

This is how the staitc list works:

Quote:
The system is able to return structs with the function GetUnitProperty(u) that contain many useful object editor data about the units, like damage or armor. But if all the data are stored into structs directly, it would be extremely bad for your memory. So this has got a nice trick:
All information the GMSI code reads out about units are stored in a big function, called the static list. If a user wants to get the UnitProperty struct of a unit the first time, a huge function is called (the static list) that runs a lot of ifs which check the unit type of the unit. At a certain point, where the unit type is 'found' the static list returns a struct using the .create method. Then the struct is stored in a table with the unit id as key.
The next time a user wants to get the information about the unit, the system reacts very quickly - because it does not have to run all the 1700 ifs. And the memory is kept low, making this system actually 'possible'.

Man, that's important.

Quote:
Somehow this Mr.Malte character has done the struct method with GMSI and without hashtables here.

That was the hardest part :O
Making GMSI recognize all the members the users want to have and extracting the important data from them.

edit: Oh, and I think GMSI should be included, too.

Last edited by Mr.Malte : 12-01-2009 at 07:21 PM.
Mr.Malte is offline   Reply With Quote
Old 12-01-2009, 07:42 PM   #33
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Quote:
Originally Posted by Mr.Malte
I am not wrong. You are wrong.
Do you even read the libraries you use?

Quote:
Originally Posted by Mr.Malte
Do these changes:
Having nicer names for the members
I'm open to suggestions.

Quote:
Originally Posted by Mr.Malte
Add minDamage and maxDamage
Why?

Quote:
Originally Posted by Mr.Malte
Return structs instead of having many functions. And make the struct members currently added visible in sth. like a comment.
Why?

Quote:
Originally Posted by Mr.Malte
Add a static list thing where data are loaded into structs after they've been gotten the first time. Very important. And please credit me for that (since it's my idea)
Not only is it not your idea (Bobo asked me over the phone to do that last week, and Dusk and Bobo both asked me to do that in this tool) but I have no intention of making this tool rely on structs.

Quote:
Originally Posted by Mr.Malte
Writing //! LoadData armor is better than //! LoadData fd43
Ah, but is it better than //! LoadData udef?

Loading the field names not only seems unnecessary, but often the field names are arcane as well (who would guess Awakentip before looking it up?). The reason I use the rawcodes is because they are already accessible in the JNGP object editor, rather than the user having to look through UnitMetaData.slk.

Quote:
Originally Posted by Mr.Malte
This is how the staitc list works:

Man, that's important.
Not really. Warcraft is already storing an order of magnitude more data than this system ever will. Hell, just think, users might have to load 1700 ifs and struct initializers into memory for the script (which is in fact more than just loading the info into hashtables directly)!
PurplePoot is offline   Reply With Quote
Old 12-01-2009, 07:51 PM   #34
Mr.Malte
User
 
Mr.Malte's Avatar
 
Join Date: Apr 2008
Posts: 286

Submissions (2)

Mr.Malte is on a distinguished road (11)

Default

Quote:
Why?
There are stupid and lazy users.
It is easier to work with minDamage and maxDamge than working with dmgplus and sides and so on.

Quote:
Why?

Because I like it better. And dusk likes it better, too.
And you said that you were gonna upate this if some people like it better.
Because it is better (faster and more structured. I like it better.)

Quote:
Not only is it not your idea (Bobo asked me over the phone to do that last week, and Dusk and Bobo both asked me to do that in this tool) but I have no intention of making this tool rely on structs.

.. Are you serious? Dusk knows my thread. Why did Bobo ask when this will not be relying on structs anyways?

Quote:
Ah, but is it better than //! LoadData udef?

Loading the field names not only seems unnecessary, but often the field names are arcane as well (who would guess Awakentip before looking it up?). The reason I use the rawcodes is because they are already accessible in the JNGP object editor, rather than the user having to look through UnitMetaData.slk.
I mean the name you gave the field

Quote:
Not really. Warcraft is already storing an order of magnitude more data than this system ever will. Hell, just think, users might have to load 1700 ifs and struct initializers into memory for the script (which is in fact more than just loading the info into hashtables directly)!

It is much, much better. Much more efficient.
200 * used units values < 200 * 800 unit values.
Most data are probably never ever needed. It's just a stupid waste to make this memory unefficient.

Last edited by Mr.Malte : 12-01-2009 at 07:51 PM.
Mr.Malte is offline   Reply With Quote
Old 12-01-2009, 07:55 PM   #35
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Quote:
Originally Posted by Mr.Malte
There are stupid and lazy users.
It is easier to work with minDamage and maxDamge than working with dmgplus and sides and so on.
GetRandomInt(minDamage,maxDamage) is not an accurate way to get a unit's damage.

Quote:
Originally Posted by Mr.Malte
Because I like it better. And dusk likes it better, too.
And you said that you were gonna upate this if some people like it better.
Because it is better (faster and more structured. I like it better.)
And plenty of people don't like it better. I tend to side with those that don't, and it will take a lot more than three people (one of whom, my brother, is infamous for having unreadable code) to convince me otherwise.

Quote:
Originally Posted by Mr.Malte
.. Are you serious? Dusk knows my thread. Why did Bobo ask when this will not be relying on structs anyways?
Because he (Bobo) wanted it to? It's not like loading data into structs is a "Eureka!" moment.

Quote:
Originally Posted by Mr.Malte
I mean the name you gave the field
And how do you give the name to the field? You would have to specify the field rawcode... oh wait, that's what we're doing right here.

Quote:
Originally Posted by Mr.Malte
It is much, much better. Much more efficient.
200 * used units values < 200 * 800 unit values.
Most data are probably never ever needed. It's just a stupid waste to make this memory unefficient.
Where did 800 come from? Also, this is pure theorycraft and I'd like to see you back it up with anything solid and relevant enough to warrant change.
PurplePoot is offline   Reply With Quote
Old 12-01-2009, 08:07 PM   #36
Mr.Malte
User
 
Mr.Malte's Avatar
 
Join Date: Apr 2008
Posts: 286

Submissions (2)

Mr.Malte is on a distinguished road (11)

Default

Quote:
GetRandomInt(minDamage,maxDamage) is not an accurate way to get a unit's damage.
Who told you I were gonna do that.

Quote:
Where did 800 come from?
800 = number of predefined blizzard units

Quote:
And plenty of people don't like it better. I tend to side with those that don't, and it will take a lot more than three people (one of whom, my brother, is infamous for having unreadable code) to convince me otherwise.

Which ones?
It's much better.

Quote:
And how do you give the name to the field?

The function names are not like GetUnitdef or GetUnitcool1, are they :P
Should be clear which names I mean.

I think you're just too lazy to update this to structs.
Mr.Malte is offline   Reply With Quote
Old 12-01-2009, 08:13 PM   #37
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Quote:
Originally Posted by Mr.Malte
Who told you I were gonna do that.
Don't see any other practical use for those values.

Quote:
Originally Posted by Mr.Malte
800 = number of predefined blizzard units
I don't load predefined units unless the user modified them. If I did, I would allow the user to specify which races they wanted to load.

Quote:
Originally Posted by Mr.Malte
Which ones?
Myself, Earth-Fury, and presumably most people who haven't said that they thought structs would be better.

Quote:
Originally Posted by Mr.Malte
It's much better.
Can you justify that statement?

Quote:
Originally Posted by Mr.Malte
The function names are not like GetUnitdef or GetUnitcool1, are they :P
Should be clear which names I mean.
No. However, I wouldn't like to write

//! LoadUnitData DamageBase1 ArmorBase

In addition, looking up those names would take just as long as (if not longer than) looking up the rawcode names.

Quote:
Originally Posted by Mr.Malte
I think you're just too lazy to update this to structs.
No, because if I loved structs so much I would have written it that way initially, and if I was lazy I wouldn't be planning to rewrite everything from scratch, let alone constantly changing implementations and adding features.

I am not required by the rules of WC3C to have your approval to make a tool, especially since you seem to think that your opinions are the absolute truth and expect us to eat it up.
PurplePoot is offline   Reply With Quote
Old 12-01-2009, 08:30 PM   #38
Mr.Malte
User
 
Mr.Malte's Avatar
 
Join Date: Apr 2008
Posts: 286

Submissions (2)

Mr.Malte is on a distinguished road (11)

Default

Quote:
I don't load predefined units unless the user modified them.
Very nice :)
Now you just have to make this work with a static list. It will drastically reduce the number of internal used lines of codes and it will make the system more efficient.
You should take a look at the painting.

Quote:
Don't see any other practical use for those values.
Doesn't mean there are none.
What is the better practical use of damagebase and dice?

Quote:
most people who haven't said that they thought structs would be better.
No structs, no good optimization by static list. Not optimized tool.
It's very easy to speak for all those people who didn't post anything.
I can do the same and write: All the people who don't post are on my side.

Quote:
Can you justify that statement?
It's faster.

Quote:
No. However, I wouldn't like to write

//! LoadUnitData DamageBase1 ArmorBase

In addition, looking up those names would take just as long as (if not longer than) looking up the rawcode names.

Id rather write //!LoadUnitData Armor than //! LoadUnitData def.
That's what I meant by nice member naming. If I'd try to get units armor, i'd probably think of armor and not of armorbase

Quote:
I am not required by the rules of WC3C to have your approval to make a tool
Nasty Lexikon >.<!
I knew I got a wrong word. Let me express myself like this: I will support your tool instead of my system then. Otherwise I still see advantages in my system and try to get it approved.

Quote:
especially since you seem to think that your opinions are the absolute truth and expect us to eat it up.
I'm sorry.

==========

I Just want to help you.
Not fight you.
Well.. By fighting you^^

Last edited by Mr.Malte : 12-01-2009 at 08:31 PM.
Mr.Malte is offline   Reply With Quote
Old 12-01-2009, 08:59 PM   #39
Furby
User
 
Furby's Avatar
 
Join Date: Oct 2008
Posts: 26

Submissions (1)

Furby has little to show at this moment (7)

Send a message via ICQ to Furby Send a message via AIM to Furby Send a message via MSN to Furby
Default

Okay, I downloaded tool, unzipped everything (also wehack.lua (and replaced old one with new one)), opened WE, opened your demo map, compiled with no errors, then I copied your trigger, created new map and pasted that trigger in it, compiled map and got this:



I might be absolutely wrong at what I'm doing, but I tried to follow all your steps, though I also might forgot to do some step. I just want to know what I did wrong. Thank in advance.
__________________
Living in the fantasy, that would be a life.

Last edited by Furby : 12-01-2009 at 09:00 PM.
Furby is offline   Reply With Quote
Old 12-01-2009, 09:03 PM   #40
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,186

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

A struct with object editor values can easily be implemented by the libraries that use this tool. As far as I'm concerned, a set of GetUnitType* functions that inline to hastable calls is perfectly acceptable and preferable to the code bloat caused by the struct.

If you really careare obsessed about speed, a hashtable-based struct access isn't good enough in the first place, you'd instead want to get the struct from an array using the unit's custom value or the unit's type id as the index which are both map-specific solutions (the first requires a unit indexing system, the second requires specific custom ids) that can not be provided by this tool, but need to be coded by the user.
__________________
Anitarf is offline   Reply With Quote
Old 12-01-2009, 09:10 PM   #41
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Quote:
Originally Posted by furby777
Okay, I downloaded tool, unzipped everything (also wehack.lua (and replaced old one with new one)), opened WE, opened your demo map, compiled with no errors, then I copied your trigger, created new map and pasted that trigger in it, compiled map and got this:



I might be absolutely wrong at what I'm doing, but I tried to follow all your steps, though I also might forgot to do some step. I just want to know what I did wrong. Thank in advance.
Could you attach the map so I can have a look?
PurplePoot is offline   Reply With Quote
Old 12-01-2009, 09:11 PM   #42
Mr.Malte
User
 
Mr.Malte's Avatar
 
Join Date: Apr 2008
Posts: 286

Submissions (2)

Mr.Malte is on a distinguished road (11)

Default

Quote:
A struct with object editor values can easily be implemented by the libraries that use this tool. As far as I'm concerned, a set of GetUnitType* functions that inline to hastable calls is perfectly acceptable and preferable to the code bloat caused by the struct.

If you really careare obsessed about speed, a hashtable-based struct access isn't good enough in the first place, you'd instead want to get the struct from an array using the unit's custom value or the unit's type id as the index which are both map-specific solutions (the first requires a unit indexing system, the second requires specific custom ids) that can not be provided by this tool, but need to be coded by the user.

A struct doesn't cause code bloat if the create function is good.
But actually I like your arguments. They are persuading.
But it's just that I don't understand not using structs. It will be either as fast as functions or faster (multiply used in functions).

However, then you should still add the static list and rename some members (will make a list of suggestions tomorrow, I have to get up early tomorrow and going to bed too late would really suck)
Mr.Malte is offline   Reply With Quote
Old 12-01-2009, 09:13 PM   #43
Furby
User
 
Furby's Avatar
 
Join Date: Oct 2008
Posts: 26

Submissions (1)

Furby has little to show at this moment (7)

Send a message via ICQ to Furby Send a message via AIM to Furby Send a message via MSN to Furby
Default

Quote:
Originally Posted by PurplePoot
Could you attach the map so I can have a look?
Well, it's just new map with your trigger, copied straight from your demo map. But if you want. Here ya go.
Attached Files
File Type: w3m TestingODE.w3m (20.7 KB, 19 views)
__________________
Living in the fantasy, that would be a life.
Furby is offline   Reply With Quote
Old 12-01-2009, 09:32 PM   #44
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

Quote:
Originally Posted by furby777
Well, it's just new map with your trigger, copied straight from your demo map. But if you want. Here ya go.
You have no custom units, so it isn't generating any code.
PurplePoot is offline   Reply With Quote
Old 12-01-2009, 09:36 PM   #45
Furby
User
 
Furby's Avatar
 
Join Date: Oct 2008
Posts: 26

Submissions (1)

Furby has little to show at this moment (7)

Send a message via ICQ to Furby Send a message via AIM to Furby Send a message via MSN to Furby
Default

Uh, silly me! You should add that information to the first post.
__________________
Living in the fantasy, that would be a life.
Furby is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 04:09 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2018, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services