onsdag 14 mars 2018

Acceleration and Debug

Today and yesterday, I worked on some implementations regarding the movement behavior of the agents.

  1. Animation bug.
  2. Implemented acceleration / deceleration.
  3. Implemented debug visuals for agents. 
  4. New counting system
  5. Redesigned the scene.

First of I fixed an Animation bug where the agents wound loop their walking animation slowly even though the actual walking speed was pretty high.

I implemented acceleration / acceleration for the agents, which makes the agents interpolate their velocity from their current velocity to the preferred velocity. They do this by using acceleration and deceleration float values between 0 and 1; 0 making the transition non extant, and 1 making it instant. This is how it looks:



The agents cannot see the wall as of this moment, but we are discussing if we should implement a behavior that lets agents avoid that as well. Also implemented is the ability for agents to enable and disable avoidance to the sides, in the video above this is enabled.


Also implemented is debug lines to the agents which makes them show their current velocity as well as the preferred velocity, the continuum velocity, as well as the collision avoidance velocity.

Shown bellow is how it looks on an agent when in the scene view:









 The white line is the current velocity, the green one is  the preferred velocity, the blue one the continuum velocity, and finally the red one which is the collision avoidance velocity.













Here it is in action:



The counter also has been modified so that it counts up when agents pass the door node. This will enable the clock to stop exactly when all agents have passed the door.

The scene was modified so that the agents can not see the exit from their spawn point, this is to avoid a bug where agents will walk into a wall towards the goal forever:



onsdag 7 mars 2018

Minimal Requirements

Today most of the things that was considered the minimal requirements for the project has been implemented.

All fixes and implementations will be shown and discussed bellow. A quick summary of the new implementations and fixes would be:

  • Created a new scene, A room with a single exit door and a togglable obstacle.
  • Fixed the collision distance of the agents.
  • Changed the "uncompressible" collider of the agents from a box to a smaller sphere.
  • New script that stops the spawning of agents after a specified amount has spawned.
  • Finished implementations of the timer mentioned in previous post.
  • Added a generic movement script to the camera.

The new scene consists of a room with a single exit door, made to emulate the real scenarios presented to us in examples found in papers and videos. It looks like this:
















The 4 dots to the right are the spawn points, and the dot to the left is the exit point. As seen in the picture, there is a wall with a doorway in middle between the spawn points and the exit point.
In this scene an obstacle can be toggled which looks like this when activated:




















Before today's changes, all agents had a collision box acting like a "closest proximity" for other agents. With this update, all boxes have been changed to a sphere:





















(before to the left, after to the right).

What this change does is allowing the agents to get closer together, which is a better representation of people in a evacuation scenario:


















Also implemented is a new script that stops the spawning of agents after a specified amount has spawned, shown in the image directly above is an example of a test using 400 agents. This allows us to test using the same amount of people as in real life scenarios.

All spawn points have been set to spawn agents very quickly, to reach the specified amount necessary as fast as possible. The agents spawn in this scene from 4 nodes, which each spawns 100 agents a second, making the agent spawn frequency 400 agents/s



















The timer script shown in the previous update has been implemented completely as of this update. The timer stops by itself after all spawned agents reaches the exit point:



The final implementation today was a generic movement script that is applied to the camera object. This allows us to control the camera while the simulation is running if we want to focus on a specific detail or area without having to move the camera "manually".



Here's a final picture showing the agents moving around the obstacle:


torsdag 1 mars 2018

First implementations

Me and Alvaro worked a lot on the kex project today.

I made a script that counts the time from start and shows it in a UI. The UI also shows the number of agents in the scene, the number of agents that have exited and the number of agents that are left:


As soon as all agents leave, the timer stops by itself, and the time turns red to indicate that it stopped:


Alvaro did some testing and research on the crowd simulator that Jack Shabo made. We found some interesting improvements and tweaks that could be made to the simulator. By lowering the size of the  box-collider on the agents, all agents were able to become a lot more compressed together. And also, by changing the interpolation setting on the agent's rigidbodies from "none" to "interpolate" the crowd behaved more realistic when they were packed together.

We want to try changing the colider on the agents from a box-collider to a shpere-collider. Hopefully the people could move more easily against each other and avoid being stuck on a collider-box edge.

Alvaro took the subway scene and removed all obstacles to make a more cleaned up environment for the agents to move in. He set all spawners so that all agents have to move to the same end location. He also created two walls that together make a small gap that the agents have to move through, making a "bottle neck".

This was the scene before (with some added walls):


And this is after, with some agents:

Start of First Iteration

Today we'll start working with the first iteration. We are a little bit behind compared to our schedule, but we'll do our best to catch up. Our goal for today will be to try and create a scene in Unity where we spawn multiple agents and have them walking towards an exit. I (Alvaro) will create this scene and Tom will work on implementing a timer that is visible from the camera.

Acceleration and Debug

Today and yesterday, I worked on some implementations regarding the movement behavior of the agents. Animation bug. Implemented accelera...