Publicerad i 5SD037, Okategoriserade

Eyes Align – Presenting the Game

e8cb0c6ccea58409dc02aff5b41e9cd2.gif

Over several weeks, I have prepared a five minute presentation to showcase the game.

It is structured in a way to show present the audience first with the premise and story of the game, then proceeding to quickly explain the mechanics. The last part is dedicated to explain the art style with real puppets and the finale is used to tie back to the introduction.

I’ve used music and audio from the game in order to set a mood for the presentation.

 

Publicerad i 5SD037, Okategoriserade

Eyes Align – Dialogue Changes

b840b3a5b39f4fb777cd0758ad665787.gif
Balancing dialogue to be both interesting and a challenge, while also providing the player with many choices is quite a difficult venture.

The dialogue mechanic of the game was at the start meant to be something far more complex than what it turned out to be (see the blog post Eyes Align – Development Week 4 for more information); our huge ambitions were dashed upon the stones of reality.

So what happened exactly? Branching dialogue, using the hub and spokes approach that games like Mass Effect use, became the standard type of dialogue in the game, which wasn’t entirely different from what was planned, but there was no AI, nor any form of skill-based mechanics involved. Gameplay turned more towards the visual novel genre, unsurprisingly perhaps, as our engine happened to be one specifically made for said genre.

 

Publicerad i 5SD037, Okategoriserade

Eyes Align – Narrative Structure, How it Changed

In my opinion, the most difficult part to get right in any story is the middle: The story needs an introduction which grabs the readers, or players, attention and a fitting conclusion that either wraps up lose ends or creates new ones to keep the reader wanting more. The middle, however, serves as the majority of the script and fills out the world, the characters and the conflict.

At the start, the middle was loosely defined as a chain of events; the player meeting two – three characters and then depending on how the player interacts with them, the ending can be different.

Due to time constraints, the narrative became more linear, with only a single ending being available and this has in turn led to some dialogue and items in the game seeming like they lead nowhere. The player’s agency in changing the story is completely mitigated.

2017-06-08 (1).png
The spraycan and the alley it is found in are two examples of artefacts that are supposed to let the player experience a different ending, but they sadly serve no purpose at the present moment.

It is, however, not all bad, as the game is supposed to be presented at the GGC as a vertical slice and the linearity of the game gives each player the same experience to judge, allowing for said experience to be polished as much as possible.

Publicerad i 5SD037, Okategoriserade

Eyes Align – Switching Engine to Ren’py

As the three first weeks of production came to a close, our attempts at using Unreal 4.0 as our game engine has been less fruitful than we expected, and as our alpha deadline draws close, a switch to something more suited for our project was deemed necessary.

Enter Ren’py, a game engine designed specifically for visual novels:

”Ren’Py is a visual novel engine – used by hundreds of creators from around the world – that helps you use words, images, and sounds to tell interactive stories that run on computers and mobile devices. These can be both visual novels and life simulation games. The easy to learn script language allows anyone to efficiently write large visual novels, while its Python scripting is enough for complex simulation games.”            (source: Renpy Official Website)

The Python-based engine offers an easy way to implement dialogue but also makes experimenting with AI in dialogue or more complex dialogue system more challenging as it offers less options of customization.

Point and click test gif.gif
Point and click implemented in Ren’py

We successfully implemented point and click elements into Ren’py for the Alpha, which proved to us that Ren’py was at least sufficiently customizable for us to use as our engine.

 

Publicerad i 5SD037, Okategoriserade

Eyes Align – Development Week 4

During this week, my work has gone almost entirely towards finalizing the Twine protoype, with the potential for importing this prototype into unreal 4.

There was more coding to be done than I had previously assumed of Twine, but nonetheless, there were results to be had from importing images and sound: We could quickly get a feeling for how the pace of the game would potentially be like and how the atmosphere would feel.

2017-05-04.png
A scene from twine. Point and click interactions

