playMaker

Author Topic: 100 Orcs WIP  (Read 15252 times)

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: 100 Orcs WIP
« Reply #30 on: July 08, 2014, 06:31:42 PM »
I managed to get to 68 :)

The frame rate problem is still there though, if you have more than say 8 orcs surrounding you.

I know it's not normal gameplay, but after starting, just stand still, and within 10 seconds (as you die) the framerate will drop to 3.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3207
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: 100 Orcs WIP
« Reply #31 on: July 08, 2014, 07:53:40 PM »
This could be a physics problem with overlapping objects. Are you using OnTriggerStay or OnCollisionStay? This could be spamming events when objects overlap...

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #32 on: July 08, 2014, 08:38:52 PM »
This could be a physics problem with overlapping objects. Are you using OnTriggerStay or OnCollisionStay? This could be spamming events when objects overlap...

Thanks for your thoughts Alex! I am currently only using OnTriggerEnter. However, in another problem I ran into, the OnTriggerEnter was causing multiple spamming events in a very very weird fashion.

I found that when I would hit an orc from the right side everything worked great. When I hit one from the left side, the OnTriggerEnter wouldn't clear and as soon as I sent the event back to the logic to see which way to run, it would trigger again as if I would hit it and the Orc would die.

To stop this, I set up two separate colliders that turn on and off after the first hit so the Orc General dude could be hit twice instead of dieing after the first hit. I hope this made sense.   

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #33 on: July 08, 2014, 08:44:06 PM »
I managed to get to 68 :)

The frame rate problem is still there though, if you have more than say 8 orcs surrounding you.

I know it's not normal gameplay, but after starting, just stand still, and within 10 seconds (as you die) the framerate will drop to 3.

I just tried this. I let 36 orcs by my count spawn and I was still getting 58 fps. :(


jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: 100 Orcs WIP
« Reply #34 on: July 09, 2014, 06:02:22 AM »
This is after 5 seconds.

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: 100 Orcs WIP
« Reply #35 on: July 09, 2014, 07:19:15 AM »
Your above screenshot is from the Web build, right?

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #36 on: July 09, 2014, 08:55:19 AM »
Yup! Sure is. When I play it in Unity, I generally stay around 53 fps according to the counter but when I have the stats up, its near 127 fps or so it says.

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #37 on: July 10, 2014, 09:13:27 PM »
I believe I've made a number of improvements to the systems that run the game logic. Please take another gander at the demo and see if you continue to have not so idle performance!

https://dl.dropboxusercontent.com/u/39578945/100%20Orcs%20Proto/100%20Orcs%20Proto.html
​​
Another note: I've zoomed in the camera just a bit. Good idea or did you like the original better?

Also, die at least once and tell me what you think about the Orcs reaction!

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: 100 Orcs WIP
« Reply #38 on: July 11, 2014, 06:15:47 AM »
Performance issue is fixed for me! It briefly drops to 30fps when you die, but recovers back to 60fps a second later.

(Think I preferred the old camera btw. Or maybe somewhere in between)

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #39 on: July 11, 2014, 07:05:52 AM »
Yay! This is good news! Thanks. I've heard that others have also had the fps issues resolved so I would say the evening was well spent!

I did as well on the webplayer but when I looked at it through the Unity Remote, I felt it was just too small. It's an easy fix if I decide to revert :)

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: 100 Orcs WIP
« Reply #40 on: July 11, 2014, 07:59:24 AM »
Out of interest, what was the problem in the end?

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #41 on: July 11, 2014, 10:45:47 AM »
I couldn't be quite sure. But here is what I did:

I am using Pool Manager to spawn and despawn enemies. When I first set this up, I had a strange recycling bug where after the Pool went through all the prefabs and started back at the beginning of the cycle, the orcs would appear backwards. So to combat this, I spawned 100 perfabs of each type of Orc in the beginning, so no two prefabs are used twice.

I finally figured out what was causing this, my mistake; not the Pool Managers. I didn't set keyframes for the position of the axe, arms and the eyes in the beginning of the walk animation so when it respawned, the transform of those sprites were still the same as they are at the end of the death animation.

After that, I took my instances down to 20 each and then put a limit on them.

The next thing I did was prevent the orcs from hitting you after you die. This was a bit tricky but I think the solution works out. No matter what I turned off, the Orcs continued to hit. And I realized that this is based on the position of the hero. They check to see if they are in range and if they are they swing their axes. So! I decided to add a new state and a global event once the hero died that sent the Orcs into a dancing animation so they no longer check for the Hero position.

I got rid of my old camera system and just replaced it with a simpler one. Not sure if this had anything to due with it. But seems to have gotten rid of that edge glitchy thing.

colpolstudios

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: 100 Orcs WIP
« Reply #42 on: July 11, 2014, 11:57:39 AM »
Any chance you could add a restart button for those who are testing please.

The player still shows he is being hit even though he is dead.

You can change direction of the player even though he is dead.


KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #43 on: July 11, 2014, 12:58:12 PM »
I can surely figure out how to add a button :)

I'm not too worried about being hit while dead and changing directions. My plan right now is when you die, a score board type item will popup somewhere near the middle and that should cover those bugs!


KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: 100 Orcs WIP
« Reply #44 on: July 12, 2014, 12:32:33 PM »
Friends I've got some exciting stuff to share! Or at least, I'm pretty pumped about it. In my original prototype I wanted three kinds of weapons, sword, arrows and bombs!

Due to the lack of experience and knowledge I decided had to forego the arrows and bombs because I was just stumped on how to get them to work!

I decided to give it another go! And I'd love to hear your feedback!

To use the arrows you hit the right mouse button and bombs are the left shift key!

https://dl.dropboxusercontent.com/u/39578945/100%20Orcs%20Proto/100%20Orcs%20Proto.html