Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Visionism on April 18, 2003, 08:05:25 pm
-
OK I dunno how off the wall thia is and the very idea is probably going to get me a smacked bottom, but how hard would it be to put hooks in the source code for sharing variables on the fly?
The reason I ask is that some of my fellow Falcon 4 nutcases did this with their favorite flightsim. Take the data out of the sim, shove it down a network cable to a second PC and use that PC with a little custom software to drive a second display. In FS2 you could use the second display for radar, mission objectives, stores management (missles, countermeasures remaining etc) Escort status monitoring and so on, much like the MFDs in a modern fighter aircraft. (You could do comms images and target display too but that would probably make the software running on the second PC hellaciously complex.) Another idea would be to drive a FS version of "*****in' betty" to tell you when your hull is critical, your missiles are exhausted, subsystems failed, etc.
Whats the use? Well I already have a half built cockpit in my basement for flight and space sims and a second display would elevate it from the ordinary somewhat. OK I'm a loony but it would be rather spiffy dontcha think?
-
*Smirks* I was having this idea playing XWA on a laptop linked to my Desktop monitor...
-
I have never fully understood why you would want or need something like this..
-
As a semi-hardcore flight sim sort of fellow, I love the *****in' Betty idea. Great thinking, my pedigree chum :nod:
-
well the *****ing betty idea i like but he was talking about splitting the display across the monitors (i think). Thats what I was refering to.
-
Basically, find some way to output data from FS to other applications.
-
Why? Because I'd like to look down and see a large, clear radar display. Because I'd like to play Freespace sitting in a full sized fully functional cockpit where I hit a large red button marked "Engage Subspace Drive" instead of leaning over to a keyboard and hitting Alt-J. Because I'd like to declutter the main display so it will look good when I run it through a projector onto an 8 foot wide screen. Because I'd like an audible warning when my hull integrity drops below 50%. Because I'd like to see how many countermeasures I have left by looking at a 7 segment LED display driven off the parallel port. Because when I kick in afterburners I want to feel the tactile feedback driver mounted in the seat hit me in the back. Because I like building things out of wood and I like doing simple electronics projects, especially ones that enhance the gameplay of the best game ever made. But most of all because I've been dreaming about something like this ever since I played Elite on my BBC Micro and finally we have the source code to the perfect software in the hands of some very talented people, some of whom are probably as stark raving hatstand as I am. Oh...and because I wanna :lol:
And yes Coolmon, thats exactly what Im asking. The display wouldnt actually be simply split across monitors, just certain variables made available to another program that would send them over the network to a second PC. Much easier I should think than including multi monitor support. I would imagine you could do it by copying the relevant data into an area of shared memory but I'm just guessing since I never made it past chapter 4 of 'Teach Yourself C'
-
I have never done something like this but I don't think it would be that hard, but I have no idea how to do that so I don't know, it would be supreemly dificult to build the second program though that I can assure you, if there is anyone willing to build the second program I would assume they would be able to do the variable hooks
-
Originally posted by Visionism
Why? Because I'd like to look down and see a large, clear radar display. Because I'd like to play Freespace sitting in a full sized fully functional cockpit where I hit a large red button marked "Engage Subspace Drive" instead of leaning over to a keyboard and hitting Alt-J. Because I'd like to declutter the main display so it will look good when I run it through a projector onto an 8 foot wide screen. Because I'd like an audible warning when my hull integrity drops below 50%. Because I'd like to see how many countermeasures I have left by looking at a 7 segment LED display driven off the parallel port. Because when I kick in afterburners I want to feel the tactile feedback driver mounted in the seat hit me in the back. Because I like building things out of wood and I like doing simple electronics projects, especially ones that enhance the gameplay of the best game ever made. But most of all because I've been dreaming about something like this ever since I played Elite on my BBC Micro and finally we have the source code to the perfect software in the hands of some very talented people, some of whom are probably as stark raving hatstand as I am. Oh...and because I wanna :lol:
Oh. My. Word.
My friend, if you have that much money kicking around, I know of some very worthwhile causes that could use funding.
-
Yeah I wish. It isnt all that expensive. Structure is all wood, Switch panels are made from a plexiglass-printed paper sandwich (backlit baby!) and the rest is just common electronic parts you can pick up in Radio Shack. The projector, much as I'd love a $4000 LCD job, is basically a clear LCD display that you put on an overhead projector. Not nearly as clear but still looks good. (Havent got that yet but they come up on ebay all the time for $100 or so) The second PC and monitor is just old junk I have laying around circa 1998. By the time I finish I estimate it will have cost around $400 exclusing the computer stuff which I have anyway. You wanna see people go REALLY nuts with this stuff look at http://www,simpits.org and have a browse through their links section. Some of those guys have spent thousands (and years) building their simulators, especially the commercial airline enthusiasts. I have a good friend who isnt listed on their site (although he provides their hosting) who is building an F15 simulator out of the front end of a genuine F15. Check it out - www.f15sim.com Sheesh and I thought I was a geek. I'm not fit to lick Gene's pocket protector. (The guy is also a programmer of no little ability so I might have to sweet talk him if I can persuade someone to put the hooks in the code for me ...heh)
-
If I had more room this would give me an excuse to drag up my old 15" montitor :p
-
Here's my guess how it could be done; when a program starts, it sends a message to Freespace 2 (Perhaps with the Win32 system, if it's fast enough). Freespace 2, if it's running, sends back a message with its current status. Then the client could send a message with what variables it wants to receive, and whenever they change, FS sends a message to the application with the updated values.
I know it's possible to do, but not how to do it. (Nearly all of my interapplication Win32 messaging knowledge comes from here (http://www.winamp.com/nsdn/winamp2x/dev/sdk/api.jhtml).)
-
That is SUCH a good idea! I have three computers in very close proximity, that would be GREEAT!
I would assume if this program was made (the one for the other computers - I dont have space in my tiny room for a full simulator you:D ) it would have multiple computer support (just send it to two ???) and you could customise what you see on each computer?
cool idea! hope it geats done... REALLY hopes it gets done!:yes:
-
would it be possible to have it output all the relevant data to even a second monitor (via S-Video or that thing on the back of Radeons) without all the second application stuff? or have the second application do that without the second computer?
what? I dunno. :wtf:
Bob
shower.
-
So long as the hooks are there I can't see why you couldn't in theory output to a second monitor if you can find someone to write the app for you. The only thing thats hard as far as I can guess is a radar display and there must already be a routine in the FS source code to plot 'world positions' onto a 2D circle so you wouldnt have to write that again, just 'borrow' the algorithm. The rest of the data is basically numeric data with some of it sent through parallel or serial ports to drive other devices (A pre-made solution for doing do already exists) such as 7 segment displays for missles/countermeasures remaining, speed, distance to target...whatever you want really. Perhaps bar graph displays (think VU meters) for power management and various indicator lights - Hull Critical, Enemy Missile Lock, Incoming Missile, etc etc. You can really do as much or as little as you like with the data and whether you process it all in a background app or on a separate PC is up to you. We just need to have the data available in the first place.
-
A little something a learned from the Simpsons:
"Less yapping, more zapping".
It would save a lot of trouble if I had the info where to find all these hooks from the source. Like where is all the movement of other ships and objects stored, but I guess people have better things to do than to write Freespace Source for Dummies.
Our live roleplaying project has progressed somewhat http://www.hard-light.net/forums/index.php/topic,8599.0.html
Guess I should update that thread a bit.
Our project has a few things in common with this threads suggestions. We are trying to pass information from the Freespace engine to individual clients in order to separate some functions of the ship to different crew members, in other words we are trying to accomplish a mockery of multiple crew. So far we are limited to ship function control (shield/engine/weponenergy, messages). Which is pretty simple stuff, but we would also like to duplicate the radar and send map information.
If someone can give a few tippers where to start looking ship/object coordinate and movement information it would save time crawling through the source.
-
As far as I know a very easy way to do this would be to write an independant dynamic link library (DLL) and put some references to it in the FS2 source code (meaning everyone gets the functionality if they want it). At some point in the main application loop, you simply access the dll's data and fill out data structures for the information you want to export (this wouldn't be too hard since most things are global in FS2, so its just a matter of adding the right header files in the right places). Then the application which distributes the data calls into the same dll file and accesses its data structures to retrieve this information.
I can't remember the specifics, but dll's allow data to be shared between applications through them.
-
I take it this idea died on the vine since there have been no updates to this thread and I can't find any mention of it in any of the feature lists. Any know if this was tried and given up on? I'm toying with looking into implementing this but wonder if someone already did and found it's not possible (or incredibly difficult).
-
Holy ****e. I was wonderring when diamondgeezer returned, until I saw the date of these posts.
AFAIK there are already persistent variables. I suspect that global variables would be similar, but I am no coder.
-
Holy ****e. I was wonderring when diamondgeezer returned, until I saw the date of these posts.
now that's what i call reviving a dead topic.
>3 years has GOT to be a record.
-
would it be possible to write an interface script in lua, which could communicate with other applications/interfaces. perhaps so you can run standalone scripts on other machines that can talk to the ones running in freespace. could this, in theory, be done right now? with stuff like the physics stacks and whatnot could it be possible to run a full motion simulator with few lua scripts.
you have a host script which gathers the variables you need and passes them on ti scripts for network interface, or serial/paralel io, ect. the serial/paralel io can be sent to simple electronic guages directly running no software, just some simple dac driving an analog gauge. the network io would send streams of variable updates over the network running a lua interpreter. they would in turn run a client script to get the variables it needs, which interface with other scripts for output.
still id like to see at some point multi-display support. that would be the **** :D
-
Different forums have different etiquette on posting... should I have started a new thread rather than reviving this one?
-
nah this works. its an intresting topic and why start a new thread. it seems to make more sence to have one old thread bumped than an old dead thread and a new dying thread. :D the concept of a freespace cocpit simulator intrests me.
oh **** where are my manors
gunnery control, fire at will
:welcome:
welcome to the hlp forum, there are no exits, those things that look like exits are only painted on and normal mapped due to budget cuts. please donate to help with that. in event of a water landing you will be used as a flotation device. flamethrowers are under your seats, but do to budget cuts theyre filled with holy water, which is collected from the hlp urinals and blessed by the priests of the v gods. shotguns and plasma rifles may be found in the weapons lockers, but only the admins [V], or a hyperintelegent shade of blue have the combo. a 10 pound sledge works just fine though, either as a wepon or to open the weapons lockers. if that dont work for you maybe i have an extra gatling gun you can use. never under any circumstances use the characters f s and 3 all squished together. if you hear a noise from the air ducts dont wory, thats only the resident shivan carl. give him your lunch and back away slowly. i find he usually likes ham and chease or a monte cristo, if you have tuna, youre a dead man. enjoy your stay.
-
Different forums have different etiquette on posting... should I have started a new thread rather than reviving this one?
no, this is better.
It's just not very common for threads this old to be revived. that's all i was saying.
-
Nuke, thanks for the warm welcome. What is Lua like? I was thinking about setting up a shared memory segment but that may be a better option. I was looking at some Falcon 4.0 forums and it seems to use the shared memory setup so I thought I'd mimic that. The downside to that is you need to have a second app read the shared memory and export it so you can use that data. I'm guessing from your description that lua would allow you to read the values without having to make some kind of intermediary process?
-
you can already read quite abit in lua. for examples of what kind of stuff can be done look up scripting.tbl in the wiki. it also has links to some other usefull lua resources. i find lua a fairly easy language to work with. if youve ever done visual basic youl find it somehwhat similar.
anyway my thought was your run a number of scripts. you first have your host script which runs in freespace, this gathers variables and would need to have support for network serial and paralell communication. im not sure if that can be programmed in right off the bat. there may need to be some source modification to allow lua access to i/o and network resources. the serial and paralell communication could drive simple electronics. while the network communication would drive stand alone client scripts on other machines. this would be used for more complex screens like radar and such.
that said alot of scripting would need to be done and it would probibly be a much greater undertaking that actually building the simulator itself.
-
This (http://www.lua.org/manual/5.1/manual.html#pdf-io.popen) might be something to experiment with. I don't know if I'm comfortable with scripts being able to actually run processes on the host computer though, so I may remove that function.
-
sounds intesting. i just want a clean way to pass vars from script running in freespace to scripts runing in another interpreter, which would allow people wishing to build a cockpit simulator, or even a full motion simulator. to write scripts for i/o output and networking (to run client scripts on other machines). such a feature would fly well to the sim people. i always wanted to build a fms, and it would be cool that if i ever did, i could run freespace on it :D
-
I looked into how Falcon-A works for Falcon 4.0. Looking at the source code it looks like it is using a shared memory file. This looks pretty straightforward...
Here's where you can get Falcon-A http://www.viperpit.org/forum/viewtopic.php?t=530 (http://www.viperpit.org/forum/viewtopic.php?t=530)
MSDN article on shared memory files http://windowssdk.msdn.microsoft.com/en-us/library/ms685026.aspx (http://windowssdk.msdn.microsoft.com/en-us/library/ms685026.aspx)
Now that I've started playing Freespace again, I think I can see why this hasn't been done already. Unlike an F-16, there aren't any indicators you would need in Freespace that aren't already on the HUD. This really makes building a cockpit superflous...
-
why do a panel when you could to a full motion simulator. :D once physics vars are accessible it would be pretty cool. using a paralel cable you could do motor speed out and rotation sensors in, and drive the whole thing off of the freespace engine :D
-
I'm sure it would be cool but it would be WAAAAAAAY over my abilities. I mean I work as a programmer (lately mostly SQL but I've worked a few years each with VB and Java) so I can grasp the coding (says the guy who still hasn't figured out how to get his MS Visual C 7 environment setup to a point to build Freespace). I took a couple of electronics type classes in college so I could figure out how to setup buttons, switches, and indicator lights. But I don't know anything about engineering...
Building a motion simulator would totally rock, but I'm not the man to do it...
-
(says the guy who still hasn't figured out how to get his MS Visual C 7 environment setup to a point to build Freespace)
Some people have had problems with the MSVC7 project. Try importing the MSVC6 one.
-
ive got a couple ideas floating around upstairs. the cheaper of the two is a 3 axis sim with 360 degree yaw radias and id say 90 degrees for pitch and roll. the yaw axis frame rotates on rails which are elevated above the floor and is driven by wheels by means of a gear motor, a simple digitaal compass provides the sensor here. the frame is a hexagonal ring about 6 feet in diameter and made from steel tubing. single wheel assembalys mounded on all 8 sides, 2 of which are driven by motors. the inside is left free for the pitch frame to rotate
your pitch axis frame which fits inside the yaw frame. it is mounted on bearings. the bearing rods are fixed to the yaw frame while the bearings are in the pitch frame. a gearwheel is fixed to the inside of the braring rod, gear motors with worm drive is mounded in such a way as to rotate the frame. the sensor emplyed here is a simple ball baring in a wire ring sensor (which can be made fairly easiy). this frame would also house the bearings motors and worm gears that articulate the roll frame.
the roll frame is a rectangular frame about 5 feet in length. the plot seat is positioned slightly behind the center of gravity. the computer, panel, controls, and screen(s) will be mounted in front to balence it out. fixed bearing rods and gears mount in the pitch frame for articulation. a rotation sensor like the one used in the pitch frame would also be used.
the computer would use a solid state ram based hard drive, which should survice being tossed around. a semi-decent video and sound card. id make it powerfull enough to run the game im building the simulator for. in the case of freespace 2 that means a gig of ram and a good 2ghz processor. it would need to have enough io ports to control the 3 sets of motors and read the 3 sensors. for screens a fairly large flat panel would do. however if the game supported multi monitors id use a pair of sli cards to drive 4 displays, which would be aranged in a hood with screens positioned to simulate front side and up windows for a virtual canopee. id use ch stick, rudder, and throttle. or sence saitek is finally coming out with rudder pedals that match my x-52 id use those.
depending on the torque of the motors being used, it might be nessicary to make the machine ultra balenced, meaning an adjustable pilot seat which could slide forward or back. this simulator could potentially hafe a full 360 degrees of rotation on all axes if you could solve the problems of running power/signal data through rotational couplings. you could just couple the power and piggyback the signal data onto the current (the same technology is used to set the clocks in many an office building).
--or--
this is a more exotic idea i just came up with. get a big sphere and hover it using either an air cushion or magnets. and at the 6 corners of the sphere have a "thruster quad" essentially 4 nozzels pointing on each direction along the plane prependicular to each axis. this gives you essentially 6 sets of 4 thrusters to controll all 3 axes of rotation. you drive theese using tanks of compressed air inside the sphere. this simulator is self contained, it requires several tanks of compressed air (which are "charged" by an external air compressor pump). your computer would also need to be on batteries (an alienware laptop :D) as theres no way to connect power and keep the sphere freely rotatable. also balence is critical, the pilot seat would need to be fore/back and up/down adjustable so that balence may be tweaked to perfection. to hover the thing magnets would be the cooler solution, as they dont make any noise and would interfere less with the rcs thrusters. an ir cushion would be the easy way, you just put your sphere in a ring with a seald base, and use about 6 carpet blowers to provide the thrust.
-
Nuke, have you seen this? http://www.acesim.com/main.html (http://www.acesim.com/main.html)
Since there is no gravity in space (I know that's not technically true, but you know what I mean), you wouldn't really need to have features like going upside down. You would just need enough motion to account for inertia... I think the JoyRider (use the link above, googling for it is rather dangerous :eek2: ) would be sufficient for that...
-
Wow! LOL
It's spooky how much of what you suggested back then has actually been partly or fully implemented.
-
Nuke, have you seen this? http://www.acesim.com/main.html (http://www.acesim.com/main.html)
Since there is no gravity in space (I know that's not technically true, but you know what I mean), you wouldn't really need to have features like going upside down. You would just need enough motion to account for inertia... I think the JoyRider (use the link above, googling for it is rather dangerous :eek2: ) would be sufficient for that...
ive seen it, i just dont like it. sure its nice if you want something cheap. but if i anted to do a simulator id rather go all the way.that said i dont think anyone has a 3 axis arbitrary motion simulator. nasa is happy with its 6 dof vertical motion simulator, which doesnt have a full range of rotational motion. it has enough vertical and lateral ranve to make it seem like real flight though. the 3 axis thruster driven hoversphere would totally rock though.
if i ever built a sim id probubly go with the first idea. it would be cheaper and have fewer engineering problems. as youre using hi torque gear motors, balence is less critical and you wouldnt have to stop and recharge every 10 minture. i think i just like the enclosed cocpit idea, better imersion :D
-
I looked into how Falcon-A works for Falcon 4.0. Looking at the source code it looks like it is using a shared memory file. This looks pretty straightforward...
Here's where you can get Falcon-A http://www.viperpit.org/forum/viewtopic.php?t=530 (http://www.viperpit.org/forum/viewtopic.php?t=530)
MSDN article on shared memory files http://windowssdk.msdn.microsoft.com/en-us/library/ms685026.aspx (http://windowssdk.msdn.microsoft.com/en-us/library/ms685026.aspx)
Now that I've started playing Freespace again, I think I can see why this hasn't been done already. Unlike an F-16, there aren't any indicators you would need in Freespace that aren't already on the HUD. This really makes building a cockpit superflous...
It's making it crossplatform compatible that really gets ya. Theoretically, you could stuff whatever data into a standard Win32 message and fire it off to another program, but it'd be totally incompatible with Linux or OS X. I don't know if either one has a shared memory space similar to the MSDN article one; I'd guess no, but I haven't worked with anything closer than memory mapped files.
-
if you did it strictly in lua it would already be cross platform. im sure you could get a stand alone lua interpreter for any os. once you pass the vars from freespace's lua interpreter to the stand alone interpreter the code becomes strictly the buisness of the simulator builder and can be carried as far as their scripting knoledge would allow.
-
Which puts you right back at square one, because if you can pass the vars to a standalone interpreter, you have to be able to pass the vars to another program. :p