AI for Enemies

As I put the finishing touches on my AI script for the two enemies in our new title, Cosmotic Blast, I wanted to out line some of what went into the design.

Enemies Movement

Enemies had to head towards you, close the gap but also not run into you. So I used this equation to find a point / vector in space to set as a target.

Vector3 locationTarget = ((target.transform.position - transform.position) + (transform.position - target.transform.position).normalized * distance);

Saying that equation in english: Take the targets position and subtract enemies position to get a vector from enemy to target. Now add back a vector from the target to the enemy but only at a given distance. See how that makes a point in space at distance from the target. If you’re to close, it could be behind you.

To avoid targets, I found all near by objects with a OverlapShereNonAlloc() with a given distance. Then applied a opposing force to the enemy. So in a loop …

force += (transform.position - nearByObjects[i].transform.position).normalized * speed;

The speed is a variable since some enemies art faster at avoiding things than others. This also makes it avoid other enemies so they fly around with a nice spacing.

I can also reverse this force for Upgrade objects so the enemy takes them for their self. Muhahah!

Enemies Shoot!

First things first, you got to aim at your target:

Vector3 pos = target.transform.position - transform.position;
Quaternion rot = Quaternion.LookRotation(pos);
transform.rotation = Quaternion.Lerp(transform.rotation, rot, Time.deltaTime * speed);

Why Lerp? Lerp makes it so it slowly rotates towards a target at a given speed. The speed is based on what level the enemy is at.

Next, got to shoot. Well this is more complex, because it depends on what the enemy is shooting but to start it off, I do a Physics.Raycast and find if the “Player” is in front of the enemies canon … then I fire().

if (physics.Raycast (transform.position, canon.gameObject.transform.forward, out hit, range, rayMask)) {
    if (hit.transform.tar == "") {
        Fire();
    }
}

The rayMask hides the Raycast from different gameObjects.

All the rest

All the rest is inherited from the classes that the ship uses, like upgrades and shield, etc.

Fun fun happy times.

Announcing Cosmotic Blast

Today we are announcing our new title, Cosmotic Blast. Think destroying asteroids, collecting upgrades and defeating enemies! It’s going to be a BLAST!

Get all of the information on our Cosmotic Blast page and spread the word by using #CosmoticBlast.

This is just the beginning of a new title. Look for more information to come.

Mission Control, we are ready for launch!

The Cosmotic Mission is ready to come out of Early Access to a full release on the Oculus Store on May 28th.

The full release will include new content and new game play and new collectables.

What the full release include?

It takes a lot of force to launch!
  • 25 challenging levels
  • 25 collectables
  • 3 space ship rooms
  • 4 unique crustal types
    • Cosmotic Crystal
    • Exploding Crustal
    • … two more!?!
  • Too many asteroids
  • 1 Kick Ass Drone!

Start getting your pilot skills ready! May 28th is the day to test your skills.

The Cosmotic Mission available now on the Oculus Store.

Early Access users will get the full release auto magically. Thank you for your support and your feedback.

Pilot. Space. Collect. Explore.

Engineering Bay

People ask, what are you working on? What more do you have to develop for The Cosmotic Mission to get it to v1.0? Of course I tell them content and that means levels and game obstacles but that also means completing the ship.

Third Bay Blind: What is that other area in the ship? Engineering bay!

Ever wonder what the other button was for? Did you see that the ship had three bays?

The main bay is the Commanding bay, where you navigate the cosmos, launch the drone and tally up your score.

Version 0.6.1 introduced the second bay, the Living Quarters, an area to play around with collectables, see where you live, and reset the game.

It’s time for the Engineering Bay

*Beep*boop* I has buttons

The game functionality of the engineering bay is simple, credits. I know, not exactly what gamers are pining to get access to but I need to give credit where credit is due. I had so much support from my Kickstarter and friends and family. I want to recognize them. Also there are tools and plug-ins that I need to credit. Joy.

In game, this is where you get access to the heart of the ship – this intergalactic magnetic-cosmotic-energy space-time warping high tech modern wonder.

Design & Sketch

Here are examples of the Living Quarters, sketch to final.

The Engineering scene is very simple in regards to game overhead, no grabbing obstacles, no collision, no added functionality so I have a lot of room for mesh detail. I hope to flex my modeling skills here.

The commanders bay hinted of the engineering bay with three tubes leading off to the left. This room will have the first cosmotic crystal discovered by humans wired up so we can take advantage of its mysterious powers.

There will be tubes and glowing crystal with large gears that look like they could drive the three spinning rings. Rubber and metal are the predominant materials. Digital panels will display titles and names to satisfy the credit criteria.

Stay tuned …

This is where I am today. I’m going to play in modo and block some shapes to get a better feel of the space.

The Cosmotic Mission Update 0.7.2

