Tutorial: 1st-person sneak in Unity 5, part 8

It is time to create a start menu for the game. For that, we need a scene. After creating the scene, rename the scene file to “start_screen” or something like that.

(Scroll down for the links to previous parts of this tutorial.)

Add the scene to the build settings (File->Build Settings…)

Make sure that start_screen scene is scene number zero (that scene will be loaded when the game starts).

Below in fig schematics of the start screen is shown. Arrows indicate state transitions triggered by button bushes.

State transitions and the buttons.

State transitions and the buttons.

To easily show the main screen and subscreens (OK to start new, Credits, OK to quit) we need canvases for each and script that set canvases active when they should be shown. That script should also handle the logics needed to start a new game or continue an already started game.

StartScreen.cs:

public class StartScreen : MonoBehaviour {

	// Canvases that contains all the screens
	// of the start menu
	public Canvas mainScreen;
	public Canvas creditsScreen;
	public Canvas confirmNewGameScreen;
	public Canvas confrimQuitScreen;

	// Info what is the name of level that should be loaded
	// with a new game selection
	public string nextLevel;

	private string currLevel;

	void Start () {
		currLevel = PlayerPrefs.GetString(PlayerLogic.CURRENT_LEVEL_KEY);	
		if (currLevel != "") {
			Debug.Log ("StartScreen.Start(): last completed level: " + currLevel);
		}
		if (nextLevel == "") {
			Debug.LogError ("StartScreen.Start(): Specify the level that for new game at " + name);		
		}
		MainScreenCb();
	}
	
	public void CreditsButtonCb() {
		mainScreen.gameObject.SetActive(false);
		creditsScreen.gameObject.SetActive(true);
	}
	
	public void MainScreenCb() {
		// we make sure that the main screen is shown and
		// subscreens are hidden.
		mainScreen.gameObject.SetActive(true);
		creditsScreen.gameObject.SetActive(false);
		confrimQuitScreen.gameObject.SetActive(false);
		confirmNewGameScreen.gameObject.SetActive(false);
	}
	
	
	public void ConfirmQuitCb() {
		// the player clicked the quit button. Now we hide 
		// the main screen and show confirm quit canvas
		mainScreen.gameObject.SetActive(false);
		confrimQuitScreen.gameObject.SetActive(true);
	}
	
	public void ConfirmNewGameCb() {
		// the player clicked the new button. Now we hide 
		// main screen and show confirm new game canvas
		mainScreen.gameObject.SetActive(false);
		confirmNewGameScreen.gameObject.SetActive(true);
	}

	public void QuitCb() {
		// the player clicked quit in confirm quit
		// exiting...
		Debug.Log ("StartScreen.QuitCb()");
		Application.Quit();
	}
	
	public void NewGameCb() {
		// The player confirmed a new game selection
		// Deleting a possible old save file
		// and creating new save information
		// and loading the first level after that
		Debug.Log ("StartScreen.NewGameCb()");
		mainScreen.gameObject.SetActive(false);
		PlayerLogic.DeleteSave();
		GameAgents.NewSGameSqn();
		Application.LoadLevel(nextLevel);
	}
	
	public void ContinueCb() {
		// The player clicked continue
		// loading the level based on save information
		mainScreen.gameObject.SetActive(false);
		Application.LoadLevel(currLevel);
	}
			
}

Add StartScreen script to an empty game object (and rename that game object as StartScreen).

After you have added Button and Text game objects under each canvas, you need to connect each button to the correct function in the StartScreen script.

To add function to a button,  I give an example about adding function call to the New Game button:

  • Select the button on the hierarchy view.
  • Scroll down on the Inspector view until you see On Click area under Button script component
  • Click +
  • Select StartScreen game object (click the small circle on the left-hand side, bottom row of the On Click area).
  • Select ConfirmNewGameCb function on the pop-up list on the right-hand side of On Click area.

The NewGame Button On Click area should look like as in the figure below after you have done this.

start_screen_button_on_click

Adding function call On Click. The Button object on Click part (inside the red rectangle) should look like this.

After this add functions to all Button game objects.

