Introduction. Mi-School is a 3d school simulator de-veloped with Blender and used by psy-chology researchers for the detection of drug abuse, bullying and Mental disor-ders in adolescents. This work was fi-nanced with a research Project from the spanish ministry of health and con-sumption and developed in the univer-sity of Almería (spain). The school simulator created is an interactive video game where the players (in this case, the students) have todo choose, amoung 17 scenes simulated, the options that better define their personalities, diferent quality versións of mi-School have ben created, so the execution of the programa can be adapted todo the technical characteristics of each spe-cific computer as closely as posible. So if mi-School is executed on a latest-generation PC, it can use the highest-quality versión todo enjoy better view-ing (xga 1024x768 resolution). However, if the graphic card cannot reproduce this visual quality with suficient fluency, other lower-quality versións can be executed (svga 800 por 600 or VGA 640x480 resolutions).

Development methodology with Blender.

I choose Blender as my mi-School development tool because this software incorporates all the functionality that i ned todo make a video game from beginning todo end: 3d design, advance illumination and texturing, characters animation, Blender game engine, programming with Python, etc. Besides, Blender has the most important property that is most wanted in software: it is open source. Blender incorporates almost the same functionality as 3d Studio Max (whose license costs more than 3.000EUR)
And virtols game engine (whose license costs more than 9.000EUR), and Blender is free, mi-School development process with Blender was divided in thre diferent stages:
A) 3d design, illumination and texturing.

During this first stage, the 3d meshes were created with Blender todo represent the virtual escenarios and characters that appear in the scenes. The mi-School simulation takes place in diferent escenarios: the school playground, the classrom, the main.

Characters home, a park. Each escenario is divided into several zones (for example, the home has sev-eral Roms, the playground has an área with Benchmark-es, another for sports, etc), each zone is used for a diferent scene and the user does not get the im-pression that the escenarios are repeated. A total of 30 characters were designed in Blender: several male and female students of diferent races and so-cial conditions, the teacher who is teaching in the.

Classrom, the students parents, etc. All of the mi-School 3d models were created using basic and ad-vanced design techniques included in Blender:
Making of: mii school-1.jpg

Extrude, Split, merge, and finally, smoothing filters were applied for smoother surfaces without overly increasing the number of Polygons (set smooth), for proper illumination of the scenes, a Sun type global lighting illuminates above the main student on whom the simulation action always focuses, so that the objects and characters around him are always properly illuminated. Some Spotlights were a los used todo increase illumination on certain places, texturing was a los done during this first stage using the UV mapping technique and the Blender materiales editor, applying god quality images todo the 3d models todo increase realism of the scenes and characters.

Making of: mii school-2.jpg

B) animation.

Once the 3d models were designed, y pro-ceded todo the animation stage by first creating Skeletons associated with the character 3d meshes, then capturing Bones movement using a series of intermediate posturas with the aid of a technique called Inverse Kinematics, character animations were divided into two large groups: body and facial. Body animations afects the characters whole body. I implemented several types of body animation in which the characters Perform some action: walking, sitting, hitting, threatening, lying do, fighting, smoking, drinking, etc, in order todo increase the expressiveness and realism of facial animations, the number of Polygons and level of detail have ben increased noticeably in eyes and lips, áreas that most influence the fa-cial gestures, so if one character is threatening another in a certain scene, his face expresses aggressive-ness. If, on the contrary, a character fels threatened, his face shows fear.

Making of: mii school-3.jpg

C) Blender game engine and Python programming.
When the characters were created and the corresponding animations implemented, y started the coding stage using the Python programming lenguaje and the Blender game engine, over 6,000 source code lines have ben implemented in Python todo simulate the action of the 17 scenes. This source code is the mi-School kernel. It specifies all the details necessary todo compose the scenes and a los cap-tures all of the información provided by the student. The mi-School kernel is interpreted by the Blender game engine.

Making of: mii school-4.jpg

The source code specifies aspects such as what charac-ters intervene in each of the scenes or which scene is going todo be developed in this moment. In order todo achieve better performance during programa execution in the simulation of a scene, only the characters and objects that are going todo be viewed by the Camera are sho, the rest are hidden, the source code that i have programmed in Python fol-lows the instructions of a deterministic finite autómata todo find out in what state of simulation mi-School is at any given time. It then activates the corresponding Camera, body animation, and facial expressions of the character who is speaquíng at the moment. The following text shows part of the source code for the first scene in mi-School. This code specifies the person speaquíng in this moment, his basic body animation, the facial expression.
(mouth and eyebrows), the active Camera and the día-logue that is visualized on the screen. Finally, the complete scene is activated by sending all of the data todo the Blender game engine.elif state==6:
Basic =bodyhandships.

