LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Racing game in LabVIEW

Hello everyone. For my second year project in LabVIEW, I have to make a police car chase that is shown on a LabVIEW VI and can be controlled through LabVIEW. My question is how do I allow a game to be displayed and controlled through LabVIEW; what information from the game do I need from the game (i.e. source code, etc) and what VIs would I need to use?

 

Thanks.

0 Kudos
Message 1 of 11
(3,618 Views)

Your questions are too general. If I made a post saying I wanted to make an operating system and said things like "what kind of code do I need to make this operating system?" then answers to that question would also be too general.  We can give suggestions but if is going to be your responsibility to break up this large task into many smaller ones, and then tackle each of the smaller tasks one at a time.  

 

How will you control the car?  Make some code to demonstrate you can acquire inputs and show it doing stuff.  How will the car be displayed?  A 2D picture control gives you full control over everything being seen but is a lot of work.  If you go that route write code to draw each of the objects on the screen.  Is there a road, trees, cars?  Write code that draws them and then write code that invokes movement of them.  Is there things that check for the end of the game?  Write the code that checks when it is over.  There is lots of options and lots of pieces.  Start small and if that means free LabVIEW training then start there.

0 Kudos
Message 2 of 11
(3,608 Views)

Hi, thank you for your feedback.

I agree that my questions are too vague. To be more specific, I would like to be able to send information from an open source racing game, such as fuel and speed, to a LabVIEW VI. The game doesn't have to run in LabVIEW, but be able to send and receive information from a VI. Any suggestions on tutorials on how to start would be much appreciated.

 

Thanks.

0 Kudos
Message 3 of 11
(3,591 Views)

Does the game already output this information or will you have to modify the source to do it?  If it's up to you to modify the game source code to output this information, as well as make a UI for displaying the game info within LabVIEW, I guess it depends on your knowledge of the game source and the language that it is written in.  Does the game source implement TCP or UPD for network play? 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 5 of 11
(3,558 Views)

Hello Condoriano,

So you have your game running somewhere, and want to remote-control i from LabVIEW. To do so, you need to define an interface between those to ("API").

You define when the game sends which and how data, and how and what data it can receive. In LabVIEW, you then program the counterpart to this interface.

implement this on both ends (game and LabVIEW).

 

Your game could e.g. send an udp message containing the speed and fuel data regularly, and it could wait for control data sent from LabVIEW.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Message 6 of 11
(3,515 Views)

Hello ikaiser,

 

Thank you for your response. After further research, I have a better idea of what my program should do. I will have a game running on a PC, and on that same PC, LabVIEW will be running and the game will be feeding information to LabVIEW. Would you suggest using UDP?

 

Many thanks.

0 Kudos
Message 7 of 11
(3,504 Views)

Instead of asking us to "do all the thinking" for you, why don't you do some of the work yourself?  Your question about udp, for instance, boils down to methods of communication between LabVIEW and other routines.  How can you learn about this?  Well, tutorials have been mentioned (but I'm guessing you don't want to spend the time and effort).  I'll mention the Web, e.g. Google, but I'm guessing you don't want to "do the research" to formulate a question and study the answers that Google will give you.  Have you tried LabVIEW's Help system?  Have you looked at the Examples that ship with LabVIEW?

 

Bob Schor

0 Kudos
Message 8 of 11
(3,501 Views)

Hey Condoriano,

 

+1 for what Bob wrote. I mentioned UDP more like an example, as it's a typical protocol used in online gaming for what we call tag data in the LabVIEW world.

 

What you need for your project depends completely on what you are planning, what your requirements are, how they might change in the future, what level your programming proficiency is, and what you want to learn.

 

Your question is a bit like "Would you suggest using email to contact my wife?" I can't answer that. When I want to talk to her, I prefer the phone, when I want to video-chat, I use a messenger on my phone, when I need to send her written documents I use snail-mail, and when I need to send things I ship a parcel. All valid ways to communicate, all good. We cannot decide what your project shall look like.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Message 9 of 11
(3,496 Views)

Hi ikaiser,

 

Thank you for your feedback. I appreciate your candid and quick responses. I will do further research into all areas that you have suggested.

 

Thanks.

0 Kudos
Message 10 of 11
(3,490 Views)