02-05-2014 10:08 PM
Hi LabVIEW Community,
This came to my mind today. I've recently saw a bunch of examples manipulating Object,Textures,light,meshes,shadow,rotation....etc (OpenGL?), and this, combined with plenty of math functions and inherently parallel programming can be used to "unusual application" using G. For me, LabVIEW is much more than one Programming Language
I got two project's recently, but i want a third 'fun' one (Just to spend my time with something useful instead procrastinating on facebook/games ). I'm wondering if the 3D Picture Control could be used to write a REAL game? For example, on Client, load simple sprites on 2D/3D scene, the game physics and everything related into game experience (User Interface for example). On Server side, deal with players account management, connection handle (TCP), scriptable elements (Using LUA) , game mechanics and so on. My idea seems one medium~big project... So, the AF is the best choice?
I hope some detailed answers and i apologize if something was 'miswritten' here (I'm not native or good english speaker).
Thanks for your attention.
02-05-2014 10:33 PM
Have a look at this:
http://lavag.org/topic/13321-cr-lvode/
It's not entirely native LabVIEW, but it's fun.
02-06-2014 01:29 AM
In principle, I don't see any reason why you can't write such a game in LV. The tools needed for this are all there and I've seen and written numerous games, including some which include 3D graphics. I expect that if you would have a problem, it would be with the 3D picture control, which I have no experience with, but which I understand can be a pain to deal with for certain things and can have performance issues. I suggest you search to see what people ran up against and also do some demo testing yourself to ensure it can do what you want. You might also be able to use things like the ODE code above or external image controls or CUDA libraries to improve the performance.
I don't know if I would suggest any one architecture or tool specifically, but in principle, the AF is certainly a relevant tool for launching parallel processes and having them communicate, and there is also an experimental network branch. That said, I don't think I would recommend diving into the AF with a large project and you would definitely want to test the performance first. Also, keep in mind that debugging AF code can be hard. I would suggest that you practice on something smaller first (maybe part of the app) and that you read up on the various discussions in the AF group - https://decibel.ni.com/content/groups/actor-framework-2011
02-06-2014 06:52 AM
Don't, just don't....
It's all possible, but I wouldn't write anything more than a small game demo 'because you can' with LV. It's a great language but it's really not the right tool for writing a substantial game. There are plenty of free tools out there to accomplish a game much more easily and with better results than LV.
Something like Monkey is great for games. www.monkeycoder.co.nz
02-06-2014 08:09 AM
Thanks for the Answers
@Todd: Interesting Library.Thanks for the example. I'll study this later.
@tst: Thanks for the "CUDA" idea.I'll definitely use this. Yes, one key point is the performance. I'm able to load a group 3D models using 3D Picture using meshes: No performance problems here. About AF, i've read it that architecture is indicated to "big project's", "dynamic number of processes" and "communication between them" : Exactly that i'm looking for . On server-side for example, many "modules" are written separately:
The Client sends a request
The Server recieve that request (Network Module)
The Network Module decodes that packet (header) and send the useful data to a specific module (For example, the player had opened one "panel" and wait some data from server).
The specific module (let's call Player Module) search such information on database and send to the network module to "pack this" into another packet.
The Server send the "answer".
The Client recieve the "answer", decodes the packet and redraw the interface with data.
Another things like "Memory management" aren't my concern. That's why i like LabVIEW: I can focus on the algorithm without worry about "write code to make this possible".Anw... I'll release one demo in few weeks. Thanks for the answer.
@ToeCutter: You said: "with better results than LV."... Benchmark? I know that exists vast number of libraries using C/C++ and so on,but there's a good interface with "3D World" on Graphics pallete. Most of real 3D game algorithms deal with meshes, textures and physics calculation: LabVIEW is really strong is this areas. Another things like Network management is easy stuff. I'll play with this later Thanks for the answer.
02-06-2014 08:31 AM
The major point to keep in mind is that LabVIEW is a programming environment designed and developed for Test&Measurement.
As most applications do not need a 3D visualization of data at all, LV does not focus on incorporating a powerful graphics engine for 3D rendering.
The 3D graph relies on very basic functions provided by OpenG and similar (at least in the past you required the MESA.dll, which is integral part of OpenG), but does not squeeze all performance out of it. Additionally, it is embedded in a specific front panel element, hence is not designed for a "full screen mode".
So while, essentially, using LV for creating 3D graphic based games is possible, i wouldn't do that. I would rather look for free or low-cost 3D engines or even game-development suites which already provide a preimplemented graphics engine like the UT engine.
Norbert
02-06-2014 08:53 AM
@Norbert
Yes, i'm aware of that. The project in my mind isn't a "Full 3D Game" (Perhaps this has not been very clear). When i'm talking about "3D", i'm speaking about the scene (basic Z perspective) and/or isolated models. For example:
http://3.bp.blogspot.com/-Cor11bRqIyk/US7PRgS192I/AAAAAAAAA-k/MRsBi-OZ2eQ/s1600/00000012.Bmp
I'm able to load some models on LabVIEW (Like that house on second screenshot). I'll play with the "complete scene" later.
Thanks for the advice. Let's measure how powerful is that 3D wrapper
02-06-2014 09:38 AM
Maybe you want to check out another option as well:
Norbert
02-06-2014 11:34 AM - edited 02-06-2014 11:35 AM
@Norbert
Interesting white-paper. I can't download the src code (504 error) here, but i've found it on Github. I think the actually OpenGL interface in LabVIEW can handle the graphics without intervention of any 'extra' rendering 3rd party library, cause the project goal is create the one "2.5D" game (Click Here) . In this case, the "rendering" process is severely reduced, because the 3D models (small ones) are relative simple on a "locked" plane.
My real concern is how much *stable* that will become when i load the complete work. For me, the most important here is increase my knowledge and share this with the community. The delivered binary is just a consequence of what i'm willing to learn (Except when we're dealing with bosses ).
Thanks for your attention and help.
06-16-2020 10:11 AM
I just stumbled over this old discussion...
Yes you can make a game !
See video.
https://drive.google.com/file/d/11N4nDhFshjCPWNPvNwclvXBqYQ17plhM/view
Greetz John