Author Topic: HUD Scripting  (Read 10396 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
i was looking at things to use for panel components and i found this thing:
http://www.sparkfun.com/products/10595
this would make a good shield gauge. though a small lcd might look better.
and 3 of these and some keyswitches would make a fairly good ets gauge:
http://www.sparkfun.com/products/9936
ive been sourcing most of my parts off of ebay, i just got a bag of 100 signal diodes (good for button scan matrices) for a buck and free shipping to boot. and my collection of 7400 series gates is ever increasing. microcontrollers are harder for me to get, usually just go digikey for those, but i order a bunch at once and only when i have money.

it would be pretty cool to make an oshw archive of gauge schematics, pcb sources, parts lists, and files for producing parts on cnc machines (laser cutters, 3d printers). you can use with manufacturing services to get all the parts needed to build a complete panel, or you can build it yourself if you had the right equipment. even with oshw there are ways to make money, like by selling completed gauges, or manufacturing parts.
« Last Edit: April 27, 2012, 09:10:44 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
this would make a good mfd screen
http://www.sparkfun.com/products/8799
its close to square and so would accommodate 3 good rows of buttons. it also has that white on blue color you see on a lot of mfd displays. its just a little pricy. i still want to find a squareish color lcd that is around 4" x 4". perhaps also with an interface you can just plug into your video card. then its just a matter of running the mfd application on that display. though you would probibly need a separate interface for the ring-o-buttons.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline ABetterWay

  • 23
  • ???
Hi Nuke,

  I'ts great to see you guys are making progress on this.  I have been lurking for years waiting to see if FSO would ever be modified to send out its data for cockpit builders.  I have always wanted to build a cockpit around this game.

Were you ever able to export textures from the engine? There was a thread from almost exactly a year ago where it was being discussed.  It looks like sending simple data packets out via UDP is simple enough, but it would still be really cool to just let the game render the radar like it is now and display that exact image on a small LCD/MFD panel.




 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
my problem has always been sourcing parts. this problem has been 2 fold, i am poor for one, and live in the ass end of nowhere and a lot of places gouge me on shipping for it. i get a lot of parts off ebay from semi-reputable gray market chinese sellers who will sell you 10 of anything for a buck and free shipping. microcontrollers i still need to buy through digikey, and last time i ordered from them their shipping rates were sane. my other source for parts is junk. ive gotten really good at desoldering.

another thing i have trouble with is chemicals for board etching. most chemicals can be shipped ground only, and i live on an island go figure. i found a hackish recipe (peroxide, vinegar and salt) for pcb etchant and im not even sure it will work. transfer paper is another thing i have trouble getting, but i found out how to make my own (cook cornstarch till it turns brown, add water and paint sheets of paper with it). i have not tested this yet at all. i should have everything, so its just a matter of designing gauges. copper clad pcbs are kind of expensive. i got 4 8-10 sheets for $20, and so far is the most expensive thing yet. and i got me a free laser printer. i still dont have a means for cutting the boards, you can dremel but thats messy and imprecise. i hear an office guillotine would work, and ive been watching garage sales and thrift stores like a hawk to try and obtain one. i could run a test etch but given my zero budget approach id want to produce something useful. all i need is a board design that i think will work. though i think i may just do a bunch of breakout boards for various components that i have on stock for prototyping. get a good precision test out of it, see how wide i can make traces and **** like that.

3rd thing you need is materials to built the cockpit. the inlaws have a saw mill, and im sure they would let me walk off with a couple of 2x4s if i put a few nails in the house they are building. i also like to raid the trash piles at local construction sites at 3am. hardware store has acrylic in stock, its ****ing expensive, but i figure it would make a pretty good panel material if you spraypaint the back of it some kind of metallic shade or black. its easy to work too. thinking about getting a laser cutter/engraver machine off of ebay, which makes quick work of acrylic. tools are really the main thing im lacking. also seeing as i live in an apartment i dont think the neighbors would appreciate me building something like that. i wanted to get my brother in law in on the project but he isnt a big fan of freespace.

Hi Nuke,

  I'ts great to see you guys are making progress on this.  I have been lurking for years waiting to see if FSO would ever be modified to send out its data for cockpit builders.  I have always wanted to build a cockpit around this game.

Were you ever able to export textures from the engine? There was a thread from almost exactly a year ago where it was being discussed.  It looks like sending simple data packets out via UDP is simple enough, but it would still be really cool to just let the game render the radar like it is now and display that exact image on a small LCD/MFD panel.

nah its over my head. youd probibly need an arm device (raspberry pi looks promising) to keep up with the required throughput, and at least 100mbps ethernet. however im starting to consider an alternative. i started a game engine written entirely in lua. my 3d renderer sort of works, and supports textured models, quads,  sprites, and text. i could fork the code and create an mfd application with the exiting engine. im thinking of using tcp/ip loopback to do ipc between this mfd software and freespace. then you could control the rendering of 2d/3d graphics over the connection. this would allow you to design mfds where video output to a small lcd screen which is driven by the same computer the game runs on, and saves you a lot of dev time. flipside is this eats up valuable monitor connections, if you ever wanted to do a multi monitor setup. im ok with this however. still need to do some hardware design, like some kind of usb hid device for interactive buttons, or you can buy off the shelf joystick controllers to save a little time.

you can do things with mfds or you can do things with a network of stand alone gauges. i figure prototyping either of these will cost about $50 each in parts. im considering it would be a good idea to sell units back to the community to help cover some of the expense. i want to make it oshw, but other oshw people are making a killing selling completed units and kits of their products to lazy foos and hobbyists, respectively (and the schematics, boars ssources and source code would all be there for the adventurous do it your selfers). i figure that 80% of the workload will be software though. ive already proven you can load lua modules in freespace, like luasocket, and ive been able to do ipc with that, so im certain its possible. the fact that i have the potential to make some money selling hardware to the community might turn out to be a motivating factor. im gonna post a poll in general fs to see how many people would be willing to buy panel elements for a freespace cockpit simulator, should give us an idea for a market.
« Last Edit: May 02, 2012, 12:32:51 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline torc

  • 210
  • Diaspora SFX engineer
right now i'm building an home cockpit BSG Viper Replica, with an interface for binding switches and toggles as i want...if will be possible put in other screens HUD gauges would be awesome.

Looking forward to those features! Keep it up guys!
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
I can't wait to get my cockpit-type area set up in my new house.  Haven't been able to use the X45, the Pro Yoke, or the racing wheel and pedals since 2008!
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline ABetterWay

  • 23
  • ???
im thinking of using tcp/ip loopback to do ipc between this mfd software and freespace. then you could control the rendering of 2d/3d graphics over the connection. this would allow you to design mfds where video output to a small lcd screen which is driven by the same computer the game runs on, and saves you a lot of dev time. flipside is this eats up valuable monitor connections, if you ever wanted to do a multi monitor setup.

If we just use a second computer, passing data via UDP packets, we would have 3 to 4 more monitor connections.  That’s what many of the flight sim guys do.

As for pre-made cockpit controls, I would definitely be interested.  I am also a fan of the Arduino and might be able to make my own controls someday, but I am always willing buy instead of build if it saves me time!

Seems like this thread if getting WAY off the original topic. :)  Should we start a new one around building a simpit?  Seems like we are gathering some interest here.  Which forum would be the most appropriate? This will probably require work in both the Scripting (Freespace Modding) and C++ (The Freespace Source code Project) areas.


 

