Ns Res Calculator
Unknown
Join Date: 2002-06-12 Member: 759Members
<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).
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).
Comments
Ed: Wtf... file didn't upload? Crap
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!
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).
-JKooL
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-->
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.)
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.
Ohyeah, Ill add a backwards converter option when I wake up tomorrow.
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-->
[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.
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++.
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.
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....
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."
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..
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...
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!
Don't reduce delphi to a piece of ****.
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.
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.