Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 26, 2016 11:32:39 GMT
Hi, i was making a single player mode for my little shooter until now, and all's well there since the levels/waves are straightforward with no random stuff. Now i'm up to the challenge of the Endless Mode, and i'm even more delighted with the options CGK offers, however there's one small thing i'd like to get advice on. The Endless Mode design goes like this: It is using Global Waves with multiple syncro spawners. Every level plays the waves in random order (from a pool of, let's say, 100 waves). To keep the wave number in check (for example's sake, we'll say there's 3 waves per level) i added a variable modifier (let's call it a "counter", which adds +1 to a variable every time the wave is complete) as a wave completion bonus, and after it hits a certain threshold (in this case, 3), i start the wave with the boss for that level. Here comes the point. The trouble is, waves will be timed and intertwined to keep the action going (wave 2 will start before wave 1 ends, wave 3 will start before wave 2 ends etc.), so the wave 4 will start before the counter hits number 3 and when the wave 3 finishes, the game will jump to the boss wave with wave 4 (which i don't even want) still in progress. Here's a small diagram to make it clearer:  I can't put Pause Global Waves nor Wave Completion Custom events on any of the waves since they'll be played randomly. I can put the Skip Wave Limit which will have the variable threshold -1 value on all waves (except the boss wave) to simply skip all the remaining waves, but that would also start the boss wave before the current wave ends. Besides that, it complicates things on the following levels, i would have to make a variable and increase it each level, i may easily lose track. Any advice on how to solve this?
|
|
|
Post by DarkTonic Dev on Dec 26, 2016 19:32:49 GMT
If your waves are not "elimination" then you can simply not use Syncro Spawners to get what you want. Use Triggered Spawners instead and wave the waves spawn from a Custom Event that you fire in "Wave Completion Bonus" in Global Wave setup. Triggered Spawners have "Wave Spawn Bonus" section for modifying variables.
If they are elimination waves, then you just won't be able to overlap waves unless you use "Delay wave" fields on individual spawners (having more than 1 in each wave) and actually make a group of waves in a single global wave. You could for instance do 10 spawners with progressive delays so it's really all one global wave.
Let me know if any of that gets you closer.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 26, 2016 20:19:54 GMT
Hmm, but how will i trigger random spawner? I have 20 syncro spawners on scene (5 for each side), and that's why syncros are handy, i can choose a random subset, and further more, limit the number of subset activated at the same time, so there's no chance of no spawner activating, or all of them activating at once.
|
|
|
Post by DarkTonic Dev on Dec 26, 2016 20:27:11 GMT
I would do it like this.
1) Set up the global waves to play waves in random order. 2) Use "Wave Completion Custom Events" on each Global wave to fire a custom event which X Triggered Spawners listen to. You could use zero Syncro Spawners and rely entirely on these. The global waves would be timed waves. 3) Make a bogus level 1 with 1 wave just to quickly fire its Wave Completion Custom Event and go to the Level 2 (which is random order).
In the Custom Event setup, you can choose Random X or Closest X custom event receivers by the way. You don't have to notify all receivers.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 26, 2016 20:43:38 GMT
I'll check it out and let you know how it works, thanks 
|
|
|
Post by DarkTonic Dev on Dec 26, 2016 20:54:19 GMT
No problem.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 28, 2016 15:11:18 GMT
Hmm, i'm a bit fried from work, but i tried it a bit, and here's what i'm maybe missing, or it's maybe not possible.
By using syncro spawners, i can choose what spawners will spawn what wave, which i need since the enemies are coming from all four sides, so waves with enemies moving from left to right will spawn only from a random subset of syncro spawners that are on the left side of the screen.
Is there a way to set up triggered spawners for a wave like in global waves since, as far as i can see, you can only spawn from pool or a specific prefab, not a global wave.
|
|
|
Post by DarkTonic Dev on Dec 28, 2016 17:50:27 GMT
Hmm, i'm a bit fried from work, but i tried it a bit, and here's what i'm maybe missing, or it's maybe not possible. By using syncro spawners, i can choose what spawners will spawn what wave, which i need since the enemies are coming from all four sides, so waves with enemies moving from left to right will spawn only from a random subset of syncro spawners that are on the left side of the screen. Is there a way to set up triggered spawners for a wave like in global waves since, as far as i can see, you can only spawn from pool or a specific prefab, not a global wave. Not sure I understand what you're asking, but I believe that you will need a different Custom Event for each group of Triggered Spawners that you want to spawn stuff. Were you trying to use a single one? In this way whenever Custom Event X fires, you can have specific Triggered Spawners that are listening for that event spawn whatever you like. Or a random subset of them can be used instead.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 29, 2016 9:35:07 GMT
That's ok if i'm using Syncro Spawners, what's the point of setting up global waves if i can't spawn those waves using triggered spawner but only syncro spawner? Oh i get it, do you mean I should set up empty timed global waves which would only serve as triggers for Triggered Spawners via Wave Completion Custom Events? I would use Syncro Spawners with no assigned waves (Prefab To Spawn: None) only for sake of position of emitting the Custom Events, i.e. hitting the random closest Triggered Spawners on the appropriate side of the screen, then in the Triggered Spawner choose whatever i want from the prefab pool. I guess i could also use the Skip Wave Type too to skip firing the custom events which i don't want to be fired until the, for example, Experience variable is high enough? I still don't understand how will i, by using this system, make global waves pause after three waves so there's time to finish the wave and then fire a custom event that will start the Boss Wave. Out of curiosity, if i WOULD use Syncro Spawners for actual spawning, is it possible (on runtime) to get a currently running wave, set it to Elimination Wave Type, pause Global Waves and set a Wave Completion Custom Event to fire a Boss Wave? I see there's a private _currentWave variable in the syncro spawner class. I tried to post last night, but this was too much for me at the moment
|
|
|
Post by DarkTonic Dev on Dec 29, 2016 23:37:17 GMT
Yes, empty timed waves - but that goes even further than what you're saying.
I'm saying you don't need any Syncro spawners at all for anything. You can delete them. The Wave Completed Custom Events settings are on the Global wave settings anyway, not on the spawner's waves, so you can still set that up without any syncro spawners. You would position your Triggered Spawners where you want things to spawn from, just like Syncro Spawners would be positioned. The Custom Events will be fired from the position of LevelSettings game object, which might not be what you want if you want to do "closest 4 spawners" or something. But you could put a script on the LevelSettings game object to move it to follow the player or whatever if that would make it work (not sure how you want things)
Yes, you can use Skip Wave Criteria if you like.
To pause the global waves, you could just have another timed wave for X seconds that has zero Custom Events to fire, then it moves on to the next. Does that work?
Your final question, yes you could do that, but I think it would have no effect, because I seem to remember that the Global Wave Settings are copied into another copied object when the Scene starts because certain things have to be looked at in advance for the code to work properly. You shouldn't be changing wave type at runtime, can't guarantee it will work. You could try.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 30, 2016 9:39:03 GMT
Oh, it uses the Level Settings position, that's useful info. I was thinking of putting 5 Spawners (in this case Triggered) on every side of the screen and then i'll just make the Level Setting object change the position close to a random Spawners group every few seconds and fire an event for a random subset of them. That will do the trick for what i'm trying to do.
As for pausing the global waves, i can start an empty timed wave right at the start of the level, set its duration to desired level duration and check Pause Global Waves when the wave is completed, that would prevent further spawning upon reaching last wave before the boss wave. Then, to make a kind of elimination wave out of the existing enemies, i can simply check if any objects with enemy tag are visible, when not, i fire go to boss wave and voila. That way i also prevent waiting for boss after the wave is complete.
That kinda sorts it out, thanks again!
|
|
|
Post by DarkTonic Dev on Dec 30, 2016 20:25:01 GMT
Cool. Keep in mind that if your boss wave wants to use syncro spawners, they too will move around when LevelSettings moves since they are sub game objects. So you may need to move it back to where you want it prior to starting boss wave.
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Dec 30, 2016 21:20:20 GMT
Oh, i'll use just Triggered Spawners, but thanks for the info, the more the better 
|
|
|
Post by DarkTonic Dev on Dec 31, 2016 0:33:47 GMT
Cool, good luck!
|
|
Oshigawa
Full Member
 
Posts: 228
Posts: 228
|
Post by Oshigawa on Jan 2, 2017 18:31:32 GMT
Ah, i have a little problem regarding the movement of level wave settings around. It seems that the spawned enemies move around with the level wave settings object.  I think i'll stick with the syncro spawners and keep one triggered spawner for bosses only. As you know i'm using playmaker, i have two questions regarding the Wave Pause Action: 1. Does the Wave Pause action completely stops spawning everything in the current wave? 2. Does it stops all the syncro spawners from further spawning? (i guess so, because of the Wave Pause Behavior setting)
|
|