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

Path of Kami: The Evolution of the Lore

One of the most critical update for Sunblaze demo. Now you are able to pet a cat! Finally!

I worked so hard to get all four of them to the end safely, but then...

An infected room from the second part of Cybel ! Are you up for some cleansing?

Today I tackled drawing different variations of facial expressions for one of the main characters in Eden. What do you think of it? :) Eden: https://gamejolt.com/games/Eden/592698

If you have more of an acquired taste, the restaurants in Niravasi have you covered! Maybe skip the salad bar, though.

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

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

I just wanted to introduce you to my latest musical production and hear some opinions about it. Thank you very much.