1 /* GemRB - Infinity Engine Emulator 2 * Copyright (C) 2015 The GemRB Project 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software 14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 * 16 * 17 */ 18 19 /** 20 * @file voodooconst.h 21 * this file contains constants of dubious nature. Most 22 * were figured out by trial and error and may be way off. 23 * Or even different between the engines. 24 * FIXME: THIS FILE SHOULD NOT NEED TO EXIST! 25 * @author The GemRB Project 26 */ 27 28 #ifndef VOODOO_H 29 #define VOODOO_H 30 31 #include "exports.h" 32 33 namespace GemRB { 34 35 // Constant to convert from points to (feet) for spell distance calculation 36 // completely empirical, 9 seems to work fine for iwd and bgs 37 // but it is either too small for iwd2 or there are other bugs 38 // (fireball to the door in the targos attack is a good test case) 39 static const int VOODOO_SPL_RANGE_F = 15; 40 41 // ... similarly for items 42 static const int VOODOO_ITM_RANGE_F = 15; 43 44 // fx_casting_glow has hardcoded height offsets, while they should be avatar based 45 // ypos_by_direction and xpos_by_direction 46 47 // MAX_TRAVELING_DISTANCE is our choice, only used for party travel 48 // MAX_OPERATING_DISTANCE is a guess 49 // test cases: tob pp summoning spirit, pst portals, pst AR0405, AR0508, ar0500 (guards through gates) 50 // it's about 3 times bigger in pst, perhaps related to the bigger sprite sizes and we modify it in Scriptable 51 // The distance of operating a trigger, container, dialog buffer etc. 52 static unsigned int MAX_OPERATING_DISTANCE IGNORE_UNUSED = 40; //a search square is 16x12 (diagonal of 20), so that's about two 53 54 // existence delay is a stat used to delay various char quips, but it's sometimes set to 0, 55 // while it should clearly always be delayed at least a bit. The engine uses randomization. 56 // Estimates from bg1 research: 57 /* 58 75 = avg. 5 s 59 150 = avg. 10 s 60 225 = avg. 15 s 61 300 = avg. 20 s <- BG1 default 62 375 = avg. 25 s 63 450 = avg. 30 s 64 525 = avg. 35 s 65 600 = avg. 40 s 66 675 = avg. 45 s 67 750 = avg. 50 s 68 825 = avg. 55 s 69 900 = avg. 60 s*/ 70 static const unsigned int VOODOO_EXISTENCE_DELAY_DEFAULT = 300; 71 72 // NearLocation range multiplier (currently the same for pst and iwd2/how) 73 // arbitrary, started as 20 and has no effect for callers that want exact position 74 // supposedly the same feet->map conversion as usual 75 static const int VOODOO_NEARLOC_F = 15; // sqrt(8*8+12+12) 76 77 // visual range stuff 78 static const int VOODOO_CANSEE_F = 16; 79 // these two are well understood for actors, but could be different for other scriptables 80 // eg. visual range is supposedly 15 (see note in DoObjectChecks) 81 static const int VOODOO_VISUAL_RANGE = 28; 82 static const int VOODOO_DIALOG_RANGE = 15; 83 84 // character speed was also hardcoded depending on the used animation type 85 // 9 is a good default for bg2, but it's clearly wrong for bg1 and some animations 86 // we now use the number of frames in each cycle of its animation (bad) 87 static const int VOODOO_CHAR_SPEED = 9; 88 89 } 90 91 #endif 92