czwartek, 23 lipca 2015

#Stencyl: Zerg terrain infection

Difficulty: (6.5/10)
Estimated time of work: 12 hours
(Together with matrix behavior)


Original request:



Video of finished project:


Download


Instruction to project:
  • Press E to choose Base building 
  • Press R to choose Egg  building
  • Click on map with building chosen to place it on map. If you heard beep sound that means you are trying to put the building over existing one => game does not allow it.
  • Press D to cancel the choice of building
  • Press A to perform single infection-step
  • Press F to allow auto infection
  • Press S to reload scene (start from empty)

Problem overview

In some RTS games after you place building it will infect ground around it. In some cases it influences gameplay, other times it's pure graphical gimmick.

This project will be using grid of tiles logic. So while mouse can move normally buildings can only be build on tiles.

Zerg buildings in Starcraft II with infected ground around them

 Disciples II showing ground infected by different factions: Damned Legion(red) and Undead Hordes(grey)

Top view RTS with grid of tiles visible

Project in bullets

What we want:
  • Choose from 2 types of building (for variety)
  • Chosen building follows the mouse in grid-system
  • On-click if there is a place on map we place the chosen building on map, otherwise we play beep sound so that player may know that they are trying to do something stupid
  • Placed building infects area around it
  • On keyboard key pressed already infected area spreads to surrounding tiles in 4 way fashion (top, down, left, right)
  • Infected tiles changes animation based on its surroundings
  • We want to let infection to spread on its own ass time progress as well without being forced to press keyboard key

Problems to be solve:
  • How do we make building follow the mouse?
  • How to snap building to grid?
  • How to check if there is place for building about to build?
  • Algorithm for spreading the infected tiles
  • Algorithm for changing animation of infected tile

Project review
While concepts of project isn't really difficult the implementation gives plenty of chances to make mistakes along the way.

Project uses matrix implemented in <matrix behavior>. This are 2D lists limited in x direction and unlimited in y direction. For more info on <matrix behavior> follow the link:

Tutorial has been divided into 4 parts:

Tags
Stencyl, Zerg, Starcraft, tile, grid, RTS, infect, infection, disease, spreading, building, placing



Brak komentarzy:

Prześlij komentarz