Wednesday, 28 November 2012

Timeline Revisions

Due to proposal feedback and general progressions in this module, I thought I would update the timeline to be more accurate; Don't worry, it's the same game and everything.

The idea now is to get a working prototype (even if it isn't very game-like) out during, or by the end of the Christmas break. (7-11 Jan) (sort of like a sprint, but just methodically researching/getting stuff done)

This will include:

  • Dynamically spawning hubs (looks 'done', but will probably need quite a bit of work to include different versions and being able to access them from lists during play)
  • Game-state/level system (started, ongoing, but I would say would be classed as done when I have level loading, restarting, and finishing completed)
  • Background (I'm hoping to get this done by the end of the week; will include  background which size is auto set depending on level layout, and scrolling when at the edge of the screen)
  • Clicking, dragging and locking of plugs (eventually I want there to be a wire from the plug, but it's not a priority in order to test the mechanics.)
  • Activation of hubs (basically players using powered plugs to turn on other hubs)

These should be in order in which I plan to do them too (and probably  actually, in order of complexity). The above tasks should allow me to have a prototype and start testing.

I decided to remove menus and optional HUD items such as inventory out of the tasks for now in order to get the core of the game out.

The main part of the game to make it more of a puzzle game however will be implementing coloured inputs and outputs; it should really change it from a "connect a to b" game to a thought invoking task. I know, due to it's complexity I will not be able to get it completely done by the end of the Christmas break but it is on my methodical backlog for when I do finish the above (hopefully earlier than planned).

Saturday, 24 November 2012

Modelling and Saving Polygons Part 1

I'm going to split this into sections, I can't bare saving this as a draft over and over again for months trying to complete it, and never getting around to it.

Anyway, A lot of people are always asking about creating low polygon objects which look good; I'd like to think I know a bit about doing this as I spent a long part of my younger nerdy life making model and object mods for the game Rollercoaster Tycoon 3. This is a proper old-school 3D game compared to most games these days; to the extent that any number of polygons saved could be a major lag-saver (due to the grid-spamming mechanics). I'm pretty sure I once made a chair of around 10 polygons... That's how military it got.

Disclaimer/Info

For a start I'm going to be teaching you wrongly. When I refer to a "Polygon" in this text (and in life) I'm ACTUALLY referring to a "tri"(triangle). A REAL polygon is an 'n-sided shape' (basically any shape with any number of sides). When I used to model, tri's and polygons were practically the same thing because EVERYTHING was split into tri's, and therefore, calling them the same thing didn't matter too much. These days you an get quads and upwards - I'm not sure if they are still calculated and split into tris, but it shouldn't matter too much because less polygons = less tris = more efficient.


Do you want to know how many tris your model has compared to polygons? Open up editable polygon mode, select ALL the vertices and press "connect" if your model is the only thing in the scene, the counter (found by pressing "7") will display the tris rather than polygons, this is often messy so you might want undo straight after you've looked.

Anyway,  few tips and tricks;

How Round?!
Usually people over-estimate the amount of sides that they need on an object; I would say considerately so. The general rule I use is that you shouldn't generally use more than 12 sides on most objects - some exceptions occur if it is a large object or a object of particular speciality, but in general, it's a good rule.
A good thing to know is often an odd number of sides is less noticeable than even numbers at low side counts - and can completely change the look of something. Even a smoothed 4-sided cylinder looks square, but change it to 5-sides and it can look twice as round.

Making Ends Meet
Do you need the ends, bottom or top of your object/sub object? Generally you don't need the bottom if it is on the floor, or the back if it is against a wall; simply taking the ends off things can take 8-12 polygons off at once (usually minimum). Do you really need a cube for a wall? If you use a plane instead you will cut the polygons by 83%. (especially good if it is repeated throughout a level).

Laziness

Remember you can change the values of everything when adding a primitive - and you should - normally things like cylinders have 5 height segments - You never usually need that many, like, ever. The best way to model is to have the lowest possible and add as needed, rather than trying to take stuff away after you've made it look good. remember if something is repeated, just a few polygons or tris saved will add up exponentially.

Texturing/Detail

Some things to bear in mind when modelling ready for textures;

  • When you can, use Cut-out alphas or mask textures - they require less processing than transparencies; a cut-out or mask just doesn't render the parts you tell it not to, whereas a transparency does some weird merge and calculation and then changes the colours of the original texture to simulate transparency.
  • Although transparencies require a bit more processing, they are still useful - don't be scared of using them instead of loads of polygons.
  • Generally it's very good idea to convert polygon-detail to texture detail, but there is a cut-off point in which doing so becomes counter-productive; so don't start removing 5 polygons and replacing it with a 1024x1024 texture.
Polygon sandwiches are not very tasty, but they are very useful;

Sometimes this displays weird, ignore it if it does for you...

What's different about these tyres? Well, the rubbish mock-up textures are the same, they are the same resolution (too high, could be reduced) and they are both lit very badly, also, they were both made by me in about 10 minutes. The difference is that the tyre on the left is 68 tris, and the tyre on the right is 38 tris.

I would personally say that the tyre on the right looks more round, but the fact it saves 30 tris per wheel is awesome (540 tris saved on an 18-wheeler!). Why are they so different? The tyre on the left is a mapped cylinder, the tyre on the right is a cylinder with the front and back removed, and the front replaced with a plane; the alpha texture simply cuts around the wheel making it from square to round. (seen below). Really, it's a half sandwich because I didn't put a plane at the back,  but who needs a plane if it is always under a vehicle?!


The wheel actually has 18 sides, You could probably get away with 12... So I went against what I already said a bit already.

Replacing parts with alpha textures works with loads of things, you just have to dream it up; buttons on a control panel could be made to look raised by just having an alpha plane raised slightly higher than the desk for instance.

I'm going to cut this short, but beware more parts. Hope this was a little useful. (little because of not-finished-ness)

Friday, 23 November 2012

All of the angles

It's really hard to show progress from coding projects - simply because hours of work might just result in a different position a colour change or something you can't see, But here is what I have achieved this week with my project;

Spawning: I can spawn hubs (centre circular thing) in any position on the screen. I can also have different combinations for different levels.

By changing the type of the hub, I can also spawn any number of inputs and outputs (sticky-out bits on the left and right sides) which are then automatically spread evenly around the sides.

I also have a level system, in which I can specify the level number, or the game state (main menu, level select, main game, whatever else).

I came up with quite a few problems with using unity to do these things; one of the main things was how arrays work; it required me to have a major read-up on the types (more than one) of arrays and their uses HERE (and in my books). I actually ended up using a Vector4 as a mini-array for storing integer information, it ended up being more compact and easy than proper 2D arrays (array inside an array).

Here are some functions which I made (No use posting tonnes of code, but these are the critical parts

The function which specifies level contents.

Function which creates the type of function box based on pre sets and the input that is given (must remember to have a "0" colour which means "doesn't matter").
Function which rotates the inputs and outputs based on how many of each there are.

I think I'll skip the inventory for now and concentrate on getting connections between function boxes available (and start and end points of course).

Tuesday, 13 November 2012

Plotting

Today I'm trying to get the mechanics nailed down further; I've decided to use colours as a baseline to work from, and have thought up some types of function boxes and how they'll work/interact;

First problem was choosing types of colours; I actually had to read more here and here




Functions:

  • Desaturate: Colour to white
  • Hue add: white to (prev set) colour
  • Join: multiple to one (same colour)
  • Split: one to multiple (same colour)
  • Prism: white to six colours
  • Primary Split: white to RGB
  • Primary Mix: mix two primary for secondary eg R+G = Y;
  • Prism mix: mix all six colours to white.
  • Possible Hue "shift": every input above central input cycles colour once one way, and every one added below cycles one the other ?
Anyway, a lot of them I already planned and/or thought about, However, I also made a display list, trying to decide what I need to display on the function boxes in order for the player to know what they are, what to do and how they work better (minus tutorials). This is mainly because I'm planning to model the function boxes soon, and will hep me know what I have to include in the design.

Things need to display:

On Function boxes:
  • The function type (icon or name)
  • Colour of each input needed (s)
  • Whether current input is correct
  • expected Colour of output(s)
  • Whether output(s) are on.

On Wires/Plugs:
Possible that wires might need to be colour coded

That is all.

Saturday, 10 November 2012

Making A Start

Today I spent quite a while starting my project; It may not sound like much but I made a script which dynamically creates a background, applies a texture and maps it so that it is uniformly applied (whatever the width may be); I currently have it working on the main menu, just as a test - but the idea is it will mainly be used to set the length of levels.

Also, what with planning ahead, I read up on Player preferences in a  few of the books I got; I will need them for a lot of things, but the more pressing use will be for storing and retrieving information on what levels are available/done/complete. It turns out player preferences are very similar to storing information in as3, the only difference is that in as3 you can store anything; opposed to the text and numbers allowed in Unity.
Fortunately, after a little rooting around I found a script which allows loads of extra types of data being able to be saved in unity, it basically converts it from whatever it is into strings and back again; I was planning on writing something similar myself, but It is a lot less time consuming now I have found this, I can just get on to compiling stuff.
all said and done, Coding in unity and trying to figure out how everything interacts is currently insanely hard for me - Just a culture shock I imagine.

Friday, 2 November 2012

Project Proposal V1.0

Hello, this is the first iteration of my project proposal; I'm hoping for some feedback on it - my main concerns are whether the brief outline of work section is anywhere near the right lines of what I'm supposed to be doing, and what I have to do for project timeline and milestone deliverables (and how to go about doing it. Additionally, any info on getting it to 1+ grade would be awesome =P


Dissertation: Project Proposal

Deepening Scripting Knowledge Through Unity Game Development.

Brief Outline of Work
In this Dissertation project I hope to deepen my knowledge of scripting; to do this I plan on making a 2D puzzle game using Unity. The game will revolve around a central "connect point a to point b" mechanic, using a variety of connecting functions, obstacles and connection requirements in order to create a puzzle. In doing so I hope to cover the following issues in order to deepen my knowledge in code.
  • Use of Javascript/C#;
  • Using Unity as a 2D game engine (for a high percentage of the time);
  • How to create/use a base class;
  • Loading/cycling levels;
  • Creating objects dynamically;
  • Adding/ controlling objects inside other objects dynamically;
  • Dynamically creating physics based objects;
  • Subclasses;
  • Object dragging/dropping/snapping(mouse);
  • Transferral/removal of information through connected of objects;
  • Battle/Removal of infinite loops;
  • UI/menus;
  • Scrolling;
  • Dynamic Control of lighting/objects;
  • Pre-loaders/Sub-loaders;
Rationale

During the duration of this course so far I have learnt many new things; how to write Actionscript, how to model, manage, animate and design. Due to the nature of the course there is usually only time to learn the basics of these areas of the games design pipeline, Until now. By far the most successful, interesting and rewarding area of my studies has been scripting, so it makes sense to carry on with this area of work. My scripting knowledge is not yet that refined, or deep as I would like, or need. I have decided that for my dissertation I shall deepen my knowledge and understanding in scripting by working by developing a game in Unity, which uses new and different scripting languages. The reason for doing this is that coders are often highly desirable in the games design industry, simply for their lack of numbers; knowing more and being able to adapt will help me become more desirable in the industry. The added bonus of creating a game in Unity is that Unity is becoming more and more popular in terms of online gaming, and additionally, using it also opens up many doors between different platforms of gaming; This both helps me become more desirable to potential employers, and enables me to reach a wider market for any games that I make. My proposal is based on a concept which I am new to, and which any games I've seen with similar mechanics haven't pulled off very well (or taken to its full potential); although It is not my primary aim, using knowledge I'm gaining through readings and the course in general should enable me to complete this task to its full potential.

Annotated Bibliography

Goldstone,W., 2009. Unity Game Development Essentials. Packt Publishing.
This book looks very useful as it covers all aspects of Unity in good detail. HUD creation and object collection in chapter 5, particle systems in chapter seven... Actually, Yeah; I am definitely going to read through large parts of this book as I believe it provides a good groundwork of some of the main aspects of unity I may not know so much about.

Additionally, while Googling for the picture on the left, I found an Ebook called "Unity 3.x Game Development Essentials" by the same person. From what I've read, it seems to be an updated and expanded version of the book for the newer versions of unity.
See also: Goldstone,W., 2011. Unity 3.x Game Development Essentials. Packt Publishing.


Mernard, M., 2011. Game Development with Unity. Course Technology PTR.
This book is very good as it covers making games in unity as a whole; this means it goes from concept, to working around unity, scripting, UI, particles, music and more. I may not need some early chapters in the book, but I have a feeling I will need most of the later chapters as it covers more complicated parts of the Unity program.
Gerasimov, V., Kraczla, D, 2012. Unity 3.x Scripting. Packt Publishing.
This book is by the same publisher as the ones by Goldstone, so I'm hoping it's going to be just as good. From what I've read, it seems to require some previous understanding of unity scripting (or at least how to start-up with unity scripting) so it may benefit me to read some of the more basic books I have found before reading this one. Chapter four will prove very helpful as it covers how to code inventories in Unity. Other areas of interest are GUI, and AI. How much I can use may be limited form this book as it seems its tutorials are based around a fps shooter, which is very far from what I'm planning to make.

Brownlow, M., 2004.Game Programming Golden Rules.Charles River Media.
I picked up this book instantly as it seemed just what I needed; a baseline of rules to do/avoid to make neat and functional code. This book is full of tips for coding. Unfortunately most of the book covers languages I am unfamiliar with and/or it seems to be based on far more complex projects such as scripting from scratch (instead of using a front-end such as unity engine or other such programs) I'm almost disappointed but I'm pretty sure I can find something which will benefit me in this book.

Castillo,T., Novak,J., 2008.Game Development Essentials: Game Level Design. Delmar Cengage Learning.
I got this book for my old project idea, but it covers all aspects of level design and the thought and concept progress, so although it may not be as applicable as it used to be, the early chapters (1-3) for creating concepts and designing should be of use. it also covers a lot of 3D aspects of level design, and although only a very small part of my project will be 3D, it should help improve it.

Moore, M., Novak,J., 2008.Game Development Essentials: Game Industry Career Guide. Delmar Cengage Learning.
I got this book because I was having trouble visualising how and where I would be a part of the games design industry when I'd finished University. The good thing is it should be useful for whatever I decide to do for my dissertation - and perhaps improve it in the areas I need to in order to get a job. This book also covers all areas of the games design industry and how to go about getting into certain parts of it; so even if it doesn't help my dissertation, it will help me as a person.

Swink, S.,2008. Game Feel: A Game Designer's Guide to Virtual Sensation. Morgan Kaufmann.
This seems like a fantastic read which would go well, or help vastly with almost any game design project; This book as some great insight into how to make a game fun to play and how to polish a game very well. Chapter 14 may also be very useful for our group project this year. Most of the book interests be including but not limited to inputs, responses, mechanics and polishing. I think it may actually help improve my games, rather than just expand my knowledge; which I think is probably a good thing. 

Brathwaite, B., Schreiber, I., 2008.Challenges for Games Designers. Delmar Publishing.
This book covers everything to do with creating and designing a game; Because my game will be a puzzle based game I will definitely need chapter 3. Chapter 11 may also be a good use. The chances are I will inadvertently draw or reference this book due to the sheer amount of time we have been studying/using it.

Trefry, G., 2010.Casual Games Design. CRC Press.
This book mainly covers the question "What is fun?" and different mechanics/playful activities which help achieve this. I have a good idea that I will be using matching and construction playful mechanics in my project, so these chapters will be of great use, although it is quite possible I will strafe into other parts of the book.

Adams, E. (2011) Gamasutra,The Designer's Notebook: Eight Ways To Make a Bad Tutorial [Online] Available at: <http://www.gamasutra.com/view/feature/134774/the_designers_notebook_eight_.php?> [Accessed: 31 October 2012].
I plan to do a game which gently eases players into several retentively new mechanics, progressing in difficulty; people always seem deluded that a good tutorial is an easy thing to do, but it clearly it isn't that easy judging by all of the games I've played in the past. This reading should be a good guide for doing a good tutorial; or at least what not to put in a tutorial; which is a good start.

Filter Forge, 2012. Filter Editor. [online] Available at: <http://www.filterforge.com/features/editor.html > [Accessed 1 November 2012 ].
This may be a strange entry, but it will be of great use to me (well, the program at least) I'm not interested in the function of the program (creating textures and picture effects), but how they have made an easy to use Node editor, and the different functions that are available to add (to modify for the game).