Federation Commander Forum Index Federation Commander
A NEW fast paced board game of starship combat!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Speeding Up Damage Allocation

 
Post new topic   Reply to topic    Federation Commander Forum Index -> Star Fleet Battles
View previous topic :: View next topic  
Author Message
szurkey
Ensign


Joined: 31 Mar 2010
Posts: 4

PostPosted: Wed Mar 31, 2010 10:57 pm    Post subject: Speeding Up Damage Allocation Reply with quote

For those who interested, here's the code I use for my TI-89 graphing calculator to generate 2d6 results for the DAC. I only use it for when more then six internals are needed.
Code:
sfb()
Prgm
ClrIO

[1,0,0]->d
[0,1,0]->e
[0,0,1]->f

[1,0,0,0]->g
[0,1,0,0]->h
[0,0,1,0]->i
[0,0,0,1]->j

Prompt x
While x>0

[0,0,0,0]->a
[0,0,0]->b
[0,0,0,0]->c

For t,1,x
rand(6)+rand(6)->y

If y<7 Then
  If y=6 Then
    b+d->b
  ElseIf y=5 Then
    a+j->a
  ElseIf y=4 Then
    a+i->a
  ElseIf y=3 Then
    a+h->a
  Else
    a+g->a
  EndIF
ElseIf y>7 Then
 If y=8 Then
    b+f->b
  ElseIf y=9 Then
    c+g->c
  ElseIf y=10 Then
    c+h->c
  ElseIf y=11 Then
    c+i->c
  Else
    c+j->c
  EndIF
Else
  b+e->b
EndIf

EndFor

ClrIO
Disp x
Disp a
Disp b
Disp c

Prompt X
EndWhile

EndPrgm

The output is in the following format:
NUMBER OF INTERNALS
[TWO, THREE, FOUR, FIVE]
[SIX, SEVEN, EIGHT]
[NINE, TEN, ELEVEN, TWELVE]
x?

So results of:
8
[0,0,0,1]
[2,3,1]
[0,0,1,0]
x?

Means that 8 internals were rolled with results of FIVE rolled 1 time, SIX rolled 2 times, SEVEN rolled 3 times, EIGHT rolled 1 time, and ELEVEN rolled 1 time. To exit the program you enter any number less then 1. There is really no reason why something similar can't be done for almost any programable device.

My old, slow, TI-89 can "roll" 100 2d6's in 6 to 8 seconds.
Back to top
View user's profile Send private message
Scoutdad
Commodore


Joined: 09 Oct 2006
Posts: 4754
Location: Middle Tennessee

PostPosted: Wed Mar 31, 2010 11:06 pm    Post subject: Reply with quote

The problem with that system is in the ordering of the hits.
While it's nice to know that you rolled a 5 six times... when those actually come up in the sequence dramtically affect the end results ofthe damage allocation.
Sure, it's probably not too bad for a small volley - ay 10 or 12 hits...
But on a massive alpha strike of 50 or more hits... it can really skew the results to have the total number of 2s, 3s, 4s, 5s, etc. rolled listed in ascending numerical order.

I do something even simpler.
I purchased a small, 18 compartment divider at Walmart.
I then purchased 3 "bricks" of small (12mm I think) dice from Chessex.
One brick contains red dice, one white, and the third has blue dice.
I placed a pair of each dice into each compartment and superglued the lid shut.
Shake it briskly... set it down... read the dice in pairs... red, white, blue.
Do all three in one compartment and move to the next.
Stop when you get to the number of DAC hits you scored.
I can do 54 "hits" in one second.

Plus... it's transportable... doesn't require batteries... and is competely random
_________________
Commander, Battlegroup Murfreesboro
Department Head, ACTASF
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Steve Cole
Site Admin


Joined: 11 Oct 2006
Posts: 3828

PostPosted: Thu Apr 01, 2010 3:03 pm    Post subject: Reply with quote

Scoutdad: write that up and email it to me.
_________________
The Guy Who Designed Fed Commander
Back to top
View user's profile Send private message Send e-mail
Scoutdad
Commodore


