Mapping Interiors Dif
by Marcus Araujo · in Technical Issues · 04/01/2008 (6:57 am) · 1 replies
How can I map a interiors for works in ImmersiveAI? For the immersiveAI
Using ImmersiveAI works on the simple ground very fine. But, wont work on a house with a diferent ground like a dif.
Any question or answers?
Using ImmersiveAI works on the simple ground very fine. But, wont work on a house with a diferent ground like a dif.
Any question or answers?
About the author
Torque Owner Jason Gossiaux
Indie Dev
SmallHouseArray=[10][6] =
xxxxxxxxxxxx
x0000000000x
x000x000000x
x00xxx00000x
x000x000000x
x0000000000x
xxxxx00xxxxx
Then if the house comes with a table and chairs you'd hard code those as being unwalkable. This is represented in the above image as the X's in the middle of the house.
You'd add the DIFs to some sort of a list, and manage the list and each would have to have its own variables. One variable would be the door coordinates. When the DIF is added the nodes for the door are calculated relative to the worldmap and stored in the list.
Then when the bot is given a move command into the DIF, the "general" A* pathfinding would fail because the DIF is blocked off its nodemap. You'd then do a raycast from the sky and figure out which DIF you'd hit. then you'd look it up in the DIF list and know where its door is at.
Then you'd A* to the node in front of the door. Upon arrival the AI would have to know to perform a new A* on the pregenerated DIF specific node map.
This obviously requires a lot of work up front. It is not general purpose and gets more complicated as you add additional doors and additional floors. It is also harder to update as things get placed in the interior during the game that would normally cut nodes off the node map. But its a theoretical start :P You could even support stairs if you added those as stored attributes and did a third handoff from the first floor interior A* to the second floor interior A*.
Good luck with it. I've not seen any better explainations for mapping interiors with nodes. It is also conceivable you could write a general pupose ray-cast driven interior mapping function. I'm still pondering exactly how I want to design mine...