11. Présentation – Dungeon of the Endless
Michaël BREYTON
Simon Perin
Associate producer
Pixel Artist
Arthur Prudent
Sébastien Dubois
Game Designer
Lead programmer
12. Présentation – Dungeon of the Endless
Game Design
Playtests
Implémentation
QA / VIP
Public
13. Présentation – Dungeon of the Endless
Début (avril 2013)
…
Early access Steam
(décembre 2013)
+ 1 update / 2 semaines
…
Bêta (??/??/2014)
…
Gold (??/??/2014) o/
Réf. : « Dungeon of the Endless - Steam » store.steampowered.com/app/249050
14. Meetup Unity 3D #5
Dungeon of the Endless
Présentation
Rendu
Génération
Conclusion
15. Rendu – Pixel Perfect
- Caméra :
- Type orthographique
- « orthographic size » = hauteur d’écran (pixels) / 2
- Textures :
-
Filtre « point »
Désactiver les mip maps
Compression RGBA 32 bit (« True color with alpha »)
Dimensions = puissance de 2
- Scaling :
- 1 pixel = 1 unité de distance
16. Rendu – Dynamic Lighting/Shadows
Eclairage dynamique => scène 3D
Scène 3D + Pixel perfect => angle de la caméra spécifique
cos(60°) = ½
sin(60°) = 0,866
=>
scale.y = 2
scale.z = 1,155
(1 / ½)
(1 / 0,866)
yx2
19. Rendu – Dynamic Lighting/Shadows
Caméra orthographique => Forward rendering
« Yes, it's an unfortunate performance choice we had to do - deferred does not
work with orthographic cameras. »
- Aras (Unity3D Lead Graphics Programmer)
Forward rendering => pas d’ombres dynamiques
« Forward Rendering supports one directional light with shadows »
- Unity3D Documentation
20. Rendu – Dynamic Lighting/Shadows
Solution #1 : tricher
-
Caméra perspective
Field of view proche de 0° (min = 1)
Caméra placée très loin de la scène (vraiment très loin)
« Far clipping » très élevé
Résultat :
-
80% pixel perfect (lignes verticales… ou pas)
Nombreux bugs graphiques (« erreurs de flottant »)
21. Rendu – Dynamic Lighting/Shadows
Solution #2 : forcer la main au shader
« fullforwardshadows - Support all shadow types in Forward rendering path »
- Unity3D Documentation
#pragma surface surf Lambert fullforwardshadows
Résultat :
-
99% pixel perfect (angle de caméra => « erreurs de flottant »)
22. Rendu – Transparence et z-index
Shader transparent => z-index aléatoire
« Using transparent objects in your game can be tricky, as there are traditional
graphical programming problems that can present sorting issues in your game »
- Unity3D Documentation
23. Rendu – Transparence et z-index
Solution #1 : render queue index
private void Awake()
{
// Transparent + 1
this.renderer.sharedMaterial.renderQueue = 3001;
}
Résultat :
-
Difficile à maintenir
Un material par index (plus de draw calls)
Insuffisant dans certains cas particuliers de level design
24. Rendu – Transparence et z-index
Solution #2 : utiliser les shaders cutout
« The graphical sorting problems normally associated with Transparent shaders do
not occur when using this shader »
- Unity3D Documentation
Résultat :
-
L’altitude (y) des objets est bien prise en compte
Impossible d’utiliser la semi-transparence dans les textures (dégradés 0 -> 1)
25. Rendu – Bump Mapping
+
=
Réf. : « Legend of Dungeon - Dynamic Lighting on Sprites » http://goo.gl/hpYQFd
27. Meetup Unity 3D #5
Dungeon of the Endless
Présentation
Rendu
Génération
Conclusion
28. Génération – Concept
Objectifs
- Infinité de combinaisons possibles
- « Maitriser l’aléatoire »
Génération semi-procédurale
- Design manuel « haut niveau »
- Concept générique = s’applique à tous les niveaux de détail (donjons, salles, props, etc)
- Extensible à volonté
29. Génération – Les données
Type = catégorie de contenu
Template
Ex : donjon, petite/grand salle, props pour mur/sol
> Type
> Tags[]
> Design graphique
> Design gameplay
> Slots[]
Template = contenu
Ex : contenu d’un donjon, contenu d’un petite salle
Peut contenir des slots!
Slot = emplacement clé
Ex : emplacement réservé à une petite salle dans un donjon
Tag = contrainte de génération
Ex : un slot taggé « niveau 1 » ne pourra être remplacé que par un
template taggé « niveau 1 »
Slot
> Type
> Tags[]
32. Génération – L’algorithme
// Tant qu’il y a des slots à remplacer
while (slots.Count > 0)
{
// Sortir un slot de la liste
slot = slots.GetRandom();
slots.Remove(slot);
// Piocher au hazard un template du même type respectant les contraintes (tags)
template = templates.GetRandomTemplateMatching(slot.type, slot.tags);
// Remplacer le slot par ce template
templateInstance = Instantiate(template, slot.position, slot.rotation);
Destroy(slot);
// Ajouter les (éventuels) slots contenus dans le template à la liste
slots.AddRange(templateInstance.Slots);
}
37. Meetup Unity 3D #5
Dungeon of the Endless
Présentation
Rendu
Génération
Conclusion
38. Conclusion – Unity3D
Unity3D
Excellent outil de prototypage
Idéal pour le développement itératif
Unity2D (4.3)
Sprite Editor -> utilisé pour le découpage de nos sprite sheets de décors
Animation de sprites -> solution in-house tant que les shaders « sprite » ne supporteront
pas le shadow casting