View unanswered posts | View active topics It is currently Sat May 30, 2026 7:50 am



Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
 Help Needed 
Author Message
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1402
Location: Canada
Unread post Re: Help Needed
Obvious Question #1: Are you using Dynamic Arrays?

Just for fun, I would try:
Code:
waitfor "User editor"
send "s10*"
:getSectorFighters
setVar $i 11
while ($i <= $gameSectors)
   send ">"
   setTextLineTrigger noSectFigs :noSectFigs "<H> Fighters : None"
   setTextLineTrigger sectFigs :sectFigs "(belong to"
   pause
   :sectFigs
    getword currentline $numFigs 4
    stripText $numFigs ","
    getwordPos CURRENTLINE $pos "Corp#"
    if ($pos > 0)
       getText currentline $belong "Corp#" ")"
       add $corpFigSum[$belong] $numFigs
       add $corpFigSector[$belong] 1
    else
       getText currentline $belong  "(#" "))"
       add $soloFigSum[$belong] $numFigs
       add $soloFigSector[$belong] 1
    end
    add $i 1
    branch ($i <= $gameSectors) :noSectFigs
    setTextLineTrigger sectFigs :sectFigs "(belong to"
    send ">"
    pause
   :noSectFigs
    killtrigger sectFigs
    add $i 1
end
send "x"

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Wed Jan 16, 2008 10:45 pm
Profile ICQ YIM
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: Help Needed
My version used static arrays because they're quicker to write to. That's trading speed for memory, but since each sector would probably need to store data... not much memory would be sacrificed. But to each their own.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Thu Jan 17, 2008 1:21 am
Profile ICQ WWW
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: Help Needed
I am still working on the debug part of the assets valuation script. I need to add some error checking and test multiple times before I will be comfortable with it going out.

The values for valuation are as follows:

Valuation

Planets
L0 - 0 (product and figs are still valued)
L1 - 40,000
L2 - 60,000
L3 - 90,000
L4 - 200,000
L5 - 850,000
L6 - 1,000,000
Fighters - 170 / unit
Shields - (10 * number * 170)
Ore - 65 / unit
Org - 90 / unit
Equ - 120 / unit

Ship
Cost - Total Purchase of bare ship
Fighter - 170
Shield - 170

Grid
Sector - 1,000 each

Credits - Credits
Player and Cit combined


I do not know a way to anticipate the relative potential of assets. There are way too many variables involved that are not objective (player ability being one). Possibilities also exist that an L6 planet would be worth less than an L5 planet in reality, however product and fighter production may level that out.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Sun Jan 20, 2008 7:18 pm
Profile ICQ
Chief Warrant Officer
User avatar

Joined: Sun Jan 20, 2008 5:15 am
Posts: 142
Unread post Re: Help Needed
Promethius wrote:
I am thinking of using fighters as the common valuation, ie. set average cost of a fighter at 200 credits, ore = 3 units or 200 credits (based on cannon damage), mines - 1k credits each, limpets 10k credits. For ships, I can get the cost of each as they are not outfitted so that isn't a major issue and I am grabbing the number of fighters.

Now where I run into major problems is the valuation of planets. What are good values for a L1 through L-6 planet. The L0 planet valuation is 40k (guessing at the average purchase price) although I would rather have 200 figs on my ship than a L0 planet. Colonists on the planets also pose an issue for valuation as does the planet type - I would prefer to have a maxed L6 with 5M ore than an L6 maxed with 100K ore. The ore value may offset this issue, but not the 1:1 vs 5:1 col/fig production.

I can assign a value to org/equ based on selling 100 units (yes, MCIC will affect the values, but I need a fixed number - not perfect I know but even for all).


I don't think assigning a monetary value to assets is all that realistic. A better approach may be to determine and overall offensive and defensive scores. This would simpify things a bit as you really don't care how much was spent on resources, simply what resources are currently available for offensive and defense.

Calculating the offensive score would be fairly easy - the total # of fighters plus the amout that could be purchased with the available cash at the current fighter price. An option here would be to modify the offensive value by the attack odds of the best invasion ship available. Product on planets would have no offensive value since it would have to be converted to cash in order to buy figs, unless there were some way to determine if ports were available for the conversion. Even then hoarding product could count against the defensive score as an invader could liquidate those assets to help fund the continued invasion. So it's probably best to just ignore potential product value.

Calculating the defensive values would be a bit more involved. Sector fighters would get multiplied by 1.1, fighters on L2 or higher planets would get multiplied by 3 (you may have to take into account military reaction here if it's something other than 0%), and manned ships in planet orbit would get the ships defense rating. You would also need to factor in planetary shields and fuel for q-cannons. I'm not quite sure how you would value cannon fuel - basically any sector setting other than 0% could potentially make any fuel only worth 50% of the units available. Otherwise MBBS/non-MBBS would determine the fuel value. Also, credits on a planets could potentially count against the defensive rating as they can be used by an invader.

Anyway, this should provide a more meaningful ranking system as it could show situations where no one has enough offensive resources to overcome anyone elses defenses.


Mon Jan 21, 2008 1:25 pm
Profile
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: Help Needed
The script is not intended for use during game play, only after a game is over using whatever game conditions were set for ending a game. A stalemated game is where the corps involved agree to the stalemate and this script should probably be used as an FYI and and not a "I have 1M more credits so I win".

The game contains too many variables to provide finite information. A planet defends at 3:1, but we have ships that attack at 0.5:1 up to say 8:1 - the player determines which ship he will be attacking with and it is not always the 8:1 ship due to its fighter capacity or whatever reason. I have used different ships on the same invasion based on the situation. The 8:1 offensive ship may also have 1.0 defensive and you would have to choose between valuing the offensive or defensive odds (is the player a hunter or a pod in waiting?).

With that said, the script should show what corps were best positioned in the game, and people will be able to draw their own inferences based on the raw information that is also provided (ie., fighters / planets / grid / cash / ships). If nothing else, it should make the smack a little more interesting.

I had thought that the original proassetcheck script was nothing but something to write during a weekend, not really that good of a script, but people seem to like it even with the general information it provides. This script may or may not prove to be of interest, but I've had fun writing it.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Mon Jan 21, 2008 3:09 pm
Profile ICQ
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post Re: Help Needed
The script worked out perfectly. I am very pleased with the results, and it listed everything I had hoped to list for game end results. You can view my examples:

Outpost-4 TWGS Game B TradeWars Academy
Outpost-4 OCS TWGS Game A

Both taken off our two TWGS.

Thank you very much for all your effort into this. I'll try to keep my future ideas down to "smaller" tasks ;)

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Mon Jan 21, 2008 4:27 pm
Profile
Commander
User avatar

Joined: Wed May 03, 2006 2:00 am
Posts: 1722
Location: USA
Unread post Re: Help Needed
Looks Great!

_________________
Coconut Telegraph (ICQ)#586137616
Team Speak3@ 220.244.125.70:9987
Founding Member -=[Team Kraaken]=- Winner of Gridwars 2010 - Ka Pla
Image
Jesus wounldn't Subspace Crawl


Mon Jan 21, 2008 8:21 pm
Profile ICQ YIM
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.