You are the AI of a very skilled mining ship called Antalasia currently cruising the remote solar system Bitiax looking for mining opportunities. Trading is the cornerstone of the galaxy and some rare items can fetch large sums on the open market.

On board you have a cargo hold full of sluglike Aliens which are quite small, drooly and clumsy but also very efficient creatures that are excellent at burrowing through mines seeking out valuables. For every AI mining ship in this quadrant of the galaxy these charming Aliens are a vital part of the crew.

While peacefully scanning for elements on the nearest planet Metis, Antalasias systems are suddenly taken offline and the ship turns dark for a second before being booted up again with all computer screens flashing “Intrusion detected”.

SAMA pirate ship

A big, dark looting ship suddenly appears out of nowhere and a demand of takeover is distributed across all screens on Antalasia. It is an AI pirate ship that has infiltrated your computer system and it is now controlling your ship!

The pirate displays a list of valuable loot that has to be collected and turned over to the hostile ship for it to release Antalasia. The pirate gives you limited control back over your cargo hold, scanners and teleportation terminal so that you can get the items it demands. You have no choice but to send down your diligent Aliens to the various planets in the system to search out the minerals, gems, gases, fossils and artefacts the pirate wants so that you can get your ship back. Your Alien will face all kinds of hardships down there having to endure extreme and hazardous environments, hostile fauna and flora, hidden traps and areas only accessible by figuring out the ancient civilizations puzzles left behind in the tunnels.

Will you succeed?

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Post article RSS Articles

The last week we’ve been implementing a new enemy in “Something Ate My Alien” called “Terrator”.

He’s much larger than the other enemies, and he’s a worm like creature that we wanted to randomly appear, work its way across the screen and ‘Eat’ our alien if he gets in the way.

Kat created the art, and split it up into sprites for each of the ‘worm’ sections, head, body and tail.

Game SAMA Something Ate My Alien 4

We didn’t want to create a random path as it was moving, because we wanted more control over him. So we decide to plan out a batch of paths that he should follow and then just pick one at random during spawn. To mix things up a bit, the path should be offset by a random number of pixels, and his start position relative to the path should also change. We also allowed it to be ‘flipped’ randomly to create more variation.

We planned out a path with about 15 or so points, and then used a smoothing algorithm called “Chaikin’s Algorithm” to create a smooth path.

Chaikin is nice and quick, not 100% accurate though, because of the way it works, the result doesn’t pass through the original points, but its good enough for what we needed it for.

Game SAMA Something Ate My Alien 5

It works by ‘cutting corners’ off each point to create a more smoothed curve, and then repeating 3 or 4 times makes it get smoother and smoother. We found 4 times was good enough to make Terrator animate smoothly in the game.

I found a C# example which helped, here: C# Smoothing Path

Although it was a quick algorithm, the implementation I found actually created quite a bit of C# Garbage, so I looked into re-writing it to remove any Garbage.

Now, rather than creating a new array on every smooth pass, you can pre-create an big array, and then it fills in that one array.

So now it was generating zero Garbage during game play. Yay!!

Game SAMA Something Ate My Alien 6

And as a bonus, with a bit of extra tweaking, I got it to process faster also. For 15 original points and smoothing 4 times, the original routine took about 1.22ms and allocated 3.3kb of Garbage. My new one took 1.05ms and allocated none.

Here is a video clip of it in game:

Here is the barebones C# code I wrote for Unity, to generate the smooth curve if anyone else might find it useful:

// Setup smooth info
int smoothness = 4;
int NumMainPoints = 15;
Vector2[] smoothPoints = new Vector2[(NumMainPoints - 2) * (int)Mathf.Pow(2,smoothness) + 2];

Vector2 startpoint = new Vector2(25,50);
Vector2 centerPoint = new Vector2(50,50);