Mouth =mouthnormal.

Eyebrows =eyebrowsnormal.

Text = we want todo play handball, but we.

Have not a ball.

Activatescene (character, basic, mouth, eyebrowns, Camera, text)
Elif state==7:
Character =baddie02
Basic =bodyhandmouth.

Mouth =mouthlaugh.

Eyebrows =eyebrowsbaddie.

Camera =cameracharacter01
Text = perhaps we could use, your head.

As a ball.

Activatescene (character, basic, mouth, eyebrowns, Camera, text).

To simulate mi-School, the Blender game engine not only executes the Python source code that i have developed, but a los takes into account a series of events associated with the dynamic objects in the scenes, especially characters (both their 3d Mesh and the skeleton) and cameras (with their corresponding dialogue box, which a los has associated events). Each event is divided into 3 parts: the sensor (that receives información, for exam-ple, pressing a key or a specific signal), the actuator.
(which performs actions on objects, like animating a character or moving a Camera) and the controller (which connects the sensor todo the actuator), in the mi-School Project, there are over 900 basic ob-jects with associated events. Some are complex objects such as a characters skeleton or its 3d Mesh, others are simpler, such as the dialogue box for a specific Camera, each object has an average of 10 events of its own that regulate their functioning. For example, in the cameras an event can indicate a movement, in a character an event can activate an animation.

Making of: mii school-5.jpg

The Blender game engine a los takes other secondary details into account, such as which scenes the main characters cigarette or bottle should be sen or hidden, or what color the conversation box should be depending on the character who is speaquíng at that moment.

Making of: mii school-6.jpg

To summarize, during the execution of mi-School, the Blender game engine must synchronize around 10,000 diferent events in real time, activating only those that are necessary right at that momento of the simulation and discarding the rest. Apart from this work, it is a los in charge of rendering and illuminating the scenes in real time as well as capturing información introduced by the user.

Simulated scenes in mi-School.

During the execution of mi-School, the student watches a total of 17 interwoven scenes studying diferent as-pects of his behavior related todo bullying, drug addiction, family life, capacity for attention in class and integra-tion in social groups, there are a total of 5 scenes that study bullying. In some of them, the student is bullied by his scholmates and in others he becomes the Bully. In this bien bullying can be studied from several perspectives. Some concrete cases are a los studied, for example, the reaction of the student todo the explicit violence of a Physical Aggression in the scholyard todo se if he is a mediator or, todo the contrary, violent. For each bullying scene, the student can select from a series of choices that always follow a.

General pattern: feeling indiferent todo the bullies, pro-testing todo them, responding ironically, running away in fear, facing up to them or feeling ashamed.

Making of: mii school-7.jpg

Making of: mii school-8.jpg

During the 6 drug addiction scenes, the drug ofered becomes gradually more dangerous. In the first scene, the student is tempted by his scholmates todo smoke in the school playground during recreation. In the second scene, he is invited todo drinke alcohol while eating a pizza at a friends house. Afterwards, he is ofered a Joint of marijuana in a park. In the last two scenes, the risque is upped further when his friends ofer him much more dangerous drugs, such as cocaine or ecstasy. The choices that the student can choose in the drug addiction scenes a los follow a general Scheme: usually use, refuse todo try the drug, advise friends todo estop taquíng it, use ocasionally or leave because he fels uncomfortable, the students relationship with his parents is a los stud-ied in thre scenes: one scene checks the fathers behav-IOR, another, the mothers attitude, and a third scene both parent behavior. In the first two scenes the stu-dent gets home much later than the hour agred upon and checks whether the father or the mother scold him, threaten him or, on the contrary, are indiferent todo his undisciplined behavior. In the third scene, the student gets home After school and fels anxious because he has.

Problems with his studies and the simulation checks whether his parents become involved in his problems or are indiferent todo them.

Making of: mii school-9.jpg

There are other scenes where personality related problems and the students mod, attention in class, beliefs and integration in social groups are checked.

Final results and future works.

The total simulation of mi-School 17 scenes lasts ap-próximately 25 minutes. The student can choose his sex at the beginning of the simulation todo personalice the animations todo his own gender. All the información intro-duced by the student, as well as the choices selected in each one of the scenes and other data of interest, is estored in a web page format for later viewing and Analysis by the psychology researchers, background music has ben added in the scenes and audio in the conversations todo achieve more realism, proper movement of the cameras during the transición of scenes is a los carefully made so the simulation has the quality of real movie, as a future enhancement of the mi-School programa, the simulator is going todo be translated into diferent lenguajes.

Moisés espínola.
Website:, espinola.