However, it must be mentioned that dialogue was more difficult to create according to the design, as there were a jumble of variables and links that eventually got very confusing to look through without providing much gameplay to test.

The Twine prototype showcases the early part of the game, introducing the player to the main conflict of the game, and becoming the main point of motivation for the player to pursue the game’s narrative.

The player starts with a package they must deliver but are met with police sealing off the area they need to go to. The post office is closed and as such they need to bring the package back home, upon which the package delivers a mysterious message that serves as the key introductory point into the narrative.

A police arrives at the players home shortly thereafter, to ask the player a few questions, later revealing that there has indeed been a case of homicide where the player where to deliver their package.

2017-05-07.png
The dialogue with a police that was tested in Twine.

However, at the end of the week, it became apparent that converting the Twine prototype into something usable for Unreal 4 would be too difficult to pursue, leaving the Twine prototype just that.

Here is a link to the final version of the Twine protoype.

https://www.dropbox.com/s/smwwwilhke0mdh7/Eyes%20Align%20-%20On%20Argus%20Station.html?dl=0

Publicerad i 5SD037

Alien Station – Development Week 3

Introduction

As lead designer, producer, script writer, and possibly even but less likely so, programmer, on the project Alien Station (working title), I will primarily work on creating the game’s narrative and designing the game’s mechanics to work in unison with it, all the while documenting and making sure production is coherent.

Week 3 of the course and project has been quite eclectic as far as my personal work goes: I have worked on three key areas for this week: Manuscript; the overarching story and its overall story in addition to dialogue script for one character encountered in the game. Prototyping in twine, and Dialogue system design.

Manuscript

The overall structure of the narrative has been defined and put to word, with introduction and conclusion being first out. To summarize in short; the player visits the ”end goal” of the game right at the start, which is the crime scene of a murder. They receive a device that they must identify, which makes up the middle of the narrative. At the end, the device will lead them to the crime scene again, where they will have an encounter with the murderer with different outcomes depending on their success during the middle act.

IMG_20170416_134827.jpg
A storyboard of the key scenes featured in the GGC vertical slice

The dialogue I have been working on is closely linked to the area which I have been prototyping in Twine, namely, the dialogue tree of a character named Oz.

Prototyping

Using Twine as a tool for prototyping dialogue has been somewhat successful, although exporting text from Twine to use in the game will be too difficult and time-consuming, which means that I decided to write up the dialogue script separately. As such, I decided on spending less time on the twine prototype for now, in order to set aside more time for the dialogue script.

Dialogue System Design

Mechanically, the dialogue system was not sufficiently defined, making a diagram or other form of documentation necessary for clarity as well as convenience. In short, the dialogue system gives the player linearly progressing dialogue through the use of topics, but gives the player ways in which the dialogue progresses in a branching manner. These parts of the dialogue in term provide the player with a challenge and opportunity to raise their standing towards given NPC’s.

Dialogue Mechanic Diagram
A diagram showing the planned structure of the dialogue system

Conclusion

Development begins to shape up, but there are still some things that need to be further defined, such as the point-and-click elements of exploration and thusly what objects will need to be intractable.

Although I feel like many things have become more clear, such as the narrative structure and dialogue system, as the week comes to pass, there is still a need to prototype and test these things as soon as possible: I fear that the way the narrative is presented is key to making players vested in playing the game in the first place, so it would be best if there is at least a key piece of the narrative playable as early as possible. Therefore, Twine seems like the best option for now, but it has its own range of problems. As such, next week will be mostly dedicated to getting the twine prototype in order.

Publicerad i 5SD033

Concealing the Respawn Time…

Newspaper spin and headlines sprite sheet.png
The spinning newspaper animation spritesheet.

As I mentioned in last week’s blog post, respawning of enemies takes some time to perform, roughly a few milliseconds to a a couple of seconds depending on how many enemies being spawned. This meant that the game would freeze while the RespawnEnemies function would run; not a very elegant or immersive procedure.

 