Offline Daboule

  • 24
It's coming ;)

It has been a bit longer than expected because of a big overload in my job.

Hope to release something soon, I'm working in both windows and linux (haven't got a Mac...) and testing everything in the EasyPic board.
It's cool to have the ETS on a small screen or to have a Biiiip Biiiip Biiiip when you've have been locked by missile

I will post a video of the running MFD asap.

I love it :D
« Last Edit: May 02, 2012, 03:21:38 pm by Daboule »

 

Offline ABetterWay

  • 23
  • ???
It coming ;)

Hope to release something soon.



Tell us more! haha


 

Offline Daboule

  • 24
It coming ;)

Hope to release something soon.



Tell us more! haha



ETS is working
Auto match speed is working
Match speed is working
Auto targetting is working
Inspected cargo/ship is almost working
Directives is working
Wingmen status is working

The mfd prototype is already able to display all those informations
I'm working on a way to display the radar information on the MFD.

Hope to be able to post a video pretty soon.

Daboule

PS : The good news is the next week-end is another 4 days week-end ;)

 

Offline ABetterWay

  • 23
  • ???
Nice!  I am looking forward to seeing the video.  Getting radar on the MFD will be incredible.  Are you re-implementing the radar code outside of FSO and just using the data passed in or are you using FSO for the image generation?  I was thinking that using the radar code in an external application and just supplying the data from FSO would be a viable option.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
There's a guy running an arcade in California who would be very interested to talk to you I imagine.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline torc

  • 210
  • Diaspora SFX engineer
