Difference between revisions of "Leagues"
From WikiManual
m |
m |
||
| Line 12: | Line 12: | ||
:Will just keep stashing it here as i find it. | :Will just keep stashing it here as i find it. | ||
| + | ==General Declarations== | ||
<pre> | <pre> | ||
General | General | ||
| Line 48: | Line 49: | ||
</pre> | </pre> | ||
<pre> | <pre> | ||
| + | |||
General | General | ||
Declarations | Declarations | ||
| Line 66: | Line 68: | ||
Private eye11 As Integer 'for eye fudging. Search 'fudge' to see what I mean | Private eye11 As Integer 'for eye fudging. Search 'fudge' to see what I mean | ||
</pre> | </pre> | ||
| + | ==General Startsim== | ||
<pre> | <pre> | ||
General | General | ||
| Line 75: | Line 78: | ||
End If | End If | ||
</pre> | </pre> | ||
| + | ==General StartSimul== | ||
<pre> | <pre> | ||
General | General | ||
| Line 92: | Line 96: | ||
End Sub | End Sub | ||
</pre> | </pre> | ||
| + | ==General FindSpecies== | ||
<pre> | <pre> | ||
General | General | ||
| Line 109: | Line 114: | ||
</pre> | </pre> | ||
| + | ==MDIForm== | ||
<pre> | <pre> | ||
MDIForm1 (Code) | MDIForm1 (Code) | ||
| Line 119: | Line 125: | ||
End Sub | End Sub | ||
</pre> | </pre> | ||
| + | ==RerunCheck== | ||
<pre> | <pre> | ||
RerunCheck | RerunCheck | ||
| Line 127: | Line 134: | ||
</pre> | </pre> | ||
| + | ==LeagueCheck== | ||
<pre> | <pre> | ||
LeagueCheck | LeagueCheck | ||
| Line 193: | Line 201: | ||
</pre> | </pre> | ||
| + | ==StartNew== | ||
<pre> | <pre> | ||
StartNew | StartNew | ||
| Line 233: | Line 242: | ||
End Sub | End Sub | ||
| + | </pre> | ||
| + | |||
| + | ==F1 Override code as of 2.42.n == | ||
| + | (not sure in what modual this is in. {{User:Griz/sig}}) | ||
| + | |||
| + | :Eric: I will add max cycles / Max rounds to my list of future work items. | ||
| + | :These will be post 2.43 however. | ||
| + | |||
| + | <pre> | ||
| + | If TmpOpts.F1 = True Then | ||
| + | |||
| + | 'Zero out all Costs | ||
| + | For t = 1 To 70 | ||
| + | TmpOpts.Costs(t) = 0 | ||
| + | Next t | ||
| + | |||
| + | 'Now set the ones that matter | ||
| + | TmpOpts.Costs(SHOTCOST) = 2 | ||
| + | TmpOpts.Costs(COSTSTORE) = 0.04 | ||
| + | TmpOpts.Costs(CONDCOST) = 0.004 | ||
| + | TmpOpts.Costs(MOVECOST) = 0.05 | ||
| + | TmpOpts.Costs(TIECOST) = 2 | ||
| + | TmpOpts.Costs(SHOTCOST) = 2 | ||
| + | TmpOpts.Costs(VENOMCOST) = 1 | ||
| + | TmpOpts.Costs(POISONCOST) = 1 | ||
| + | TmpOpts.Costs(SLIMECOST) = 1 | ||
| + | TmpOpts.Costs(SHELLCOST) = 1 | ||
| + | TmpOpts.Costs(COSTMULTIPLIER) = 1 | ||
| + | TmpOpts.DynamicCosts = False | ||
| + | |||
| + | TmpOpts.CorpseEnabled = False ' No Corpses | ||
| + | TmpOpts.DayNight = False ' Sun never sets | ||
| + | TmpOpts.FieldWidth = 9237 | ||
| + | TmpOpts.FieldHeight = 6928 | ||
| + | TmpOpts.FieldSize = 1 | ||
| + | TmpOpts.MaxEnergy = 40 ' Veggy nrg per cycle | ||
| + | TmpOpts.MaxPopulation = 25 ' Veggy max population | ||
| + | TmpOpts.MinVegs = 10 | ||
| + | TmpOpts.Pondmode = False | ||
| + | TmpOpts.PhysBrown = 0 ' Animal Motion | ||
| + | TmpOpts.Toroidal = True | ||
| + | |||
| + | TmpOpts.BadWastelevel = 10000 ' Pretty high Waste Threshold | ||
| + | |||
| + | For t = 0 To TmpOpts.SpeciesNum - 1 | ||
| + | TmpOpts.Specie(t).Fixed = False 'Nobody is fixed | ||
| + | TmpOpts.Specie(t).Mutables.Mutations = False 'Nobody can mutate | ||
| + | TmpOpts.Specie(t).CantSee = False | ||
| + | TmpOpts.Specie(t).DisableDNA = False | ||
| + | TmpOpts.Specie(t).CantReproduce = False | ||
| + | TmpOpts.Specie(t).DisableMovementSysvars = False | ||
| + | Next t | ||
| + | |||
| + | TmpOpts.Specie(0).Veg = True 'Force the first entry to be a veggy | ||
| + | TmpOpts.Specie(0).qty = 10 ' Do this so that eye fudge works | ||
| + | |||
| + | TmpOpts.FixedBotRadii = False | ||
| + | TmpOpts.NoShotDecay = False | ||
| + | TmpOpts.DisableTies = False | ||
| + | TmpOpts.RepopAmount = 10 | ||
| + | TmpOpts.RepopCooldown = 1 | ||
| + | TmpOpts.MaxVelocity = 180 | ||
| + | TmpOpts.VegFeedingMethod = 0 ' Straight nrg /cycle feeding method | ||
| + | TmpOpts.VegFeedingToBody = 0.5 ' 50/50 nrg/body veggy feeding ratio | ||
| + | TmpOpts.SunUp = False ' Turn off bringing the sun up due to a threshold | ||
| + | TmpOpts.SunDown = False ' Turn off setting the sun due to a threshold | ||
| + | TmpOpts.CoefficientElasticity = 0 ' Collisions are soft. | ||
| + | TmpOpts.Ygravity = 0 | ||
| + | |||
| + | ' Surface Friction - Metal Option | ||
| + | TmpOpts.Zgravity = 2 | ||
| + | TmpOpts.CoefficientStatic = 0.6 | ||
| + | TmpOpts.CoefficientKinetic = 0.4 | ||
| + | |||
| + | 'No Fluid Resistance | ||
| + | TmpOpts.Viscosity = 0# | ||
| + | TmpOpts.Density = 0# | ||
| + | |||
| + | 'Shot Energy Physics | ||
| + | TmpOpts.EnergyProp = 1 ' 100% normal shot nrg | ||
| + | TmpOpts.EnergyExType = True ' Use Proportional shot nrg exchange method | ||
| + | |||
| + | DispSettings | ||
| + | End If | ||
</pre> | </pre> | ||
Revision as of 18:02, 24 December 2006
Code/Debugging/Fixes/Changes for Leagues
see also: DeBugging and Bug_Reports
this is a Work In Progress
- Holy crap!!!
- League code is all over the place!
- Will just keep stashing it here as i find it.
Contents
General Declarations
General Declarations Public Type datispecie Skin(13) As Integer path As String Name As String Stnrg As Integer Veg As Boolean Fixed As Boolean color As Long Colind As Integer Postp As Single Poslf As Single Posdn As Single Posrg As Single qty As Integer Comment As String Leaguefilecomment As String Mutables As mutationprobs CantSee As Boolean ' Flag indicating eyes should be turned off for this species DisableDNA As Boolean ' Flag indicating DNA should not execute for this species DisableMovementSysvars As Boolean ' Flag indicating movement sysvars should be disabled for this species CantReproduce As Boolean ' Flag indicating whether reproduction has been disabled for this species. End Type
General Declarations 'For League mode: (runs a series of F1 contests, 1 on 1) Public LeagueMode As Boolean Public Leaguename As String Public Leaguererun As Boolean Public LeagueEntrants(30) As datispecie 'all those already in the league Public numLeagueEntrants As Integer Public LeagueChallengers(31) As datispecie 'all those challenging (31 instead of 30 for some loop functions) Public Defender As Integer 'couple used to determine which bots are facing which in League mode Public Attacker As Integer Private eye11 As Integer 'for eye fudging. Search 'fudge' to see what I mean
General Startsim
General
Startsim
If LeagueMode Then
LeagueForm.Show
SimOpts.TotRunCycle = -1
End If
General StartSimul
General
StartSimul
'Restart
'Leaguemode handles restarts differently so only restart here if not in
leaguemode
If totnvegs = 0 And RestartMode And Not LeagueMode Then
' totnvegs = 1
' Contests = Contests + 1
ReStarts = ReStarts + 1
' Form1.StartSimul
StartAnotherRound = True
End If
End Sub
General FindSpecies
General
FindSpecies
If TotSpecies = 1 Then
' If Not LeagueMode Then
ContestMode = False
MDIForm1.F1Piccy.Visible = False
Contest_Form.Visible = False
t = MsgBox("You have only selected one species for combat. Formula 1
mode disabled", vbOKOnly)
Exit Sub
' End If
End If
MDIForm
MDIForm1 (Code) Private Sub Leagues_Click() optionsform.SSTab1.Tab = 4 NetEvent.Timer1.Enabled = False NetEvent.Hide optionsform.Show vbModal End Sub
RerunCheck
RerunCheck Private Sub RerunCheck_Click() Leaguererun = CBool(RerunCheck.value) End Sub
LeagueCheck
LeagueCheck
Private Sub LeagueCheck_Click()
If LeagueCheck.value = 1 Then
If F1Check.value <> 1 Then
F1Check.value = 1
F1check_Click
End If
LeagueMode = True
TmpOpts.League = True
If Leaguetype(0).value = False Then
Leaguetype(0).value = True
End If
Else
TmpOpts.League = False
LeagueMode = False
'Leaguetype(0).value = False
End If
End Sub
Private Sub LeagueAutoCheck()
If LeagueCheck.value <> 1 Then
LeagueCheck.value = 1
LeagueCheck_Click
End If
End Sub
Private Sub LeagueF1Option_Click()
Leaguename.text = "F1"
LeagueAutoCheck
End Sub
Private Sub LeagueF2Option_Click()
Leaguename.text = "F2"
LeagueAutoCheck
End Sub
Private Sub LeageSBOption_Click()
Leaguename.text = "Shortbot"
LeagueAutoCheck
End Sub
Private Sub LeagueMBOption_Click()
Leaguename.text = "Multibot"
LeagueAutoCheck
End Sub
Private Sub Leaguetype_Click(Index As Integer)
'If Leaguetype(Index).value = False Then
'' Leaguetype(Index).value = True
'End If
End Sub
Private Sub LightText_lostfocus()
Dim a As Single
a = val(LightText.text)
If a < LightUpDn.Min Then a = LightUpDn.Min
If a > LightUpDn.Max Then a = LightUpDn.Max
LightUpDn.value = a
TmpOpts.LightIntensity = a
End Sub
StartNew
StartNew
If LeagueMode = True Then LeagueForm.Visible = True ' EricL 3/20/2006 Have
to bring up league form after Options dialog goes away
'Form1.Active = True
'this just tricks the program into thinking we have enough
'species for F1 mode.
'If TmpOpts.League = True And TmpOpts.SpeciesNum = 2 Then
' additem TmpOpts.Specie(1).Name
' TmpOpts.SpeciesNum = TmpOpts.SpeciesNum + 1
'End If
SimOpts = TmpOpts
If SimOpts.League = True Then
LeagueMode = True 'should be anyway, but sometimes when
'restarting a league it screws up
LeagueInputChallengers
SetupLeague_Options
' SimOpts.F1 = True
LeagueForm.F1ChallengeOption_Click
End If
If Form1.Active Then Form1.SecTimer.Enabled = True
StartAnotherRound = True ' Set true for first simulation. Will get set true if
running leagues or using auto-restart mode
While StartAnotherRound
StartAnotherRound = False
Form1.StartSimul
Wend
End Sub
F1 Override code as of 2.42.n
(not sure in what modual this is in. Griztalk)
- Eric: I will add max cycles / Max rounds to my list of future work items.
- These will be post 2.43 however.
If TmpOpts.F1 = True Then 'Zero out all Costs For t = 1 To 70 TmpOpts.Costs(t) = 0 Next t 'Now set the ones that matter TmpOpts.Costs(SHOTCOST) = 2 TmpOpts.Costs(COSTSTORE) = 0.04 TmpOpts.Costs(CONDCOST) = 0.004 TmpOpts.Costs(MOVECOST) = 0.05 TmpOpts.Costs(TIECOST) = 2 TmpOpts.Costs(SHOTCOST) = 2 TmpOpts.Costs(VENOMCOST) = 1 TmpOpts.Costs(POISONCOST) = 1 TmpOpts.Costs(SLIMECOST) = 1 TmpOpts.Costs(SHELLCOST) = 1 TmpOpts.Costs(COSTMULTIPLIER) = 1 TmpOpts.DynamicCosts = False TmpOpts.CorpseEnabled = False ' No Corpses TmpOpts.DayNight = False ' Sun never sets TmpOpts.FieldWidth = 9237 TmpOpts.FieldHeight = 6928 TmpOpts.FieldSize = 1 TmpOpts.MaxEnergy = 40 ' Veggy nrg per cycle TmpOpts.MaxPopulation = 25 ' Veggy max population TmpOpts.MinVegs = 10 TmpOpts.Pondmode = False TmpOpts.PhysBrown = 0 ' Animal Motion TmpOpts.Toroidal = True TmpOpts.BadWastelevel = 10000 ' Pretty high Waste Threshold For t = 0 To TmpOpts.SpeciesNum - 1 TmpOpts.Specie(t).Fixed = False 'Nobody is fixed TmpOpts.Specie(t).Mutables.Mutations = False 'Nobody can mutate TmpOpts.Specie(t).CantSee = False TmpOpts.Specie(t).DisableDNA = False TmpOpts.Specie(t).CantReproduce = False TmpOpts.Specie(t).DisableMovementSysvars = False Next t TmpOpts.Specie(0).Veg = True 'Force the first entry to be a veggy TmpOpts.Specie(0).qty = 10 ' Do this so that eye fudge works TmpOpts.FixedBotRadii = False TmpOpts.NoShotDecay = False TmpOpts.DisableTies = False TmpOpts.RepopAmount = 10 TmpOpts.RepopCooldown = 1 TmpOpts.MaxVelocity = 180 TmpOpts.VegFeedingMethod = 0 ' Straight nrg /cycle feeding method TmpOpts.VegFeedingToBody = 0.5 ' 50/50 nrg/body veggy feeding ratio TmpOpts.SunUp = False ' Turn off bringing the sun up due to a threshold TmpOpts.SunDown = False ' Turn off setting the sun due to a threshold TmpOpts.CoefficientElasticity = 0 ' Collisions are soft. TmpOpts.Ygravity = 0 ' Surface Friction - Metal Option TmpOpts.Zgravity = 2 TmpOpts.CoefficientStatic = 0.6 TmpOpts.CoefficientKinetic = 0.4 'No Fluid Resistance TmpOpts.Viscosity = 0# TmpOpts.Density = 0# 'Shot Energy Physics TmpOpts.EnergyProp = 1 ' 100% normal shot nrg TmpOpts.EnergyExType = True ' Use Proportional shot nrg exchange method DispSettings End If