Dave,
you asked for it, so see comments below:

Am Montag, den 31.01.2011, 04:49 -0600 schrieb Plastic:
> So, I have started on my ATC project.

> 1. I'll be keeping the aircraft, their altitude, speed, direction, intended
> alt, speed and direction, etc, in a large DIMmed array that can hold 10
> aircraft. Landed or departed aircraft will be removed from the array and any
> newer aircraft will be scrolled up one spot. 

If you coding for speed, shuffling around large amounts of data through
array indices is probably a bad idea - Maintain a pointer variable
instead that holds the "starting index". the one before that is the
last. Instead of moving around all the planes through the arrays, you
then just increase the pointer by one and the data in the arraysstays
where it is (e.g if your pointer variable is 5, your first plane sits in
planes(5), the last one in planes(4). to handle the wrap-around, use
MOD.
> Like in real life, the oldest
> aircraft is always at the top of the stack. There will be inbound and
> outbound aircraft. Inbound aircraft will be announced and placed at the edge
> of the screen, and outbound aircraft will originate from the runway when
> given flight instructions and clearance to take off. The aircraft must
> always maintain "separation" of 1000 feet altitude and 3 miles horizontally.
> Checking all the aircraft against each other to see if any violate airspace
> of others, or have collided, might be hard to code.
> 
You should decide what sort of coordinate system your planes live in.
You might want to divide the airspace in equally-sized cubes where each
cube can only be occupied by one plane - This will simplify programming,
but loose the impression of 'continuous movement' for the player - or
you might decide to have a coordinate system based on real topograhic
data like "5 miles 400 yards south, 3 miles 100 yards east", which will
be a bit more complicated to handle.

> 2. I need to write a command parser to accept input from the user, namely
> instruction for flights. There is a standard way of doing this and I will
> follow this. This means I need to accept input and add it to a stack, then
> when it is "entered" I need to parse it to ensure valid, rational input.
> Once I know it is within bounds, I need to carry out the action, i.e.
> instruct the aircraft to follow the instruction.
> 
> 3. I need to write routines for landing aircraft. Once instructed to land, I
> need to detect when they cross the glide-slope, and get them to follow it to
> landing, land, then remove themselves from the stack.
> 
> 4. I need to write a "ticker"... No matter the speed of the hardware, the
> game should run at the same speed. This means events should be triggered at
> an interval, complete (even on the slowest hardware) before the next
> interval. This interval should ideally be 1 second, but could be 2 seconds.
> Despite the ticker, the input routines need to continue unaffected.
> Responsiveness of keyboard input is essential.
> 
> 5. I need to plot this on a 512x256 screen. I can't let flights go off the
> edge of the screen.
> 
> 6. I need to detect valid landings of arrivals and proper exits of
> departures.
> 
> 7. I'd like to add an element of realism where planes, including departures,
> can declare emergencies.

And planes trying to land on the wrong runway, not on the glide path,
abort the landing, and so on. A game like this shouldn't be too
realistic - otherwise it would become boring. People doing this in real
life get a lot of compensation for doing their boring routine job right
(Travelling a lot by plane, I hope so, at least....)

> 
> Well, those are the "hard bits" I can see up front.
> 
> I can foresee earning a little money next week, so maybe a compiler will be
> in my future? I'd prefer an easy compiler over a good compiler. I would also
> love to have an external USB floppy so I could save my stuff somewhere other
> than my OS X HD... Maybe later...

Go get yourself the free Turbo compiler and its toolkit and save your
money. You can't do much better than that.

> 
> In the mean time, I'll work on this and keep sharing. Hopefully it'll work
> out.
> 
> Dave
> _______________________________________________
> QL-Users Mailing List
> http://www.q-v-d.demon.co.uk/smsqe.htm




_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to