Author Topic: Real Line Of Sight detection  (Read 1767 times)

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Real Line Of Sight detection
« on: 3 September 2010, 10:37:45 »
Under the current code units can fire on any unit within their range regardless of any intervening terrain or tileset objects  :(

Units need to detect when terrain or tileset objects are blocking their LOS and attempt to move until they have a clear LOS.

« Last Edit: 3 September 2010, 10:39:32 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Real Line Of Sight detection
« Reply #1 on: 3 September 2010, 12:44:29 »
I'll put it on the list, and give it some thought... but Glest's game mechanics are, in general, not overly concerned with the third dimension... so it could be quite a bit of work.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Real Line Of Sight detection
« Reply #2 on: 3 September 2010, 18:46:01 »
I can see how this would be difficult with different trajectories.  The engine would have to know to treat linear projectiles differently from parabolic ones, and figure out if the obstacle is short enough to shoot over or not.

Mark

  • Guest
Re: Real Line Of Sight detection
« Reply #3 on: 3 September 2010, 23:04:52 »
Some games have physics engines that tell the computer if the object hits a valid polygon.  If such a physics engine were to be developed-though this seems like a tough thing to do- trees and other things could get in the way, and if a different unit got in the way, it would take the damage (though probably not allied units).  I know glest has something like this because of two things: in glest, you select a unit by clicking on it's model.  You can zoom in all the way and click as close to the line as possible, and you will agree with me.  Also, if you select a unit that has a unit behind it, you will select both if both are multi-selectable.  Clearly, I don't understand everything about this idea, but I think you guys are on to something.  Modman likes this idea, too, though he just calls it a physics engine and he has a detailed explanation of what it is.  I know there are other games that do not use the selection method of glest, but instead have areas on the ground around the unit that when clicked, select the unit.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Real Line Of Sight detection
« Reply #4 on: 9 September 2010, 05:03:17 »
Personally, I oppose this idea. As interesting as it could be, it has a major disadvantage... Why should I have to manually orientate my units to be facing a certain direction? Plus, I think its simply a lot of work for a primarily unneeded feature.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

emscape

  • Guest
Re: Real Line Of Sight detection
« Reply #5 on: 13 September 2010, 19:39:16 »
it would be cool, but then it also must effect the fog of war,

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Real Line Of Sight detection
« Reply #6 on: 13 September 2010, 20:00:57 »
Why should I have to manually orientate my units to be facing a certain direction?

You do not have to manually orientate your units. They will still turn to face the enemy they just will not be able to shoot through objects like walls, seems sensible to me. The second stage would be to have units move themselves into a position where they can see the enemy, however this would be very tricky to get working correctly.

Plus, I think its simply a lot of work for a primarily unneeded feature.

It will be alot of work but it is certainly a needed feature. Vanilla Glest hides this limitation well by using short ranges, curved tracjectories and mostly flat maps, however the problem can be seen around the object 9 rocks which units often shoot through. I've been experimenting with a military type mod and the problem becomes cleaer with longer ranges and "bumpier" maps, units wil often have firefights through hills and forests  :o
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

ChupaReaper

  • Guest
Re: Real Line Of Sight detection
« Reply #7 on: 19 September 2010, 11:11:57 »
It does look odd when projectiles go through large objects and buildings, but since my mod uses walls, this would be quite important as though they stop melee units, ranged units can easily just shoot through the walls. Shooting over the walls would be good aznd also the height of flying units would have to be considered.

 

anything