After discussing this problem with my group, we remembered a cut feature planned during early development: A spinning newspaper that was supposed to appear between levels and add flavour to the setting by describing the ongoing events of the game, with humour.

There were already art assets for its animation and a few different variant headers for the final frame. Although they were without a picture, this was easy enough for the art department to finalize, even making a little fanfare sound to play while  the animation would run.

So, now that the feature was planned for and its assets complete, I would still need to implement it in the code. As the function for respawning enemies takes some time to complete, it would need to run during the last frame of the animation as to not halt it.

When the player returns to the starting area of the map, the game pauses and a bool related to the newspaper animation and enemy spawning is set to true. This allows the game to continue looping through the Update function to reach the Draw function necessary for animation, while disabling player and enemy movement. In addition, the fanfare sound starts playing as soon as the bool is true.

An sf::Clock is used to measure the length of the frames, the last frame sticking around for a couple of seconds; otherwise the text on the newspaper might be difficult to read if there are few enemies to spawn. When the timer of the last frame is finished, the bool checking the function is set to false, allowing the updating of the game to proceed as normal.

The newspaper is animated with the Animation function I’ve described in one of my previous blog posts, but as the last frame is reached, the texture containing the spinning newspaper spritesheet changes to image with the different newspapers. One of the five newspapers are chosen based on an int set to Rand % 4 + 1, giving a random number between 1 and 5.

newspapers.png
The different variations of newspapers that might pop up: Nothing like a little humour to cover up the limits of your programming…
Publicerad i 5SD033

Random Respawning of Enemies

The artifact I’ve been working on this time is the random respawing of enemies, set to occur whenever the player returns back to the start. Design-wise it allows for the game to move along many consecutive turns with increasing difficulty. A great disadvantage with this random spawning is that it takes a lot of processing; a fxed spawn-pattern might have been more cost-effective (but, of course, more predictable).

To allow enemies to spawn at different locations during the course of the game I’ve had to go back and revise the old code for spawning them:

Before and during the Beta phase of the project, enemies spawned only once during the game, at the beginning. They were (supposedly) given random x and y coordinates that were limited to the size of the map, and not directly at the players start location. This was not working correctly due to a small error, and hard to spot. Simply put, the enemies spawned using only the randomized x-coordinate, in both their x and y coordinates. As the enemies kept moving around the map correctly I did not notice this error until this revision of the code.

I decided to refine this random code to include a check to see if the position would be inside a radius around the home base, making a new random position if that is the case (a brute-force method that might take some extra time, but at least it works).

Moving on from that, the spawning code works, so the next step would be to apply it when enemies need to respawn. I therefore made a ”respawnEnemies” function that would handle all the necessary code specific for their spawning.

First it iterates through enemies  to fin out how many enemies have been taken out, and if not, how many of each type of enemy there are. Enemies that are dead are deleted from the enemy vector.

Secondly, it checks the current size the vector versus the size before iteration to check how many casualties there have been.

Thirdly, a for-loop will restock enemies depending on how many casualties there were, adding an extra amount for high casualties and the prescence of zeppelins. In the loop, a random number between 0 and 100 is generated to see what type of enemy is spawned, with an decreasing chance for AAA-cannons and Zeppelins to spawn depending on how many there are alive.

2016-03-10 (2).png
A placeholder at its worst… however, without it the game would seem to freeze without a clear reason when the enemy-respawn function is called.

 

 

Publicerad i 5SD023

[5SD023] Projektrapport och kodrecension – Programmeringsuppgift – Grupp 7

Projektrapport

Projektstatus

När projektet började var vi mer engagerade i att skapa en motor istället för att börja prototypa de olika delarna av spelet såsom stealth, flygande och fiender. Hade vi börjat med att prototypa istället för att försöka skapa en motor så kan projektet sett annorlunda ut nu. Det är möjligt att vi hade vetat mer om de olika funktionerna vi planerat, men trots allt är vi relativt nöjda med hur vårt arbete med spelet skett under de senaste veckorna.

 