MainScreen

  • Credits Button should call CreditsButtonCb()
  • NewGame Button should call ConfirmNewGameCb()
  • Continue Button should call ContinueCb()
  • Quit Button should call ConfirmQuitCb()

CreditsScreen

  • Back button should call MainScreenCb()

ConfirmNewGameScreen

  • Back button should call MainScreenCb()
  • OK button should call NewGameCb()

ConfirmQuit

  • Back button should call MainScreenCb()
  • OK Button should call QuitCb()

Now we are almost ready. Remember to set button and text anchors so that the screens looks OK also in different resolutions and aspect rations.

Previous parts of the tutorial

 

About my formal education & stuff

As there seems to be some interest of my eduction, I thought to add a short note about that so that this is out here.

I have Masters degree in New Media (art & design). That degree includes 60-70% computer science, mathematics, and multimedia (that was at that time formal languages, signal processing, virtual reality, etc.). The rest of my Masters are interactive storytelling, management and game design.

My doctorate is in Art and Design in department focusing on new media which means obligatory studies in the philosophy of art and aesthetics, and some HCI. Of course, research literature & methods part of studies were about games.

Beside my Master studies I worked as software designer for almost five years developing network management systems (e.g. data visualisation and management tools) with C++, X/Motif, SQL, and Perl.

Part of my work in academia, I have been developing games for teaching and research (location-aware mobile games, games/interactive narrative for interactive television, …).

Homicide rates and game sales

I took a quick look at game sales and homicide rates.

Homicide (per 100 000 people) vs game sales (dollars per people) at 2011

Homicide (per 100 000 people) vs game sales (dollars per people) at 2011

Regression analysis was made using R (version 3.1.1) and lm. 2011 was year where I had null data points minimised.

Coefficients:
               Estimate Std. Error t value Pr(>|t|)  
(Intercept)      5.1644     1.8820   2.744   0.0158 *
adj.game.sales  -0.3391     0.2475  -1.370   0.1922  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 5.507 on 14 degrees of freedom
Multiple R-squared:  0.1183,	Adjusted R-squared:  0.05527 
F-statistic: 1.878 on 1 and 14 DF,  p-value: 0.1922

I assumed that violent homicides are linearly distributed.

While regression shows downward trend, the analysis does not suggest significant connection between game sale and homicide rates.

Data:

Call for Chapters: Game Design Research Collected Edition

Edited by Petri Lankoski and Jussi Holopainen

The aim of this collection is to provide an introductory book to all who wants to study game design—with the focus on games, components, systems, game development, etc.—as part of research or development. Design has been a study topic in various fields where design methods has been in focus of enquiry (e.g., Jones, 1970). In game design, an early look at the design if Crawford’s (1984) book The art of game design.

The three more specific aims are to 1) situate the game design research within and alongside general design research, 2) situate game design research within games research, and 3) provide methodology and methods with concrete case studies as examples to guide anyone interested in game design research.

Design research has moved to cover more general questions of studying design: for example,  how we study design, what methods we can use to study design and what is design along with the more fundamental questions such as what kind of knowledge design research produces. This is apparent in areas outside games. For example, Groat and Wang (2004) cover research methods in architecture to analyze design processes and works.

According to Blessing and Chakrabarti (2009) design research has gone through three overlapping phases: The Experiential phase lasting until end of 1950s where senior designers wrote about their own experiences in designing. The Intellectual phase from 1960s until about 1980s where the emphasis was on providing a robust logical foundation for design and on the methods and principles of design. In the Empirical phase from 1980s forward the aim has been to understand how designers really work by conducting empirical studies both in the laboratory and in the wild.

The history of game design research seems to have followed the same phases from Crawford’s 1984 seminal The Art of game design being an example of the experiential phase to the recent empirical studies of game design (see for example Kultima 2010, Hagen 2009, Peltoniemi 2009; O’Donnell, 2014). In addition, researchers have also started to look using game design as research methodology where game design is used intentionally to study specific aspect of design. This kind of approaches are in akin to what Koskinen et al. (2011) call constructive design research.

