Weekend Project: Kenney Jam 2017

I decided to do a jam this weekend, hosted by Kenney.nl the theme this time is “It’s a feature, not a bug!”.

What’s a game jam? It’s a competition (but not really competitive) to create a game with certain parameters within a specified timeframe. The rules of this comp. are simple; use any/all Kenney.nl assets to create our game. Sound and fonts we can bring but all sprites and UI must come from them.

I started playing around with the assets this morning and spent most of today just thinking of random possible scenarios.

(See you in 48 hours)

Update to the Dusty game

 

An early blender model of the hover sailing ship.

This project still doesn’t have an official title. It started, mostly a sandbox for me to experiment with Rust/pubG game elements, but as I played around with this idea came to me: The concept is a super-flat world where the procedurally generated elements will float above the surface. These floating mountains would be a refuge for farmers and/or criminals. WHO: You play a person from the lowest cast of society “scav” short for a scavenger, these are a group of people wander the surface looking for anything of value. WHERE: This is an alien planet that humans have sucked dry of all ‘harvestable’ recourses. WHY: Your character has been given a chance to enter a competition, one that evolved out of desperation. It’s solo Iditarod style race that starts and ends at two extreme distances. Along the way, there will be O2 and Water harvesters (you’ll need to find in order to survive) as well as checkpoint base stations.

C# and Cellular Automata

Spent some time this week learning Cellular Automata the first part of Unity live training course on procedural generation.

 

 

using UnityEngine;
using System.Collections;
using System;

public class MapGenerator : MonoBehaviour {

    public int width;
    public int height;

    public string seed;
    public bool useRandomSeed;

    [Range(0,100)]
    public int randomFillPercent;

    int[,] map;

    void Start() {
        GenerateMap();
    }

    void Update() {
        if (Input.GetMouseButtonDown(0)) {
            GenerateMap();
        }
    }

    void GenerateMap() {
        map = new int[width,height];
        RandomFillMap();

        for (int i = 0; i < 5; i ++) {
            SmoothMap();
        }
    }


    void RandomFillMap() {
        if (useRandomSeed) {
            seed = Time.time.ToString();
        }

        System.Random pseudoRandom = new System.Random(seed.GetHashCode());

        for (int x = 0; x < width; x ++) {
            for (int y = 0; y < height; y ++) {
                if (x == 0 || x == width-1 || y == 0 || y == height -1) {
                    map[x,y] = 1;
                }
                else {
                    map[x,y] = (pseudoRandom.Next(0,100) < randomFillPercent)? 1: 0;
                }
            }
        }
    }

    void SmoothMap() {
        for (int x = 0; x < width; x ++) {
            for (int y = 0; y < height; y ++) { int neighbourWallTiles = GetSurroundingWallCount(x,y); if (neighbourWallTiles > 4)
                    map[x,y] = 1;
                else if (neighbourWallTiles < 4)
                    map[x,y] = 0;

            }
        }
    }

    int GetSurroundingWallCount(int gridX, int gridY) {
        int wallCount = 0;
        for (int neighbourX = gridX - 1; neighbourX <= gridX + 1; neighbourX ++) {
            for (int neighbourY = gridY - 1; neighbourY <= gridY + 1; neighbourY ++) { if (neighbourX >= 0 && neighbourX < width && neighbourY >= 0 && neighbourY < height) {
                    if (neighbourX != gridX || neighbourY != gridY) {
                        wallCount += map[neighbourX,neighbourY];
                    }
                }
                else {
                    wallCount ++;
                }
            }
        }

        return wallCount;
    }


    void OnDrawGizmos() {
        if (map != null) {
            for (int x = 0; x < width; x ++) {
                for (int y = 0; y < height; y ++) {
                    Gizmos.color = (map[x,y] == 1)?Color.black:Color.white;
                    Vector3 pos = new Vector3(-width/2 + x + .5f,0, -height/2 + y+.5f);
                    Gizmos.DrawCube(pos,Vector3.one);
                }
            }
        }
    }

}

Billboard experiments

While researching how to implement a dialogue system (vomit emoji) in Unity3D I randomly ended up finding this awesome blog post about Billboard orientation for 2D spites using 3d cameras in perspective mode. This shows some of the quick experiments I whipped up after implementing his ideas. Pretty elegant solution for an annoying problem.

<code>

// BillboardSprite.cs
using UnityEngine;
using System.Collections;

public class BillboardSprite: MonoBehaviour {

	public Transform MyCameraTransform;
	private Transform MyTransform;
	public bool alignNotLook = true;

	// Use this for initialization
	void Start () {
		MyTransform = this.transform;
		MyCameraTransform = Camera.main.transform;
	}
	
	// Update is called once per frame
	void LateUpdate () {
		if (alignNotLook)
			MyTransform.forward = MyCameraTransform.forward;
		else
			MyTransform.LookAt (MyCameraTransform, Vector3.up);
	}
}

</code>

 

 

 

 

 

 

 

 

 

 

Ludum Dare 38 Submission!

 

What have I been up to you ask???

Well, besides working on my own projects I took part in the Ludum Dare Game Jam. Basically we locked ourselves in a room and made game in 72 hours. This year I joined up with @kalaena, check out her blog HERE! The theme to this years Jam was “A Small World”. Our concept was simple, you play a Parasite who is resting comfortably inside a slice of pork sushi (yes that kind of parasite & yes I said pork), at a roadside gas station. 

Your new ‘HOST’ Gary decides your sushi home is a delicious roadside snack. From there on out you’re mission was to race the clock and do as much damage as possible then escape… out the… you know*.  Time as all game-jams is a cruel mistress so, we were only able to get some basic game functionality working along with some pretty cool levels and some great art that @kalaena made that brought the whole thing together.

You can also checkout the GITHUB link for the source files of our game. We had a ton of fun making it and everybody learned great deal. Thanks for visiting!

[here’s some pics from the game, development process and concepts.]