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 > Resources > Code Resources > Systems
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-07-2007, 02:35 PM   #16
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

I did create an arithmetic way to solve for the XP, but had a few rounding error problems (apparently 663.000 == 662 with a R2I() call).

Collapse JASS:
globals
    real array XPforLevel
    constant real XP_REQUIRED_CONSTANT_FACTOR = 68.00
    constant real XP_REQUIRED_LEVEL_FACTOR = 125.00
    constant real XP_REQUIRED_PREVIOUS_LEVEL_FACTOR = 1.10
    integer array XP_REQUIRED_TABLE
endglobals
    
function GetRequiredXP takes integer forlevel returns real
    if XPforLevel[forlevel] != 0 then
        return XPforLevel[forlevel]
    endif
    if forlevel < 2 then
        return 0
    endif
    if XP_REQUIRED_TABLE[forlevel] != 0 then
        set XPforLevel[forlevel] = XP_REQUIRED_TABLE[forlevel] // get value from table
        return XPforLevel[forlevel]
    endif
    if forlevel == 2 and XP_REQUIRED_TABLE[forlevel] == 0 then
        set XPforLevel[forlevel] = 200 // default if none existed
        return XPforLevel[forlevel]
    endif
    set XPforLevel[forlevel] = ((GetRequiredXP(forlevel-1)*XP_REQUIRED_PREVIOUS_LEVEL_FACTOR)+(XP_REQUIRED_LEVEL_FACTOR*forlevel)+XP_REQUIRED_CONSTANT_FACTOR)
    return XPforLevel[forlevel]
endfunction

The problem is that it must return a real for the rounding of the next-level-calculations to be accurate. This method also requires more user-input (all the game-play constant values) vs only a max level.

I personally like the other method better. Once you create the hero once (which I do at map init), there is no noticeable lag. I also don't have to worry about weird rounding issues, since the game has done all the calculations internally. And hey, it only gets the value by creating a unit if the value is not already pre-set. I actually got the idea to use the hero from the GetItemCost function.
__________________
Ammorth is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-07-2007, 04:06 PM   #17
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
I actually got the idea to use the hero from the GetItemCost function.
I noticed. :p
It's still cool though, and I agree, your other method does seem cleaner and requires less user-input. You also don't even need the input for max level. Just check if the level changes when you add a level and voillah, if it doesn't it hit max and you can return 0.0 or something and if it did then you can return an actual value.

Good stuff.
__________________
Rising_Dusk is offline   Reply With Quote
Old 12-08-2007, 07:22 AM   #18
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

Updated. v1.10 is finished. Read the read-me for updates, I'm going to bed.
__________________
Ammorth is offline   Reply With Quote
Old 12-08-2007, 05:33 PM   #19
Anopob
Yay!
 
Anopob's Avatar
 
Join Date: May 2006
Posts: 870

Anopob has a spectacular aura about (120)

Default

Whoa that's awesome, though I failed with 1% left in the game (damn it!). +rep
__________________
Give +REP to people who help you with things or make good resources.
Better Ways of Requesting For Help - Race Contest #2 WIP Thread (Bone Race)
As of December 1st I have my blue rep. Yay :D
Anopob is offline   Reply With Quote
Old 12-09-2007, 12:57 PM   #20
MaD[Lion]
MaD Da ViNci
 
MaD[Lion]'s Avatar


Respected User
 
Join Date: Apr 2003
Posts: 1,699

Submissions (10)

MaD[Lion] is a jewel in the rough (225)MaD[Lion] is a jewel in the rough (225)MaD[Lion] is a jewel in the rough (225)MaD[Lion] is a jewel in the rough (225)

Default

nice map, nice design, nice system. Awesome!
__________________
Current Projects:
MaDOS (outdated)System for object movements & effects - NEW VERSION IS UNDER W.I.P
Cinematic SystemSystem for making better cinematics and with fancy effects
Timing SystemTiming system that simulates the usage of PolledWait just with 0.01 accuracy
MaD[Lion] is offline   Reply With Quote
Old 12-09-2007, 01:38 PM   #21
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

I like the map, and the way the system looks, I don't like the code.

The problem is that it is just doing too much, the whole unit life, mana, experience stuff should be an usage example outside the system's code, and avoid including that XP function in this library, the library itself should only have the basic tools to create a multiboard progress bar with whatever image and name you want to give it. The actual creation of them should be outside it, as sample triggers, or if you want as another library.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 12-09-2007, 04:21 PM   #22
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

Quote:
Originally Posted by Vexorian
The problem is that it is just doing too much, the whole unit life, mana, experience stuff should be an usage example outside the system's code, and avoid including that XP function in this library, the library itself should only have the basic tools to create a multiboard progress bar with whatever image and name you want to give it. The actual creation of them should be outside it, as sample triggers, or if you want as another library.

