Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
actor limit?

presidentg
Registered User
Quote
2023-06-12 03:29:46

Im trying to create multiple units/actors for my rts game however when trying to create the 5th ai/unit it doesnt work (The ai wont shoot and it will just snap to target without moving). The same thing happens when I try to copy an existing unit, it just doesnt seem to work. Is this a bug in coppercube or am I forgetting to change something?


sven
Registered User
Quote
2023-06-12 11:22:28

I dont think so that there is limit.. at least limit cant be 5 .


VP
Guest
Quote
2023-06-12 13:08:54

It could be caused by a few things. We need more info to be able to diagnose/help properly without guessing. The following common problems may be useful...

1- Do the nodes have collision enabled? When you create a new unit, where are you placing them in the scene? The new unit may simply be getting stuck in the ground (or stuck on another unit) when it's spawned. It may be unable to move but still able to look around/turn - try spawning it slightly higher so it doesn't get stuck.

2- How are you creating the new units? Are you simply cloning an existing node - or using scripting? Depending on how the actions/behaviours are scripted, cloned nodes can sometimes confuse coppercube; each new node will have a unique identifying number which needs to match the action/script.

3- If you've used the built-in "Game Actor" behaviour, have you also made use of the "Attacks Actor with Tags" option? If so, you can also use variables to determine what happens when the node attacks (use the "on attack box" in the character behaviour section) and then increase the "activation radius" to ensure they actions are being triggered by the player/enemy proximity, dictated by the Tags you set.

4- Also, in the "on attack" action box, you'll need to use a "restart behaviours of a scene node" command to reset the attack/activation. It may simply be that the unit has already attacked and hasn't been reset yet - in that case, it will just look at the player/enemy without attacking it.

There are other scenarios I can think of, I've encountered the same thing myself but it depends on how you've set up your game as to what the problem may be. Just to confirm, there's definitely not a hard-limit to the actors/characters you can have in coppercube. Just for the record, I've tested a game in the past with over 1000 simple wasp enemies that were all identical clones and spawned from a central hive - and they all functioned perfectly with "Game Actor" behaviour set to "random patrol" and "Attacks Player".


presidentg
Registered User
Quote
2023-06-13 05:56:19

I did a bit more messing around and experimenting and I've came to find that you any number of ai/ actor is allowed HOWEVER for my case in order to make that work, I needed to clone a specific unit that would actually work upon cloning which was a smg unit. Im really not sure why its the only one that works but for now its a solution. After that I had to import my actual unit model and parent it to the normal unit and make the original units textures invisible so youre able to view the actual unit model. Im still not sure why I cannot create a whole new actor but for now this strategy works.


VP
Guest
Quote
2023-06-13 08:29:31

Glad it's working. Yes, that's a perfect workaround. I'mn ot sure why that happens with certain models.

To improve on your solution, you can use what most people consider a "Dummy Node" instead of your invisible SMG unit. Usually I create a sphere with zero polygons, then child the actors/models to that.

Your way is exactly the same, but a sphere with zero polygons uses less resources - especially if you're cloning many of them.

The good thing about a dummy node as a parent, is that you can then do extra things with it - for example: swapping the child model but keeping the parent the same (for upgrades etc), or rotating the child model in any direction while the parent unit is moving (good for tank turrets), or flipping your model 180 degrees (if your model is ever imported facing the wrong direction).

A good practice is to add all your scripts/actions/behaviours to the parent - to allow you to swap the child with no issues. You can copy and paste them from one node to another using "CTRL + b" to copy, then "CTRL + j" to paste.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact