Altitude Game: Forums  

Go Back   Altitude Game: Forums > Altitude Support > Map Making
FAQ Community Calendar

Map Making Discuss everything related to creating new levels here.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2013, 08:54 PM
19 cm 19 cm is offline
Member
 
Join Date: Nov 2011
Posts: 73
Default A theory of turrets (and shields?)

I'm gonna summarize here a few observations I have made while making co-op maps and trying to figure out how prevent turrets from shooting you through shields.

Bullets originate 25 units ahead of the turret's origin (that's the point a turret rotates around in the editor) in the direction where the turret is currently pointing. This doesn't depend on the visual size of the turret or any other variables.

If this starting point is in solid, the bullet explodes there without traveling any further.

As you might expect from a game engine, objects in the game do not move smoothly and continuously, rather they are processed several dozen times per second in discrete tics.

Turret bullets are processed 50 times a second. In each tic a bullet travels a fixed distance equivalent to the turret's "speed" setting in the map editor. E.g. the default setting of 17 means a bullet travels 17 units every 1/50th of a second, or 850 units per second.

A curious thing about bullets is that they never move a fractional distance. Either they move an entire tic's distance (17 units or whatever "speed" is) or they explode where they are.

One reason a bullet can be prevented from traveling further is an obstruction on the way. A a line trace is done from the current position to the next desired position. If there's anything solid on the way, it explodes. (If the turret's "Bullet Blast Damage" setting is 0, the explosion effect is not drawn.)

Another reason is if the bullet has reached its destination, or if it would overshoot the destination if it tried to make a full move. Each bullet has its destination, which is simply a pair of coordinates. The destination is set the moment a bullet is spawned and never changes.

Open question: will a bullet explode/hit if it encounters a plane on the way? I don't know.

One interesting consequence of the fact a bullet never travels a fractional distance is that fast turrets tend to do less damage, on average, than you might expect. In fact, if a turret's "speed" is greater than its "blast radius", there exists a location where you can hover, unprotected, under direct turret fire without receiving any damage whatsoever.

Shields you would also expect to be more effective against fast turrets. But it's a bit more complicated in reality because of the bizarre shield bug where if you're not looking at a turret completely straight, the shield will fail and you'll take damage. The greater the angle between your planes line of sight and the bullet's velocity vector, the greater the possibility you'll get hit.

A bullet's damage has two components: direct (when it actually hits you) and blast (even if you're some distance away).

The amount of blast damage you get is a function of the distance between your plane and the the blast origin, the blast radius and the turret's "blast damage" setting. I don't know the exact formula, but it might be a simple linear one, such as damage_taken = blast_damage * (blast_radius - dist) / blast_radius.

The important thing is it doesn't matter if there's a wall between you and the blast; only the distance matter. So shields do not protect you from a blast -- they just make the blast happen (with full force) a certain minimum distance away from you.

A "blast radius" of ~80 or more means you may get some damage even through a shield (even if the shield doesn't fail). That's because the distance between your plane's origin and the shield's outer radius is somewhat less than 80 units.

80 happens to be the default "blast damage" setting for turrets (not sure -- check), so shields are not 100% effective against the most common turrets!

Last edited by 19 cm; 05-25-2013 at 09:13 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Turrets, and 1de Friblurks Suggestions 13 06-07-2010 10:10 PM
all Turrets killed Nikon Suggestions 7 03-25-2010 03:43 AM
Turrets Fishibaron Suggestions 1 03-01-2010 09:52 AM
Different Turrets skywalker Suggestions 8 12-07-2009 12:12 AM
turrets Maxzippoman Suggestions 9 06-04-2009 06:19 AM


All times are GMT. The time now is 06:14 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
2008 Nimbly Games LLC