can't wait to see it! AMAZING FEATURE INCOMING! :D
indossare una divisa può avere un prezzo alto...ma a volte...è troppo alto!!! Bill Adama

 

Offline Daboule

  • 24
Hi all,

  • Dumbfire threat indicator
  • Missile threat indicator


have been added (the buzzer in my cockpit will love that :D)

Radar is a bit more complicated, but almost working...

Daboule

 

Offline Daboule

  • 24
Nice!  I am looking forward to seeing the video.  Getting radar on the MFD will be incredible.  Are you re-implementing the radar code outside of FSO and just using the data passed in or are you using FSO for the image generation?  I was thinking that using the radar code in an external application and just supplying the data from FSO would be a viable option.
Hi ABetterWay...

In fact the radar is an impressive piece of maths and trigonometry (at least for me) and I had to reopen my classroom books...
To make things simple let's say that the code transforms the 3D coordinates of the blips into 2D coordinates used by the render engine to display the related bipmaps on the radar.
I've search a lot to find a way to have the radar working.
The easiest one seemed to be that one: extracting the "flat" (2D) coordonnates of the blips and use that coordinates to generate a new image... it is not really easy but it is working (ok... almost working) for the ships only for the moment.
I send the coordinates through UDP to a dedicated application, and this application uses the coordinates to create a new image each time the new coordinates are received...
I have to polish that a bit and find a way to have the same thing for the other objects...

I will let you know as soon as I have something finished

Daboule

 

Offline Daboule

  • 24
my problem has always been sourcing parts. this problem has been 2 fold, i am poor for one, and live in the ass end of nowhere and a lot of places gouge me on shipping for it. i get a lot of parts off ebay from semi-reputable gray market chinese sellers who will sell you 10 of anything for a buck and free shipping. microcontrollers i still need to buy through digikey, and last time i ordered from them their shipping rates were sane. my other source for parts is junk. ive gotten really good at desoldering.

another thing i have trouble with is chemicals for board etching. most chemicals can be shipped ground only, and i live on an island go figure. i found a hackish recipe (peroxide, vinegar and salt) for pcb etchant and im not even sure it will work. transfer paper is another thing i have trouble getting, but i found out how to make my own (cook cornstarch till it turns brown, add water and paint sheets of paper with it). i have not tested this yet at all. i should have everything, so its just a matter of designing gauges. copper clad pcbs are kind of expensive. i got 4 8-10 sheets for $20, and so far is the most expensive thing yet. and i got me a free laser printer. i still dont have a means for cutting the boards, you can dremel but thats messy and imprecise. i hear an office guillotine would work, and ive been watching garage sales and thrift stores like a hawk to try and obtain one. i could run a test etch but given my zero budget approach id want to produce something useful. all i need is a board design that i think will work. though i think i may just do a bunch of breakout boards for various components that i have on stock for prototyping. get a good precision test out of it, see how wide i can make traces and **** like that.

3rd thing you need is materials to built the cockpit. the inlaws have a saw mill, and im sure they would let me walk off with a couple of 2x4s if i put a few nails in the house they are building. i also like to raid the trash piles at local construction sites at 3am. hardware store has acrylic in stock, its ****ing expensive, but i figure it would make a pretty good panel material if you spraypaint the back of it some kind of metallic shade or black. its easy to work too. thinking about getting a laser cutter/engraver machine off of ebay, which makes quick work of acrylic. tools are really the main thing im lacking. also seeing as i live in an apartment i dont think the neighbors would appreciate me building something like that. i wanted to get my brother in law in on the project but he isnt a big fan of freespace.

Hi Nuke,

  I'ts great to see you guys are making progress on this.  I have been lurking for years waiting to see if FSO would ever be modified to send out its data for cockpit builders.  I have always wanted to build a cockpit around this game.

Were you ever able to export textures from the engine? There was a thread from almost exactly a year ago where it was being discussed.  It looks like sending simple data packets out via UDP is simple enough, but it would still be really cool to just let the game render the radar like it is now and display that exact image on a small LCD/MFD panel.

