mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
AI optimizations and more (81b loss :( )
This commit is contained in:
+5
-5
@@ -209,11 +209,11 @@ The game has 8 difficulty levels of computer-controlled opponents. Or actually 7
|
||||
|
||||
** **Tosser** - When attacking, he acts exactly like **Poolshark** however, he may have a "better" weapon inventory due to a different purchase tactic. He always activates the best defensive weapon he has before shooting. And just like **Poolshark** he uses **Battery** and **White Flag**. At the beginning of the round, he assesses how much money he has and depending on that, he makes (money/5100) attempts to buy defensive weapons and then checks again how much money he has left and makes (money/1250) attempts to buy offensive weapons.
|
||||
|
||||
** **Chooser** - Takes as a target the weakest opponent (with the least amount of energy) and aims very precisely, but before the shot the energy of the shot is modified by the parameter of luck :) , that is, despite the precise aiming it does not always hit. He shoots with the best weapon he has unless low energy is required (the target is close). Then he changes his weapon to **Baby Missile** to avoid hitting himself. He always activates the best defensive weapon he has before shooting and, like **Poolshark**, uses **Battery** and **White Flag**. He purchases just like **Tosser**.
|
||||
** **Chooser** - Takes as a target the weakest opponent (with the least amount of energy) and aims very precisely, but before the shot the energy of the shot is modified by the parameter of luck :) , that is, despite the precise aiming it does not always hit. He shoots with the best weapon he has unless the target is close. Then he changes his weapon to **Baby Missile** to avoid hitting himself. He always activates the best defensive weapon he has before shooting and, like **Poolshark**, uses **Battery** and **White Flag**. He purchases just like **Tosser**.
|
||||
|
||||
* **Spoiler** - He shoots exactly like **Chooser** except that he has more luck :) , which means that even if he doesn't hit the target of his choice, it can be a more precise shot than **Chooser**. He uses defensive weapons exactly like **Chooser**. At the beginning of the round, he assesses how much money he has and depending on that, he makes (money/5100) attempts to buy defensive weapons and then checks again how much money he has left and makes (money/320) attempts to buy offensive weapons. When buying defensive weapons, he buys only strong and precise weapons - that is, weapons that won't accidentally hurt him.
|
||||
|
||||
** **Cyborg** - Takes aim at the weakest opponent (with the least amount of energy) but prefers human-controlled opponents. Aims very accurately and in the vast majority of cases hits on the first shot. He fires the shot with the best weapon he has unless low energy is required (the target is close). Then he changes his weapon to **Baby Missile** to avoid hitting himself. He uses defensive weapons exactly like **Chooser**. He shops exactly like **Spoiler**.
|
||||
** **Cyborg** - Takes aim at the weakest opponent (with the least amount of energy) but prefers human-controlled opponents. Aims very accurately and in the vast majority of cases hits on the first shot. He fires the shot with the best weapon he has unless the target is close. Then he changes his weapon to **Baby Missile** to avoid hitting himself. He uses defensive weapons exactly like **Chooser**. He shops exactly like **Spoiler**.
|
||||
|
||||
* **Unknown** - Before firing each shot, he randomly chooses a course of action from **Poolshark** to **Cyborg** and applies his tactics. However, the tactics of weapon purchases are always identical to **Tosser**.
|
||||
|
||||
@@ -241,9 +241,9 @@ Table of weapons purchased by: **Spoiler** and **Cyborg**.
|
||||
|
||||
| Offensive weapons | Defensive weapons |
|
||||
| --- | --- |
|
||||
| Baby Nuke | Battery |
|
||||
| Nuke | Strong Parachute |
|
||||
| Death's Head | Mag Deflector |
|
||||
| Missile | Battery |
|
||||
| Baby Nuke | Strong Parachute |
|
||||
| Nuke | Mag Deflector |
|
||||
| Hot Napalm | Heavy Shield |
|
||||
| | Force Shield |
|
||||
| | Bouncy Castle |
|
||||
|
||||
+5
-5
@@ -204,11 +204,11 @@ Gra posiada 8 poziomów trudności przeciwników sterowanych przez komputer. A w
|
||||
|
||||
* **Tosser** - Atakując działa dokładnie tak jak **Poolshark** jednak może posiadać "lepszy" zasób broni dzięki innej taktyce zakupów. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną. i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Na początku rundy ocenia ile ma pieniędzy i w zależności od tego podejmuje (pieniądze/5100) prób zakupu broni defensywnych a następnie jeszcze raz sprawdza ile pieniędzy mu zostało i podejmuje (pieniądze/1250) prób zakupu broni ofensywnych.
|
||||
|
||||
* **Chooser** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) i celuje bardzo dokładnie, jednak przed samym strzałem energia strzału modyfikowana jest o parametr szczęścia :) , czyli mimo precyzyjnego wycelowania nie zawsze trafia. Strzał oddaje najlepszą posiadaną bronią chyba że wymagana jest małą energia (cel jest blisko). Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Zakupów dokonuje tak samo jak **Tosser**.
|
||||
* **Chooser** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) i celuje bardzo dokładnie, jednak przed samym strzałem energia strzału modyfikowana jest o parametr szczęścia :) , czyli mimo precyzyjnego wycelowania nie zawsze trafia. Strzał oddaje najlepszą posiadaną bronią chyba że cel jest blisko. Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Zawsze przed strzałem aktywuje najlepszą posiadaną broń defensywną i tak jak **Poolshark** stosuje **Battery** i **White Flag**. Zakupów dokonuje tak samo jak **Tosser**.
|
||||
|
||||
* **Spoiler** - Strzela dokładnie tak jak **Chooser** tyle, że ma więcej szczęścia :) , co oznacza że nawet jeśli nie trafi w wybrany cel, to może być to strzał precyzyjniejszy niż **Chooser**. Broni defensywnych używa dokładnie tak jak **Chooser**. Na początku rundy ocenia ile ma pieniędzy i w zależności od tego podejmuje (pieniądze/5100) prób zakupu broni defensywnych a następnie jeszcze raz sprawdza ile pieniędzy mu zostało i podejmuje (pieniądze/320) prób zakupu broni ofensywnych. Przy zakupie broni defensywnych kupuje tylko bronie silne i precyzyjne - czyli takie, które nie zrobią mu przypadkiem krzywdy.
|
||||
|
||||
* **Cyborg** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) lecz preferuje przeciwników sterowanych przez człowieka. Celuje bardzo dokładnie i w zdecydowanej większości przypadków trafia za pierwszym strzałem. Strzał oddaje najlepszą posiadaną bronią chyba że wymagana jest małą energia (cel jest blisko). Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Broni defensywnych używa dokładnie tak jak **Chooser**. Zakupy robi dokładnie tak jak **Spoiler**
|
||||
* **Cyborg** - Obiera sobie za cel najsłabszego przeciwnika (o najmniejszym zasobie energii) lecz preferuje przeciwników sterowanych przez człowieka. Celuje bardzo dokładnie i w zdecydowanej większości przypadków trafia za pierwszym strzałem. Strzał oddaje najlepszą posiadaną bronią chyba że cel jest blisko. Wtedy zmienia broń na **Baby Missile** by unikać trafienia samego siebie. Broni defensywnych używa dokładnie tak jak **Chooser**. Zakupy robi dokładnie tak jak **Spoiler**
|
||||
|
||||
* **Unknown** - Przed oddaniem każdego strzału losowo wybiera sposób działania od **Poolsharka** do **Cyborga** i stosuje jego taktykę. Taktyka zakupów broni jest jednak zawsze identyczna jak **Tosser**
|
||||
|
||||
@@ -236,9 +236,9 @@ Tabela broni kupowanych przez: **Spoiler** i **Cyborg**
|
||||
|
||||
| bronie ofensywne | bronie defensywne |
|
||||
| --- | --- |
|
||||
| Baby Nuke | Battery |
|
||||
| Nuke | Strong Parachute |
|
||||
| Death's Head | Mag Deflector |
|
||||
| Missile | Battery |
|
||||
| Baby Nuke | Strong Parachute |
|
||||
| Nuke | Mag Deflector |
|
||||
| Hot Napalm | Heavy Shield |
|
||||
| | Force Shield |
|
||||
| | Bouncy Castle |
|
||||
|
||||
@@ -155,7 +155,6 @@ endo
|
||||
|
||||
; choose the best weapon
|
||||
|
||||
ldy #last_offensive_____ ;the last weapon to choose +1
|
||||
jsr ChooseBestOffensive
|
||||
rts
|
||||
.endp
|
||||
@@ -202,7 +201,6 @@ endo
|
||||
|
||||
; choose the best weapon
|
||||
|
||||
ldy #ind_Laser__________ ;the last offensive weapon to choose +1
|
||||
jsr ChooseBestOffensive
|
||||
rts
|
||||
|
||||
@@ -317,7 +315,6 @@ NoUseDefensive
|
||||
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
||||
|
||||
; choose the best weapon
|
||||
ldy #ind_LeapFrog_______ ;the last offensive weapon to use +1
|
||||
jsr ChooseBestOffensive
|
||||
|
||||
; randomizing force +-100
|
||||
@@ -327,9 +324,10 @@ NoUseDefensive
|
||||
NotNegativeEnergy
|
||||
adw Force #100 RandBoundaryHigh
|
||||
jsr RandomizeForce
|
||||
lda ForceTableH,x
|
||||
bne HighForce
|
||||
; if Force lower than 256 - set weapon to Baby Missile (for security :) )
|
||||
; if target distance lower than 24 - set weapon to Baby Missile (for security :)
|
||||
jsr GetDistance
|
||||
cpw temp2 #24
|
||||
bcs HighForce
|
||||
lda #ind_Baby_Missile___
|
||||
sta ActiveWeapon,x
|
||||
HighForce
|
||||
@@ -349,7 +347,6 @@ HighForce
|
||||
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
||||
|
||||
; choose the best weapon
|
||||
ldy #ind_LeapFrog_______ ;the last offensive weapon to use +1
|
||||
jsr ChooseBestOffensive
|
||||
|
||||
; randomizing force +-50
|
||||
@@ -359,9 +356,10 @@ HighForce
|
||||
NotNegativeEnergy
|
||||
adw Force #50 RandBoundaryHigh
|
||||
jsr RandomizeForce
|
||||
lda ForceTableH,x
|
||||
bne HighForce
|
||||
; if Force lower than 256 - set weapon to Baby Missile (for security :) )
|
||||
; if target distance lower than 24 - set weapon to Baby Missile (for security :)
|
||||
jsr GetDistance
|
||||
cpw temp2 #24
|
||||
bcs HighForce
|
||||
lda #ind_Baby_Missile___
|
||||
sta ActiveWeapon,x
|
||||
HighForce
|
||||
@@ -380,15 +378,17 @@ HighForce
|
||||
jsr TakeAim ; direction still in A (0 - left, >0 - right)
|
||||
|
||||
; choose the best weapon
|
||||
ldy #ind_LeapFrog_______ ;the last offensive weapon to use +1
|
||||
jsr ChooseBestOffensive
|
||||
ldy ind_Nuke___________+1
|
||||
jsr ChooseBestOffensive.NotFromAll
|
||||
|
||||
lda Force
|
||||
sta ForceTableL,x
|
||||
lda Force+1
|
||||
sta ForceTableH,x
|
||||
bne HighForce
|
||||
; if Force lower than 256 - set weapon to Baby Missile (for security :) )
|
||||
; if target distance lower than 32 - set weapon to Baby Missile (for security :)
|
||||
jsr GetDistance
|
||||
cpw temp2 #32
|
||||
bcs HighForce
|
||||
lda #ind_Baby_Missile___
|
||||
sta ActiveWeapon,x
|
||||
HighForce
|
||||
@@ -1014,10 +1014,11 @@ SorryNoPurchase
|
||||
;----------------------------------------------
|
||||
.proc ChooseBestOffensive
|
||||
; choose the best weapon
|
||||
; Y - the last offensive weapon to use + 1
|
||||
; X - TankNr
|
||||
;----------------------------------------------
|
||||
|
||||
ldy #last_offensive_____+1 ;the last weapon to choose +1
|
||||
NotFromAll
|
||||
; Y - the last offensive weapon to use + 1
|
||||
lda TanksWeaponsTableL,x
|
||||
sta temp
|
||||
lda TanksWeaponsTableH,x
|
||||
@@ -1029,4 +1030,33 @@ loop
|
||||
tya
|
||||
sta ActiveWeapon,x
|
||||
rts
|
||||
.endp
|
||||
;----------------------------------------------
|
||||
.proc GetDistance
|
||||
; calculates distance from tank X to TargetTankNr(Y)
|
||||
; result in temp2
|
||||
;----------------------------------------------
|
||||
ldy TargetTankNr
|
||||
lda xTanksTableH,x
|
||||
cmp xTanksTableH,y
|
||||
bne @+
|
||||
lda xTanksTableL,x
|
||||
cmp xTanksTableL,y
|
||||
@ bcs YisLower
|
||||
sec
|
||||
lda xTanksTableL,y
|
||||
sbc xTanksTableL,x
|
||||
sta temp2
|
||||
lda xTanksTableH,y
|
||||
sbc xTanksTableH,x
|
||||
sta temp2+1
|
||||
rts
|
||||
YisLower
|
||||
lda xTanksTableL,x
|
||||
sbc xTanksTableL,y
|
||||
sta temp2
|
||||
lda xTanksTableH,x
|
||||
sbc xTanksTableH,y
|
||||
sta temp2+1
|
||||
rts
|
||||
.endp
|
||||
+1
-1
@@ -397,7 +397,7 @@ PurchaseMeTable2 ;weapons good to be purchased by the robot (Cyborg)
|
||||
;the comment is an index in the tables
|
||||
; "Baby Missile ","Missile ","Baby Nuke ","Nuke "
|
||||
; "LeapFrog ","Funky Bomb ","MIRV ","Death's Head "
|
||||
.by %00110001
|
||||
.by %01110000
|
||||
; "Napalm ","Hot Napalm ","Tracer ","Smoke Tracer "
|
||||
; "Baby Roller ","Roller ","Heavy Roller ","Riot Charge "
|
||||
.by %01000000
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user