Jump to content

User talk:Morgan525

From UFOpaedia
Revision as of 01:32, 14 July 2012 by Morgan525 (talk | contribs) (moving stuff from my main page to the discussion section)

Table of Battlescape sound calls

The following is a list of how most events in TACTICAL generate sounds. This data is scattered throughout the executable in various data arrays. First an event number is passed to the sound subroutine. The program then compares the event with its corresponding entry in another section to determine how to play that sound. 06 is the standard method. 01 plays the sound uninterrupted by other sounds.

	Play		CAT
Evt# 	Setting		reference           Description
00	00		--		Normal bipedal movement.  Routine refers to tileset and alternates between 1 and 2.
01	01		0E		normal tank move
02	01		00		snakeman move
03	02		--
04	01		0F		Flying unit move
05	01		10		Celatid move
06	01		2F		Silacoid move
07	02		--	
08	02		--
09	02		--
0A	01 		28		hovertank/cyberdisk move
0B	06		04		rifle/pistol shoot
0C	06		16		bullet hit
0D	03		14		sliding door opens. Routine randomly plays 1 of the 2 entries in SAMPLE2.
0E	06		03		normal door opens
0F	02		--
10	06 		0C		big gun shoots
11	06		0D		big gun hits		
12	06		0B		laser gun shoots
13	06		13		laser shot hits
14	06 		12		plasma gun shoots
15	06		13		plasma shot hits
16	06		34		rocket launches
17	06		35		blaster bomb/stun launcher shoots
18	06		0C		small explosion (problem: zombie move)
19	06		05		big explosion
1A	02		--		stun rod  (*problem*)
1B	06		24		psi attack
1C	06		06		mind probe use* 
1D	06		11		reload weapon
1E	06		26		place an item
1F	02		--
20	04		--		death of a male. Routine randomly plays 1 of the 3 sounds in SAMPLE2.
21	06		17		tank destroyed
22	06		0A		sectoid death
23	06		08		snakeman death
24	06		09		etheral death
25	06		06		muton death
26	06		0A		floater death
27	06		07		celatid death
28	06		08		silacoid death
29	06		09		chryssalid death
2A	06		0A		reaper death
2B	06		17		sectopod death
2C	06		17		cyberdisk death
2D	06		30		zombie & reaper attack
2E	06		31		chryssalid attack
2F	06		32		silacoid attack
30	06		30		celatid attack
31	06		27		throw an item
32	05		--		death of a female. Routine randomly plays 1 of the 3 sounds in SAMPLE2.
33	02		--		
34	02
35	02
36	02
37	02


Functions used in UFOextender's new interception routines

For those that might want to know how accuracy is calculated with the new options for interception turned on:

X-Craft Accuracy

[(1+((3-(.5*(difficulty level-1)))/UFOsize)/2 ] * Weapon Accuracy ....... [beginner=1..superhuman=5]

Diff	Ship Size				
	VS	S	M	L	VL
begin	0.8	0.875	1	1.25	2
exp	0.75	0.8125	0.91667	1.125	1.75
vet	0.7	0.75	0.83333	1	1.5
Genius	0.65	0.6875	0.75	0.875	1.25
Super	0.6	0.625	0.66667	0.75	1
         

UFO Accuracy

60 + ((difficulty level-1)*3) - [Cautious Mode bonus (10)]

Feedback

Any questions or feedback one may have....

Decompiled accuracy algorithm?

Hi Morgan/Tycho

Is the algorithm you describe above, what you have decompiled from the standard game? Or is it a variant for UFOExtender? Great news if you have decompiled what the game actually uses - I will need to check some of my firepower calculations to make sure they are still in line with the algorithm.

cheers, Spike 09:37, 30 June 2012 (EDT)

It is an extender version of the original formula if one chooses to enable it. The original is the one that has been noted already: [1+(3/UFOsize)]/2 * Weapon Accuracy ... UFO sizes going from 5 for very small to 1 for very large. The calculation starts at offset 0x446DCD of the CE version. If one were to set the extender's interception difficulty to beginner, the algorithm's output is the same as the original one. The original UFO accuracy algorithm is a flat 60% chance to hit despite the difficulty level (and no penalty for the Xcraft being in cautious mode.)

Morgan525 19:23, 30 June 2012 (EDT)