nah its over my head. youd probibly need an arm device (raspberry pi looks promising) to keep up with the required throughput, and at least 100mbps ethernet. however im starting to consider an alternative. i started a game engine written entirely in lua. my 3d renderer sort of works, and supports textured models, quads,  sprites, and text. i could fork the code and create an mfd application with the exiting engine. im thinking of using tcp/ip loopback to do ipc between this mfd software and freespace. then you could control the rendering of 2d/3d graphics over the connection. this would allow you to design mfds where video output to a small lcd screen which is driven by the same computer the game runs on, and saves you a lot of dev time. flipside is this eats up valuable monitor connections, if you ever wanted to do a multi monitor setup. im ok with this however. still need to do some hardware design, like some kind of usb hid device for interactive buttons, or you can buy off the shelf joystick controllers to save a little time.

you can do things with mfds or you can do things with a network of stand alone gauges. i figure prototyping either of these will cost about $50 each in parts. im considering it would be a good idea to sell units back to the community to help cover some of the expense. i want to make it oshw, but other oshw people are making a killing selling completed units and kits of their products to lazy foos and hobbyists, respectively (and the schematics, boars ssources and source code would all be there for the adventurous do it your selfers). i figure that 80% of the workload will be software though. ive already proven you can load lua modules in freespace, like luasocket, and ive been able to do ipc with that, so im certain its possible. the fact that i have the potential to make some money selling hardware to the community might turn out to be a motivating factor. im gonna post a poll in general fs to see how many people would be willing to buy panel elements for a freespace cockpit simulator, should give us an idea for a market.

Hi Nuke,


I'm also looking at the Raspberry Pi as the motherboard of my simpit. For those of us who don't know this product: It is complete PC (motherboard, video out, SD card reader, usb port, CPU....) a really really small form factor (the size of a credit card) and it cost only 25 €... It seems that you can easily install linux on it.

On http://www.raspberrypi.org/ they are really impressive videos showing the Raspberry Pi running Open Transport Tycoon (another open source video game :D)

I will try to order one and test if it can be the core of my MFD... (by the way, I agree with ABetterWay, this thread is really far from it's first subject and it would be a good idea to open a new one, dedicated to simpit building...)



Daboule
« Last Edit: May 03, 2012, 11:52:36 am by Daboule »

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
i wouldnt call it a pc (its arm based, and im oldschool enough that 'pc' means 'x86', but not oldskool enough to call it ibm compatible :D), but i like it anyway. it could sidestep and simplify a lot of the hardware dev though. its already got video hardware, network interface, has enough gpio for any interfaces you might want to add, and you still have usb. you can use gles for fairly good graphics. of course you need to find a smallish screen with an hdmi interface, and i see that as getting expensive (unless there is a cheap adapter). seems it has composite built in so i can keep using those 3.5" monitors.

i started a thread on general fs to discuss the marketability of open source cockpit gear. but yea im not really sure theres a board for hardware at all. i generally dont know where else to put it. but scripting is likely going to be the primary method to talk to hardware.
« Last Edit: May 03, 2012, 04:04:15 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline ABetterWay

  • 23
  • ???
i generally dont know where else to put it. but scripting is likely going to be the primary method to talk to hardware.

Scripting will probably be used quite a bit, but I figure at some point we might want to bypass the scripting engine for speed. I'm just saying that off the top of my head based on past experience with scripting. I have never used lua so I can't really comment on its speed.  I have always been a fan of native code vs scripting or interpretive languages. Especially when it comes to the speed we might need for something like this.

It would be really nice to have a board devoted to simpits, joysticks and other hardware.  Probably to much to ask for though.  Lets start a new thread in the same forum as your hardware poll. In General.



 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
i generally dont know where else to put it. but scripting is likely going to be the primary method to talk to hardware.

Scripting will probably be used quite a bit, but I figure at some point we might want to bypass the scripting engine for speed. I'm just saying that off the top of my head based on past experience with scripting. I have never used lua so I can't really comment on its speed.  I have always been a fan of native code vs scripting or interpretive languages. Especially when it comes to the speed we might need for something like this.

It would be really nice to have a board devoted to simpits, joysticks and other hardware.  Probably to much to ask for though.  Lets start a new thread in the same forum as your hardware poll. In General.



if you cant write the native code patches that dont interfere with what the rest of FSO does, dont reccomend "native code" blah blah, k?
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline ABetterWay

  • 23
  • ???
if you cant write the native code patches that dont interfere with what the rest of FSO does, dont reccomend "native code" blah blah, k?

Ouch!

I believe I could write code that doesn't interfere. Why would you immediately assume I could not?  I promise not to force you to use my changes.

Actually, why would it matter if I recommend a different way of doing things?  I guess I am in the wrong forum. Is "native  code" a bad word in the scripting section? :)

This is the reason I would like to move the thread out of this section.