enemy "clumping" problem
pnoland
Member Posts: 36
Heya. I have been making progress with GameSalad but I have come across an issue while trying to create a very basic artificial intelligence for my enemy actor class. Basically I have the start of a space shooter game and I created an enemy spawner that spawns enemies randomly every few seconds using the faux timer setup (mod1 > self.Time%x). I also just have a setup to where every second the enemy ship will rotate to the players position giving it a "chasing" effect. The problem is when I have spawned multiple instances of the enemy they tend to just catch up with each other and clump together. I'm curious to know if there is a way to use the magnitude function on instances of actors so they would know how close together they are from each other? So far my attempts to figure that out have failed...
Here is a quick video showing what is happening and what I want to avoid: [url]
Don't mind the "0" on the enemy ships.
Here is a quick video showing what is happening and what I want to avoid: [url]
Don't mind the "0" on the enemy ships.
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
One thing I've setup to kind of help is that the ships will not chase you until your are a certain distance away but after a little while they end up in the same clumped formation. I suppose once I implement the enemy ship damage it won't be as bad when you are destroying them but if there are a lot of them in the scene it can be a little hectic with a massive clump chasing you haha
1) bounce off of each other
2) combine into a mega boss enemy
3) spawn tiny hornet ships
3) just blow up and disappear
Each of these game mechanics will cause the player to create a different survival/win strategy.
I always think this is the best way of working with limitations within a game system, when presented with a coding issue that's causing issues . . . . dress it up in nice graphics and sound and make it a feature !
Edit: nevermind. If you spawn instances, you can't access them without constraints.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User