Nigel Cross has defined design research as “development, articulation and communication of design knowledge” (Cross 1999, p.5). Cross argues further that the design knowledge resides in people, processes, and artifacts resulting in three different domains of design knowledge: design epistemology (the study of designerly ways of knowing), design praxiology (the study of practices and processes of design) and design phenomenology (the study of the form and function of the resulting artifacts). The studies in game design research can be positioned accordingly.

The book is going to have two thematic parts:

What is game design research

  • epistemology of game design research
  • design knowledge & knowledge in design research
  • aesthetics in design
  • game design vs game design research (the role and contribution of game design research)
  • game design research and games research

Conducting game design research

  • validation of game design research
  • methods in game design research (e.g., qualitative, quantitative, historical, simulations, prototypes)
  • Norm critical design, politics/ethics of design
  • Case studies

Other suitable topics are considered as well.

In the more philosophical or theoretical oriented submissions we would like to see contributions addressing design research in games in contrast to more general theoretical or philosophical arguments about design or design research exemplified with games.

The submission should contain 1000-1500 (without references) words overview of chapter. In addition, include references to 2-4 your research publications that relate to the proposed chapter. We aim for chapters that are 6500–8500 words.

Email proposal to Petri Lankoski (petri.lankoski@sh.se) as plain text (no attachments).

Deadlines

  • chapter overview: Dec 11, 2015
  • full chapter draft: May, 2016

About editors

Petri Lankoski (D.Arts) is an associate professor at Södertörn University where he teaches game development and research. His research focuses on games and emotions, game character design, and game design. Petri also develops games as part of the research. His publications include Character-driven game design  (published by Aalto University) and Game research methods: An overview (book edited with Staffan Björk, published by ETC Press).

Jussi Holopainen (PhD) is a games researcher working for Games and Experimental Entertainment Laboratory in RMIT University’s Centre for Game Design Research. His current research interests include experimental game design, empirical studies of game design practices, and games for behavioral change. He has authored or co-authored several pieces on game design, most notably Patterns in Game Design, and was a co-organizer of the Game Design Research Symposium at ITU Copenhagen in 2004.

REFERENCES

Björk, S. & Holopainen, J. (2004). Patterns in Game Design. Charles River Media.

Blessing, L. T. M., & Chakrabarti, A. (2009). DRM, a Design Research Methodology. Springer London. doi:10.1007/978-1-84882-587-1.

Crawford C. (1984). The Art of Computer Game Design. McGraw-Hill.

Cross, N. (1999). Design Research: A Disciplined Conversation. Design Issues, 15(2), 5–10.

Groat, L.N. & Wang, D. (2004). Architectural Research Methods, 2nd ed. Wiley.

Jones, J.C. (1970). Design Methods. John Wiley & Sons.

Hagen, U. (2011). Designing for player experience: How professional game developers communicate design visions. Journal of Gaming and Virtual Worlds, 3(3), 259–275.

Koskinen, I., Zimmerman, J., Binder, T., Redstrom, J., & Wensveen, S. (2011). Design Research Through Practice: From the Lab, Field, and Showroom. Elsevier.

Kultima, A. (2010). The organic nature of game ideation. In Proceedings of the International Academic Conference on the Future of Game Design and Technology – Futureplay ’10 (p. 33). New York, New York, USA: ACM Press. doi:10.1145/1920778.1920784.

Lankoski, P. (2011). Character-driven game design: A design approach and its foundations in character engagement. Taik Books.

Lankoski, P. & Björk, S. (2015) Game Research Methods: An Overview. ETC Press.

O’Donnell, C. (2014). Developer’s Dilemma: The Secret World of Video Game Creators. MIT Press.

Peltoniemi, M. (2009). Industry Life-Cycle Theory in the Cultural Domain: Dynamics of the Games Industry. Tampere University of Technology.

Some notes about the freedom of expression, games & critique

