|
From: TIMOTHY K H. <tkh...@ve...> - 2006-11-27 03:36:15
|
Beware, I lied again...
thrust(int direction, double fraction)
is incorrent, the correct function name is:
partialThrust(int direction, double fraction);
TIMOTHY K HAMILTON <tkh...@ve...> wrote: I've almost got the available accel pre-calculations finished, I just have to find every place in the code where mass can possibly be removed, and make sure that accel is then re-calculated, but the basics are already there.
Fractional thrust is also completely implemented, just call:
thrust(int direction, double fraction)
where fraction is between 0-1. It works exactly like the existing thrust(direction) function in all other ways.
I'll do what I can on the higher-level nav as you suggest, the majority of the tactical stuff needs to wait until we can get a ship to orient itself correctly, not to mention make a missile orient itself correctly... once missiles can be guilded, things are going to be a lot more fun.
-Tim
Nathan Clow <n_...@ho...> wrote: No need to be so apologetic. =)
Angular movement is still wonky. I'll have another go at that tonight sometime. There were two major problems in the linear versions that I think also could have translated to the angular versions, since I translated the derivation straight across. The distance p was supposed to be the distance from the current position to the midpoint, which I treated wrongly at first, and the lack of the special case examining velocity when the position was between p and the goal produced some erroneous behavior. I tried to use the same logic for the fixes applied to the linear code in the angular code but it didn't seem to work as expected before my last commit.
One optimization I can think of off the top of my head is to pre-calculate acceleration available in every direction, updated when engines are added, removed, or stop working for whatever reason.
One thing I will need is a way to thrust at less than 100% of engine power in a given direction. This is necessary to use during the timestep when p is less than a full thrust away. I was going to write it but if you want to go ahead. Something that takes a simple 0-1 percentage should do the trick.
Do you want to work on higher-level nav behavior? For instance, when a ship enters the MIN_DIST from its target it shouldn't stop decelerating if it wants to actually stop at that target, and we need a way to switch off from NAV_GOTO to NAV_STAY when the ship is comfortable with its position. Another thing is that if a ship is traversing several points it may not want to slow down and try to stop at each point. It may want to slow down somewhat according to a provided constant, or depending on where it thinks its next goal point is relative to the current point. There's definitely a lot of work to do at that level in tickAI and navXX functions.
----- Original Message -----
From: TIMOTHY K HAMILTON
To: eig...@li...
Sent: Sunday, November 26, 2006 9:39 AM
Subject: [Eighthfleet-development] Algorithm Apologies and Thoughts
Alright, so it would seem that my contribution to navigation algorithms is to break them, sorry about that.
Your method for lineral acceleration is very obviously superior to mine, the movement once it reaches the target point is much smoother and oscilates less. Angular movement still acts a little funny though, as it doesn't start decelerating until it's completely passed the target angle, instead of approx. halfway there. I'm not going to touch that, however.
What I will do is try to optimize things a little better. I'll keep my hands out of the angular velocity code, but I think I can streamline the linear velocity stuff. One way I think to keep from doing a lot of re-calculating is just to pre-calculate as much of the information as possible during initialization of the ship. One of the most obvious values for this, I think, are the various availableThrusts, which only need to be re-computed whenever an engine is added or destroyed.
Again, I'll be a lot more careful about touching navigation, and just focus on what I promised about tactical behavior instead.
Sorry I broke your code.
-Tim
---------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
---------------------------------
_______________________________________________
Eighthfleet-development mailing list
Eig...@li...
https://lists.sourceforge.net/lists/listinfo/eighthfleet-development
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
Eighthfleet-development mailing list
Eig...@li...
https://lists.sourceforge.net/lists/listinfo/eighthfleet-development
|