News for hackers. Stuff that matters.
Re:How can one manage thousands of IF…THEN…ELSE rules? by kamaal on Sunday September 16, 2012 @11:56PM (#4531272)
How do video games solve it?

Do you have any material one can read to learn more about this?

Re:How can one manage thousands of IF…THEN…ELSE rules? by seanmcdirmid on Sunday September 16, 2012 @11:59PM (#4531279)
Often through physics engines. You express a bunch of constraints then let a physics engine solve them on each time step (and sometimes across multiple time steps).

Custom (non-physics) solutions involve declarative sets of constraints being solved by some sort of engine; such solutions often start to resemble physics engines even if the physical rules even if the constraints are not exactly physical.

Learning how to use a physics engine, first, then how those physics engines work, is a good start to understanding these kinds of problems.

Edit: I'm really surprised the stackexchange answers don't mention this.

Re:How can one manage thousands of IF…THEN…ELSE rules? by flyinRyan on Monday September 17, 2012 @05:22AM (#4531791)
What would be a good place to start learning about what you're describing here?
Re:How can one manage thousands of IF…THEN…ELSE rules? by seanmcdirmid on Monday September 17, 2012 @05:33AM (#4531817)
I would start with Erin Catto's Box2D.

http://box2d.org/

There are C#, Flash, Java versions if you aren't into C++. Lots of documentation on the web, but the getting started guide is good enough.

Re:How can one manage thousands of IF…THEN…ELSE rules? by teamonkey on Monday September 17, 2012 @11:28AM (#4532983)
Using a physics engine to express an AI problem? That's an interesting solution, but that's certainly the first time I've heard of one being used like this?
Re:How can one manage thousands of IF…THEN…ELSE rules? by seanmcdirmid on Monday September 17, 2012 @07:25PM (#4535425)
But you know, the problem as stated was how a bunch of influences affect...cows. So think of them as a bunch of mechanical cows instead, and the influences are modeled through springs and collisions, things like that.

AI is often cast as constraint solving, and a physics engine is basically a constraint solver. Of course, for real the AI engine runs next to the physics engine. Ah! I should have mentioned Rodney Brooks' work:

http://en.wikipedia.org/wiki/Subsumption_architecture

where you model intelligence as a bunch of simple prioritized reflex-like behaviors. Now, on each step, you have each "entity" execute their reflexes according to the current environment, where some reflexes act to disable others. The reflexes are incredibly simple, you probably couldn't even express A* path finding, but you could have the act as ants following a diffusely scented trail. Also see his paper "Elephant's Don't Play Chess."

Re:How can one manage thousands of IF…THEN…ELSE rules? by teamonkey on Monday September 17, 2012 @11:42AM (#4533068)
If I was given the task to integrate cow herds in a computer game, my first instinct would be BOIDS/flocking, adding in weights for wind velocity and sun. It's fast and lends itself to predictable behaviour which is beneficial to the player.

It may not necessarily be realistic but then most players won't be familiar with cow movements.