Jump to content
  • Advertisement
Sign in to follow this  
Sagar_Indurkhya

Massive Computation Advice

This topic is 5398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am doing an AI project that is a game, but all the players are AI bots. Anyway, the game is played out, with the variables being recorded, and then played back like a movie. The program has to do huge computations, so real-time rendering is not an option. My question to you is this: what kinds of problems have you found with this kind of project. also, do you suggest making tons of optimizations, or just keep it simple? Obviously, speed is not really a concern, though I am doing it in C++. Should I use vectors over arrays, etc, to keep out bugs? Also, how do desktop computers handle this kind of program, that may run for hours on full speed?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Sagar_Indurkhya
I am doing an AI project that is a game, but all the players are AI bots. Anyway, the game is played out, with the variables being recorded, and then played back like a movie. The program has to do huge computations, so real-time rendering is not an option. My question to you is this: what kinds of problems have you found with this kind of project. also, do you suggest making tons of optimizations, or just keep it simple? Obviously, speed is not really a concern, though I am doing it in C++. Should I use vectors over arrays, etc, to keep out bugs?
Something like that. If this project is large enough, you're probably going to lose more time from crashes than undertweaked code. Make sure that you optimize algorithms, however.
Quote:
Also, how do desktop computers handle this kind of program, that may run for hours on full speed?
Just fine... why wouldn't they?

Worst case: they get a little warm.

Share this post


Link to post
Share on other sites
If your computations are too complex to be performed in real-time anyway, you should focus on good algorithms. This means extensive use of STL and Boost support algorithms and data structures wherever applicable (e.g.
prefering list::sort() to your own sort function). This assures that if errors occur, they're most likely due to faulty algorithms.

The performance difference from STL/Boost data structures and algorithms over custom functions operating on PODs and your own implementation is negligible (they will most likely be even faster) unless you are a very good and experienced programmer.

Less error-prone code is only one benefit of using STL/Boost. Another is that you can focus on the algorithms and choice of appropritate data structures themselves rather than their implementation details.

Desktop PCs can cope pretty well with CPU intensive programs as long as the hardware is properly setup (e.g. suffiecent cooling is provided).

Share this post


Link to post
Share on other sites
Ok. So use boost and Stl. I will have to actually start using boost, though I already use STL(who doesn't?). How do you all organize such large projects also? My project has like 3 or 4 api's(like DX, etc). Any build time tricks? Also, should I consider something like .NET to make code little cleaner?

Share this post


Link to post
Share on other sites
Yeah consider using .NET. I was actually going to suggest using Java for the same reason, you get garbage collection. For a project that's a) going to be running for a long time, b) doing a lot of crazy, computationally-intensive algorithms ("crazy" is how I describe a lot of the AI algorithms out there), and c) doesn't need smooth performance, you're going to find it a huge benefit to have automatic garbage collection.

As far as organizing a large project, just follow good OO practices and you should be fine. Break up the project into several distinct units that know as little about each other as possible. For example, have an "ai" unit and a "record-and-play-back" unit, and make it so that if you were to completely rewrite the "ai" unit, you wouldn't have to change the "record-and-play-back" unit at all.

Share this post


Link to post
Share on other sites
Yeah. I am probably going to make the thing .NET. I will probably save the thing as an XML file, so I can easily parse it and do analysis. My only concern is that .NET makes me use those .NET containers, etc, and I have trouble with those. Does anyone have any comments on STL.NET? I am predicting maybe 5 minutes per frame or something. I will probably have 40 or so hidden layers for each NN, and their are probably a couple thousand NN's. Does anyone know if it is possible to use directx and just draw the screen to an array? Also, do you guys know of any sound analysis libraries.

Share this post


Link to post
Share on other sites
Make it OSS once it's stable and you have published a few (at least one) paper that covers or at least outlines your idea. This will most likely be enough to preserve your IP. If implementation itself is not in the focus of your research, you could start making it OSS from the beginning. Public infrastructure like Sourceforge can help you with that. You can setup everythig and submit code once you feel it's ready (ie. it compiles and does some basic stuff).

With OSS you an also benefit from feedback and suggestions of other developers, which is especially good if end up in a blind alley with some part of your code.

A good licence such as GPL can also help to protect your IP.

This is just a suggestion, though.

Good luck,
Pat.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!