aliens

Author Topic: Features: Show chance to hitting and the throw trajectory  (Read 58923 times)

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Features: Show chance to hitting and the throw trajectory
« on: September 07, 2013, 08:04:52 pm »
On the screenshots - result of cooperative work three options:
 battleRangeBasedAccuration, battleShowChanceToHit and battleShowThrowTrajectory

screen064. Was chosen snap shot. Near crosshair you can see probability of hitting.
screen065. Next rookie in the skyranger ready to throw smoke grenade. The game is shows the blast radius and the throw trajectory.
screen066. Chance to hit for first soldier significantly decreased because of dense smoke.

I wrote this code just for fun) , but
I would be interested to know ideas about this and suggestions about optimization.

Code:
chance to hitting: https://github.com/redv/OpenXcom/compare/rigth_shot_chance_view
throw trjectory: https://github.com/redv/OpenXcom/compare/throw_view

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #1 on: September 07, 2013, 10:51:05 pm »
The area of effect ring looks a tad out of place, but all the same I'd love to have this.

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: Features: Show chance to hitting and the throw trajectory
« Reply #2 on: September 08, 2013, 01:19:21 am »
Part of me thinks this is cheating but the other part of me thinks this is a really useful idea ( especially for newbie's).... I am so confused right now, Good Job :P

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #3 on: September 08, 2013, 05:03:54 am »
The area of effect ring looks a tad out of place, but all the same I'd love to have this.
Yeah it seems useful but the graphics look kinda jarring.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Features: Show chance to hitting and the throw trajectory
« Reply #4 on: September 08, 2013, 09:54:39 am »
perhaps make that ring a little thinner? or even several thinner rings with a bit of spacing between them (2-px-width rings with 2-px-width free space between them?) might look cool...

Offline Mr. Quiet

  • Commander
  • *****
  • Posts: 523
  • Likes: Quiet things. Dislikes: Loud things.
    • View Profile
    • =Open_X_Com= Mods
Re: Features: Show chance to hitting and the throw trajectory
« Reply #5 on: September 08, 2013, 10:07:43 am »
This is a great ides redv!! Give the ring a little bit of transparency. I think that's all it needs. If it still looks ugly, thin it up.

redv, can you post more pictures on the trajectory? I can barely see it on the second screen. I'd like to see different angles and stuff.
« Last Edit: September 08, 2013, 10:09:16 am by WeOwnTheNight »

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #6 on: September 08, 2013, 04:51:46 pm »
The area of effect ring looks a tad out of place, but all the same I'd love to have this.
The circle is drawn around last point of trajectory. After call convertVoxelToScreen(), last point always in the top corner of tile. Now i found the cause of the error. I just need add correction to my calculations. Just 8 pixels down.

Yeah it seems useful but the graphics look kinda jarring.
Yes, i know it. Therefore i asked to the forum about this)
I want get ideas about improvements.

Give the ring a little bit of transparency. I think that's all it needs. If it still looks ugly, thin it up.
redv, can you post more pictures on the trajectory? I can barely see it on the second screen. I'd like to see different angles and stuff.
I thought add texture to the circle and change its in cycles. Like rotation or pulsation of the circle. But, in my opinion, even this effect will looks very well, this will looks like as taken from other game.
Static shadow or transparency also not good. I tryed it. Because if it looks good at day, but bad at night.
Now i think about adding pulsation of the shadow of tiles under the ellipse. And try a different thinness of line.

screen035. Throw at night. Trajectory shows good.
screen036. Throw at day. Trajectory shows good too. Because uses two colors for drawing the trajectory.


Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #7 on: September 08, 2013, 08:14:01 pm »
The circle is drawn around last point of trajectory. After call convertVoxelToScreen(), last point always in the top corner of tile. Now i found the cause of the error. I just need add correction to my calculations. Just 8 pixels down.
No no- I meant, out of place as in it doesn't look like it would fit the graphics/art style that XCOM uses.
Try some other colours for the ring, maybe the same shade of yellow as the accuracy number, or the red of the targetting reticle... that sort of thing.

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #8 on: September 09, 2013, 01:17:25 am »
Try some other colours for the ring, maybe the same shade of yellow as the accuracy number, or the red of the targetting reticle... that sort of thing.
Damn! Why? Why i didn't think about that?(
Yes, this is much better.
Thank you)

If anyone (any visible unit) standing inside blast radius, then color will change to yellow and blink like yellow crosshair.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Features: Show chance to hitting and the throw trajectory
« Reply #9 on: September 09, 2013, 07:57:46 am »
Ooh, nice! So it actually behaves exactly like the red box/crosshair... that's perfect!

Merge! Merge! Merge!
:)

Offline kkmic

  • Commander
  • *****
  • Posts: 582
  • Undefined
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #10 on: September 09, 2013, 11:26:50 am »
Merge! Merge! Merge!

Tora! Tora! Tora!

Offline mercy

  • Colonel
  • ****
  • Posts: 341
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #11 on: September 09, 2013, 01:58:40 pm »
Oh my god this looks GOOD!!!    Excellent job.

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: Features: Show chance to hitting and the throw trajectory
« Reply #12 on: September 09, 2013, 02:49:28 pm »
Nice job, Merge it :P

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Features: Show chance to hitting and the throw trajectory
« Reply #13 on: September 09, 2013, 04:39:13 pm »
is that "ring" a flat object (on the ground) or a 3D-like object? it looks like it could be a torus with a square cross-section, but perhaps it's just two concentric rings of different color...

(I'm asking because I'm not sure how to interpret the way it intersects with the haystack on the left.)

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Re: Features: Show chance to hitting and the throw trajectory
« Reply #14 on: September 09, 2013, 05:35:51 pm »
is that "ring" a flat object (on the ground) or a 3D-like object? it looks like it could be a torus with a square cross-section, but perhaps it's just two concentric rings of different color...

This ring is flat object on the ground.
1. I draw whole ellipse on special surface.
2. Cut a rectangles 32x40 from the ellipses surface.
3. Superimpose these rectangles to the map surface.
One problem - 3D map blocks is not rectangle)   https://www.ufopaedia.org/index.php?title=Module#Terrain
As result, in some cases, apear artifacts like 3D intersections.
Now i finished optimizations. Later will try to solve these problem.