The Sporum - The Official Spore Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to forum index 
[Login] Login 
Awareness and buildings (update 8/2 see p9)  XML
Forum Index » Spore Galactic Adventures
Author Message
DVDMaster


Civilized Sporeon

Joined: 05/12/2009 22:00:32
Messages: 2139
Offline

SMLightning: After much consideration, i've decided to sticky this thread.


I have been experimenting with awareness and buildings.
I have built simple scenes and placed characters who have been programmed with a a simple advanced AI:
SHOOT PLAYER IF AWARE of PLAYER
IDLE DANCE ALWAYS

THe NPCs I've place do not have a ranged weapon, so the net effect is that the NPC will turn and face me if he is aware of me, otherwise he dances.

By walking around, I can tell if the NPCs can see me.


Here is the result of my study:

Blocks I,II,III are 3 separate buildings. I moved next to each NPC and noted whether each of the NPCs dances or faces the captain.
A can see B
B can see A,C,D,E,F
C can see B,D,E,F
D can see B,C,D,E,F
E can see B,C,D,E,F
F can see B,C,D,E
This is what you expect.

However, if blocks I and II are combined into a single building, here are the results:
A can see B
B can see A,F
C can see nothing
D can see nothing
E can see F
F can see B,E,

The only way I can explain this is that GA computes a bounding box that contains the building and then uses the bounding box to determine awareness.

C & D can't see anything because they are in the box. They can't see each other either.
B can't see E because the line of sight between the head of B and the head of E passes through the bounding box.

What this suggests is that if you are building interiors, you need to:
1) build the floor and the walls out of separate buildings.
2) if the scene is going to have boxes or a desk, these need to be separate objects. Otherwise their height contributes to the bound box of the floor and it can make it so that NPC cannot see things.

IMPORTANT UPDATE 7/12
It appears that gates are transparent.

