🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Intelligent ship computer - possible?

Started by
3 comments, last by c0ma2k 22 years, 11 months ago
Hi all, I am currently creating a multiplayer space sim with "realistic" physics. As flying a ship would be far too difficult to handle for the average player to be fun, I wanted to implement a kind of "intelligent ship computer" that at least assists a bit with steering the ship. It should be able to use the ship''s thrusters (around 10 or slightly more per ship) for e.g. stopping or flying to a given position. It should not cheat by overriding the physics, etc. As my experience with AI equals zero, my question to you is now: Do you think this is possible at all? And if so, would it be possible for a single programmer in a reasonable amount of time? I don''t expect very detailed answers, just a "yes" from someone who did something similiar before would be very encouraging Bye, c0ma2k
Advertisement
"yes"

It is possible. It isn''t even hard to accomplish. The only difficult thing would be to let the ''computer'' know where you are heading.
There are two levels to this problem: 1) The autopilot; and, 2) The Flight planner. Tackle each one separately.

The Flight Planner.

This should produce a flight plan as a set of waypoints: A,B,C..., interpreted as fly(A,B), fly(B,C), etc. Each flight leg will have an appropriate set of inputs (like speed and heading) which will be determined by the planner. The planner should be a minimum cost path-finding algorithm. A* will work just fine for this purpose.

The Autopilot

This needs to be a closed loop control system. Given a current state S1 and a required state S2, the control loop determines the minimal set of inputs (thruster firings) to move from S1 to S2. Given a flight leg fly(X,Y), I suggest you have the autopilot attempt to minimise the across track (shortest path between X and Y) velocity while maximising the along track velocity. This should be fairly trivial in your problem unless you are simulating the effects of gravity from nearby objects (which will tend to pull the ship away from its flight track).

Having said all of this I will ask though whether this level of realism is necessary for your game. What we are talking about here is a space ship simulator with autopilot, rather than a game. The person playing would not know the difference between this full simulation and a fudge job because they have no way of experiencing the physics, except via the graphics. If, however, you wanted them to learn to fly the ship, then this is different (but you might not need the autopilot for this unless you wanted different levels of computer assistance).

If you''re going to do such a simulation, then you will need to do the above. Why am I certain of this? Because this is exactly what I have been doing for my PhD for a robotic aircraft. The aircraft is a commercially produced research and reconnaisance aircraft called the Aerosonde.

However, don''t be disheartened... the sort of autopilot system I described above has been around for decades. Why is my PhD special then? Because I am incorporating most aspects of real world uncertainty and non-linearity into my system and a very realistic dynamic domain model so that the aircraft can make real time decisions about changing its flight plans as the world changes. It''s quite impressive if I do say so myself.

If you are serious about doing your simulation, take a look at books related to autopilot design.

Cheers,

Timkin
First, thanks for this answer!

quote: Original post by Timkin


Having said all of this I will ask though whether this level of realism is necessary for your game. What we are talking about here is a space ship simulator with autopilot, rather than a game. The person playing would not know the difference between this full simulation and a fudge job because they have no way of experiencing the physics, except via the graphics. If, however, you wanted them to learn to fly the ship, then this is different (but you might not need the autopilot for this unless you wanted different levels of computer assistance).



Actually this is what I want: Different levels of computer assistance. As the game includes some character development like an RPG, the players should learn to fly the ships. The assistance is supposed for the beginners, so it doesn''t need to be that good. For example, a kind of ''brake key'' would be very helpful, when rotation or acceleration gets out of control. Of course, the optimum case is a ship computer that makes flying as easy as in games like Wing Commander - if the player wants that.

The real physics has at least one great advantage. Players could eventually build their own ships, position the ships'' thrusters and therefore modify the flight behavement.


quote: If you are serious about doing your simulation, take a look at books related to autopilot design.


Yes, I''m in fact very serious about that.
Graphics engine, scripting, collision, physics, networking, etc. is all quite done. So I don''t want to give up on the ship computer. Still it should be a game and it should be fun, so if this idea doesn''t work out, I''ll drop the physics. But there''s always Elite which showed us that all of this is possible in some way or another (including fun), and AFAIK no one has done a similiar game ever since.

Do you have any special recommendation about a book?


Bye,
c0ma2k
quote: Original post by c0ma2k
Actually this is what I want: Different levels of computer assistance. As the game includes some character development like an RPG, the players should learn to fly the ships. The assistance is supposed for the beginners, so it doesn''t need to be that good. For example, a kind of ''brake key'' would be very helpful, when rotation or acceleration gets out of control. Of course, the optimum case is a ship computer that makes flying as easy as in games like Wing Commander - if the player wants that.


Computer assisted control is not too much extra work on top of an autopilot. Essentially, user commands are damped and then added to the control loop. The autopilot then applies the same computation to find the rest of the set of control movements to move to the next state.

quote: Original post by c0ma2k
The real physics has at least one great advantage. Players could eventually build their own ships, position the ships'' thrusters and therefore modify the flight behavement.


Changing the characteristics of the ship will require changing parameters (gains) in your controller. There has been some work in the past 5 years on doing this in real time (in the event of damage to an aircraft thus changing the way it handles) although it might be a little more advanced than is necessary for a game.

quote: Original post by c0ma2k
Yes, I''m in fact very serious about that.
Graphics engine, scripting, collision, physics, networking, etc. is all quite done. So I don''t want to give up on the ship computer.

Do you have any special recommendation about a book?


It sounds like you have put a lot of effort into your game. The amount of effort it takes to implement an autopilot will depend on your maths ability. As a starting point (but a bit of heavy reading) you should track down the book

"Planning and control"
Thomas Dean and Michael P. Wellman
Morgan Kaufman Publishers, San Mateo, Ca. 1991

You should find it in most college libraries

Tom Dean is one of the leaders in the field of automated planning and control systems. The book is a very good coverage of the issues and it has plenty of references to other material.

Good luck!

Tim

This topic is closed to new replies.

Advertisement