Det kan bli svårt för oss programmerare att kunna implementera vissa funktioner utan grafiska assets. I väntan på grafiska assets har vi programmerare inte mycket att göra och om efter ett speltest i får feedback att redigera ett grafiskt element så drar det tid från andra assets. Som tur har vår grupp överskott av grafiker så att uppgifterna kan spridas ut mer, men det resulterar också i att den estetiska stilen kan bli skev.

 

Faktumet att vi skrev en statemanager så pass tidigt i spelet kan ha dragit vår uppmärksamhet från “köttet” i spelet, det faktiska spelet, så vi kan ha spenderat för mycket tid på saker som egentligen är helt onödiga innan

 

Alla fiender, och därmed alla planerade obstacles, har hittills blivit implementerade, med AI, rörelse, m.m. Ljud finns för maskin och artillerield, men animation är ännu inte implementerad eller färdig som spritesheets till fiender. Det kan dock behövas testas för att justera svårighet ytterligare.

 

Kollision finns men för enkelhetens skull använder vi SFMLs sprites inbyggda funktioner, vilket innebär att kollision kollas med kollisionslådor som är lika stora som Spriten de utgår ifrån. Detta skulle gå att förbättra genom att definiera en floatrect som en slags collider vars position är relativ till sin sprite.

 

Designval

Låter kanske lite klyschigt men vi är nöjda med de designval vi har gjort. Vi valde att tänka lite “utanför lådan” och istället för att göra en generisk side-scrolling space shooter så gick vi åt ett mer “Asteroids” håll. Där kameran följer spelaren och hen har ett stort område att röra sig fritt på. Eftersom den estetiken vi tog från konceptet var baserat runt flygplan gav vi spelaren och fienderna rätt så verklighetstrogna beteenden. Vi försökte ge planet en känsla av vikt, att man kontrollerar ett fordon. Men då blev vi också tvungna att utforma en AI som presenterar en utmaning för spelaren att både undvika och slåss emot.

 

AI

AI-koden är en så kallad “finite state-machine” vilket funktionellt är en pekar till en AIState, som ändras till olika states som ärver av den pekarens klass.

Fiender har en klasshierarki, som används för att iterera genom dem för att uppdatera, rita ut dem, osv. Detta gör det enklare att använda AI:n, då alla funktioner som används relativt till fiende-entiten när den nämns i AI-koden, kan härledas till olika typer av fiender.

Fiendetyperna är följande; Flygplan, Luftvärn och Zeppelinare.

Flygplanen har den mest involverade AI:n, men även den är relativ simpel med tre states som växlas mellan. Flygplanen patrullerar kartan och om de ser spelaren så börjar de jaga och skjuta denne.

Zeppelinaren har också en del av AI-koden men endast för att kunna patrullera runt på kartan, då den är mer av en “passiv” fiende som signalerar andra flygplan att anfalla om spelaren är i dess närhet för länge.

Luftvärnets beteende är så pass enkelspårig och annorlunda från de andra fiendernas att AI till den inte skulle tillföra något. Istället skjuter den mot spelaren efter att en tidsintervall passerats och spelaren är inom dess räckvidd.

 

Prestanda/Optimering

Något vi fortfarande har problem med är hur spelet uppdaterar när vi debuggar, spelet kan köras bra men bara på en av våra datorer och när laddaren är ikopplad. Vi har försökt hitta olika lösningar men har inte lyckats. När vi pratat med andra grupper har de haft samma problem.

Sourcetree/Repositories(?)

Något annat som också orsakade en hel del problem för oss är SourceTree, vi var väldigt förvirrade med hur vi skulle skapa branches och sedan merga med huvud branchen. Sedan när det står att en branch är “2 behind” har vi ingen aning vad det betyder och ibland dök en commit inte upp för en av oss, men var fullt synlig för de andra två. Så de första veckorna blev vi tvungna att skicka koden via skype eller skicka .zip filer till varandra. Vi tycker att en lektion där vi undervisas hur man skapar en branch, hur man “comittar”, “pullar”, “pushar” och “mergar”. Hade vi fått en sådan lektion innan arbetet började tror vi att vi kan ha undvikit mycket av de problemen och den huvudvärken vi led av.