The bounding box of a gate and of disguised gates do NOT block line of sight. This means that by replacing the building with a disguised gate that uses that building, most of the problems will be solved.
1. NPCS can see (awareness tests and commands that depend on awareness work.
2. NPCs can transition onto and off of these disguised gates.
There are some problems if you move a disguised gate to far off the ground. It isn't a visiblity problem, but appears to be pathing issue. My guess is the the AI uses the ground geometry to figure out paths.


Just because you have fixed the visibility problem, you can still have problems with NPC walking on buildings.

It is my experience that any NPC activity on buildings as floors is buggy. Here is a very simple example:
NPC using basic AI, "mindless", patrol with way points.


If you change the building to a disguised gate (using the same building piece), you get better results:


However, you still have problems using a disguised gate as a bridge.


It appears that it uses the ground under the bridge for path calculations.

UPDATE (5/4/2010):
I've been asked if the awareness bounding box affects static ornamental such as large rocks or plants. From what I can tell, rocks and plants do NOT have awareness bounding boxes. They function just like disguised gates.

This message was edited 8 times. Last update was at 05/04/2010 21:52:38


[WWW]
pheibos


Multicellular

Joined: 04/12/2009 13:56:37
Messages: 312
Location:
somewheeeeeeeere under ze rainbow.

Offline

that's very clever, and I will indeed take your tips. well done

-90% of teens today would die if Myspace had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.
VoidDancer


Microbe

Joined: 09/12/2008 12:13:25
Messages: 30
Offline

Domo Oregato, mr sporeato.

Very nice analysis indeed.
benjee9


MouthBreather

Joined: 09/13/2008 09:49:35
Messages: 694
Location:
In my mutant creature labs.

Offline

Very well done! Excellent, in fact! That is truly amazing and I will use your tips in any interiors I make! Thankyou!

[WWW]
DVDMaster


Civilized Sporeon

Joined: 05/12/2009 22:00:32
Messages: 2139
Offline

Thanks.
I'm working on and adventure and a video demoing this.

[WWW]
Sonneillon


Multicellular

Joined: 09/13/2008 03:46:16
Messages: 306
Location:
Has lost all love of spore :(

Offline

Interesting, that helps explain why the AI breaks a little bit. Well done, the diagram was very interesting

Mushroomman55


Multicellular

Joined: 05/17/2009 19:52:13
Messages: 121
Location:
Somewhere...

Offline

My brain hurts!

And there I am again, racing across the galaxy to save planets before it's too late...
DVDMaster


Civilized Sporeon

Joined: 05/12/2009 22:00:32
Messages: 2139
Offline

Video added to first post.

[WWW]
Khorzho


MouthBreather

Joined: 11/03/2008 16:51:35
Messages: 568
Offline

Nice work! This explains why AI behavior seemed unpredictable. It's just is a little unintuitive.

But I think this video shows one other problem which is much more relevant and game-damaging, and probably related to the Line of Sight behavior you've catalogued.

At the end, when you Jet Pack up to the top of the Yellow block. Your avatar lands on the edge of it.

Your left foot is angled and flush with the slope of the building, and looks as you'd expect.

However... your right foot is sunken into the top of the building. It SHOULD be flush with it.

This demonstrates poor collision detection and/or clipping plane computation. This is a big issue for this game right now, and we've gotten zero response from Maxis on it so far.





SporeMasterKaliena


Spore Master

Joined: 09/09/2008 23:28:48
Messages: 10032
Location:
Virginia, USA

Offline

I've asked for a Dev response, don't know if they have time to reply at this moment but I have asked for you. Good information solidly presented.





cmykflutterby


Microbe

Joined: 01/20/2009 07:08:59
Messages: 47
Offline

that just solved something for me!
this needs to be stickied or added into a tutorial somewhere!
Andeavor


MouthBreather

Joined: 10/23/2008 12:10:23
Messages: 949
Offline

Excellent demonstration you've put together here.

At the moment, I would advise everyone to place 'responsive' NPCs in open areas and not too close to buildings and if you need an interior setting, use it for walk-through or decorative purposes only, unless you manage to work a way around - given the patience, of course.

I'm looking forward to the Dev's response and hope a solution is on the way soon.

[MSN]
Double_Helix


Multicellular

Joined: 09/16/2008 02:32:31
Messages: 108
Offline

There is something else you need to know too.

The bounding box creation also influences paths. By keeping the walls, floor, and roof separate you can reduce issues with paths you layout with your ai. Also be sure to place enough path points so that curvature doesn't mess up the pathing either. Paths on buildings works, but its finicky. You will have to test a lot.

Collision boxing is also a bit odd. It's not the same for everyone so it has something to do with the relationship of creature parts and particular shapes. It can also be influenced by processor performance. Slower or busier processors will cause more clipping issues. I figure this due to the fact that some people have a ton of clipping issues where others do not on the same objects.

Because of the way collision detection and avoidance works, the ai can't transition well or at all onto objects. They either must be on them or off them. The Ai also gets confused (little ? over their head) if the plane they are standing on is too close to the ground plane. There seems to be a minimum distance the surface they stand on needs to be from the ground, in order to avoid problems.

So you can build a mission in a "space ship" or building or what have you but it will take quite a bit of tweaking to get it to work. Large open space works better than narrow corridors and such.

Personally I think its all a little to finicky to rely on solely and this information should just be used to create some accents to your adventures.
DVDMaster


Civilized Sporeon

Joined: 05/12/2009 22:00:32
Messages: 2139
Offline

Khorzho wrote:Nice work! This explains why AI behavior seemed unpredictable. It's just is a little unintuitive.

But I think this video shows one other problem which is much more relevant and game-damaging, and probably related to the Line of Sight behavior you've catalogued.

At the end, when you Jet Pack up to the top of the Yellow block. Your avatar lands on the edge of it.

Your left foot is angled and flush with the slope of the building, and looks as you'd expect.

However... your right foot is sunken into the top of the building. It SHOULD be flush with it.

This demonstrates poor collision detection and/or clipping plane computation. This is a big issue for this game right now, and we've gotten zero response from Maxis on it so far.


I've seen the problem too. It does seem that the coordinates of the skin do not mesh with the coordinates of the blocking volume used for collision detection. In general, it seems that the problem escalates when you scale up the object. I didn't scale up the object in my demo, but buildings are naturally bigger than other props. The places where I have an issue with this is when items are dropped and they sink below the skin to that they are invisible or when NPCs walk entirely into walls. As for feet sinking into the floor, it is more a visual annoyance for me.

I don't mind simple visual bugs. I'm old enough to have played some really crude graphic games (I'm 41 years old).

It is a tough design decision. Which is worse, having characters sink into the object or have them float above? From an aesthetics point of view, sinking in is better?

My bigger issue with collision detection is that fast moving objects (like my captain with speed 5, jump 4, glide 4) can move so fast that the collision against the blocking volume on the surface nearest the captain is missed and you collide with the blocking volume on the far side of the object. The net result is that you are now trapped INSIDE the object.


[WWW]
Vilageidiotx


Spacefaring Sporeling

Joined: 12/09/2008 22:22:38
Messages: 9513
Location:
Location Location

Offline

This would explain why I haven't really suffered from this problem; I make each part of rooms and the like seperatly.

Vilageidiotx is a they!

[WWW] aim icon [ICQ]
 
Forum Index » Spore Galactic Adventures
Go to:   
 
Powered by JForum 2.1.8 © ( EA Dev Build 2016-08-15 15:16:49 ) JForum Team