You are browsing as a guest. Sign up (or log in) to start making projects!

Bevy Hunter

  • 4 Devlogs
  • 11 Total hours

a top down shooter, that can load thousands of birds

Ship #1 Pending review

What did you make?

I made a top down shooter with the Bevy engine and Rust to test Bevy’s limits.
Features:

  • Zooming in and out
  • aiming with the mouse pointer
  • spawning thousands of birds without lag
  • changing the max number of birds with the scroll wheel
  • a simple menu to quit the game
  • an UI to see the FPS, max number of birds and current number of birds.

What was challenging?

It was hard to find tutorials for bevy, because I just found old tutorials but with the Bevy migration guide it worked.
And the system, to check if a bullet hits an enemy, was hard to optimize for thousands of enemies.
And the borrow checker was a bit weird at first.

What are you proud of?

I am proud, that I tried Bevy, because I was afraid, because it has no code editor and I only used simple languages like Lua and Python before.

What should people know so they can test your project?

I didn’t get mac support working but you can download the Linux and the Windows version of the releases site on Github.
For the Linux users: I don’t know why but I got more stable FPS with wine and the windows version.

  • 4 devlogs
  • 11h
Try project → See source code →
Open comments for this post

4h 28m 45s logged

Twin!

I now have a name for the shooter: Bevy Hunter (because of the engine), yk
But at this point I would call it more an experiment rather than an game.

The biggest change is:

a spawn logic

The birds are spawned on a random position in a circle around the player.

To show of the performance of bevy I added a max bird counter and you can adjust the counter with the scroll wheel. Like the name says, you can adjust how much birds are rendered.

And I also added some small things like

  • I switched the zoom from the scroll wheel to e and q
  • a rapid fire when you press right mouse button
  • I added a simple menu where you can exit the game
  • a simple UI, that shows you the fps, birds spawned and the max birds.

With that setup I get like 500 FPS without birds and 40 - 80 FPS with 100k birds. But it is also depends on the zoom.
You can see that in the video.

I think there will eventually some small changes. But I’m happy with my current game

0
0
5
Open comments for this post

3h 29m 27s logged

Yo Twin!

Finally there are enemies!
But here is everything I did:

1. My own sprites

I thought of a good theme for the game and now the enemies are birds (because of bevy, yk) and you are the hunter. And it isn’t top down anymore and the gun follows the mouse and not the player.

2. Infinite map

I deleted the old map and just changed the background color. It is just cooler I think.

3. Zoom

You can zoom out. That’s important for later when there are more enemies

4. Removed Walls

I removed the complete collision system rapier2d. It is just to heavy for the enemy and bullet collision and I don’t have walls anymore

5. Enemies.

There logic is very simple. The code just searches the direction to the player and then it goes in that direction.

6. The best part: The enemy kill system

Here’s how it works:

  • I get all bullets and their position in one vector.
  • I do this: if bullet_pos.distance_squared(enemy_pos) < 20. and
    checks if the euclidean distance between the bullet and the enemy is under 20
  • If it is true I delete the bullet and the enemy

I saw others do it not with distance_squared() but with distance() but that squares roots of a number and thats to heavy.
Without it, I can spawn more enemies.

In the video you can see the enemy counter in the left bottom corner, btw.

Ok that was everything, I think.
Bye Twin!

0
0
7
Open comments for this post

2h 27m 42s logged

TWIN

2nd Devlog and I understand Bevy halfway.
And I have 20 Tabs opened with some examples.

Here are all changes:

1. Downgrade to Bevy 0.15

At first I was on the newest version of Bevy (0.20) but there is no event system and less tutorials than on bevy 0.15 so I just use the older version.

2. Textures

There are just placeholders from kenney.nl but they work fine.

3. Rotating and Shooting

I wanted a movement like in SAS: Zombie Assault (an old flash game). That means you move with WASD and aim with the mouse.

And you can also already shoot with left mouse button. For that I used the bevy event system. That means when I press left mouse button it sends an event and if that event sends it shoots.
That sounds way to over complicated but it is important for weapon switching later.

I also tried a weapon switch system.

4. Collision boxes.

I made Walls with rapier2D.
It was at first a bit complicated because every objects need an rigidbody and in Godot only Physics objects needed that and to control the player I must control a KinematicCharacterController instead of the transform but idk why.

5. Smooth Camera

The camera is a bit slower than the player and that looks cool

Ok bye Twin!

0
0
9
Open comments for this post

18m logged

Yo Twin!

I want to build a top down shooter in bevy.
Now you maybe ask:

What is bevy?

Bevy is a game engine build in rust without a gui.

Now you think:

But why bevy?

Bevy has an ECS (Entity Component System), that allows you to spawn 200k enemies without lags.
And I think it looks hard to code (and it is hard)

My current progress is a moving rectangle.
Ok bye Twin!

0
0
2

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…