Tuesday, November 27, 2012

Games Style Modelling - 2

So, moving on from yesterday, I came in tonight and modelled a game level. I mainly concentrated on keeping the model low-poly while still adding some interesting detail into the level. I did a rough render of the level adding some basic moody lighting. This is the result:

Game level with a rough lighting pass

Of course I haven't added any textures to it, so it doesn't look like much at the moment.

The layout of the level is shown here. It has around 69000 polys. which, I think, can be handled by a game engine reasonably well.

The level - bird's eye view

The majority of the level was built by reusing a section. However, the crossing gave me a good chance to break the symmetry and push the design.

Some unique detail added to the crossing

The level is based on a lot of tiling. This is the basic geometry I built for the system and then just adjusted it to various situations.

The basic section

This shows how the basic section was used repeatedly to create the whole level.

The straight sections

The curved sections at the extremes also helped at some interest to the level. More variation can be added by using textures and various other maps.

The curved section

Pipes passing over the crossing gave me some opportunities to add interest.

Some detail on the roof
So that was about it. I might take this on and texture it, but honestly I don't see myself making that effort, especially because this is done using a tutorial and is not my design. I guess I learned as much  wanted form it and I would leave it here now. Tomorrow I go on to model some destruction.

Monday, November 26, 2012

Games Style Modelling - 1

So, I am now researching for this Sony Games project that I have. I started off my going through a few forums and a few tutorials to get a basic understanding of the general conventions of modelling for the games industry. I would also be looking into environment design literature. However, there is not much available directly for games, but I guess stuff from film is equally relevant.

I have started doing a basic tutorial from Digital Tutors where they are talking about games modelling and texturing. This is work from the first day on it. The model here is around 20000 polygons and I still need to add a few things like props, wires, bevels and some other bits and bobs.

Here are some snapshots:

The Cryo-chambers

Detail on the lab-door and the recovery room in the background

The intake wires and the ceiling

Interior of the capsule

Friday, November 23, 2012

Crowd Simulation - Getting Started

Well I am not an expert on crowd simulation, but I have been reading up a lot over the past few weeks. Here I am presenting a list of key readings for someone who wants to get started with it. My main area of interest is behavioral animation so this reading list is geared more towards that.

1. Crowd Simulation by Daniel Thalmann and Soraia Raupp Musse.
I think this is the key text if you wanted to get started with crowd sims. It is like a huge survey paper of what is going on in the field. It is a bit dated now and doesn't include the research from the last 4-5 years, but still is a great starting point.

2. Flocks, Herd and Schools: A Distributed Behavioral Model by Criag Reynolds.
This is where it all started for behavioral animation. The model presented here, however simple, is still very relevant and effective. This is a must read for someone looking to get down and dirty with crowd-sims. Reynold's model works on a premise that if we simulate relatively simple individuals effectively, group behavior will automatically surface. He was able to demonstrate his theory very effectively in the artifact he created.

3. Artiļ¬cial Fishes: Physics, Locomotion, Perception, Behavior by Tu and Terzopoulos 
The model presented by these researchers is based on the same basic premise as Reynolds. However, this is a much more complex and evolved model. The fish in their model have internal states like hunger, libido etc and also some 'habit parameters'. On a second level they have evolved behavior like hunting, mating and schooling. On another level the fish have sensing capabilities and could sense things like temperature for example.

To make this model work there is an algorithm that generates intentions based on internal states and environment variables and produces an output. This output is then passed down to the behavior routines engine and this specify what lower level actions to perform to fulfill the intentions.

This reading is a bit dated but is still relevant as a lot of research in the field has branched out of here. It still remains a key reading for a beginner.

4. Hierarchical Model for Real Time Simulation of Virtual Human Crowds: 
Soraia Raupp Musse and Daniel Thalmann
This paper is a bit advanced and discusses a few more higher level concepts. The main aim of this paper is to come up with a real-time model of crowd simulation. The paper discusses two major points, Crowd Structures and Crowd Behaviours.

Crowds are structured in a hierarchical manner and has 3 levels: Crowd, Group and Individual. The parameters set at a higher level are inherited at the lower level. At the lower level, these parameters can be over-riden. So for example, if we make a crowd 'happy', we can have a group or an individual who is 'sad' and then this entity will behave in a different manner.

In this model, groups are the most complex entity. The individual agents share a decision process and all the information required for this process. The model allows for complex group behaviour like splitting or mutiny.

