playMaker

Author Topic: Buhgaawk - WIP  (Read 774 times)

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Buhgaawk - WIP
« on: January 04, 2022, 06:24:12 PM »
This is my current wip:
Buhgaawk

In it’s current form it is a very basic Flappy Birds clone.
I started with that, as I wanted to have the most basic game mechanic I could think of and then recreate that with Unity and Playmaker to teach myself both Unity and Playmaker basics.
I am fairly happy with the look and feel of Buhgaawk and I have to say that I learned a lot on the way. This is the first time I actually used a design document with clear milestones and goals. This helped me immensely with keeping things in scope and focus on what I wanted to achieve: have a game that could be considered “done”.
I am at a stage though, where I am not sure whether I should add all the stretch goals that I had for it or just leave it as it is and move on to the next project.
Maybe I can prioritise the stretch goals and just add some of them.

I would love to hear your feedback.

Thanks in advance.
« Last Edit: January 04, 2022, 06:26:41 PM by BrotherWrong »

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #1 on: January 06, 2022, 11:19:34 AM »
I added the first stretch goals:
- increasing difficulty by spawning obstacles in shorter succession based on score
- added a menu for customizable player character
- Difficulty (Speed) selection
- added credits screen

Open ideas/stretch goals:
- "The ground is lava" as additional difficulty increase
- Pause menu with options (currently not working due to mouse issues)
- Particle FX on level change/high score
- Online leaderboard
- animated depth of field
- music selection/toggle

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6911
    • jinxtergames
Re: Buhgaawk - WIP
« Reply #2 on: January 06, 2022, 02:20:31 PM »
Hi.
I did a quick try on your game.
Its good that you start with simple mechanics just to learn.
Many people start immediately with their 'Dream Project' and hit a lot of walls and quit.

I noticed some lag going on.

How are you doing the back ground object and tubes (create/destroy, Pool, move to position)

Is the background moving or the character?

I'm just asking so i can advise you on how to improve performance :)

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #3 on: January 06, 2022, 06:19:40 PM »
I noticed some lag going on.

How are you doing the back ground object and tubes (create/destroy, Pool, move to position)

Is the background moving or the character?
Thanks for your feedback.
I’m surprised about the lag. Everything’s low poly and is destroyed as soon as it is out of sight. The character is only moving up and down. The rest is done with Translates on the background items.
I guess I could give it a sprite background to save on resources but I wanted to try out the spawning of random objects from an array. ;)
I uploaded the latest version a couple of minutes ago.
Maybe have another look?
Cheers!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6911
    • jinxtergames
Re: Buhgaawk - WIP
« Reply #4 on: January 06, 2022, 08:44:53 PM »
Hi.
Exactly :) Create/Destroy leaves a lot of garbage

instead you can do 2 things, move the objects when they are offscreen or look into pooling.

you can find a simple pooling package on the Ecosystem

What pooling does is preload prefab objects (disabled) and you can then spawn / Despawn them from its list.

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #5 on: January 07, 2022, 06:00:34 AM »
Exactly :) Create/Destroy leaves a lot of garbage
Oh? I had no idea. How do they leave garbage?

instead you can do 2 things, move the objects when they are offscreen or look into pooling.
Move? I'm not sure I understand, what you mean by that. Move them where?


What pooling does is preload prefab objects (disabled) and you can then spawn / Despawn them from its list.

I will definitely look into that. Thanks!

But as I said, I'm surprised there is lag at all. What platform are you using?
I would have thought that most platforms theses days would easily handle something like Buhgaaawk. 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6911
    • jinxtergames
Re: Buhgaawk - WIP
« Reply #6 on: January 07, 2022, 11:35:45 AM »
Hi.
search for "unity garbage collection" you can find a lot of information on this.

With 'move' i mean once the its off screen (background/tubes) then you can position it to the right side offscreen.

here is one of my old tutorials on background scrolling, it has also pooling in it.


Quote
But as I said, I'm surprised there is lag at all. What platform are you using?
I would have thought that most platforms theses days would easily handle something like Buhgaaawk.

It's not about the platform, but about how it's coded.
And a common mistake for beginners is using Create/Destroy objects during gameplay.

in the unity editor you have a 'Profiler' and when you play the game you can see that you will probably have some peaks every x seconds.
these peaks can cause lag and are caused by garbage collection.

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #7 on: January 10, 2022, 05:32:59 AM »
Definitely looking into that. Thanks.

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #8 on: January 18, 2022, 03:20:06 AM »
Hmmm...
I have now removed the whole create/destroy setup and have implemented the pooler mechanics. With very weird results though. I get 3 or 4 spawns out of my obstacles then the prefabs only pop up partially, meaning parts of the collection of primitives are missing. Then they seem to stop altogether and only the hitboxes are spawned (yay, invisible obstacles!).
My background items spawn just fine for a good while and then they pop up all over the place and in all levels of scaling.
What am I doing wrong?

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #9 on: January 18, 2022, 07:42:23 AM »
I get 3 or 4 spawns out of my obstacles then the prefabs only pop up partially, meaning parts of the collection of primitives are missing. Then they seem to stop altogether and only the hitboxes are spawned (yay, invisible obstacles!).
It seems that from the third spawn onwards the children game objects aren't being activated. Why would that be? I don't see any recursive options in the "Pool Spawn" action. Any pointers as to how I can avoid this behaviour?

My background items spawn just fine for a good while and then they pop up all over the place and in all levels of scaling.
What am I doing wrong?
I was able to fix this by not using "Set Parent" after spawning the pooled objects. It seems that making them a child of an empty game object breaks the association to the pool and they had any Transform actions overwritten by the parent object.
This makes my hierarchy pretty messy, but I can live with that.

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #10 on: January 18, 2022, 08:46:22 AM »


I get 3 or 4 spawns out of my obstacles then the prefabs only pop up partially, meaning parts of the collection of primitives are missing. Then they seem to stop altogether and only the hitboxes are spawned (yay, invisible obstacles!).
It seems that from the third spawn onwards the children game objects aren't being activated. Why would that be? I don't see any recursive options in the "Pool Spawn" action. Any pointers as to how I can avoid this behaviour?
[/quote]
FIXED:
I am using a Trigger Event to mark my obstacles for deactivation.
One of the child objects was touching this trigger before it's parent object and was deactivated before it's parent, which caused the issue.
Pooling does NOT like parenting... :P



djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6911
    • jinxtergames
Re: Buhgaawk - WIP
« Reply #11 on: January 18, 2022, 08:56:58 AM »
Hi.
Parenting is ok, but disabling the parent with pooled children will give issues.

there are solutions for it, for example the main parent, disable it further away so that the other pooled objects already despawned.
(give the main a different tag)

BrotherWrong

  • Playmaker Newbie
  • *
  • Posts: 14
Re: Buhgaawk - WIP
« Reply #12 on: January 21, 2022, 09:53:47 AM »
Thanks. I checked it out and found the issues as mentioned above.
Really appreciate your support on here. Thanks man!