Dogfight computer

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
dan3008
Average
Average
Posts: 13
Joined: Tue Apr 29, 2014 7:13 pm
Location: HMS Zion, a small ship where I am captin

Dogfight computer

Post by dan3008 »

Hi everyone.

This is my first post here (HELLO), but i've been lurking as a non-member for a while.

quick bit of background, I've been playing Elite since before I could talk (Born 1991, started playing the original elite 1993) and have never stopped. Now I am wanting to make an expansion for oolite (might make more than one) and have been reading the wiki ect.

So for my first project, I'd like to look at a dogfighting computer for ships. Basically, I'd like it to be able to turn the ship to face the target, and open fire.

any hints to get me started?

Thanks

Dan
User avatar
Captain Beatnik
Deadly
Deadly
Posts: 154
Joined: Sun Feb 27, 2011 10:15 pm
Location: Eastern Bavaria (Average Agricultural Confederacy)

Re: Dogfight computer

Post by Captain Beatnik »

Hello commander dan3008 and welcome to this board, the friendliest place this side of Riedquat. :D

I think the development of something like a dogfighting computer will require quite a lot of scripting. I would suggest to start at the wiki. There you will find many howtos that will give you valuable information about oxp-development: http://wiki.alioth.net/index.php/OXP_Distribution

I´m looking forward to hear more of your project!

Best regards

C.B.
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams, 1952 - 2001)
You have to try the impossible to achieve the possible. (Emil Sinclair, 1877 - 1962)
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Dogfight computer

Post by Norby »

Welcome dan3008!

Your selection is not the easiest for a first project. You can try my similar function in Telescope OXP where a double ident press ("r") can steer to the most centered ship, even if out of the screen. It is useful in dogfight when you want a lock on the next target as fast as possible after you finished one.

If you look into the Scripts/telescope.js file then the $Telescope_Steer() function add a FrameCallback in the 1514. line which can change the player.ship.orientation towards the target in every frame (normally 60 times in a second).

There are small tricks to do this correctly, for example I multiplied the player.ship.maxPitch with the elapsed time since the last frame (from the "delta" variable) to match the produced turn rate to the capability of the current player ship. So you should learn and borrow from existing codes also after you read the [wiki]OXP_howto[/wiki].

Programmed fire is even harder due to no simple fire function in the javascript interface. You can reduce the energy of the current target to simulate a hit (another trick is to get the correct damage amount from currentWeapon), but for an acceptable impression you must make visual and sound effects, and the usage of these will be obvious after some practice only.

If you are still here then we welcome you in the "dark side" of Oolite! ;)
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: Dogfight computer

Post by JazHaz »

dan3008 wrote:
Born 1991, started playing the original elite 1993
Sorry, what? You started playing the original Elite in 1993, the year that Frontier Elite 2 came out? So which game was you playing?
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Dogfight computer

Post by Diziet Sma »

JazHaz wrote:
dan3008 wrote:
Born 1991, started playing the original elite 1993
Sorry, what? You started playing the original Elite in 1993, the year that Frontier Elite 2 came out? So which game was you playing?
I thought that was pretty clear. :wink:

G'day Dan, and welcome aboard!
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
dan3008
Average
Average
Posts: 13
Joined: Tue Apr 29, 2014 7:13 pm
Location: HMS Zion, a small ship where I am captin

Re: Dogfight computer

Post by dan3008 »

JazHaz wrote:
dan3008 wrote:
Born 1991, started playing the original elite 1993
Sorry, what? You started playing the original Elite in 1993, the year that Frontier Elite 2 came out? So which game was you playing?
Yep, the original, my parents only had number 1. I got myself a pre-owed copy of 2 when i went to uni, in 2010... not long before i found oolite, and decided to just stick with that.
Norby wrote:
Telescope OXP
anyway, thats for all the advice. I'll certainly take a look at that Norby :)
Captain Beatnik wrote:
I think the development of something like a dogfighting computer will require quite a lot of scripting
haha, sure its not the easiest start point. But at least i'm familiar with javascript. and IMHO its the one thing that's really missing from Oolite that isnt already coverd in other oxp's. Normally i'd start with something simple, like a new ship or texture pack, but I dont have a decent image editor at the moment (old laptop :( ) and I cant do 3d models to save my life lol
attacked, defended myself, now i'm the fugitive. How was i supposed to know that other ship was a galcop...
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Dogfight computer

Post by Smivs »

Hi Dan, and welcome.
dan3008 wrote:
[a dogfighting computer] its the one thing that's really missing from Oolite that isnt already coverd in other oxp's.
Ha, there is a good reason for that! Whatever 'career' the player adopts, one thing remains constant, and that is that the real fun in the game is getting into a mean and dirty dogfight from time to time :) if you 'automated' it you would take away the best bit of the game. :(
You wouldn't build a robot to take care of your love life for you, would you? 8)
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Dogfight computer

Post by Norby »

There is another OXP: [wiki]SniperLock[/wiki] keep your ship lined up on target after you lined up once by hand. I think it can be a big help for novices but maybe considered to an uber addon by others. ClymAngus wrote in the SniperLock topic: "additionally we require an autopilot.oxp and autotrade.oxp in order to turn oolite into a proper screen saver." ;)
dan3008 wrote:
save my life
Life savers: [wiki]Auto_eject_OXP[/wiki], [wiki]Energy_Equipment_OXP[/wiki], [wiki]Repair_Bots_OXP[/wiki], [wiki]Retro_Rockets_OXP[/wiki] or [wiki]Hired_Guns_OXP[/wiki].
dan3008
Average
Average
Posts: 13
Joined: Tue Apr 29, 2014 7:13 pm
Location: HMS Zion, a small ship where I am captin

Re: Dogfight computer

Post by dan3008 »

Smivs wrote:
Ha, there is a good reason for that! Whatever 'career' the player adopts, one thing remains constant, and that is that the real fun in the game is getting into a mean and dirty dogfight from time to time :) if you 'automated' it you would take away the best bit of the game. :(
You wouldn't build a robot to take care of your love life for you, would you? 8)
I dono, I find the fights rather tedious. I quite enjoy just trading and doing delivery missions. besides, I never said that the computer would be good. End of the day, skill and determination would be able to outdo a computer, not even a contest
attacked, defended myself, now i'm the fugitive. How was i supposed to know that other ship was a galcop...
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Dogfight computer

Post by Diziet Sma »

dan3008 wrote:
Smivs wrote:
Ha, there is a good reason for that! Whatever 'career' the player adopts, one thing remains constant, and that is that the real fun in the game is getting into a mean and dirty dogfight from time to time :) if you 'automated' it you would take away the best bit of the game. :(
You wouldn't build a robot to take care of your love life for you, would you? 8)
I dono, I find the fights rather tedious. I quite enjoy just trading and doing delivery missions. besides, I never said that the computer would be good. End of the day, skill and determination would be able to outdo a computer, not even a contest
That's the nice thing about Oolite.. "Your Ooniverse, your way.." and if that's what floats your boat, there's bound to be others out there who feel the same way. So I say, go for it! 8)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Paradox
---- E L I T E ----
---- E L I T E ----
Posts: 607
Joined: Wed Feb 20, 2013 1:24 am
Location: Aboard the D.T.T Snake Charmer: My Xanadu
Contact:

Re: Dogfight computer

Post by Paradox »

Right on Dizzy! };]
Personally, Sniper Lock is a life saver when flying by keyboard! I would have stopped playing long ago without it!
Post Reply