Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
World Share / Help Request: T3A Flight Simulator
Old
Lucien
Guest
 
Status:
Posts: n/a
Default World Share / Help Request: T3A Flight Simulator - 01-29-2008, 11:46 PM

Hey everyone, this is my first post here.

I've made a flight simulator that (somewhat) emulates lift and gravity as well as normal flight. I've tried to make it as feature-rich as possible, including a throttle gauge, a digital altimeter and a dial altimeter for perspective. The plane flies somewhat realistically, and the ground acts solid enough so that the pilot cannot crash through the ground. All other collisions have yet to be implemented.

I'm having a few problems with the code, though. The plane runs smoothly in first and third-person camera perspectives, but when I switch to the chasing perspective the plane constantly jitters. I know the problem is probably that the lift and forward movement are executing in tiny amounts (moving up and forward every 0.001 seconds to increase throttle responsiveness), but I don't know how to extend the time-periods to reduce jitter without making the plane less responsive to throttle changes. Can anyone help me with this?

(Also, suggestions for a way to emulate momentum would be greatly appreciated. Currently, the plane simply stops and drops like a rock when you turn off the engine rather than falling forward and down.)

Next up, I have problems with switching from Chase to Third Person perspectives. After going into Chase and flying around a bit, when I perspective to Third the camera is tilted to either side and is not properly oriented to the plane. (At the time of this writing it's occurred to me that I could have the camera orient to the plane instead of the third-person dummy, I'll try that and edit this post after I confirm.)

Last problem, probably related to the same short movement durations and gravity constraints: On takeoff, the plane is a bit jittery and bounces up and down. The problem is cleared the moment it achieves flight speed and lifts off, and is most likely caused by the gravity engaging when the plane reaches the minimum gravity threshold. Can anyone help me work the jitter out of the gravity as well?


Instructions/Controls:
E: Throttle up.
D: Throttle down.
C: Retract/Extend landing gear. Note that the gear has drag- you will move faster with it retracted.
P: Change perspective. Third -> First -> Chase, looping.
-ARROW KEYS-
Forward: Dive.
Backward: Pull up.
Left: Roll or turn left (all wheels must be on ground to turn.)
Right: Roll or turn right

(It should be noted that users running Windows may view the altimeter in a different font than is intended; I've noticed that Windows-made Alice games all display 3D texts in strange positions and sizes. Apologies to anyone running Windows. The altimeter is the only 3D text in the game.)
Attached Files
File Type: a2w T3A.a2w (441.0 KB, 528 views)
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 01-30-2008, 08:54 AM

Quote:
Originally Posted by Lucien View Post
...

(Also, suggestions for a way to emulate momentum would be greatly appreciated. Currently, the plane simply stops and drops like a rock when you turn off the engine rather than falling forward and down.)

...
Very impressive piece of work.

Take a look at http://www.alice.org/community/showthread.php?t=1020 You may get some ideas there to help you with the momentum issue.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 01-30-2008, 06:30 PM

Very nice job.

You might want to try some variations using the "Move at <speed> for <duration>" command and then writing equations of motion to control the speed. This would automatically get momentum and often gives you smoother motion than moving incrementally - not always though so you'll need to experiment a bit.
   
Reply With Quote
Old
Lucien
Guest
 
Status:
Posts: n/a
Default 01-30-2008, 10:20 PM

If I pass a variable such as speed to 'move at speed', will MAS update itself automatically as the value of speed changes, or will it keep the value that it had at the beginning of the movement?
   
Reply With Quote
Continuous Speed Adjustment
Old
DrJim
Guest
 
Status:
Posts: n/a
Default Continuous Speed Adjustment - 02-01-2008, 12:21 PM

It certainly is possible to continuously adjust speed - see the attached - but be careful. You are getting into multiple threads (although only marginally) and Alice's behavior can be somewhat unpredictable. (The "event while" is particularly bad - I would avoid it completely.)

Maybe one of Dick Baldwin's tutorials has been updated to cover this behavior in more detail. Any references, Dick?

(Note also that in the example, the speed that is being adjusted is a world-level variable - not the greatest of ideas in good programming practice.)
Attached Files
File Type: a2w Adjust Speed.a2w (190.0 KB, 452 views)

Last edited by DrJim; 02-01-2008 at 12:26 PM.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 02-01-2008, 12:54 PM

Quote:
Originally Posted by DrJim View Post
.. (The "event while" is particularly bad - I would avoid it completely.)

Maybe one of Dick Baldwin's tutorials has been updated to cover this behavior in more detail. Any references, Dick?

...
Other than confirming your assessment about the "while" event, I don't recall having written anything that bears directly on this issue.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 02-02-2008, 09:22 PM

Quote:
Originally Posted by DickBaldwin View Post
I don't recall having written anything that bears directly on this issue.
Guess that's why I didn't see it when I skimmed your tutorials.

One discussion somewhere mentioned the problem with loops not having been completed when another thread causes execuation of the thread with the loop to terminate early. That always seems to give some sort of "index error" and can be avoided if you always make sure any user input won't interrupt a loop before it completes.

Unfortunately, the above isn't a very good explaination because I really don't understand the problem - but it has occured several times when people try to use arrow keys to control walks, etc.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 02-03-2008, 10:52 AM

Quote:
Originally Posted by DrJim View Post
Guess that's why I didn't see it when I skimmed your tutorials.
The truth is, I have written and published so much material on the web (see http://www.dickbaldwin.com/toc.htm) since 1997 that I often can't remember what I have already published and what I haven't already published. I frequently find it necessary to Google my own publications on the web to determine whether or not I have already published material on a particular topic.

It's actually faster for me to search the web for my own material than it is to search my own hard drive. I've tried the Google desktop search engine, but it indexes everything, including temporary copies of files. Because it indexes temporary files and accumulates links to a lot of garbage, I haven't found it to be too useful.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

Last edited by DickBaldwin; 02-03-2008 at 10:53 AM. Reason: correct grammar
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.