Question Racer Checkpoints mfd... possible to code?

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Hi guys,

Some of you may have seen the chat and experimenting with rocket racing over the past few weeks. There has been talk of pilon racing and other varients. So I have a question to knowledgable the .dll coders out there.

Is it possible, without great pain, to code something that does something similar to this:

Racer Checkpoints MFD. A simple mfd that displays a checkpoint (lat/long). When the vessel comes within 500m of this point, the mfd recognises that and switches to display the next checkpoint. When the 'last' checkpoint is reached, the mfd displays a "complete" message and the total time taken to travel from first checkpoint to last. The checkpoints could be loaded as an .ini file or similar.


doable with the orbiter API? any thoughts appreciated.
 

tl8

Addon Developer
Addon Developer
Tutorial Publisher
Joined
Oct 16, 2007
Messages
3,645
Reaction score
25
Points
88
Location
Gold Coast QLD
Should be easy enough for computerex, I will mention it when I talk to him next.
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
That should be dead easy. Have an ordered list of the checkpoints coordinates and a pointer to the current checkpoint. At each timestep, check whether current position is within a certain distance of the checkpoint (subtraction of vectors and take length) and if it is then set the pointer to the next checkpoint.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
ah sweet cheers chaps, this would make a great addition to both offline and MP rocket racing imo.

I shall wait to see if someone is willing to put this together. tl8, give computerex a cookie if it helps sweeten him up. ;)
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Looks ugly at the moment:
rcpmfd.jpg


Can you draw me a picture as to how it should look like, and what it should display?
 

Woo482

Moderator
Moderator
Addon Developer
GFX Staff
Joined
Feb 13, 2008
Messages
3,048
Reaction score
20
Points
78
Location
Earth?
it does not look that bad and it does what it needs to do
 

MeDiCS

Donator
Donator
Joined
Sep 22, 2008
Messages
602
Reaction score
2
Points
0
Perhaps a map showing the location of the next, or all, checkpoints?
 

Woo482

Moderator
Moderator
Addon Developer
GFX Staff
Joined
Feb 13, 2008
Messages
3,048
Reaction score
20
Points
78
Location
Earth?
That looks a lot better than the last one :) how are the check points defined ?
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
The checkpoints are defined in files located in the "checkpoints" directory. The files can be loaded during the simulation session, and the one titled "default.chkpt" is loaded by default when the MFD starts. The file format is fairly simple...

Code:
CheckpointCount = 2

Checkpoint_1_Name = Habana
Checkpoint_1_Lon = -82.40
Checkpoint_1_Lat = 23.00

Checkpoint_2_Name = Cape Canaveral
Checkpoint_2_Lon = -80.675
Checkpoint_2_Lat = 28.5208
 

Arrowstar

Probenaut
Addon Developer
Joined
May 23, 2008
Messages
1,785
Reaction score
0
Points
36
Does that take into account altitude? Or is this only for atmospheric, short races?
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
This is only aimed at atmopheric short(ish) races. So I doubt computerex has taken it into account, I didn't ask him too. But this will be used in conjunction with racing gates - which are pairs of balloons floating at 2000m. They will be 1000m apart. The CPMFD will trigger a CP as reached when it is within 500m of the CP - which will be a point in between both balloons. Therefore it will trigger if you pass through the gates.


edit to add: Great progress mate, looks like everything is in there. You got a rough ETA on this? Be good to test it out with what I have. 2 questions: Can I include this with the ORRL addons? and is there a max number of decimal places the CP long/lats can be set too? cheers mate.
 
Last edited:

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
The checkpoints are defined in files located in the "checkpoints" directory. The files can be loaded during the simulation session, and the one titled "default.chkpt" is loaded by default when the MFD starts. The file format is fairly simple...

Code:
CheckpointCount = 2

Checkpoint_1_Name = Habana
Checkpoint_1_Lon = -82.40
Checkpoint_1_Lat = 23.00