Kodrecension av Player från Grupp 8

Spelarklassen behöver, utöver sfml-header och system-headers:

”ProjectileManager.h”
Används för att lägga in olika typer av projektiler; de läggs in i vektorer och uppdateras, ritas ut och tas bort i den klassen.
Ljud för skott och liknande ligger här, och skulle kunna läggas in i en soundmanager istället, möjligtvis genom att låta spelaren ta in SoundManager som en parameter och använda den som parameter i ProjectileManager.

”Planet.h”
Används för att kolla ifall en sektor är öppen eller inte. Spelarens ”radiusPos” sätts också till Planets ”getRadiusSize()”.

”AnimatedSprite.h”
Ärver av sf:Sprite, och lägger till funktioner för att uppdatera och lägga till frames samt kolla deras livstid.
Spelaren använder sig av Animated sprite för att animera sin kanon.

Texturer skulle kunna läggas i en manager, just nu läggs de in i en vector separat i spelarens klass.

Alternativt skulle man också kunna lägga draw-funktioner från spelaren till någon slags DrawManager för att kunna, bland annat, bestämma i vilken ordning spelaren ska ritas ut gentemot resten av sprites.

Input för spelaren ligger i Update och skulle kunna flyttas till en InputManager.

 

Publicerad i 5SD033, Okategoriserade

Implementation of Animation Code

This week I have mostly been implementing animation for several sprites and special effects, using an animation code I made beforehand. I have previously used this code only to switch singular frames on sprites, but, as I am aware of now, it is a bit more difficult to cycle through animation frames using this code unless they are in a specific order.

Overall, the function is fairly simple and looks something like this:

inline void Animation(sf::Sprite* p_sprite, sf::Vector2i p_vectorI, int p_xMin, int p_xMax, int p_yMin, int p_yMax, int p_width, int p_height)

  • The sf:.Sprite* paramenter uses the sprites setTextureRect function  to switch frame on the spritesheet.
  • sf::Vector2i p_vectorI is basically the frames of the animation (if each frame is the same size). As it holds both x and y values it can scroll through frames by incrementing them on the x-axis (row), or the y-axis(column) for larger spritesheets.
  • The six other integers in the parameter determines the minimun and maximum frames as well as each frames width and height.

The function muliplicates the values of sf::Vector2i p_vectorI in x-axis and y-axis with the width and height of the frame, respectively, then checks if they are above or below the maximum allowed size, then sets the TextureRect of the sprite to the mulitplicated value.

It is of course arguable if the min/max values of frames’ size really are  necessary, as the code is relatively simple and requires a lot of additional parameters.

For example; as I implemented the animation for the player’s sprite, I bumped into the first problem with the function: The sprite needed to cycle between three frames if it turned and cycle through roughly four frames when it fired. The frames for turning were seperated from their respective frames for firing, meaning that to animate the firing correctly, my function would first have to ”jump” to the second frame of each firing animation, then cycle through them, ending by jumping back to the respective turning frame.

As this was a bit problematic to accomplish, I decided to switch the positions of the frames of the spritesheet so that each five frame animation were on a row by each other.

 

Baked potato explosion sprite sheet.pngPlayerPlane Death Animation Spritesheet.png

PlayerPlane Spritesheet
Spritesheets ready for animation! The top two are fairly simple, designed to cycle through all frames in succession. The one that’s third from the top, however, requires the animation to cyclethrough five frames and repeat, depending on the turning direction of the sprite and if it fires.

 

PlayerPlane Spritesheet
Spot the difference with the above? The turning sprites are seperate from their respective fire animation frames, making the usage of my function a bit more difficult.