I'm going to have to disagree with you here. Systems are designed to make the life easier for the people using them. It wouldn't make sense to use a system if it made your code harder to make. One of the key uses (as illustrated by my demo map) is health, mana, and experience bars. Including dynamic bars that only take 2 lines of code (if using a label) is what I consider easy. For someone having to re-create the code that updates these bars could out-weigh how easy the implementation is. Then they ask their selves: Is it really worth it?

And if a person doesn't want to use the health, mana, exp bars, just set the period to 5 or 10 seconds. If there are no unit bars in existences, it closes the loop right away.
__________________
Ammorth is offline   Reply With Quote
Old 12-09-2007, 05:08 PM   #23
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Systems indeed are made to make things easier for people but codes that suffers from "do it all" syndrome are actually useless because of their magnitude (perfect example would be Vexorian's caster system as opposed to using only CSSafety)


So I must totally agree with Vexorian here,
you need to split multibars core code from specific stuff.
Just do exactly as Vexorian described and you shall be fine.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.

Last edited by cohadar : 12-09-2007 at 05:09 PM.
cohadar is offline   Reply With Quote
Old 12-09-2007, 07:35 PM   #24
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
but codes that suffers from "do it all" syndrome are actually useless because of their magnitude
This system is like making the caster system and include all the spells I made with it in the same library as opposed to keep things like system and applications separate. Rather than a multi function system it is working more as a sample or template than a system. Rather closer to ABC instantiating the textmacro forcing global A, B and C hashes...


Quote:
'm going to have to disagree with you here. Systems are designed to make the life easier for the people using them.

Quote:
It wouldn't make sense to use a system if it made your code harder to make.
Hence the reason I ask you about this change. I don't want a mana bar, I don't want an experience bar, etc. I want to make my own bar and place it in any place of any multiboard and let it have whatever graphics I want and let it measure whatever I want.


Quote:
One of the key uses (as illustrated by my demo map) is health, mana, and experience bars. Including dynamic bars that only take 2 lines of code (if using a label) is what I consider easy. For someone having to re-create the code that updates these bars could out-weigh how easy the implementation is. Then they ask their selves: Is it really worth it?

Nobody is asking you to remove the applications of it, just to keep applications outside the system's library. Let me try to explain it "A system has to be used and not include its own uses"

You should make your system be able to work without that XP function, without any MANA or HEALTH constant, etc. Let another library do it. It is an extra abstraction layer that will let your users keep using 2 calls for your stuff but will also make it more powerful for other guys, right now it looks more viable to me to code my own multiboard progress bar than to use your system.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 12-09-2007, 08:05 PM   #25
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Ammorth: your system is very good, but the mana, life and experience bars shouldn't be part of the core library. Instead you can offer with the pack a library which will be like a "plugin", a library which will require the core bar library, which will offer to the user a "ready to use" life, mana and /or experience bar.

Take advantage of the require library feature, and make modular your resource.
moyack is offline   Reply With Quote
Old 12-09-2007, 08:20 PM   #26
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

offtopic:
Quote:
Originally Posted by Vexorian
Rather closer to ABC instantiating the textmacro forcing global A, B and C hashes...

Fighting fire with fire khe khe...
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-09-2007, 09:27 PM   #27
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

Split the system. Hopefully all is well now.
__________________
Ammorth is offline   Reply With Quote
Old 01-04-2008, 07:09 AM   #28
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

Soo... I know it's the holidays and everyone is probably doing stuff, but whats the status of this? I doubt I will be able to do much after the holidays are up since exams are approaching.
__________________
Ammorth is offline   Reply With Quote
Old 01-04-2008, 11:52 PM   #29
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

I'll check it out right now!!!

EDIT: Ok, checked again and I only have one complain: I won the game but still I lost WHY??? WHY???? This bug must be fixed immediately or I'll found where you live and I'll kick in your ass!!

I'm so angry that I'm going to fuck you in the worst way!!!

** Approved **

I like your system, and you did a very good test script of it, there's no bugs or anything odd. And the usefulness of this is very wide. Excellent work :)

Last edited by moyack : 01-05-2008 at 12:15 AM.
moyack is offline   Reply With Quote
Old 01-05-2008, 04:52 AM   #30
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

Quote:
Originally Posted by moyack
EDIT: Ok, checked again and I only have one complain: I won the game but still I lost WHY??? WHY???? This bug must be fixed immediately or I'll found where you live and I'll kick in your ass!!

I'm so angry that I'm going to fuck you in the worst way!!!

Ill take it you didn't read the note about how I don't give a shit about the demo game :P

The reason you both won and lost is because you have NoPause enabled through war3err. When you win, it pauses the game. Not being able to pause allows the timer to continue, forcing you to lose.

Gameover

Retry?
Y/N
__________________
Ammorth 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 01:52 AM.


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

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