Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I need to simulate the effects of adding supporting materials to a building structure for a genetic algorithm in a block-based world. Essentially I am planning to use a genetic algorithm to optimise the viability of a structure for a game in Java.

I've tried looking around for examples of algorithms, but so far have only come up with JBullet. How would the stress be calculated from a list of materials and their properties?

share|improve this question
1  
What have you tried? This question seems more like something that would appear on an exam than it does a "hey guys I've been trying to ________ and I've done _______ can you help with ______"? Just sayin... –  Digital Architect Mar 9 '13 at 8:25
    
@DigitalArchitect it's not an exam question. I've tried searching around for tips on this sort of thing but haven't been able to find anything except perhaps using JBullet. –  first_responder Mar 9 '13 at 8:29
3  
This question is really too broad. Your description of what you are trying to accomplish is very lacking. But ultimately you probably won't get around having to learn some physics, even if you end up using a library it is hard to get good results without a decent amount of domain knowledge. –  eBusiness Mar 9 '13 at 9:43
    
Beware that genetic algorithms don't optimize for pretty =) In the meantime, maybe you can steal ideas from en.wikipedia.org/wiki/Finite_element_method –  Patrick Hughes Mar 9 '13 at 17:38
    
Possibly related: meta.gamedev.stackexchange.com/questions/1072/… –  Trevor Powell Mar 11 '13 at 22:54
add comment

closed as not a real question by bummzack, Trevor Powell, eBusiness, Josh Petrie, Anko Apr 7 '13 at 16:29

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 1 down vote accepted

I imagine you're looking to do something like this (starting at 3:04)? From a game called StarForge.

Essentially, you need to simulate the basic forces of stress:

  1. Compression - Generally simulated by calculating the amount of force being applied to an object and its "squishy-ness". When the compression gets too high you can have materials crumble, crumple or shatter.

  2. Shear - This is a force across cross section. You can limit this to just a few pre-selected cross sections. This is the force that will cause objects to deform under stress (eventually breaking).

  3. Tension - Essentially the opposite of compression. This is measured by calculating the amount of force pulling on an object. So having an entire structure suspended by a single cube would cause that coupling to break.

All in all, this is going to be very math heavy and will likely take a lot of optimizations to get working in a performance friendly way. Calculating stresses like this in real time is a lot easier when you're just dealing with simple cubes, but it'll still be a challenge without a good amount of engineering knowledge.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.