EvilPootCat's Shifter Changes
Tribes is the only game I've bought that was worth the full price, in no small part to its extensibility, rules-centric and team-centric gameplay and lack of overblown storyline and graphics. (Tribes 1 is multi-player only, with some training exercises).
And from Sierra/Dynamix, no less. I can picture the conversation in my head...
Lead Developer: EarthSiege/Starsiege has played out its storyline for now, so we're going to try this FPS thing, but we don't even know if the project will work or not.
Marketing Exec: Really? We'll set our writers to work on other projects then, like Kings' Quest XVII.
Lead Developer: Oh. Ok. Score!
Anyway, I was looking for a project to practice code optimization one day, So I figured, "Why not dig into Shifter? Let's see what happens." Aside from changing
projectile and weapons parameters, I've tried to optimize code in certain (ok, semi-random) functions.
Some of them seem to work, some patches broke the original code, and some I can't tell the difference.
The idea is efficiency, without affecting functionality (except for the scoring changes).
I've used Shifter0928 (2000) as my codebase, and I'll be plugging in pieces of various shifter versions, mostly 0928 and _v2. My changes reflect my (unproven) assumption that this scripting language functions in an interpreted fashion (variables instantiated on-demand), and contains short-circuiting logic for compound conditions.
Shifter_v2: Accel Pad
(Dec. 2002)
This snippet contains code to replace AccelPadPack::CheckPlayer() and ::OnCollision(), located in staticshape.cs. I'd already done similar things to 0928's version, but the _v2 code here can be plugged into 0928. Which you'll want to do, as it looks like czar has added directional boost capability. a la Merc's advanced booster. Changes:
- Removed armor-dependent boost modifier (and all the armor type checks). Jump distance seems more consistent between armor types now.
- CheckPlayer() now schedules itself on .16 second intervals, vs. .05.
- Removed unused vars and calculations, and removed some (not all) one-use vars.
Changes to Shifter_v1_09282000
(Apr. 2001) Changed scripts are contained in this zip (~91k); specific code and value changes are flagged with initials mkp. Coming Soon: code comparisons and maybe even some performance timing. If you try any of this on a 'real' (>8 player) server, I'd like to hear how well the modified code held up. Particularly the accel pad; I can feel a difference, even training mode.
'Important' (noticible impact) changes
- Scoring::Object():
- Replaced the class-based scoring with scoring based on the item's maxDamage value.
- remoteSellItem(): If you're going to sell a type of ammo, sell all of that type at once.
- AccelPadPack::CheckPlayer(): Accel pad jumping seems to behave smoothly now...
- Disabled code to calculate unused/redundant position coordinates.
- Rearranged the armor-dependent boost logic.
- Removed calculation of a useless variable, and relocated a client lookup to execute when needed.
Other changes
- StaticShape::shieldDamage(): Removed holding variables for the shield flash vector's coordinates and their deltas.
- StaticShape::onDamage(): Hacked the airbase object handlers into tiny, useless bits, and haven't reverted to original code yet.
- Scoring::Object():
- Reversed the order of distance bonus calculation to test by increasing (vs. decreasing) distance. Short range kills get processed first.
- Changed the distance calculation to use the last thing that damaged the target, to calculate the correct distance for remote turret kills. (no more +10 points for that turret you set on the other side of the map.)
- Scoring::killpoints(): Reversed the order of distance bonus calculation to test by increasing (vs. decreasing) distance. Short range kills get calc'ed first.
- buyItem(): Small change to if() structure dealing with Merc-booster pack removal.
- remoteSellItem(): If you're going to sell a type of ammo, sell all of that type at once.
- RocketImage::onFire(): Armor and client lookups now occur after check for ammo, and the Locking Stinger acquisition logic was rearranged.
- Player::onDamage():
- Arranged 'dead player' and 'GravGun damage' short-circuits to occur earlier.
- Rearranged lookups for ShooterClient and DamagedClient.
- Constant multiplier for head shots.
- Rearranged the if structure for merc-booster pops.
- Player::onCollision(): In item pickup logic (from dead players), moved the check for item count, to short-circuit mine/grenade/beacon filters (don't bother checking for item type, if the dead player has none of that item)
- gravCharge::damageTarget(): Disabled the calculation of an unused variable.
- Lightning::damageTarget(): Rearranged energy drain logic to have a slightly shorter path if target's energy is zero (a frequent occurance with the elf gun :).
- RepairBolt::checkDone():
- Replaced class-based scoring with maxDamage calculation (as in Scoring::Object())
- Rearranged the 'wrong team' and 'last damager' logic.
- Removed the calculation of an unused variable.
- NuclearExplosion(): Attempted to streamline the positioning of the nuke explosion's components, by removing one-use variables.
- DeployableRocket::missilecheck(): Shifter tip #156: deployable rocket turrets take damage if they detect an enemy sensor jammer with their check for guided missiles. I've folded both checks into one loop, instead of two, and increased the interval between checks.
- Turret::onCollision (): Combined the 'IsDead' and 'Not Player' short-circuits.
- AccelPadPack::onCollision(): Disabled code to calculate unused/redundant position coordinates, and rearranged an if structure.
- Various Places: There are several occurances of "if (floor(random()*N) < M)" to generate random events. I've changed several to "if (random() < 0.M)".
- Boomstick: Now shoots 4 fat slugs, instead of 20 little ones. (fewer pellets to track == smaller processing time)
Miscellaneous gameplay changes (not an exhaustive list, just the highlights)...
- 40% chance of plasma causing player to catch fire (vs. 30%)
- 60% chance of players exploding due to excessive damage (vs. 50%)
- Hvy Plasma now expels fewer plasma bombs.
- Nuke Explosion delay is 8 seconds (vs. 4).
- Chemeleons and Scouts can not carry plasma guns (cry me a river).
- Most of the projectiles have had their parameters changed, mostly lower.
- Rockets are faster, turn better, do less damage, and carry more force.
- Rocket Turrets have a longer range.
- Mortar Turrets take twice as much damage.
- Laser Turrets are slightly less durable, but are now shielded.
- Repair guns fix at a 0.1 rate (vs. 0.08).
- Inv. stations are a little stronger, with MaxDamage of 1.5 (vs. 1.0).
- Engineers now have a 90% chance to disarm plastique/detpacks (vs. 50%).
- Mortar fragments now have an explosion radius of 10 (vs. 20)
Last Updated on 12/15/2002
shoot.the.food@gmail.com
Accessed
times.