5. Group Behaviours for Systems with Significant Dynamics by Brogan and Hodgins
This paper mainly talks about something they call 'significant dynamics', i.e., the simulation of crowds where the dynamics of locomotion of the agents is complex enough to impact the behaviour.

The more relevant part of the paper is where they present the algorithm for group behaviour. They divide it into two parts: Perception and Placement. Perception allows the agent to sense the relative position and velocities of other agents and static objects. Placement works by computing a desired position of an entity. All the approaches actually use this higher level algorithm, however, the lower level implementation detail differs.

6. Crowd Simulation for Virtual Heritage: Branislav Ulicny and Daniel Thalmann
The concept presented in this very brief paper is very elegant, although a bit advanced for the beginner. This is a three level system.

On the topmost level there are rules which have two parts. The antecedent part defines which agents are allowed to use which rules and under what circumstances. The consequent part defines the effects of firing the rule which can be change in current agent behaviour, attributes or event triggering.

The current behaviour is performed at the intermediate level. Here every possible behaviour is implemented as a Finite State Machine(FSM)

On the bottom-most level we have algorithms for path planning and collision avoidance etc.

The reading list given above is in now way exhaustive, but will help someone new to crowd simulations to get a hang of what are the major issues and how are they generally handled. It would also help the reader get comfortable with the jargon. From here you can graduate on to newer ideas and more current research.


Wednesday, November 21, 2012

Building upon the Car agent

In the past few days I have taken the car agent and extended it's functionality a bit more now.

The extended functionality includes:

1. It has headlights and looks cool :p

2. The front and the back wheels turn according to the speed of the car. This is achieved by dividing the speed of the car by the circumference of the wheel given by the expression: 
(tz / (3.1415927 * wheel_radius)) * 360

3. The front wheels can now be steered.

4. The motion of the car is driven by the steering of the front wheel. This then decides how much is the car turning based on the steering. In theory now, the whole decision system needs to just interface with this steering module and it can decide where the car is going based on the environment.

Getting till here has been such a great struggle as Massive still keeps crashing. Also, none of the short-cut keys work. So, if I want to alt-connect something to drive the rate for example, I am not able to do that.

Will try to put up the videos of the system that I have created. I managed to do a capture, but it just doesn't work nicely. So still trying to figure that bit out. Here are some samples from what I did till now.

The brain of the Car agent at the current state of development
The wheel spin module
The steering module

The steering-turning module
Will try to get up a video ASAP.
If you are interested in discussing about Crowd Simulation, or Massive, just drop me a line :)

Sunday, November 18, 2012

Another day with Massive

Well.. It's getting better. It's not that Massive is behaving better now, it's just that I am getting used to it misbehaving.

It just has a very peculiar way of working, and has unintuitive work-flow. For example, if a node in your scene is not connected to anything and you delete it, you lose the whole network. So, if you want to delete a node, the way I figured out to delete it is that you first connect it to something and then delete it. It's still early days and I might be doing something completely foolish, but the software is just not natural to work with.

I would say it is a beautiful and elegant software design but it's poorly implemented.

OKAY. So with my rant out of the way. I got on with some tutorials and started making this car agent. At the moment, it can just drive around and you have to steer it manually and it can knock over traffic cones.

Here is the basic skeleton of the car agent. Once ready, this agent will be able to move and steer. There are also hubcaps on the wheels so the rotation of the wheels is visible.

Skeleton of the Car Agent to drive its behaviours
 I then went on and put up some blocks to define the car of the agent. In the end I think I will attach some better render geometry to it. These blocks are just for collision shapes for ODE-RBD.

Collision shapes attached to the skeleton for ODE-RBD
(Open Dynamics Engine Rigid Body Dynamics)
This is not really relevant to this post, but just found this screenshot on my machine. This is the Motion Tree of a human agent I am building at the moment. Will talk about in detail later.

Motion tree for an upcoming human agent
Keep watching this space as I would be updating my work on crowd simulation regularly(-ish). 

Massive - Meh

I decided that I am going to do some crowd simulation this year for various projects that I am involved in. The obvious first choice to look at was Massive, as it is talked about a lot and supposed to be good. I have had a few interactions with it, and I would have to say I am NOT very pleased. It crashes at every opportunity and is generally unstable. The UI is not at all intuitive and the 'undo' generally doesn't work. Also, the company is VERY uptight about academic licences.

I think it is a very elegant software design, but very sloppy implementation. Maybe the newer versions are better, but it's just impossible to get hold of them, so I don't really know. Did place a request for a PLE but they flatly refused.

Might be shifting to something like Golaem now or might try to build a AI network in Houdini.

Let's see how it goes.