|
I'm surprised you know about OpenCL. Actually, I'm studying it right now. It's not that hard to implement, but I'm not sure if it's mandatory to implement it on OpenCL.
After the algorithm is made, I'd be happy to take a shot of implementing it on OpenCL. But the priority should be to get it working.
|
|
(03-25-2010, 08:58 PM)Erusavion Wrote: For something this big, we'd need an entire development team. I'd be happy to dedicate my time to this during the summer but right now I'm very busy with school and work.
But if we are to see this through we'd need several people working on this.
I fully agree. That's why I brought it here. I could never start, much less complete this idea. I'm willing to both learn, and then program for this. I am in my Senior year of high school, but I have few extracurriculars. I should have at least a decent amount of time to help.
|
|
I lied. I have a recursive algorithm to SOLVE a 2D maze. Although, the algorithm to creating it could be edited to make it random pretty easily. Also, the recursive algorithm could be used to help testing the randomly generated map.
|
|
03-25-2010, 09:17 PM
(This post was last modified: 03-25-2010, 09:26 PM by master[mind].)
(03-25-2010, 09:05 PM)Aleator Wrote: I'm surprised you know about OpenCL. Actually, I'm studying it right now. It's not that hard to implement, but I'm not sure if it's mandatory to implement it on OpenCL.
After the algorithm is made, I'd be happy to take a shot of implementing it on OpenCL. But the priority should be to get it working.
Agreed. I don't think generation should require OpenCL, but Testing the map most definitely would. It would not be good to have server side delays between rounds for testing. I have read a small portion of the OpenCL docs. Parallel computing fascinates me(probably why I enjoy graphics rendering ) I knew about CUDA for a little while, but it's more commercial. OpenCL, was an awesome announcement for me. I want to attempt some applications with it at some point in time(which means never ).
Erusavion Wrote:I lied. I have a recursive algorithm to SOLVE a 2D maze. Although, the algorithm to creating it could be edited to make it random pretty easily. Also, the recursive algorithm could be used to help testing the randomly generated map.
That it would! Post it on here? I need to learn some of this stuff. Like I said, I'm inexperienced, and a little overzealous, not bad qualities, but it means I can get myself in over my head sometimes(and I have ). Heh...
Edit: Sorry 'bout the name mixup...
|
|
I'm like that also. I don't have much experience either.
Yes, OpenCL really is a big step. In case you didn't know, they have bindings for C++ and python, so it might be an advantage if you don't want to write the code in C.
|
|
I'm actually more comfortable with C. The whole Object Oriented thing is nice, but confusing to code. Python uses tabs. Tabs are bad.
|
|
I hope you don't mind, I'm going to post it in c++ because I don't feel like rewriting it in pseudo code. If you want me to, though, I will.
Quote:bool Maze::findPath(int nextRow, int nextColumn)
{
delay(100);
if(grid[nextRow][nextColumn] != ' ')
return false;
if(nextRow > rows - 1 || nextRow < 0 || nextColumn > columns - 1 || nextColumn < 0)
return false;
grid[nextRow][nextColumn] = 2;
gotoXY(nextColumn, nextRow);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 14);
cout << (char)2;
if(nextRow == endRow && nextColumn == endColumn)
{
gotoXY(0, rows);
cout << "The " << (char)2 << "s found a solution!!!" << endl;
return true;
}
if(findPath(nextRow + 1, nextColumn))
return true;
if(findPath(nextRow - 1, nextColumn))
return true;
if(findPath(nextRow, nextColumn + 1))
return true;
if(findPath(nextRow, nextColumn - 1))
return true;
grid[nextRow][nextColumn] = ' ';
gotoXY(nextColumn, nextRow);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_INTENSITY | FOREGROUND_RED);
cout << "!";
delay(500);
gotoXY(nextColumn, nextRow);
cout << " ";
return false;
}
Keep in mind, this is solving a 2d maze so it is based on a grid (column, row).
|
|
03-25-2010, 11:27 PM
(This post was last modified: 03-25-2010, 11:36 PM by master[mind].)
Thanks...now for some deep studying...
Edit: 'k got the first portion.
Eureka! I can't mentally execute code, but I get the idea. Brilliant use of recursion...I thought I'd never see that in use...wow...
That would be the most efficient way of testing for at least x number of open pathways. That's...amazing.
I'll PM you tomorrow to see if I figured it out right.
|
|
If you would like, I could comment it to make it easier to read. Also, I could send you my source code and you could compile it and see how it runs.
|
|
Will it compile on DevC++(the included gcc, not the IDE)? That's all I have access to right now.
|
|
Do you have linux or windows?
|
|
Windows and Linux, but Linux is not available. Here's the issue. I usually "maintenance" my computer(don't install software), but I ordered a new graphics card(GTX 260). That was going to be my reinstall point(for both Win/Lin). Graphics Card died, and there was no replacement. I am saving my money for a GTX 470. I am going to build a Windows based "Gaming PC" and use the "older" parts for a Linux workstation(Gentoo and Awesome yeehaw!) That will be my official setup, but until then, only Windows Vista is set up for use(git is a pain in Windows ). DevC++ should compile the code.(minus a need for the main function.)
|
|
Sweet, you used awesomeWM? I didn't know anybody else that did. I loved awesomeWM.
Yes, DevC++ should compile it. I just don't have any experience with it so I can't help you with troubleshooting. Also, just a reminder, since this is just a recursive function visiting one block at a time this isn't a very efficient way of doing it. I only coded my code this way because we were doing a 2D maze. Basically it is going to slowly visiting the top block, bottom block, left block, and right block. Depending on which is empty first, it will move to that block, even if it leads to blocked off spaces. Now, that sounds wonderful right? Because it should visit all blocks. That is not the case, though. If the path leading to the exit is down, but there happens to be a path to the right also, it is going to ignore the right because it never recursively comes back to try another path.
With all that being said, I'm not sure how much data structures experience you have, but I think that the structure of the map should also be organized in a graph structure and then we could use breadth first/depth first traversal. This would visit each point on the map efficiently.
|
|
Haven't used(man I'm lazy) but will definitely be using. It is, in my opinion, the best tile wm available. Lua scripted configs makes it even better.
Anyways, splitting the recursion up into separate threads for openCL might make the process better than on a CPU. Can you expound on the graph concept? I'm not sure I understand the process. More specifically, the breadth depth use of the graph.
|
|
If you pm me your email I actually have a slide that describes graphs and such that I can send to you.
|
|