Joined: 09 Oct 2006
Posts: 4754
Location: Middle Tennessee

PostPosted: Thu Apr 01, 2010 4:08 pm    Post subject: Reply with quote

Written up... emailed...
_________________
Commander, Battlegroup Murfreesboro
Department Head, ACTASF
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
szurkey
Ensign


Joined: 31 Mar 2010
Posts: 4

PostPosted: Thu Apr 01, 2010 11:52 pm    Post subject: Reply with quote

While the results are slightly skewed for large amounts of internals, they are much less skewed than the Fed Commander damage allocation system, and as fast or faster than Fed Commander damage allocation system.

As for speed, here's a process analysis:
Code:
My Method:
Input number of internals
Wait few seconds for results
Write results on DAC
Loop
{  Look at DAC
    Mark SSD
}

Your Method:
Shake dice compartment divider
Loop while more damage
{  Look at dice compartment
    Loop three times{
        Look at DAC
        Mark SSD
    }
}

You have a nested loop. For low number of internals, your method is faster. For high number of internals, my method is faster. Also, you have to keep track of which compartment you read last. I could probably write a new program that stores the results in a character string, and then spits the string back out. But then I would have to look at the calculator, look at the DAC, mark the SSD. That's just one extra step that I don't consider necessary.

My TI-89 calculator is 7.5 x 3.5 x 0.875 inches. It is very durable. I've dropped it many times a year for 10 years. So how big is your dice compartment divider to lug around?
Back to top
View user's profile Send private message
Savedfromwhat
Commander


Joined: 23 Aug 2007
Posts: 657

PostPosted: Fri Apr 02, 2010 12:20 am    Post subject: Reply with quote

They say NASA spent over a million dollars developing a pen that would write in zero g. Russia used a pencil.
Back to top
View user's profile Send private message
szurkey
Ensign


Joined: 31 Mar 2010
Posts: 4

PostPosted: Fri Apr 02, 2010 12:57 am    Post subject: Reply with quote

Savedfromwhat wrote:
They say NASA spent over a million dollars developing a pen that would write in zero g. Russia used a pencil.

Even I'm not that bad. I originally got the TI-89 for math, physics, and engineering classes.

Now if I were to buy one of the soon to be released iPads, download the latest SDK for it, code up an interactive DAC (the iDAC), that would certainly qualify such a response. Actually, I would then have to code up interactive SSDs (the iSDD) for the iPad and then link them to the iDAC, I could then run my entire fleet from a $500+ tablet computer. I love the idea, but I don't have the time.

It should be possible to code up an app for any of the new smart phones, etc., to do what my TI-89 program does. They have too small a screen for the iDAC.
Back to top
View user's profile Send private message
Savedfromwhat
Commander


Joined: 23 Aug 2007
Posts: 657

PostPosted: Fri Apr 02, 2010 1:04 am    Post subject: Reply with quote

To be honest I shouldn't have even chimed in as I am a Federation Commander player and Have only played SFB once (and never allocated any damage lol).
Back to top
View user's profile Send private message
szurkey
Ensign


Joined: 31 Mar 2010
Posts: 4

PostPosted: Sat Apr 03, 2010 12:14 pm    Post subject: Reply with quote

Savedfromwhat wrote:
To be honest I shouldn't have even chimed in as I am a Federation Commander player and Have only played SFB once (and never allocated any damage lol).

Not true. I'm perfectly okay with you chiming in. Most SFB players would be shocked and appalled at the version of "SFB" I play. I use a modified form of energy deallocation from FC, no attrition units (the only exception is for the Omega Hivers), no scatter packs, no wild weasels, no damage repair during a battle (but you can transfer shield boxes to an adjacent shield limited by your damage control rating), no explosive mines (including T-Bombs), etc. But I do use the DAC with my TI-89 calculator quickly generating numbers for groups of more than 6 internals. It's really more of mix of SFB and FC.

I guess you could say that I really play "Federation Star Fleet Battle Commander!"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Federation Commander Forum Index -> Star Fleet Battles All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group