The Cosmotic Mission has been patch with an update to the loader of the Living Quarters.

This was actually quite an interesting trouble shoot because I had thought my loader was not working correctly because it would stall in the activation stage of the newly loaded level.

I combed through the loader code, finding some room for optimization but ultimately it was not the loader. It was a massive job during the initialization of some of the objects in that scene.

Then I went through texture sizes and mesh colliders. None of those seemed at fault. I isolated the issue down to it being just the larger mesh objects. Which surprised me because the vertex count was only around 10k and that should have been addressed in the loader. So what was it?

It was a shader! I use a highlight effect to show interactions. That highlight effects pre-calculates a manipulation to the vertices that on large meshes brings Unity to it’s knees. So what to do? Turn off the effect? limit the poly count? I’ve got a better idea.

Disable Read/Write to save memory and lock the mesh from script manipulation.
Disable Read/Write to save memory and lock the mesh from script manipulation.

Turn off mesh read/write on the larger objects. Ta da! Yes the effect isn’t as prevalent on those objects but they also have a base that does function well.

So there you go. If you haven’t already gotten The Cosmotic Mission, please support a great game by downloading it now. Piloting a drone in space in room scale is awesome!

The Cosmotic Mission 0.7.1 Live

As of this morning a new version of The Cosmotic Mission is live on the Oculus store.

New levels in a new galaxy with new obstacles and new collectables all with a new interaction.

What New Interaction?

We got feedback that while trying to solve some of the more challenging levels, it was getting tedious to go back into the ship to launch or restart the drone. So I made it a button. By hitting the ‘Y’ button. (Left hand – top button on the touch) it triggers this function.

“So I made it a button”

-Ian

Press the ‘Y’ Launch/Restart Button

  • Has the level started?
    • No, level has not started: Pressing the ‘Y’ button launches the drone and starts the level even if your outside the ship
    • Yes, level has started: Pressing the ‘Y’ button restarts the level
      • Where you inside the ship or outside when you restarted the level?
        • I’m Outside: When restarting, the drone will auto launch
        • I‘m Inside: When restarting, the drone will not launch

… this has become my favorite button.

Known Issue

Boo, long load times when going to the Living Quarters. How else are you going to check out what collectables you’ve unlocked. Well for now, you’re going to have to wait. It takes about 15-20 secs to load. Ugh, that’s like forever.

We are going to use an asynchronous load for that oh-so-juicy living quarters content so you don’t have to wait. err… but for now you’re going to have to wait for update. #ironic.

Please check out the update and give me feedback. If you don’t already have The Cosmotic Mission, get it!

Deep Space Exploding Crystal Location

Cosmotic commander, we are now getting more information about the new crystal you might be encountering April 30th.

Long distance bleak data inversion (Long-Dbdi) has been able to pin down a location of a new type of crystal. This crystal has been named expansive-isotropy crystal but typically has been referred to as simply,”Exploding Crystal.”

The proximity to the Cosmotic Crystal should be taken under advisement. Proceed with caution.

Additional Observations

The matrix of this crystal type appears to be empty space. Truly unique characteristic which is upsetting many of our resident scientists for the implications are massive.

The first ever image of a Cosmotic Exploding Crystal taken from extreme long distance.
First Image of Exploding Crystal

The first location captured a few days ago is now void of crystal. All near mater has been observed to be on a new trajectory away from that point. Perditions of an explosion was derived from this finding. Addition information about what caused it to become unstable is yet to be known. Is it like the Cosmotic Crystal?

Last Major Early Access Update for The Cosmotic Mission

We are pleased to announce a major update to The Cosmotic Mission early access on April 30th, 2019. This will be the last major mission update. After this update there will be a content lock down until full release is launched.

This update includes the discovery of an additional galaxy with multiple Cosmotic Crystal site locations. These locations have increased debris and obstacles so it will be even more challenging to collect the Cosmotic energy.

Without this energy, your chances of coming home are marginal.

Warning – New Crystals

First image captured of the newly discovered, highly unstable crystal.

Be on the lookout for a newly discovered, highly unstable crystal spotted this in the area of the new galaxy. Take precautions, for this crystal appears able to emit a lot of force that could damage the drone and other Cosmotic Crystals.

More Collectables

We’ve already sent out canisters for you to collect to aide in your mission to the new galaxy. This includes synthetic crystal fragments of the newly discovered crystal for you to study. As well as provisions for your long mission back to earth.

Software Updates

There will be new software transmitted to your ship adding functionality and drone controls. This adds more control and better launching routines to ensure your mission success.

Get It Now

This early access days are numbered. We have many more details about the full release in coming days. Get your copy today before it goes to full retail value at the Oculus Store.

Spread The Word – Join The Conversation

Please follow us @ThetaREZ on Twitter and join ThetaREZ on Facebook to spread the word about this great game and to join the conversation.