Checkpoint_2_Name = Cape Canaveral
Checkpoint_2_Lon = -80.675
Checkpoint_2_Lat = 28.5208
If I were you I'd add an optionable altitude parameter as well a radius that you have to be within to trigger the checkpoint, rather than hardcoding it. You can always have a default radius but it's always handy to override thingns like that in config files.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
This MFD should be used for checkpoints on the ground...The reason being, distance/bearing is calculated by using the longitude and latitude of the defined checkpoints, and may cause huge errors when the vessel is too far off ground.

Here's how it looks now:
chkpt.png

Now radius, altitude, altitude tolerance maybe defined for each checkpoint.

I cannot upload this to orbithangar because of connectivity issues at the moment, so here it is on mediafire. If I don't get any bug reports, I will upload it there in the future.

http://www.mediafire.com/?sharekey=aea87364961594b2d2db6fb9a8902bda

Can I include this with the ORRL addons? and is there a max number of decimal places the CP long/lats can be set too? cheers mate.
Number of decimals placed increased. You can include this add-on in the ORRL add-ons. The source code is included too.

In case this is being used in conjunction with OMP (like it was being used today) then this second page is sometimes useful:

chkpt2.png
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
oooo contestant page... nice addition.

This is looking great mate, I shall DL now and give it a test. Will hit you back with thoughts/suggestions/feedback later.

cheers matie.


-----Post Added-----


That works like a charm mate! nice one. I just plotted a little 7 gate race around Ascension Island using my balloon gates.... I think this idea just might work!

The MFD has all the functions I wanted and that I think it needs, but a few thoughts...

Having used it in flight, I think the layout needs tweaking slightly, to reorder things like this:
STATUS
<SPACE>
NEXT CP info (rad, alt etc)
NEXT CP orientation (bearing, distance etc)
DISTANCE BAR (nice touch btw)
<SPACE>
FILE NAME
CP COUNT
TOGGLE CP DISPLAY (cycle through CPs)

I think the CP name, the bearing and the file name should be in white, the rest green.
You may not agree, I just think that would organise things better imo.

Also, is there any chance of having the timer start when you cross CP-1 rather than when you click start? Clicking start should just enable this process.


Other than that it's all gooood, grats and thanks. great stuff. I didn't find any bugs, but it was only a brief test session.. I'm starving.
 

Dig Gil

LearninProgram,Slackin DigTech
Joined
Aug 2, 2008
Messages
463
Reaction score
0
Points
0
Location
Between Azores and New Zealand
Website
dig-orbiter.blogspot.com
I agree that some information should pop-up more so it would be easier when you are seeing in a hurry.
A sugestion: It would be better to display a map or add a header indicator instead of the progression bar.

mapforcheckpointmfdux0.png
This is an edited screenshot from MapMFD, my one is a bit colourful :p as an example. green crosshair is the starting location, the red crosshair is the finish line, the yellow marks are the pilons (or checkpoints), the blue lines (which are straight) are completed path and red lines (also straight) are uncompleted paths, finally the red smaller percentage is the actual red path's progression and the blue one is the whole race's progression percentage.
 
Last edited:

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Yeah, Dig, agree with that, a sexy pointy compass arrow would be nice. But in truth, not essential, encourages a little more brain power. ;)

It seems all the content is there and working fine though, computerex, just needs user-friendliness tweaking.

good job.


-----Post Added-----


I just had a thought.

Is there any way you can code a CP to only be 'reached' if the vessel is travelling under a certain speed? i.e. The last checkpoint will only be triggered, and the course completed, if the vessel is < 100m/s or something. Would make landing part of the race then. cool? possible?

I think taht combined with the timer starting on the first CP, means you'd get quite a controlled envelope for timing, making it fairer... and the race seem a bit cooler.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Re-arranged:
rc34.png


The timer starts when the first checkpoint is passed. Note, now the minimum number of checkpoints a race can have is 2 (time starts on the first, and stops when you pass the second). I can add the "maximum velocity on passing" feature, however I am not sure where I'll display it. The MFD is cluttered enough as it is xD.
 

HiPotOk1978

ReFuel L.L.C CEO
Addon Developer
Joined
Aug 19, 2008
Messages
373
Reaction score
0
Points
0
Location
Tucson
that MFD looks totally sexy! things are comming together for the ORRL it seems. I hope to see everyone except Gonzo (j/k) in the multiplayer events
 
Top