Game
Space Cadet Bert
9 years ago

v0.0.2 - Introducing basic enemy spaceships


Space Cadet v0.0.2 Now Available.

Hi everyone,

Today sees the release of v0.0.2 of Space Cadet Bert. I’ve added the basics of enemy ships flying around the asteroid belt.

The first attempt at some asteroid avoidance was using GameMaker’s built-in potential_step function. I was not happy with the results. The potential_step function works fine for the blobs on the asteroids edging around the stationary rocks but that behaviour doesn’t look good for spaceships avoiding moving rocks. As I haven’t spent much time with potential_step I am planning to look at some tutorials and see if anyone has attempted anything similar to what I want to achieve.

Another method of obstacle avoidance I have seen is using a force field or vector field. The basic principle is to have an “anti-gravity” force for each spacerock. Instead of attracting objects as gravity would, the hazard exerts a repelling force on the object, deflecting the object to the side. As the spaceship approaches the spacerock the force increases, preventing a collision. This should give the appearance of the spaceship steering away from the spacerock.

Here’s an article I found interesting

I also had a look at the Inverse Square Law and Newton’s Law of Universal Gravitation for a quick physics refresher.

After making a few notes, I created a new object and wrote some code. For the first attempt I settled on a simple formula which gives a linearly increasing force once the spacerock crosses the detection threshold. The force direction is directly outwards from the spacerock.

Here’s the important line of code:

RockForce = (EnMaxSpeed) * (1 - (RockDist / DetectRange));

For a simple model, the results are good.
Here is a video showing how things run at the moment

For future development I am going to try some other methods of calculating the force. An alternative is to use a constant force but calculate the direction more effectively. This would mean when heading directly towards a spacerock, the force is fully to the side, and when the spaceship is already to the side, the force acts in the same direction as the spaceship movement. Of course, I may find something useful using the GameMaker motion planning functions.



0 comments

Loading...

Next up

Just as Pecaminosa's musicians #improvise this rendition of #LittleSunflower 🌻, so do we improvise with this post you're reading. 😂

What's coming out of your own improvs? 🤔

#Pecaminosa | #IndieDev | #OST | #Jazz

Bandana Dee the Dream Friend

Finished a project I've been working on over the last few days!

Modeled and textured in Blender.

#3dart #lowpoly #npbr #fantasy #hut

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.🛡🗡 Bookmark pre-launch page🔖🔖🔖

https://www.kickstarter.com/projects/rdvindiegame/the-patagonian…

Quantum precognition is one of the most powerful cards. End game cards & equipment. Demo/alpha build boss is no match for this deck.

Finished work on the emotions of a new character for the tank universe

Hi everyone! I started to create some environment props for my new video game, here is a cozy house in the forest. I'm planning to switch from Unity to Unreal... Let's see what new challenges I have to face. Made in Blender and Substance Painter.

Showing off player 2 😎

What do you think?

My D&D art for my family so far (WIP if you couldn't tell)