Now open-source TGW calculator

Forum for all general ingame discussion.
Post Reply
bryan
Forum Intermediate
Posts: 966
Joined: Mon Jun 20, 2005 7:57 pm

if anyone wants any ti programming done, i can do it.

im just finishing up on my connect-4 game. if anyone has an idea how to build a wintest (ie to test if someone has won) or an ai for it, it would be helpful.

i might give a chess game a go next, but that is a fair bit harder.
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

WhiteyDude wrote:The formulas for basicly everything game related were in it :P. Thanks for the source Pooks - seems pretty basic once you know the numbers...


It wouldn't be too hard for the game administration to impliment into the game either...


Little popup window on the side with a php calc based on what you have ingame...




/Whitey


Indeed, it is simple. I have the rest of my day off, but it is bright and sunny. Maybe I'll update the scripty later, and perhaps make it intergrateable with the game.
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
Legoless
Fledgling Forumer
Posts: 181
Joined: Sat Jan 07, 2006 3:51 am
Alliance: ArvYStaTe.net
Race: Developer

Well, I was thinking all kinds of formulas for stats, etc.. :) But I've gotten them all from Seijuro's calculator, thanks for that. ;)
Legoless
Fledgling Forumer
Posts: 181
Joined: Sat Jan 07, 2006 3:51 am
Alliance: ArvYStaTe.net
Race: Developer

Well, now that spy action formula changed, could anyone try to type it down? Thanks..
bryan
Forum Intermediate
Posts: 966
Joined: Mon Jun 20, 2005 7:57 pm

you want a ti program or a php one?


the ti one is very easy, i can give you the source, but you will need to know how to type it up.

just tell me how integrated you want it, like all in one or something, with getkeys or simple menus.
Legoless
Fledgling Forumer
Posts: 181
Joined: Sat Jan 07, 2006 3:51 am
Alliance: ArvYStaTe.net
Race: Developer

Not doing PHP one, although updating Seijuro's calc would be good idea.
User avatar
GhostyGoo
Forum Addict
Posts: 2592
Joined: Sat Feb 26, 2005 5:21 pm
Alliance: 5PYM45T3R
Race: HE WHO KEEPS ME HERE
ID: 0
Location: ZOOMING THROUGH YOUR EGO AT A ZILLION MILES AN HOUR
Contact:

Honours and Awards

Sleipnir wrote:
Zekk wrote:dude! awsome! :D

btw, whats TI-83?

*novice programer*


Apparently, it's the new way of teaching math to kids these days. Ah, back in ye olden days, when we had such sophisticated tools as our heads, and pen n paper. No programmable calculators for me. If something comes up that a simple calculator or pen and paper can't fix, Matlab is my next stop.


I still use a system of mung beans threaded with cotton...
Image
ImageImageImage
Spoiler
GhostyGoo wrote:Yesno.
the3rdlibra wrote:if it's a silly turnip head competition you want, i'm going to decline as i think i may have met my match in you vegetable brains.
Cersei Lannister wrote:Debasing? I am not the one drawing crazy pictures of force fielded stick figures.
Energise
Magical Monkeys & Grapefruit Migration:|:Hallowed are the Gò.Ó'ri™ **fixed**
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

Oh, so that's what became of those beans that you wouldn't eat at the table when you were young... *tisk tisk*

Well, I'm glad that they helped you become the mathemagician that you've become.
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
User avatar
GhostyGoo
Forum Addict
Posts: 2592
Joined: Sat Feb 26, 2005 5:21 pm
Alliance: 5PYM45T3R
Race: HE WHO KEEPS ME HERE
ID: 0
Location: ZOOMING THROUGH YOUR EGO AT A ZILLION MILES AN HOUR
Contact:

Honours and Awards

Yup yup ....i was ever so resourceful as a child; i pickled the beans and then threaded them.
Image
ImageImageImage
Spoiler
GhostyGoo wrote:Yesno.
the3rdlibra wrote:if it's a silly turnip head competition you want, i'm going to decline as i think i may have met my match in you vegetable brains.
Cersei Lannister wrote:Debasing? I am not the one drawing crazy pictures of force fielded stick figures.
Energise
Magical Monkeys & Grapefruit Migration:|:Hallowed are the Gò.Ó'ri™ **fixed**
bryan
Forum Intermediate
Posts: 966
Joined: Mon Jun 20, 2005 7:57 pm

abacus are good too


good work on your locking spree too goo.
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

I posted it in the other thread, but this is my official calcualtor thread, so heregoes. My calculator can be found here: http://jason.streamdown.net/up.php

It can now calculate sabs.
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
agapooka
Semper Ubi Sub Ubi
Posts: 2607
Joined: Thu Mar 31, 2005 4:34 am
ID: 0

Honours and Awards

The calculator has been updated once more. Most of it is so that I can edit more easily, and this more frequently. :P

The calculator can still be found at http://jason.streamdown.net/up.php

If you have any suggestions, post them here. This can include idea for new calculations and you may even request for a shorter easier-to-remember URL (but it will basically just redirect to the current one, so anyone that has the page saved in their favourites doesn't have to worry :) ).

BUT, I did "add" fleet hangar cost calculations. The cost for fleet hangars is the same as mothership weapons, though, so it wasn't much of an addition.

The code, however, has changed quite a bit. I was able to reduce it to about 60% of what it used to be :).

Here is the source:

Code: Select all

<?php 
$a = $HTTP_GET_VARS['a'];
$b = $HTTP_GET_VARS['b'];
$c = $HTTP_GET_VARS['c'];
$p = $HTTP_GET_VARS['p'];

