#### Archived

This topic is now archived and is closed to further replies.

# Interesting puzzle: Domain-anisomorphic design

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

## Recommended Posts

Consider the following software engineering/game engine design problem: Suppose you have problem domain D that contains a number of objects, whatever they may be. You also have a desired output range R. This range contains the same objects morphed according to some set of rules f. In terms of software engineering, you have many approaches that you can take to get from D to R. However, there are two that I will outline, and let you choose one which is best. In a domain-isomorphic design, your functionality applies to each object in D in turn. You apply functionality for all objects in D to transform D into R. There doesn''t have to be a 1 to 1 correspondence between D and R; if there isn''t, you do conversions as appropriate. In a domain-anisomorphic design, your functionality is only indirectly related to D. Instead, you design a third domain, F, which is used to get from D to R. Which is better?

##### Share on other sites
A great guru once said: "Every computing problem can be solved by adding a layer of indirection"

##### Share on other sites

If the purpose is to map diameter to circumference .. then you obviously just compute it directly ... if your purpose is to cause a character in a game to choose a set of actions ... the mapping functions will be much less deterministic and direct.

In a mathematical arena ... i have created a set of templated classes embodying functions, which apply themselves to an incoming object and create an outgoing object (basically my setup is just a heirarchy of functors) ... and I have created classes representing most standard operations .. and most common ways to composite them ... so one brach of the tree of object embodies: Multiple/Divide (scale), Add/Subtract (arithmatic), RaiseTo(pow), Exponentiate, Log, MultiplicativeInverse(1/x), Sin/Cos/Tan, Absolute Value, etc ...
and the other main branch embodies compinations: Add/Subtract (terms), Multiply/Divide(factors), Floor/Ceiling, Composite (F(G(x))), etc etc

so then I can build functions like F(x) = sin(G(x)) + 3 - 2y^2, just by combining my function objects in an appropriate fasion ...

now I''ll admit .. this was a long round about way to say this: it is possible to create usefull processes for maping one domain to another ... and then allow composition to create more advanced beahior .... this works in NPC situations too.

Say you have an NPC''s state ... you can pass it through a modifier for randomness (just a little), then another for his personality(selfish), then that through another for his enviroment(just got paid), ... then ... having maped the original domain of NPC states to a new domain of NPC states, you can map these new states to actions with another algorithm ... whatever your AI problem solving system is.

##### Share on other sites
Is it really your job to determine the domain when making games? We should all know that AI programmers and engine programmers are best left to work separately (to follow up on your example). Not to mention designers.

I'll give you an example in turn. Does it really make sense to map the AI's personality directly to its behavior? Most likely not. First of all, AIs should not be completely predictable. Second of all, you're going to find that mapping state to behavior directly with AIs is limiting.

Edited by - GayleSaver on June 30, 2001 10:01:08 PM

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631781
• Total Posts
3002316
×