Home   Help Search Login Register  

Author Topic: indoor combat  (Read 2378 times)

0 Members and 1 Guest are viewing this topic.

Offline ZapBrannigan

  • Members
  • *
indoor combat
« on: 17 Oct 2010, 08:14:56 »
I have a few problems related to building combat.

1. How to fix the problem where if the player drops from a height(even from one stair) when he lands he isn't able to turn or look around for about half a second. 

2. How to make the AI turn more quickly.  Right now they turn like tank turrets. If the player pops out from behind a corner i want them to spin around to engage him.

3. How to give the AI strafing abilities like the player.  in buildings if the player is one flight of stairs down from an enemy, and the enemy wants to engage him, he will turn his back on the player to go around the stairs. I want the AI to face the player the whole time he is moving.  how to make it so that if the player is within a certain distance of the AI he will constantly face the player and use side steps to move around.

thanks

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: indoor combat
« Reply #1 on: 17 Oct 2010, 10:13:11 »
It is tempting to say "get really good at C++, join BIS and modify the game engine so it's also meant for indoor combat" but I guess that wouldn't be much of a help.  :(
try { return true; } finally { return false; }

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: indoor combat
« Reply #2 on: 17 Oct 2010, 13:43:35 »
What Worldeater is saying is that AI + precise movements such as those required by indoor combat = not going to happen in the current game engine. You can MAYBE fake it in very controlled environments (i.e. what every other FPS out there is doing) by manually placing AI next to a wall and animating it to sidestep, turn towards the player etc. But to make it work in any place, in any situation - unlikely. :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline ZapBrannigan

  • Members
  • *
Re: indoor combat
« Reply #3 on: 17 Oct 2010, 14:39:21 »
Well of course im talking about a certain situation. Im a mission maker  :P. actually i think the designer letting the AI run free too much is irresponsible. I like to keep a balance between scripted scenes/controled enemies  and free AI. 

What I was thinking of doing is for the AI spinning to face the player.  making a script that gets the direction heading to the player.  and then setdirs him incrementally by loop that changes his direction by 1 degree each loop.  a quick test with my own (out of shape) body seems like half a second to turn 180 degrees seems pretty good.  so that makes 1 degree every .003 seconds. for less lag maybe go by 5 degrees each .01 seconds.    so,  i just change his direction by 5 degrees every .01 seconds until he is facing the player.

so maybe i could do it like
Quote
_unit = _this select 0
@_unit distance player < 4       
@_unit knowsabout player > .7

_direction = getdir _unit

*insert trg here which creates new variable _bearing*

?(_bearing-_direction) <|10| or ?(_bearing - _direction)>|350|:exit
 
#loop
?(_direction - _bearing) <10:exit
_direction = (_direction - 5)
?_direction < 0:_direction = (_direction + 360)
_unit setdir _direction
~.01
goto "loop"

woow thats a mess,  haha, this is just a rough idea  i know if this way the unit could end up turning the wrong way and its full of errors.