top of page

Devil's Punishment

We are an international remote team of 12 people working on this game, out of which 3 are programmers including me.

The key features which I have worked on are :

  • Random Map Generation

  • Interacting feature of laser and elevator and brightness slider

  • In charge of merging all the git branches

1. Random Map Generation

  • The random map generation was written by me starting from scratch. The basic overview is given below

  • Showcasing the slowed-down Random Map Generation for the game we are working on, Devil's Punishment

  • This means that each time a player restarts the match or start a new sessions he/she will be playing an entirely new map

  • The main elements of the map generation are :

    • ​Grid layout & room spawn

    • Connecting two rooms with suitable corridors

    • Check for collisions

    • Connected components

  • These elements are explained after the demo videos (click here to go to the explanation)

Videos

Explanation

a. Grid layout & room spawn

  • The map is laid out in an imaginary grid with cells of size of the largest room

  • Space is left between the rooms for the corridors to be spawned in

  • Next the predetermined number of rooms are spawned randomly in these cells

  • Advantages :

  • Disadvantages :

    • This approach may be changed once new rooms are introduced and the difference between the size of the largest and smallest room increases, leading to longer hallways

Connecting two rooms

b. Connecting two rooms

​

  • Choosing the right corridor near the doors

  • Other indexing techniques(fill later)

  • There are several types of corridors, X, T, L and I corridors. Each of these have variations depending on the position of the overhead​ pipes​ (pics are given below)

Types of corridors

1.

Corridor_I.PNG
Corridor_I_2.PNG

​"I" shaped corridor 

Types of corridors

1.

Corridor_L_1.PNG
Corridor_L_1(2).PNG

​"L" shaped corridor Variation 1

Types of corridors

1.

Corridor_L_Wor.PNG
Corridor_L_Wor(2).PNG

​"L" shaped corridor Variation 2

Types of corridors

1.

Corridor_L_3.PNG
Corridor_L_3(2).PNG

​"L" shaped corridor Variation 3

Types of corridors

1.

Corridor_T.PNG
Corridor_T(2).PNG

​"T" shaped corridor 

Types of corridors

1.

Corridor_X.PNG
Corridor_X(2).PNG

​"X" shaped corridor 

Types of corridors

MapGen1.PNG

Here we see that the black circle represent the doors to be connected

Here we can see that the doors have been connected by appropriate corridors shown by the black rectangle

MapGen2.PNG

Types of corridors

c. Connected components

  • After the pairs of rooms are connected, we check for disconnected components and connect them. Disconnected components indicate groups of rooms which are connected to each other but isn't connected to the other rooms and the main map, hence disconnected.

  • For example, in the first screenshot below you can see that the rooms in the red box is one connected component (since there are connected to each other and from one room you can reach all other room). And the rooms in the blue polygon are another component. These two components are connected through a few functions. (IEnumerators in Unity C#)

  • This concept of connected components can be related to graphs in data structures and algorithms.

screen_5120x3840_2019-11-17_20-40-00-wit
screen_5120x3840_2019-11-17_20-40-57.png
screen_5120x3840_2019-11-17_20-43-01.png

d. Check for collisions

  • After all rooms are connected, we check for collisions among corridors, meaning we check for more than one corridor in a particular position. 

  • This is done by using trigger colliders as collision detectors

  • The collided corridors are added to a list which is then worked on by a few functions which remove the wrong corridors and spawn the correct corridor for a given collision (give collision pic)

corridor_collision_2.PNG
corridor_collision_2.PNG
corridor_collision_2_after_script.PNG
corridor_collision_2_after_script.PNG

The pictures on the left shows the state of the junction before running the function, and the ones on the right show the state of the junction after the functions does its job. The wrong L corridors in the junction are removed and the correct T corridor is placed.

Pictures

Project Gallery

< Previous Project
Next Project >

Ignacio Gómez, CEO of Versefera Studios

​Joel's work in the team with the random map generation system was a crucial part of our game development. He was consistent, responsible and committed to our project. Any challenge he faced while working with us was overcame by himself with little help from other team members. I'd highly recommend his services to anyone that's looking to finish something, programming-wise.

Testimonials

bottom of page