.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Approaching Infinity (http://forum.shrapnelgames.com/forumdisplay.php?f=255)
-   -   Firing range (http://forum.shrapnelgames.com/showthread.php?t=50745)

Tarkh April 10th, 2015 03:25 PM

Firing range
 
It seems I don't fully understand the firing range rules. I have a rifle with range 3, but I get "Out of range" message when I try to shoot enemy that is located 2 tiles diagonally + 1 tile orthogonally away from me. At the same time, when enemy is 2 tiles orthogonally + 1 tile diagonally away, I can shoot it with no problem.
What do I miss here?

Kazeto April 10th, 2015 05:11 PM

Re: Firing range
 
Most likely there's something in the way. Something that you can see through but can't shoot through.

PvK April 10th, 2015 06:49 PM

Re: Firing range
 
I see the same thing, even over open ground, so it's not about obstacles.

2 diagonal + 1 orthogonal is 3 x 2 away, or square root of (3x3 + 2x2 = 13), so that is over range 3, and makes sense it is out of range.

1 diagonal + 2 orthoganal is 1 x 3 away, or square root of (3x3 + 1x1 = 10), so that's just a hair over absolute range 3 (square root of 9), so it seems the game uses actual distance according to the Pythagorean formula, but with a slight nudge.

DamienPS April 10th, 2015 10:41 PM

Re: Firing range
 
In my current game my Spacesuit visible range is 5 and my current weapon is range 1/6 which means if I can see it without cover it's dead.

Tarkh April 11th, 2015 02:16 AM

Re: Firing range
 
Quote:

Originally Posted by PvK (Post 829296)
it seems the game uses actual distance according to the Pythagorean formula, but with a slight nudge.

It'd be great to hear from Bob how exactly things are. Why should game use Pythagorean formulae when range is calculated in tiles, not in abstract numbers? Or...?

PvK April 11th, 2015 03:23 AM

Re: Firing range
 
Because if you count tiles on a square grid, then things end up with square fields of vision and square fields of fire, and diagonal movement and combat/spotting have a ~40% advantage, which is weirder and looks gamey-er than having correct range, even if movement is still in even grid chunks.

Although, it seems that movement isn't entirely treated the same way, at least for oxygen use - I'm not sure if time for diagonal movement is +40% or not - it should be.

Kazeto April 12th, 2015 02:47 PM

Re: Firing range
 
Quote:

Originally Posted by Tarkh (Post 829307)
It'd be great to hear from Bob how exactly things are. Why should game use Pythagorean formulae when range is calculated in tiles, not in abstract numbers? Or...?

Because the only case in which calculating range by simply counting the distance on the grid won't give you weird results that defy common sense is when you are using a hexagonal map.

That being said, I think that the value used for calculating the range via use of Pythagorean formulae is actually the range plus half a tile. That's a fairly common thing when you want to have an outer range area that is as close to being a circle as possible.

If that were the case, then with range of 3 you'd get 3,5 instead, which when multiplied by itself gives 12,25. And that means you'd be able to shoot at something that is 3 tiles in one direction and 1 in the other from you (as (3*3)+(1*1) equals 10), but not at something that is 3 tiles is one direction and 2 in the other (as (3*3)+(2*2) is 13, which is above 12,25).

Mind you, I'm not saying that this is guaranteed to be the case, but it is a rather simple and effective solution so I wouldn't be surprised if it was. If you want to make sure, you'd have to play with weapons that have different ranges to make sure.

ibol April 12th, 2015 03:43 PM

Re: Firing range
 
Kazeto's explanation is exactly correct. Thanks!

Tarkh April 13th, 2015 02:26 AM

Re: Firing range
 
Damn, the only case when my father was invited to my school for a "pedagogical talk" was because his son (me) regularily hadn't done his homework on math and geometry...:)
How complicated is the life of a space adventurer!

ibol April 13th, 2015 10:22 AM

Re: Firing range
 
here's something on the topic of "firing" :
have any of you ever seen a "gatling laser" ?
https://ibol17.files.wordpress.com/2...ling-laser.gif


All times are GMT -4. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2017, Shrapnel Games, Inc. - All Rights Reserved.