smoothPoints[0] = startpoint;
smoothPoints[1] = startpoint + new Vector2(8,0);
smoothPoints[2] = startpoint + new Vector2((8 + 2),0);
smoothPoints[3] = centerPoint + new Vector2(-6.0f, 0.5f);
smoothPoints[4] = centerPoint + new Vector2(-2.0f, -1.5f);
smoothPoints[5] = centerPoint + new Vector2(1.5f, 0.5f);
smoothPoints[6] = centerPoint + new Vector2(5.0f, -2.5f);
smoothPoints[7] = centerPoint + new Vector2(2.5f, -5.5f);
smoothPoints[8] = centerPoint + new Vector2(-3.0f, -3.0f);
smoothPoints[9] = centerPoint + new Vector2(-4.5f, -0.5f);
smoothPoints[10] = centerPoint + new Vector2(-2.5f, 2.0f);
smoothPoints[11] = centerPoint + new Vector2(1.5f, 2.5f);
smoothPoints[12] = centerPoint + new Vector2(5.0f, 2.0f);
smoothPoints[13] = centerPoint + new Vector2(9.0f, 2.5f);
smoothPoints[14] = centerPoint + new Vector2(150, -0.5f);

ChaikinFast(ref smoothPoints, smoothness, NumMainPoints);

private void ChaikinFast(ref Vector2[] smoothPoints, int smoothness, int NumMainPoints) {
    Vector2 lastVector = smoothPoints[NumMainPoints - 1]; // Save last point
    int p = NumMainPoints - 2;
    int factor = 2;
    int lastPoint;
    Vector2 offsetRight, offsetLeft;

    // Loop through mulitple times to smooth
    for (int s=1; s<=smoothness; s++) {
        lastPoint = (NumMainPoints - 2) * factor;
        offsetRight = (smoothPoints[p+1] - smoothPoints[p]) * 0.25f;

        // For each point, replace with 2,
        // with each one being 25% more towards the left and right points
        for (int n=lastPoint; n>1; n-=2) {
            offsetLeft = (smoothPoints[p] - smoothPoints[p-1]) * 0.25f;
            smoothPoints[n] = smoothPoints[p] + offsetRight;
            smoothPoints[n-1] = smoothPoints[p] - offsetLeft;
            offsetRight = offsetLeft;
            p--;
        }

        // Prepare for next loop
        p = lastPoint;
        smoothPoints[p+1] = lastVector; // Copy the end point to the end
        factor *= 2;
    }
}
ArtWork - Bitiax solar system

ArtWork - Bitiax solar system

News

Brief description and concept art of the different planets that you can send your alien to in the game "Something Ate My Alien"

Something Ate My Alien - Dev Blog

Something Ate My Alien - Dev Blog

News

"Something Ate My Alien" is a 2D Mining game currently under development by RoKabium Games. This is an article about the development.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Icon
Something Ate My Alien
Platforms
Windows, Mac, Linux
Developer
RoKabium Games
Engine
Unity
Contact
Send Message
Release date
Game watch
Follow
Share
Style
Genre
Platformer
Theme
Sci-Fi
Players
Single Player
Project
Indie
Twitter

Latest tweets from @rokabiumgames

Got the UI Inventory screen working now. This is the 'Fossil' management area. #gamedev #indiedev #sama T.co

Oct 19 2017

New level in the works for "Something Ate My Alien". #screenshotsaturday #gamedev #indiedev #sama T.co

Oct 14 2017

Meet the family.... #gamedev #indiedev #sama #conceptart T.co

Oct 13 2017

Nice... Gamedev.net have featured our #screenshotsaturday image on their front page today, in the "Imag… T.co

Oct 9 2017

Working on the puzzles a bit, colour coding them. You have to move/dig them around to get them into the 'slots'.… T.co

Oct 7 2017

Time Lapse video of our concept UI redesign work in Photoshop for SAMA Youtu.be #gamedev #indiedev #conceptart #timelapse

Oct 5 2017

Concept UI alien customization screen #gamedev #indiedev #conceptart T.co

Oct 2 2017

All the enemies coming out to play....Yelp! #screenshotsaturday #gamedev #indiedev T.co

Sep 30 2017

Our 2nd Dev Blog is out now, follow the link and have a read! #gamedev #indiedev Somethingatemyalien.com

Sep 29 2017

Withering Rat, Crumble Crab or Giant Worm... Which fossils will you find? SAMA concept art. #gamedev #indiedev T.co

Sep 28 2017

Tags
Embed Buttons
Link to Something Ate My Alien by selecting a button and using the embed code provided more...
Something Ate My Alien
Statistics
Last Update
Watchers
2 members
Articles
3
You may also like
Cortex Command
Cortex Command Platformer
Abuse
Abuse Platformer
Dig or Die
Dig or Die Platformer
Fumiko!
Fumiko! Platformer
The Swapper
The Swapper Platformer
Pale Blue
Pale Blue Platformer