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

Bandana Dee the Dream Friend

Smile! Here, take some happy pills! ✨💊 #Blender #3DModelling #3DArt Buy me a Ko-fi: https://ko-fi.com/barbarafb_

Runestones: from concept to in-game model🗿

So here's the first of the zodiac signs i will make for the next weeks.

In the quest for accessibility, I'm adding Resurrection Shrines for players on the 'novice' end of the platforming spectrum.

In order to unlock the power of a Shrine, you must collect 3 'Souls' from your dead corpses! (the floating blue orbs)

Rockin the Guitar, an Axe like Guitar I made for my Uni project

Alone Together....

Who's is this little cutey👸 here? Thanks🙏 for a gorgeous fanart @WheNa! Feel free to share your arts, screenshots, or videos with #playzelter or #zelter hashtags! #pixelart #animating #unity3d #animated #indiegames #unrealengine #animate #conceptart

If you’ve played the Vault demo and enjoyed it, please consider ‘liking’ the game page here on Gamejolt and/or leave a comment!

Also please consider tossing Vault on your Wishlist, I really appreciate your support!

https://store.steampowered.com/app/1251800