Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano.
http://www.facebook.com/polimigamecollective
https://twitter.com/@POLIMIGC
http://www.youtube.com/PierLucaLanzi
http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Introduzione alla realizzazione di videogiochi - MeccanichePier Luca Lanzi
Slide del corso "Introduzione alla realizzazione di videogiochi" tenuto per gli studenti delle scuole superiori presso la sede di Cremona del Politecnico di Milano.
Introduzione alla realizzazione di videogiochi - Game EnginePier Luca Lanzi
Slide del corso "Introduzione alla realizzazione di videogiochi" tenuto per gli studenti delle scuole superiori presso la sede di Cremona del Politecnico di Milano.
Introduzione alla realizzazione di videogiochi - FunPier Luca Lanzi
Slide del corso "Introduzione alla realizzazione di videogiochi" tenuto per gli studenti delle scuole superiori presso la sede di Cremona del Politecnico di Milano.
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Machine Learning and Data Mining: 04 Association Rule MiningPier Luca Lanzi
Course "Machine Learning and Data Mining" for the degree of Computer Engineering at the Politecnico di Milano. This lecture introduces association rule mining and the Apriori algorithm
Machine Learning and Data Mining: 02 Machine LearningPier Luca Lanzi
Course "Machine Learning and Data Mining" for the degree of Computer Engineering at the Politecnico di Milano. This lecture gives a very short introduction to the three main machine learning paradigms.
Machine Learning and Data Mining: 03 Data RepresentationPier Luca Lanzi
Course "Machine Learning and Data Mining" for the degree of Computer Engineering at the Politecnico di Milano. This lecture overviews the data representation issues in Data Mining.
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano.
http://www.facebook.com/polimigamecollective
https://twitter.com/@POLIMIGC
http://www.youtube.com/PierLucaLanzi
http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Procedural content generation dates back to the early 1980s when simple algorithmic procedures were applied to generate huge, possibly infinite, amount of game content with very limited resources. Nowadays, although the memory limitations are long forgotten, procedural content generation is still widely used both to reduce the design costs, to generate those immense scenarios which would be infeasible for human designers, and to inspire human designers. In this presentation, we show application of procedural content generation using Unity and discuss various tricks of the trade.
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano.
http://www.facebook.com/polimigamecollective
https://twitter.com/@POLIMIGC
http://www.youtube.com/PierLucaLanzi
http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Introduzione alla realizzazione di videogiochi - MeccanichePier Luca Lanzi
Slide del corso "Introduzione alla realizzazione di videogiochi" tenuto per gli studenti delle scuole superiori presso la sede di Cremona del Politecnico di Milano.
Introduzione alla realizzazione di videogiochi - Game EnginePier Luca Lanzi
Slide del corso "Introduzione alla realizzazione di videogiochi" tenuto per gli studenti delle scuole superiori presso la sede di Cremona del Politecnico di Milano.
Introduzione alla realizzazione di videogiochi - FunPier Luca Lanzi
Slide del corso "Introduzione alla realizzazione di videogiochi" tenuto per gli studenti delle scuole superiori presso la sede di Cremona del Politecnico di Milano.
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano. http://www.facebook.com/polimigamecollective https://twitter.com/@POLIMIGC http://www.youtube.com/PierLucaLanzi http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Machine Learning and Data Mining: 04 Association Rule MiningPier Luca Lanzi
Course "Machine Learning and Data Mining" for the degree of Computer Engineering at the Politecnico di Milano. This lecture introduces association rule mining and the Apriori algorithm
Machine Learning and Data Mining: 02 Machine LearningPier Luca Lanzi
Course "Machine Learning and Data Mining" for the degree of Computer Engineering at the Politecnico di Milano. This lecture gives a very short introduction to the three main machine learning paradigms.
Machine Learning and Data Mining: 03 Data RepresentationPier Luca Lanzi
Course "Machine Learning and Data Mining" for the degree of Computer Engineering at the Politecnico di Milano. This lecture overviews the data representation issues in Data Mining.
Video game design and programming course for the Master in Computer Engineering at the Politecnico di Milano.
http://www.facebook.com/polimigamecollective
https://twitter.com/@POLIMIGC
http://www.youtube.com/PierLucaLanzi
http://www.polimigamecollective.org
Politecnico di Milano, Videogiochi, Video Games, Computer Engineering, game design, game development, sviluppo videogiochi
Procedural content generation dates back to the early 1980s when simple algorithmic procedures were applied to generate huge, possibly infinite, amount of game content with very limited resources. Nowadays, although the memory limitations are long forgotten, procedural content generation is still widely used both to reduce the design costs, to generate those immense scenarios which would be infeasible for human designers, and to inspire human designers. In this presentation, we show application of procedural content generation using Unity and discuss various tricks of the trade.
Slides from the 2016/2017 edition of the Video game Design and Programming course at the Politecnico di Milano. More information at http://www.polimigamecollective.org Some of the video games developed by the students during the course are available at https://polimi-game-collective.itch.io
A talk from Toronto's FITC Spotlight on Hardware talk. I spoke about using tools like Openframeworks, OpenCV, and the Kinect to create Interactive Installations, and paired it with an interactive lighting installation.
References, citations, and source code can be found here: http://www.andrewlb.com/2013/06/sls-notes/
Computer Science CS Project Matrix CBSE Class 12th XII .pdfPranavAnil9
The following project is based on Matrices and Determinants. It is a menu based program with data file and SQL Connectivity. The program is capable of performing all the complex functions of matrices and determinants that are mentioned in the Class 12th Math’s book. The ‘Menu’ of the program upon which it executes is as follows:
1: Generate a Random Matrix
2: Addition
3: Subtraction
4: Multiplication by a Scalar
5: Multiplication by a Matrix
6: Calculate Determinant
7: Calculate Minor
8: Calculate Cofactor
9: Calculate Adjoint
10: Transpose
11: Inversion
In the present paper the authors introduced an algorithm for encrypting useful data at bit level. The
authors have used a new technique of introducing noise wave over the bit patterns of the plain text to encrypt it. Noise
has been defined as the complement of the present bit pattern. Certain window layers have been selected over the bit
patterns and noise wave has been made to propagate over those pattern in concentric circular fashion thus encrypting
the whole bit text present. Windows are picked up from the bit patterns randomly and noise wave is made to propagate
from any random position with a random intensity. Noise propagates inside the medium with decreased intensity as
one move farther from the source of noise using natural laws. The method has been applied on some standard text
and the output has been found to be totally unpredictable. The method can be used to encrypt OTP (One Time
Password) and other bank transactions.
[App devcon 18] Brace yourself with Android Architecture ComponentsMichelantonio Trizio
Writing robust Android apps can be challenging, Have you ever experienced complex lifecycle issues, unreliable mobile networks, and constrained device capabilities? These areas are very "touchy", because a little oversight can easily lead to memory leaks, crashing your app, drained batteries, and.. unhappy users. During last I/O, Google introduced new libraries for Android to allow developers to build stronger apps. This session will drive you with code examples to a new (and.. better..) Android app architectural approach, including an overview of functionalities that will make these problems dramatically easier to solve.
A comparison between Objective-C and an early beta version of Swift.
Presentation organised by iOS NSAgora, the iOS Developers Community of Iasi, Romania.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
DMTM Lecture 13 Representative based clusteringPier Luca Lanzi
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Slides for the 2016/2017 edition of the Data Mining and Text Mining Course at the Politecnico di Milano. The course is also part of the joint program with the University of Illinois at Chicago.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
1. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Content Generation with Unity
2. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
What is Procedural Content Generation?
Procedural Generation
with no or limited human intervention, algorithmically
of Content
of “things that affect the gameplay”, not non-player
character behavior, not the game engine
3. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
so what exactly is procedurally generated?
levels, tracks, maps, terrains, dungeons, puzzles,
buildings, trees, grass, fire, plots, descriptions,
scenarios, dialogues, quests, characters, rules,
boards, parameters, camera viewpoint, dynamics,
weapons, clothing, vehicles, personalities, etc.
4. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015http://en.wikipedia.org/wiki/Rogue_(video_game)#mediaviewer/File:Rogue_Screen_Shot_CAR.PNG
5. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
6. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
BBC Micro – 2 MHz MOS Technology 6502/6512
16-128 kB RAM 32-128 kB ROM
7. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015https://www.youtube.com/watch?v=ISR4ebdGlOk
8. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
9. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
10. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
what’s the basic principle?
11. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
f(x) = sin(x)
float y = 0f;
for (float x = 0f; x<6.28f; x+=.01f) {
y = Mathf.Sin(x);
}
12. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
What the ingredients?
domain knowledge
structured randomness
multi-layering
filters, limits & restrictions
specialized algorithms
artificial intelligence
gameplay integration
13. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Outline
geometry
textures
animations
dungeons
14. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Geometry
(Quads)
15. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
16. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
/// specify vertices
Vector3[] vertices = new Vector3[4];
vertices[0] = new Vector3(0.0f, 0.0f, 0.0f);
vertices[1] = new Vector3(0.0f, 0.0f, m_Length);
vertices[2] = new Vector3(m_Width, 0.0f, m_Length);
vertices[3] = new Vector3(m_Width, 0.0f, 0.0f);
/// specify 2 triangles
int[] indices = new int[6];
/// triangle 1
indices[0] = 0;
indices[1] = 1;
indices[2] = 2;
/// triangle 2
indices[3] = 0;
indices[4] = 2;
indices[5] = 3;
/// create the mesh
Mesh mesh = new Mesh();
mesh.vertices = vertices;
mesh.triangles = indices;
mesh.RecalculateBounds();
17. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
/// create the normals
Vector3[] normals = new Vector3[4];
normals[0] = Vector3.up;
normals[1] = Vector3.up;
normals[2] = Vector3.up;
normals[3] = Vector3.up;
mesh.normals = normals;
/// create the UV for the full texture
Vector2[] uv = new Vector2[4];
uv[0] = new Vector2(0.0f, 0.0f);
uv[1] = new Vector2(0.0f, 1.0f);
uv[2] = new Vector2(1.0f, 1.0f);
uv[3] = new Vector2(1.0f, 0.0f);
mesh.uv = uv;
/// create the UV for half texture
Vector2[] uv = new Vector2[4];
uv[0] = new Vector2(0.0f, 0.0f);
uv[1] = new Vector2(0.0f, 1.0f);
uv[2] = new Vector2(0.5f, 1.0f);
uv[3] = new Vector2(0.5f, 0.0f);
mesh.uv = uv;
18. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Geometry
(Polygons)
19. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
/// specify vertices
Vector3[] vertices = new Vector3[_no_sides];
float d = 2*Mathf.PI/no_sides;
for(int s=0; s<_no_sides; s++) {
vertices[s] = new Vector3(Mathf.Cos (-s*d), 0f,
Mathf.Sin (-s*d)) * _ray;
}
/// compute triangles no_sides-2 triangles, 3 indices each
int[] indices = new int[(_no_sides-2)*3];
for(int t=0; t<_no_sides-2; t++) {
indices[t*3] = t;
indices[t*3+1] = t+1;
indices[t*3+2] = vertices.Length-1;
}
/// ...
20. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Geometry
(Surfaces)
21. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
public class MeshBuilder
{
public List<Vector3> Vertices;
public List<Vector3> Normals;
public List<Vector2> UVs;
public void AddTriangle(int i0, int i1, int i2);
public Mesh CreateMesh()
}
MeshBuilder meshBuilder = new MeshBuilder();
//Set up the vertices and triangles:
meshBuilder.Vertices.Add(new Vector3(0.0f, 0.0f, 0.0f));
meshBuilder.UVs.Add(new Vector2(0.0f, 0.0f));
meshBuilder.Normals.Add(Vector3.up);
...
meshBuilder.AddTriangle(0, 1, 2);
meshBuilder.AddTriangle(0, 2, 3);
...
22. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
MeshBuilder meshBuilder = new MeshBuilder();
for (int i = 0; i < m_SegmentCount; i++)
{
float z = m_Length * i;
for (int j = 0; j < m_SegmentCount; j++)
{
float x = m_Width * j;
Vector3 offset =
new Vector3(x, Random.Range(0.0f, m_Height), z);
BuildQuad(meshBuilder, offset);
}
}
23. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
24. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Geometry
(Cubes, Cylinders, Flowers)
25. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
26. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
27. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
28. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Generation of Textures
29. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
structured noise
30. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
31. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
// Create the new texture
texture = new Texture2D(width, height, TextureFormat.RGBA32,
false);
// Assign it to the material
GetComponent<MeshRenderer>().material.mainTexture = texture;
// Generate the pixels
for (int y = 0; y < height; y++){
for (int x = 0; x < width; x++){
R = …
G = …
B = …
A = …
texture.SetPixel(x, y,
new Color (R, G, B, A));
}
}
// Apply the texture
texture.Apply();
32. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
// Noise pattern
noiseR =
SimplexNoise.noiseOctaves(nOctaves,xx*betaWR,yy,seed,frequenc
y);
// Alpha blending
valueR = (1-alphaR)+alphaR*noiseR;
// Sine pattern
valueR *= Mathf.Sin(noiseR*(sineX*x+sineY*y)*sineFrequency);
33. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Animations
34. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Procedural Animation
35. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Animation in Unity
Skinned mesh renderer
Transforms = Bones
36. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
// Get all children transforms
var bones = gameObject.GetComponentsInChildren<Transform>();
// Rotate them using a sine wave
foreach(var bone in bones)
{
// Create a sine wave
float angle = Mathf.Sin(t + phase)*amplitude;
// Assign rotation
Vector3 tmpRot = bone.localEulerAngles;
tmpRot.z = angle;
bone.localEulerAngles = tmpRot;
}
37. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Dungeon Generation
38. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Dungeon Generation
39. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
The Grid Map
40. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
// Mark the starting location
CellLocation currentLocation = starting_location;
map.MarkAsVisited(currentLocation);
// Pick a starting direction
Direction previousDirection = Direction.North;
// Repeat until all cells have been visited
while (!map.AllCellsVisited)
{
// Choose a direction
DirectionPicker directionPicker =
new DirectionPicker(map, currentLocation, directionChangeModifier,
previousDirection);
Direction direction = directionPicker.GetNextDirection(map, currentLocation);
// Check if we can go in that direction
if (direction != Direction.None)
{
// Create a corridor to the next cell and flag this cell as visited
previousLocations.Add(currentLocation);
previousDirection = direction;
currentLocation = map.CreateCorridor(currentLocation, direction);
map.FlagCellAsVisited(currentLocation);
} else {
// Backtrack
currentLocation = previousLocations[previousLocations.Count - 1];
previousLocations.RemoveAt(previousLocations.Count - 1);
}
Recursive Backtracking algorithm
41. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Virtual Map -> Physical Map
// Choose a prefab based on the cell type
GameObject prefab = behaviour.GetPrefab(cell_type);
// Instantiate the prefab at the given position
GameObject go = (GameObject)GameObject.Instantiate(prefab, new
Vector3(l.x*behaviour.tileSize,l.storey*(behaviour.wallHeight
+behaviour.storeySeparationHeight),l.y*behaviour.tileSize),
Quaternion.identity);
go.name = cell_type.ToString();
42. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
we can do it, so can you!
43. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
http://www.youtube.com/watch?v=uIUYWzdMXog
44. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015http://www.michelepirovano.com/portfolio_swordgenerator.php
45. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015http://www.michelepirovano.com/portfolio_swordgenerator.php
46. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
http://www.polimigamecollective.org
http://www.facebook.com/polimigamecollective
http://www.youtube.com/PierLucaLanzi
47. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
47
48. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
Ingredients #1 & #2
Domain Knowledge & Artificial Intelligence
• Domain Knowledge
§ To generate something you need to know it
§ PCG typically aims at building an artificial level
designer, usually needs domain knowledge
about level design
• Artificial Intelligence
§ Need algorithms that can work on complex
knowledge and generate plausible content
§ Search-based methods, L-systems, evolutionary
computation, fractals, cellular automata,
agent-based methods, planning, etc.
48
49. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
50. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
ingredient #3
structured randomness
things look like they have been randomly
generated but it is not completely at random!
51. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
f(x) = sin(x)
52. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
53. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
they both look like “noise”
but one of them feels like it has structure…
it is structured randomness
54. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
55. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
ingredient #4
multi-layering
typically more layers of procedural
content generation are applied in sequence
56. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
• Warzone 2100
§ Heights & Cliffs
§ Roads
§ Textures
§ Player Bases
§ Local Features
• Civilization 4
§ Fractal Heightfield
§ Plate Tectonics
§ Tile Types
§ Rivers and Lakes
§ Map Bonuses
57. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
ingredient #5
Filters, Limits & Restrictions
“In Civ3 I would say we even shipped with a sub-standard resource
placement algorithm where all the iron could be concentrated in just
a few small locations on the map, and for one player there may be
literally no way for them to build swordsmen.” – Soren Johnson
"With Civ4 we instituted randomness with limitations. There
always has to be a minimum distance between each element of
iron, or each element of horses, and that completely solved the
problem.” – Soren Johnson
58. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
ingredient #6
specialized algorithms
placing special items, requires special tricks
this tricks must be encoded in the PCG
59. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
1. Connect all bases, the resources,
pick three random points and
connect them
2. Apply a customize A* heuristic
and reuse roads!
3. Customize A* heuristic with
randomize cost of non-road
grid cells.
60. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015
ingredient #7
gameplay integration
Is it fun to play? Is the progression adequate?
61. Pier Luca Lanzi e Michele Pirovano – Codemotion Milan November 2015