Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Joey_21 on March 23, 2003, 02:06:56 am

Title: Force a ship to rotate
Post by: Joey_21 on March 23, 2003, 02:06:56 am
Suppose I have a ship that has beams on its side but for some purpose or another the enemy craft that the ship is supposed to be firing at is directly in front of it instead of beside it.

How about a force-ship-rotate s-exp that works a bit like this:

when
----is-destroyed-delay
--------Aries
----force-ship-rotate
--------GTD Bastion (name of ship doing the turning)
--------X (which axis to turn on)
--------90 (number of degrees, negative values to turn the opposite direction)
Title: Force a ship to rotate
Post by: kasperl on March 23, 2003, 05:53:30 am
shouldn't this be in the SEXP thread?
Title: Force a ship to rotate
Post by: Killfrenzy on March 23, 2003, 07:13:47 am
Either way, this could be the single most useful thing that could be implemented now. It would make capship battles more believable.
Title: Force a ship to rotate
Post by: Black Wolf on March 23, 2003, 08:54:31 am
Could we also add a little section for to face ship? You could either set it to x degrees and or zero degrees and "ship Name". Or even "Ship name" and x degrees, so you could rotate past a ship.
Title: Force a ship to rotate
Post by: Goober5000 on March 24, 2003, 11:57:57 am
Um, I just added set-ship-facing a few days ago which will do just this...

However, it does it instantly, not gradually.
Title: Force a ship to rotate
Post by: Joey_21 on March 24, 2003, 12:03:18 pm
Quote
Originally posted by Goober5000
However, it does it instantly, not gradually.


Hence a purpose I would rather have force-ship-rotate. ;)

Seriously though... it's very unrealistic to see a ship automatically change directions like that...
Title: Force a ship to rotate
Post by: Goober5000 on March 24, 2003, 12:04:44 pm
Meh - someone couuld always add an optional speed parameter.  There's probably a function in the ai somewhere that would do that.
Title: Force a ship to rotate
Post by: Ulala on March 28, 2003, 11:10:40 pm
I like this idea! :nod:
Title: Force a ship to rotate
Post by: Killfrenzy on March 29, 2003, 01:13:12 pm
I could see this:

"This is the KS Victorious engaging Swarm carrier. Starboard broadside!"

Ship heels over to port to bring her starboard guns to bear, and they open fire in a blaze of energy.
Title: Force a ship to rotate
Post by: Petrarch of the VBB on March 29, 2003, 01:49:23 pm
It would also be a way for Orions to win beamfights. I am fed up with them flying head on to their target, when all the turrets are on the sides.
Title: Force a ship to rotate
Post by: TrashMan on March 29, 2003, 03:43:49 pm
I've been proposing the same thing ever since I joined the boards...
WE NEED THE SET-SHIP-FACING sexp!!!!

But you would need more parameters:
- which ship is doing the turning/facing
- ship towards it will face
- how will it face it (left, right, top, bottom..)
- speed at which it will turn

----------------------------
It could be done like this:
 each facing/side has it's own normal (like a weapon) and the ship tries to move around untill that normal points right at the enemy ship. And it tries to keep it that way!
Title: Force a ship to rotate
Post by: Goober5000 on March 29, 2003, 06:48:05 pm
Geez, calm down. :rolleyes: Didn't you see that it was implemented already?  It's currently instantaneous, but it could be modified.
Title: Force a ship to rotate
Post by: Ulala on April 02, 2003, 01:20:13 pm
Modification would be cool. Capship battles might start to make a little more sense. :p
Title: Force a ship to rotate
Post by: Killfrenzy on April 03, 2003, 03:32:22 am
Yeah, and then these warships might actually act as if there are humans in charge rather than monkeys (or an orang-utan in the case of the Collossus) :D
Title: Force a ship to rotate
Post by: Ulala on April 03, 2003, 11:49:30 am
:lol:
Title: Force a ship to rotate
Post by: redmenace on April 03, 2003, 02:53:42 pm
Quote
Originally posted by Killfrenzy
Yeah, and then these warships might actually act as if there are humans in charge rather than monkeys (or an orang-utan in the case of the Collossus) :D
well more or less "Monkeys on space crack". May I add the same monkeys that developed user interface of truespace(3d moddeling program).
Title: Force a ship to rotate
Post by: LAW ENFORCER on April 03, 2003, 03:44:13 pm
Thats a bit harsh! ... blender:rolleyes:

Now THATS a user interface!

It was originaly going to be Myst IV: Blended Worlds, all about how some books were blended and seperated and how you had to solve many diffrent pussles over strangly twisted lanscapes that intertwinded with eachother leaving some pussules from the start not completeable until the end!:eek2:

