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

art comission.

Fan art for Foolish I'm feeling kinda better so I drew this

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…

What do you think guys in my robot?Just a beginner in 3d modeling..

My instagram https://www.instagram.com/rojhonbb/

Back in my art school days I used to ride the 710 COPSA line from Parque Del Plata to Montevideo almost everyday. This is the Marcopolo Viaggio G4 Mercedes Benz model from the late 80s, one of the older bus models that was running on the line.

Why walk when you can jump?

Let me introduce you to the new Mech line: Gendai Spec. Those are Mech that specializes in surprise attacks, covered operations, and stealth. They are equipped with melee weapons but one of Gendai's frames supports sniper rifles.

Made my first ever animation.

Double Rainbow!!!

The Authority decided to investigate the Basement and leads to recovering classified documents Fun fact: The building has 928 doors and not 1000 doors. #horror