Ns Res Calculator

UnknownUnknown Join Date: 2002-06-12 Member: 759Members
edited February 2003 in NS General Discussion
<div class="IPBDescription">I was bored so..... eh</div> I made a resource calculator because I was bored.

Just download and unzip to anywere and your set to go. Its nothing special, fancy, big, flashy, etc.


I believe I got the resource model correct, but if I made a mistake please tell me.

Note: Only works for Windows OSs and maybe Linux (I don't have a Linux machine so I don't know).
«1

Comments

  • uranium_235uranium_235 Join Date: 2002-11-20 Member: 9478Banned
    edited January 2003
    I think it needs a patch <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    Ed: Wtf... file didn't upload? Crap
  • uranium_235uranium_235 Join Date: 2002-11-20 Member: 9478Banned
  • masterswordmanmasterswordman Join Date: 2002-12-21 Member: 11303Members
    DOH <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    Hmm thats strange... I'll try using a different sorce code. (I used ccc_ansi.cpp in this one. I'll change it to apstrings and iostream.h in the next one. Also note that I am using a compiler that was mostly written for Win3.1 <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink.gif' border='0' valign='absmiddle' alt='wink.gif'><!--endemo-->)
  • masterswordmanmasterswordman Join Date: 2002-12-21 Member: 11303Members
    English, please speak english <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->.
  • DoADrunkMonkeyDoADrunkMonkey Join Date: 2003-01-05 Member: 11902Members
    man, i always thought it didn`t matter how many players you or the other team had.
    what equation are you useing?

    i got.
    res = nodes * 0.31 * seconds
    P.S u can rerange it remember, so you can find how long it takes to get X res with X nodes.
    E.G.
    69.4 seconds for 22 res with 1 node.

    Hell ta this!
    ASK THE CODERS!
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    edited January 2003
    Heh, I did not relize that most ppl have no idea what I'm talking about.


    But here is the exact code I used for the alien side.

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->team_resources_gained=(num_players * .23 * num_resource_towers) * (num_enemy_players/num_own_players);

    resources_gained=team_resources_gained/((num_own_players - num_gorges) + (num_gorges * 3));

    if (player_gorge == 'Y' || player_gorge == 'y')
    resources_gained*=3;<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    I think ours are differing so much because I'm using .23 and you are using .31 I am not sure what the current one is, but this is the most common # I found on the forums.

    EDIT: Yes, the # of res does depend on the # of players on each team. It also depends how even the teams are. Hence the (num_enemy_players/num_own_players).
  • JKooLJKooL Join Date: 2002-12-24 Member: 11492Members, Constellation
    The res calculations also take into effect how many players are on each team. Teams with more players get less resources.

    -JKooL
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    BTW, for the people that this program did work (if any), tell me somethings that will hopefully make this more efficent and useful.
  • pantspants Join Date: 2002-12-20 Member: 11188Members
    worked well for me on xp, it just looks kinda crap <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
  • ElricElric Join Date: 2002-11-13 Member: 8448Members
    You have to add the whole thing by 10 for it to be accurate. With 0 rt, you get 10 RP/minute and then the RT's add from there.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    edited January 2003
    <!--QuoteBegin--sp@zmong+Jan 18 2003, 05:26 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (sp@zmong @ Jan 18 2003, 05:26 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->worked well for me on xp,  it just looks kinda crap <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--><!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Nothing I can do about that... yet. I'm still just a rookie at this. (2nd year of programming in HighSchool using a 2nd year college book)

    Ty Elric, I was wondering how people were getting the + 10 mine is figured for per tick though. So I should just add +1 considering there are about 10 ticks in each minute.

    Also, there is a bug in the program. It will not work correctly if the teams are uneven because it only returns an int and not a double like I told it to. Error in the function call. I stink at finding small errors.... <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' valign='absmiddle' alt='sad.gif'><!--endemo-->
  • s_viper3s_viper3 Join Date: 2003-01-16 Member: 12363Members
    HaHAhahaHAH AH Ahahahaha lol tell me the formula formally and I'll write a nice fully GUI version of the program in 5 minutes. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    Well, I would like to get all the bugs out of it first before any fancy stuff is done.


    Also, I find this amusing that more ppl downloaded this little thing then my rpg game. (100% text based and based off a message board rpg..... don't ask. If you want the game, tell me in a PM or something, and I might put the zip in the off topic section. Check out the forums @ www.smashbrosonline.com. I am Link Leader there.)
  • s_viper3s_viper3 Join Date: 2003-01-16 Member: 12363Members
    Ok unknown, I felt bad for doing this, but I went through this forum and got the formulas for the calculations (Im not sure if I got the marine one right but ohwell)
    So I went and made a windows version. Took about 10 minutes or so, from scratch. heh <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    download here
    <a href='http://files.nullfusion.com/nsResGuesser.zip' target='_blank'>http://files.nullfusion.com/nsResGuesser.zip</a>

    If you want its source, email me <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo--> you can keep it and work on it.
  • s_viper3s_viper3 Join Date: 2003-01-16 Member: 12363Members
    BTW: Im using the formulas that unknown posted in that one post. If they are wrong, tell me the correct formulas, and Ill put em in. I don't know crap about this.

    Ohyeah, Ill add a backwards converter option when I wake up tomorrow.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    edited January 2003
    What did you make that with? I'm wondering if I can do something like that too for my other programs.... outshine everyone else in my class <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    EDIT:

    I think I found out something wrong with the <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->team_resources_gained=(num_players * .23 * num_resource_towers) * (num_enemy_players/num_own_players);<!--c2--></td></tr></table><span class='postcolor'><!--ec2--> formula.

    I believe you should add 1 to it so it would look like this <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->team_resources_gained=(1 + num_players * .23 * num_resource_towers) * (num_enemy_players/num_own_players);<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    I have not tested it with this yet, but I was told by someone to add 10 because you are supposed to get 10 res a min per node (about). But since mine goes by per tick and there are ~10 ticks per min, so I just did 10/10 and got 1. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    EDIT2: Its fine, I had a feeling someone would do that. I was thinking of keeping just for my clan, but I wanted feedback and was hoping to learn something. And if you tell me how you did that, I'll learn something. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' valign='absmiddle' alt='biggrin.gif'><!--endemo-->
  • Eater1Eater1 Join Date: 2002-12-18 Member: 11106Members
    edited January 2003
    You can do GUI's very easily with VB if you're feeling lazy, or you can try your hand at windows programming, but it's a bit of a pain to get started - the entry function alone, plus the code to open an empty window, takes about 30 lines of code (in C++), and then you have to actually code the GUI. If you just wanna do quick little programs like this, go with VB.

    [EDIT] BTW, I don't mean to be picky (well, actually, I do), but "magic factor" is not technically the correct term. It should be "magic coefficient"

    Eater.
  • s_viper3s_viper3 Join Date: 2003-01-16 Member: 12363Members
    Yup, that little proggie was written in VB. You'd be crazy to write that in raw C or even delphi.
    As of Windows 2000, all the core VB dependencies are imbedded into the system. So there's no reason not to use it for quick, cheap little programs. Escpecially ones that don't need speed. If you want speed in VB, there is a program that will convert a VB project into a C source project in MS visual C. then you run the 'VB c-code optimizer' on it, and it will heavily optimize alot of the inefficincies in the c code to make the widgets, etc. respond like VB. At the same time, it will also remove the VB dependecies and if your really smart, implement MFC classes so then you have a 5kb exe with no dependencies.

    Didn't deem most of that necessary <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->

    That program was compiled in MS C++.
  • TheHornetTheHornet Join Date: 2002-10-31 Member: 1776Members, Constellation
  • DaemonlaudDaemonlaud Join Date: 2002-12-30 Member: 11637Members
    edited January 2003
    Bugs...(to the first prog)

    ok 1) answering 'no' to another calcuation doesn't quit the window but just hangs the prog
    2) I can't get the Khaara to actually give me a number.
    I answer the questions and it asks - Do I want to do another calc?

    Well, an answer to the first one would be nice.
  • scitzo85zscitzo85z Join Date: 2002-11-09 Member: 7917Members
    <!--QuoteBegin--Unknown+Jan 18 2003, 11:52 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Unknown @ Jan 18 2003, 11:52 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Heh, I did not relize that most ppl have no idea what I'm talking about.


    But here is the exact code I used for the alien side.

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->team_resources_gained=(num_players * .23 * num_resource_towers) * (num_enemy_players/num_own_players);

    resources_gained=team_resources_gained/((num_own_players - num_gorges) + (num_gorges * 3));

    if (player_gorge == 'Y' || player_gorge == 'y')
    resources_gained*=3;<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    I think ours are differing so much because I'm using .23 and you are using .31 I am not sure what the current one is, but this is the most common # I found on the forums.

    EDIT: Yes, the # of res does depend on the # of players on each team. It also depends how even the teams are. Hence the (num_enemy_players/num_own_players).<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    ok, i know nothing about the language you wrote this in ( i know a good deal of java & C++, but thats it)
    but this statement seems a little odd to me:

    resources_gained*=3;

    shouldnt it be something like: resources_gained = resources_gained * 3; ??

    that multiplication sign in front of the = just bothers me...but maybe thats just a feature for that language....
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    <!--QuoteBegin--scitzo85z+Jan 19 2003, 09:53 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (scitzo85z @ Jan 19 2003, 09:53 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->ok, i know nothing about the language you wrote this in ( i know a good deal of java & C++, but thats it)
    but this statement seems a little odd to me:

    resources_gained*=3;

    shouldnt it be something like: resources_gained = resources_gained * 3; ??

    that multiplication sign in front of the = just bothers me...but maybe thats just a feature for that language....<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Might want to buy some new Java and C++ books; C/C++/Perl/PHP/Java/many other languages have:

    +=
    -=
    *=
    /=

    at the minimum. They function just like you assumed. (a += b) == (a = a + b). Usually covered in chapter two of any given book. Look under "operators."
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    edited January 2003
    <!--QuoteBegin--Daemonlaud+Jan 19 2003, 03:33 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Daemonlaud @ Jan 19 2003, 03:33 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Bugs...(to the first prog)

    ok 1) answering 'no' to another calcuation doesn't quit the window but just hangs the prog
    2) I can't get the Khaara to actually give me a number.
    I answer the questions and it asks - Do I want to do another calc?

    Well, an answer to the first one would be nice.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    1) I'm a n00b programmer so I don't know how to make it do that its self. So stop being lazy and use that mouse (or alt + F4). <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' valign='absmiddle' alt='tounge.gif'><!--endemo-->

    2) Because you spelt Kharaa wrong. The 2 'a's are at the end, not after the 'h'. Or you can just type in "Alien" or "alien". You just have to spell it correct. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->


    And yes, *= is just shorthand. I'm a lazy typer (when it comes to programming) so I use shorthand..
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    <!--QuoteBegin--Unknown+Jan 18 2003, 07:15 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Unknown @ Jan 18 2003, 07:15 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->2nd year of programming in HighSchool using a 2nd year college book<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    hey wtf have you learned in two years? using += ?
    lol I think you should be able to do a GUI after two years...

    and for your compilator... download borland compiler it's free but it's at the command line...
  • DoADrunkMonkeyDoADrunkMonkey Join Date: 2003-01-05 Member: 11902Members
    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->You'd be crazy to write that in raw C or even delphi. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    man what you talking about, VB and delphi are practically the same apart from delphi doesn`t need 7 meg of run times and doesn`t stop working after a couple of days and works whenever and whatever.

    Dude, its just a simple maths how could you not do that in raw c? you could do it in asm if you really wanted!
  • FireStormFireStorm Join Date: 2002-11-06 Member: 7390Members
    I think delphi is great for beginners and VB sucks...
    Don't reduce delphi to a piece of ****.
  • KaineKaine Join Date: 2002-08-07 Member: 1096Members, Constellation
    I learned programming in delphi. although i never formally learned it, so my code is really hacky. quite often tho, my l33t programmer mates send me code when they can't get it to work or want it optimized, 'cause i quite often see simple solutions to things they have learnt to do the hard way, its great fun <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' valign='absmiddle' alt='biggrin.gif'><!--endemo--> VB sucks my testicles. Delphi owns, becuase of its tiny filesizes and total lack of dependencies. i love it.
  • DoADrunkMonkeyDoADrunkMonkey Join Date: 2003-01-05 Member: 11902Members
    yeah i`am afraid so, i tryed both and i just find delphi more versatile and adjustable but i don`t wanna anoy anyone who does use VB.

    just my opinion that VB waddles in pits of donkey crud compared to delphi, its just cos VB has backing of microshit thats why they usually get sucked into it first at school.
  • UnknownUnknown Join Date: 2002-06-12 Member: 759Members
    <!--QuoteBegin--FireStorm+Jan 20 2003, 01:00 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (FireStorm @ Jan 20 2003, 01:00 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><!--QuoteBegin--Unknown+Jan 18 2003, 07:15 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Unknown @ Jan 18 2003, 07:15 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->2nd year of programming in HighSchool using a 2nd year college book<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    hey wtf have you learned in two years? using += ?
    lol I think you should be able to do a GUI after two years...

    and for your compilator... download borland compiler it's free but it's at the command line...<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Nah, I've learned other stuff, but we are moving slow. We are just now finishing reviewing last year. <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo--> And we are finally going to learn something new. <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo--> <!--emo&:0--><img src='http://www.unknownworlds.com/forums/html/emoticons/wow.gif' border='0' valign='absmiddle' alt='wow.gif'><!--endemo-->


    I use Turbo C++ 3.1 to compile. Also, you must remember that the computers we use in school to program are ~100mhz, 8mb of ram, Windows 3.1/NT/95 (most have 3.1 only 1 or 2 have 95 the rest have NT), and no CD drives.

    Its sad really, our programming computers suck while the typing class computers are like 8x better then ours.
Sign In or Register to comment.