However, it was deemd to crappin' hard and was made into a 3D modeler instead...


:ha: ;7
Title: Force a ship to rotate
Post by: _argv[-1] on August 31, 2003, 07:46:11 pm
In ai-chase, the ship approaches its target, then starts circling it as it gets close enough. Another AI goal type to chase without approaching could be done. I'll see what I can do.
Title: Force a ship to rotate
Post by: Raven2001 on September 01, 2003, 08:59:27 am
A really nice thing would be, instead of forcing the ship to face another ship, the SCP dudes could implement AI engage scripts where we could shoose the tactics the ship would use...

For example, a Ravana would use a "dive" tactic... it faces the target, fires, at a certain range the Ravana will have to disengage, fly a bit, and turn around for another dive... a ship that has beams on the side, will always fly circles around the Target in order to have the side beams pointing at it... this sort of stuff... but implemented in AI scripts so that the capship battles look realistic, where the BIG GUYS do some maneuvering
Title: Force a ship to rotate
Post by: _argv[-1] on September 01, 2003, 11:47:50 am
Quote
Originally posted by Raven2001
A really nice thing would be, instead of forcing the ship to face another ship, the SCP dudes could implement AI engage scripts where we could shoose the tactics the ship would use...

For example, a Ravana would use a "dive" tactic... it faces the target, fires, at a certain range the Ravana will have to disengage, fly a bit, and turn around for another dive... a ship that has beams on the side, will always fly circles around the Target in order to have the side beams pointing at it... this sort of stuff... but implemented in AI scripts so that the capship battles look realistic, where the BIG GUYS do some maneuvering

Something wrong with the Ravana just facing its target and shooting away? (It still approaches its target if it gets too far away, of course.)

If it tries to dive like that, it'll lose almost every battle against ships with lateral turrets, because it will spend most of its time diving and therefore unable to bring its main guns to bear, while the target is still busy putting beams through it. When attacking another ship you're supposed to shoot at it. :)
Title: Force a ship to rotate
Post by: Raven2001 on September 01, 2003, 03:59:32 pm
No!!! You got it all wrong!!! Normally, if set to attack a ship, the Ravana closes its distance with the Target at the same time it fires her beams, but at a certain point (when it is too close) it just flyes in circles around the Target, and doesn't shoot (the beams are facing the front)... instead, the Ravana should fly away and turn around for another pass...

Oh, there is another beahviour... if it is too close when ordered to attack, the Ravana automatically begins the circling around the bogey...

Got my point now??
Title: Force a ship to rotate
Post by: TrashMan on September 01, 2003, 04:02:19 pm
Don't worry people!

Goober5000 is working on my ai-face-ship SEXP that will allow anyone to order a ship to face any other ship anyway you want, from anyside you want.

when
has-arrived-delay
-Orion
-10
--ai-face-ship
---Orion
---left
---Ravana
---rear

i.e. -  for example, a Orion will try to get to the rear of a Ravana, while facing it with it's left side!
Title: Force a ship to rotate
Post by: Goober5000 on September 01, 2003, 04:14:27 pm
Um... no, that's not it at all.  The ship will merely turn to point in a particular direction.  If you want it to maneuver around, you'll have to script waypoints.
Title: Force a ship to rotate
Post by: _argv[-1] on September 01, 2003, 05:16:56 pm
Quote
Originally posted by Raven2001
No!!! You got it all wrong!!! Normally, if set to attack a ship, the Ravana closes its distance with the Target at the same time it fires her beams, but at a certain point (when it is too close) it just flyes in circles around the Target, and doesn't shoot (the beams are facing the front)... instead, the Ravana should fly away and turn around for another pass...[/B]

Again, when she turns around to flee, she will be unable to fire at her target until she turns around again to start shooting.

The way I've done it is that she will simply stop, shoot at the target, and turn as necessary to keep her aim on the target. If both ships are instructed to sit and shoot (like a Ravana targeting a Hecate), then they will both just face each other and slug it out. If the target gets too far away, she will try to keep up with it, to prevent it from getting out of range.

Note that two big ships attacking each other will not collide -- they're programmed not to. They will only circle around each other, or face each other. For this reason, it doesn't really make much sense for them to try and distance themselves from each other anyway.

Of course, if you really want, and if the ship can do it, then it could be programmed to use reverse thrusters to back away from the target. Turning away from it, however, is a really bad idea.

Quote
Originally posted by Goober5000
If you want it to maneuver around, you'll have to script waypoints.

