11-22-2015 06:42 PM - edited 11-22-2015 06:42 PM
Hi,
I am absolutely new to programming and Labview in particular, which is taught in my university. We've been taught all the basics of Labview but now we have been given a project in which we have to design a maze game. We must make a maze, have a character and a treasure on the maze, be able to control the character to get to the treasure whilst there are baddies on the maze to catch you, and also whilst the treasure on the maze move, and be able to configure the difficulty of the maze. I've been trying to research this for hours and hours and I'm still pretty much as empty as when I started.
Are there any helpful tips or pointers people can give me, or books to read/ places to research.
Thank You
11-22-2015 07:10 PM
That's a pretty complicated assignment for school! Sounds fun, though.
You should start with the basics just to get an idea of what LabVIEW is capable of. Once you have a starting point with the programming language itself, you can use it however you'd like.
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe." - Abraham Lincoln
Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
As far as your specific assignment goes, you'll probably have to create a picture indicator that you can think about like an array of color values. A red pixel can be the user going through the maze, white pixels can be the walls, green pixels could be baddies. All of this could be controlled using a Simple State Machine architecture with user events.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-23-2015 12:31 AM
Thanks for your reply.
I did a lot of reading up on the State Machine and I can see how that would definately be useful in the later stages of the maze.
I'm still not sure on how to actually make the initial map i.e. how do I make a 30 x 30 grid where I can program in what a 'wall' is and where the player/treasure/baddies spawn?
11-23-2015 01:45 AM
Soooo, you've basically been asked to rewrite Pac-Man? Cool, but I agree with James it's a relatively complicated ask for a beginner task. I also agree with him on the importance of going through the training material.
Some pointers:
11-23-2015 02:45 AM
The project is a little tough but im in university studying Computer Engineering so I didnt expect any less!
I also agree on running through all the training first. My university has registered me so I can do the self-paced training session online.
Thanks for the pointers tst. Now I know where to start and can work my way up
11-23-2015 03:28 AM
@Mechasaiyan wrote:
The project is a little tough but im in university studying Computer Engineering so I didnt expect any less!
That's the spirit!
As a fun note: On NI Week this year they had a PacMan clone running on a Compact RIO in the mess hall. 🙂
As far as the maze goes, Tst's 2D array-suggestion is good. The maze itself it basically a boolean array, there's a wall or there's not. When a character moves it can move in any direction not hindered by a wall (check against the maze).
Ofcourse the project says nothing about PacMan so it leaves a lot of room for creativity. You can have a "run to the next map" which dynamically generates a map and so on.
/Y
11-23-2015 03:58 AM
@Mechasaiyan wrote:
im in university studying Computer Engineering
Interesting. It's unusual to see LV in the computer science part of academia. What kind of engineering is it?
11-23-2015 08:59 AM
Look at the example called Queue Stack Maze Solver.vi. It won't handle the full set of variables you need to use in your more advance game but it might give you some ideas on the maze creation itself t get you started. Plus, you will surely get bonus points for your grade if you have an AI-based "Auto-Solve" function in your game.
11-23-2015 10:32 AM
tst wrote:
Interesting. It's unusual to see LV in the computer science part of academia. What kind of engineering is it?
I'm studying Electronics and Computer Engineering. This was an optional module out of 4 others. I've done some programming on other software; C, matlab and a bit of Java. The graphical coding of this software somewhat enticed me.
NIquist wrote:
Plus, you will surely get bonus points for your grade if you have an AI-based "Auto-Solve" function in your game.
I forgot to mention having an auto solver which the user can choose to show/hide is a must
11-23-2015 11:03 AM - edited 11-23-2015 11:06 AM
Looks like you're in good shape with NIquist's maze solver for the maze part of it.
Combine that with this Etch-a-Sketch imitation and you can probably work out how to navigate the maze using arrow keys.
I'm curious how this program will function when you're all done. The combination of baddies moving around and auto-solver should result in a different solution each time. Do you need the baddies to move around? If so, you could just add a Timeout case to your event structure that moves them around.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'