Page 1 of 1

Dogfight computer

Posted: Tue Apr 29, 2014 7:31 pm
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

Re: Dogfight computer

Posted: Tue Apr 29, 2014 8:45 pm
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.

Re: Dogfight computer

Posted: Tue Apr 29, 2014 9:57 pm
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! ;)

Re: Dogfight computer

Posted: Tue Apr 29, 2014 11:03 pm
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?

Re: Dogfight computer

Posted: Wed Apr 30, 2014 4:56 am
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!

Re: Dogfight computer

Posted: Wed Apr 30, 2014 7:12 am
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

Re: Dogfight computer

Posted: Wed Apr 30, 2014 8:20 am
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)

Re: Dogfight computer

Posted: Wed Apr 30, 2014 10:02 am
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].

Re: Dogfight computer

Posted: Fri May 02, 2014 4:55 pm
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

Re: Dogfight computer

Posted: Fri May 02, 2014 5:22 pm
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)

Re: Dogfight computer

Posted: Fri May 02, 2014 7:31 pm
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!