Or beg programmers to code the circling around code to do this...
Title: Force a ship to rotate
Post by: Shiva Archon on September 01, 2003, 09:57:18 pm
Whats wrong with using a close-in waypoint to turn a capship around?  Capship battles pretty much have to be waypoint-choreographed anyway, since that circling thing is next to useless for all but Orions and Demons.
Title: Force a ship to rotate
Post by: StratComm on September 01, 2003, 10:23:27 pm
Quote
Originally posted by Shiva Archon
Whats wrong with using a close-in waypoint to turn a capship around?  Capship battles pretty much have to be waypoint-choreographed anyway, since that circling thing is next to useless for all but Orions and Demons.


The problem is that there seems to be no determining factor for what angle the capship chooses to turn by when turning around (maybe has something to do with the smallest possible arclength but I haven't seen anything to support that), so in situations where capships are flying in close formation to each other, they cannot be ordered to turn around with waypoints without risking mass collisions.  However, I think that trying to more carefully script capship behavior is a moot point, as a good FREDer will never leave capships to their own affairs unless there is some explicit reason to do so.  Otherwise, all good battles are scripted.
Title: Force a ship to rotate
Post by: TrashMan on September 02, 2003, 04:33:35 am
Quote
Originally posted by Goober5000
Um... no, that's not it at all.  The ship will merely turn to point in a particular direction.  If you want it to maneuver around, you'll have to script waypoints.


Why not? If you got the hang of facing a ship, shouldn't be relatively easy to add this as well? Capship fights will look good even without scripting.
Title: Force a ship to rotate
Post by: _argv[-1] on September 02, 2003, 02:12:13 pm
Quote
Originally posted by Shiva Archon
Whats wrong with using a close-in waypoint to turn a capship around?  Capship battles pretty much have to be waypoint-choreographed anyway, since that circling thing is next to useless for all but Orions and Demons.

It's not automatic. :D Why script capship battles when the AI can do it on its own?

There needs to be an ai-guard for big ships, though, so you can have cruisers and corvettes escorting a destroyer -- stay with it, circle around it when it's not moving, engage hostiles in defense of your escortee, etc. Then you don't need to script battlegroup coordination, either.

I don't know how hard this would be, though. It depends on how applicable the small ship ai-guard is to big ship AI. As you may know, big ship AI is quite different from small ship AI.

Anyway, my line of thinking is simply that the big ship AI should be smart enough that you don't need and won't want to script big ship battles.
Title: Force a ship to rotate
Post by: Flipside on September 02, 2003, 03:02:05 pm
I agree, though the opportunities for Freespace Pokemon abound ;)

Flipside :D
Title: Force a ship to rotate
Post by: ChronoReverse on September 02, 2003, 03:20:08 pm
DEIMOS!  I CHOOSE YOU!  GOOOOO!
Title: Force a ship to rotate
Post by: StratComm on September 02, 2003, 03:32:23 pm
Quote
Originally posted by ChronoReverse
DEIMOS!  I CHOOSE YOU!  GOOOOO!


Oh the humanity!  Did someone have to go and inalterably taint my opinions of Freespace by using it in Poke-speak?

*faints*
Title: Force a ship to rotate
Post by: _argv[-1] on September 02, 2003, 03:51:15 pm
Check that. ai-guard already works correctly when given to big ships. Same logic as small ships -- approach, circle around, keep up, temporary ai-chase on attackers, etc.

P.S. ChronoReverse: :hopping: :hopping: :mad: :mad2: :shaking: :shaking: :shaking:
Title: Force a ship to rotate
Post by: ChronoReverse on September 02, 2003, 03:54:10 pm
Sorry, couldn't help myself when Flipside made the pokemon comment XD
Title: Force a ship to rotate
Post by: Flipside on September 02, 2003, 04:03:44 pm
LOL Well, you could theoretically set up arenas to test new capital ships for effectiveness of weapon arrangements etc, it would only be a matter of time before there was a league ;)

Flipside :D
Title: Force a ship to rotate
Post by: Goober5000 on September 02, 2003, 10:11:08 pm
Quote
Originally posted by TrashMan
Why not? If you got the hang of facing a ship, shouldn't be relatively easy to add this as well? Capship fights will look good even without scripting.


Rule #1 in the SCP forum: Non-coders should not speculate on how easy it may be for coders to implement things.  Getting a ship to face a location was relatively simple, but getting a ship to maneuver to a certain location is orders of magnitude more difficult.
Title: Force a ship to rotate
Post by: redmenace on September 02, 2003, 11:53:06 pm
plus manuever around ships. you basically i guess, have to teach it drivers ed. and what if other ships are flying around that will influence its behavior.