General information


Subject type: Mandatory

Coordinator: Juan José Pons López

Trimester: First term

Credits: 4

Teaching staff: 

Marco Antonio Rodríguez Fernández

Academic year: 2025

Teaching course: 2

Languages ​​of instruction


  • Catalan
  • Spanish

The subject's classes will be held mainly in Catalan, although the bibliography, documentation and supporting materials will mostly be in English.

Competencies / Learning Outcomes


Specific skills
  • E7. Develop video games in interpreted languages ​​to prototype gameplay, user experience and balance.

General competencies
  • G3. Gather and interpret relevant data (usually within their area of ​​study) to make judgments that include reflection on relevant social, scientific, or ethical issues.

  • G5. Develop the learning skills needed to undertake further studies with a high degree of autonomy.

Transversal competences
  • T2. Work as a member of an interdisciplinary team either as an additional member or performing management tasks in order to contribute to developing projects with pragmatism and a sense of responsibility, making commitments and taking into account available resources.

Presentation of the subject


Interpreted languages ​​are widely used as a resource in application and video game programming, due to their great flexibility, versatility, simplicity and efficiency. When integrated into more complex compiled applications, they provide valuable tools such as real-time interactive development, execution and debugging, saving resources and compilation time in the main application (or engine).
In this course we will introduce one of the most widely used interpreted languages ​​currently in the video game industry: Lua (www.lua.org).
As this is a second-year subject (where three previous programming subjects have already been taken), it is assumed that the student has adequate knowledge of the fundamentals of programming, object-oriented programming and programming applied to video games. In this sense, it is worth noting that a brief introduction to the language and its particular characteristics will be given, in order to quickly focus on the applications of programming through scripting in game environments. It is highly recommended that the student has satisfactorily completed the contents of the previous programming subjects, in order to be able to follow the subject normally.

The classroom (physical or virtual) is a safe space, free from sexist, racist, homophobic, transphobic and discriminatory attitudes, whether towards students or teachers. We trust that together we can create a safe space where we can make mistakes and learn without having to suffer the prejudices of others.

 

Contents


1.- Introduction to interpreted languages
1.1.- Paradigms and classification of programming languages
1.2.- Compiled languages ​​vs interpreted languages
1.3.- Basic concepts about interpreted languages
2.- Programming with Lua
2.1.- Basic characteristics
2.2.- Common uses
2.3.- Interpreter / IDE
2.4.- Modes of development
2.5.- Chunks and blocks
2.6.- Grammatical rules
2.7.- Unwritten rules and programming style
2.8.- Local variables and global variables
2.9.- Common operators (arithmetic, relational and logical)
2.10.- Specific operators (concatenation and size)
2.11.- Table builders
2.12.- Multiple return
2.13.- Higher order functions
2.14.- Variable arguments
2.15.- Metatables and metamethods
2.16.- Simulation of object-oriented programming
3.- Graphic programming with the Love2d engine
3.1.- Events
3.2.- Graphic programming and game loop
3.3.- Finite state machines (FSM)
4.- Application of scripting to game environments: Modding
4.1.- Data files (csv, xml, json).
4.2.- Game configuration files.
4.3.- Integration in applications and game engines
4.4.- Structural analysis of a commercial game.
4.5.- Use of Lua and Xml, for the generation of mods.
5.- Application of scripting to game environments: Lua embedding in the Unity3d engine
5.1.- Integration of a Lua interpreter as an asset.
5.2.- Loading at runtime.
5.3.- Interaction with Unity3d objects

Activities and evaluation system


The grade of each student will be calculated following the following percentages:
A1. Exercise in class: Tables with Lua 1.8%
A2. Class exercise: Barcode Fighters 1.8%
A3. Exercise in class: Sprites with Lua2 1.8%
A4. Exercise in class: Luathon 2.8%
A5. Exercise at home: Modding with Lua 1.8%
A6. Laboratory practice: Introductory session with Lua's interpreter 5%
A7. Laboratory practice: Programming a game with Love2d 12%
A8. Laboratory practice: Programming a structured game with Love 12%
A9. Laboratory practice: Integration of scripting in Lua with a game performed on a 11% graphics engine
A10. Final Exam 50%
Final grade = A1 0,018 + A2 0,018 + A3 0,018 + A4 0,028 + A5 0,018 + A7 0,05 + A8 0,12 + A9 0,12 + A10 0,11 + A10 0,5

Considerations:

  • It is necessary to obtain a mark higher than 5 in the final exam to be able to pass the subject.
  • An activity not delivered or delivered late and without justification counts as a 0.
  • It is the student's responsibility to avoid plagiarism in all its forms. In the event of detecting plagiarism, regardless of its extent, in any
  • activity will correspond to having a grade of 0. In addition, the teacher will communicate the situation to the head of studies so that applicable measures can be taken.
  • in terms of the sanctioning regime.
  • Attendance at laboratory practices is mandatory.
  • The retake exam only recovers the theory note.
  • Given the fundamental nature of this subject, the student is required not only to provide solutions to certain problems, but also to be able to generate them autonomously, without any external help. For this reason, the use of generative artificial intelligences (IAG) to resolve the problems posed in the subject —whether in exercises, practices or tests— is counterproductive, is strictly prohibited and will be considered a case of plagiarism fraud. In this sense, the use of IAG to generate programming code is not allowed, not even in the form of fragments, even if this code is subsequently modified or customized.

Any form of academic fraud will be sanctioned in accordance with the center's assessment regulations. If signs of fraud are detected, including the improper use of generative artificial intelligence tools, the subject's teaching staff may call the student for an individual interview with the aim of verifying their authorship.

Bibliography


Basic

Ierusalimschy, R., De Figueiredo, LH, & Celes, W. (2006). Lua 5.1 reference manual. moon org.

W3Schools. (n.d.). XML tutorial. Retrieved from https://www.w3schools.com/xml/default.asp

Complementary

Paxton, D. (2013) Modder's guide to Civ5