if ($a == '') { $a = '0'; }
if ($b == '') { $b = '0'; }
if ($c == '') { $c = '0'; }
if ($p == '') { $p = '0'; }

$title = "Pookie's TGW Calculator";
$fname = "up.php";
$version = "2.0.2";
$release = "3rd of June 2006";
$disclaimer = "Property of Jason Lambert (Agapooka)<br />Pookie TGW Calculator version ".$version.", released on the ".$release.".";

for ($i=0; $i<=7; $i++) {
   if ($i == $p)
    {
    $sel[$i] = " selected";
    }
    else
    {
    $sel[$i] = "";
    }
   }

$head = "<html><title>".$title."</title><head><center><h1>".$title."</h1></center></head>";
$body = "<body><center><table width=500 cellspacing=3 cellpadding=3 border=1>";
$tbl0 = "<tr><td width=100%><center><form action='".$fname."' method=get>";
$frma = "<input size=8 maxlength=22 value=".$a." name=a />";
$frmb = "<input size=8 maxlength=22 value=".$b." name=b />";
$frmc = "<input size=8 maxlength=12 value=".$c." name=c />";
$frmp = "<select name='p'>
      <option value=0".$sel[0].">Calculate:</option>
      <option value=1".$sel[1].">Unit Production Cost</option>
      <option value=2".$sel[2].">Ascended Fleet Cost</option>
      <option value=3".$sel[3].">MS Weapon Capacity and Fleet Hangar Cost</option>
      <option value=4".$sel[4].">MS Shield Capacity Cost</option>
      <option value=5".$sel[5].">Spy Levels</option>
   <option value=6".$sel[6].">Sabotage</option>
   <option value=7".$sel[7].">Planets (coming soon!)</option></select>";
$frm0 = "<input type=submit value='GO!' />"; 
$foot = "</form></center></td></tr></table><small>".$disclaimer."</small></center></body></html>";

if ($p == '0')
   {
   echo $head,$body,$tbl0,$frmp,$frm0,$foot;
   }
if ($p == '1')
   {
   $currency = "Naquadah";
   $ans = (-1*($a-$b)/3)*((15000*(($b-1)/3)+15000*(($a+2)/3))/2);
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '2')
   {
   $currency = "Dark Matter Units";
   $ans = (-1*($a-$b))*(((5000*($b-1)+5000*($a+4))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '3')
   {
   $currency = "Naquadah";
   $ans = (-1*($a-$b))*(((10000*($b-1)+10000*($a+2))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency."<br /><small>*Fleet hangars come at the same cost as weapon capacity.</small>";
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '4')
   {
   $currency = "Naquadah";
   $ans = (-1*($a-$b))*(((12000*($b-1)+12000*($a+(10/12)))/2));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frma,$frmb,$frmp,$frm0,$answ,$foot;
   }
if ($p == '5')
   {
   $currency = "Naquadah";
   $ans = (6000*pow(2,($c-1)));
   $answ = "<br />Cost: ".number_format($ans, 0, '.', ',')." ".$currency."<br />Cost for Replicators:    

".number_format(0.9*$ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0,$frmc,$frmp,$frm0,$answ,$foot;
   }
if ($p == '6')
   {
   $currency = "spies must be sent";
   $ans = 1.01*($a/(($b+1)/($c+1)))+1;
   $answ = "<br />".number_format($ans, 0, '.', ',')." ".$currency;
   echo $head,$body,$tbl0."Enemy covert action:".$frma."<br />Your covert action:".$frmb."<br />How many spies you

have:".$frmc."<br />".$frmp,$frm0,$answ,$foot;
   }
if ($p == '7')
   {
   echo $head,$body,$tbl0,$frmp,$frm0."<br /><br />Coming when they are updated and actually useful! <img src='http://www.jason.streamdown.net/icon_razz.gif' alt=':-P' />".$foot;
   }
?>
Agapooka wrote:The argument that because a premise cannot be proven false, it must be true, is known as a Negative Proof Fallacy in logic.
Mister Sandman wrote:Nothing at all near the negative proof fallacy in logic. If it cannot be proven false, it has to be true.
Pooka's UU Market Loyalty Card:

Rudy Pena: 1 stamp!

A Spider: 1 stamp!
User avatar
Kaitou
Fledgling Forumer
Posts: 159
Joined: Fri Dec 16, 2005 1:00 am
Race: Tollan
Location: Australia

Awesome work, if only I understood all that code stuff :P
-lil evil genious-
Fledgling Forumer
Posts: 163
Joined: Sun May 07, 2006 2:09 am
ID: 0
Location: in my ickle lab of evil cookin up something evil for j00

its incredable how simple the code is wen u think about it...wow...i wish i had someone that culd teach me how to program...and software obviously :D

i tried to learn from various sights but i started to forget it rly quickly....dang my memory....

kwl calcs...ill probs use em properly in the future :D :-D

tanks
Paul-ish
Forum Newbie
Posts: 32
Joined: Sat Nov 26, 2005 7:18 pm
ID: 0
Location: Seattle, WA
Contact:

I'm not great at math but in the equation you made
(-1(A-B)/3)((15000((B-1)/3)+15000((A+2)/3))/2)
the

Code: Select all

(-1(A-B)/3)
part of the equation sticks out to me. that part is meant to find one third of the difference of the two numbers (the current UP and target UP) so to be more understandable, and if you want to make it less taxing on any computer/calculators couldn't you make it easier by saying

Code: Select all

((B-A)/3)
instead. It makes it easier on the eyes mostly. Tell me, am i wrong?
Post Reply

Return to “StarGateWars General”