(I was first thinking to write a short essay with this title, but this turned to be loosely related thoughts about the topic.)

  • Freedom of expression has newer covered using expression to harm someones reputation and slander a person.
  • Freedom of expression is threatened if people are afraid to express their opinions, even if they don’t need to be afraid of a government prosecution.
  • While companies should have right to choose what publish (and sell), there are cases where this is not so. Monopolies (even de facto monopolies) or utilities are different when their choices can control what others can publish. For example, Comic Book Association was a in practice working as a censor even the US government was not giving them legal power to prevent certain kinds of expressions in comic books. That said, a website does not need to publish what they don’t want. It would be stretching the concept of censorship to call all editorial decisions not to publish (or edit something out) as censorship. However, there are plenty of cases where editorial rights can be used unethically.
  • A mob going after publication or reviewer when the mob disagree with the reviewer’s opinion (especially if someone in the mob threatens the reviewer) can be part of creating an atmosphere of fear that threatens the freedom of expression.
  • It should be natural that developers can create games as they like and critics can criticize the games as they like (as long as they don’t break laws). Also it is ok to disagree with a critique. However, spamming, threats, and name-calling are not productive forms to show the disagreement. Freedom of expression does not include name-calling (in many cases) or threats.
  • A review is an opinion. A good review provides well-argued point of view to a game. The review is not meant to be a product description. This is how reviews of literature, film, music or comics are by tradition. Game criticism is a young (compared to,especially, literature criticism). The language and approaches used are still developing.

My experiences with censorship & media panics

I grew up with books and comics. Big part of comics available in Finland were translations of European comics such as Asterix, Yoko Tsuno, Spirou et fantasia, Blueberry, Tex Willer, Judge Dredd (and bit later Valerians, Canardo & Bilal, Tardi, Comes), but also US superhero comics.  At that time I was not even aware that US comics were influenced by comic code (the old EC comics pieces where published and available in Finland), but US comics got more interesting with Miller’s Daredevil and later with Vertigo’s pieces (when mainstream publishers started to abandon comic code).

I got into gaming when I got my first game console (don’t anymore remember what that was, but a friend got a Colecovision console). Later I got ZX Spectrum (and a friend had Commodore VIC-20 and bit later C-64 and Amiga). That time Nintendo’s Watch & Game was rather big. Many in my class have those and we traded machines when we got bored to that one game that was in. Authorizes or media were not interested during 80s and 90s console and computer games had rather low profile.

On the other hand, Washington Wives raised some media panic about heavy rock. Of course that was something I listened. Finnish tabloids repeated US stories, but in Finland that was rather low key. Mostly we had fun with those stories and all possible ways to connect bands such as W.A.S.P and KISS to Satanism.

I found also role-playing games via an advertisement in a sci-fi fanzine at early 80s. We played some time before Finnish tabloids started to reproduce US stories how role-playing games related to suicides, Satanism, occult etc. Role-playing games were not very big thing in Finland and those things were very annoying, but newer became something to be taken too seriously. Role-playing games were small thing. Those things were much more serous and annoying because many cases larpers needed to rent places and role-playing moral panics made that harder.

As a media nerd, I also got into horror & splatter film. Finland introduced video censorship law at 80s which meant that one cannot legally sell films on video that were R-18 (Film theatres could continue to show those). Video censorship meant that the most horror films were not available in Finland (many newer came to theatres). During that time we smuggled horror to Finland or bought them from some friend of friend. Finland was not the only country that censored film, but UK did that also. So it was somewhat hard to get uncut films (unless one owned NTSC video player and television) that had were not dubbed. Despite the law, it was not that hard to get Nightmare on Elm Street, Evil Dead, The Thing, Videodrome, Reanimator or The Day of the Dead etc. It was harder to get them in good quality.  Finland relaxed in film and video censorship laws at 2001. Lawmakers probably at that time even did not know that computer and videogames existed, sot games distribution was not controlled.

While access to horror films and comics got better, videogames got in spotlight when games where connected in school shootings and Jack Thompson started to attack on games by arguing that murder simulators are not protected speech. I would be devastating to games in US (and probably also elsewhere) if Thompson would have succeeded in selling his argument to US court.

Echoes on Thompson’s high profile litigation, moral panic on games and media effect claims have been constant companion throughout my time as a game researcher. Now moral panics are more annoying than ever: evaluators of funding applications has been rejecting application because game effects are not considered in application and so on (as this has been case all my career there we include always text pointing out the problems with media effect claims and cultural importance of games etc., but that has been too rarely enough to secure funding).

Then games got again in spotlight when some gamers were threatening game critics. And gamers got plenty of negative publicity.