Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Rts enemy and ai

presidentg
Registered User
Quote
2023-06-03 03:22:09

How can I create a simple enemy without using the default coppercube ai, it is really buggy and just not that great. I looked at the source of this one rts game called Geoforce core but I can seem to make the ai and behaviors work on my game. Anything I can use or do?


Guest
Guest
Quote
2023-06-03 04:05:40

Start with a cube/cuboid as tall as the player in the center of your scene. Use a texture to designate one side of it as the face of enemy. Preferably use code, but if you can't program, then try to make the enemy face your player at the start of the scene with visual scripting. After you have that working reliably you can try making it so the enemy only turns to face the player when the player is within a certain distance of the enemy. Naturally you would then make it so the enemy pursues the player next. Furthermore if the player leaves the radius of the enemy's turn-to-face-player mechanic, you would then want the enemy to go back to idling or whatever. Then attacking, dying, etc. Basically you need to break your enemy's behavior down into easily understandable actions and reactions (states). Start small.


presidentg
Registered User
Quote
2023-06-03 05:43:16

sorry I should have been more clear, I'm making an rts game so there isn't just one player character, its multiple characters per say so I wouldn't be able to make it face a specific character. What I'm looking for is an ai that can move and shoot at those characters.


Guest
Guest
Quote
2023-06-04 03:05:14

If this is your first game I recommend you do something with less complex behaviors. Maybe hold off on this project until you get more familiar with programming. Just my 2 cents.


presidentg
Registered User
Quote
2023-06-04 05:05:24

Ive made multiple games before in the engine and quite familiar with it. I just dont know what alternatives to use instead of the awful cc ai.


Guest
Guest
Quote
2023-06-04 09:18:34

First off stop thinking of it as an AI. That makes it sound way more complicated than it is. Your best bet is to sit down and make up a list of behaviors/actions that you need your units to do. Do they move in formation? What do they do when not moving? What happens when half the unit is destroyed? Will they flee? Surrender? You can see there is no one-size-fits-all solution for your problem. The alternative you seek is a large chunk of your game that someone would have to write. If someone else does that for you then you will not be satisfied because you have no control over it. You will be back at square one in no time. I recommend you start small if you proceed with this project. Try getting a group of cubes to move together in unison first. RTS games have a lot of similarities with tabletop wargames. Use their rules to get a grasp of how your game should function before adding your own taste to it. Plan it out to demystify the needs of the program and then learn to code. One step at a time, friend.


okeoke
Registered User
Quote
2023-06-04 15:12:52

I would start by thinking what your map design will look like. if you are going to move you units, it means that they most likely will face some obstacles on they way - stones, buildings, other units, etc. Since ccb doesn't have any built-in path finding algrorythm you need to figure out how to implement it yourself, and exact implementation will most likely be based on the map design.
I would say build a simple test map the way you want, than implement one unit which can navigate through the map. I'm pretty much sure, you will reject the idea of making an RTS with coppercube at this stage:)
For the starters, you can check other threads with the same topic:
https://www.google.com/search?q=...

Especially, this one https://www.ambiera.com/forum.ph...

If you're looking for a specific engine for rts, you can check spring engine, it's designed specifically for rts - I never used it but I believe, there are some tutorials on youtube, it also seem to have a decent documentation.
The other simple way would be to make a mod for some old blizzard game like starcraft 2 or warcraft 3 - they both have great editing tools, which allows you to make almost total conversions. I'm also not that familiar with sc2 modding, but for wc3 you can check "hive" which is a biggest modding community. You can find all required tools and also a tone of free to use resources there.


Guest
Guest
Quote
2023-06-05 20:36:01

Guest wrote:
First off stop thinking of it as an AI. That makes it sound way more complicated than it is. Your best bet is to sit down and make up a list of behaviors/actions that you need your units to do. Do they move in formation? What do they do when not moving? What happens when half the unit is destroyed? Will they flee? Surrender? You can see there is no one-size-fits-all solution for your problem. The alternative you seek is a large chunk of your game that someone would have to write. If someone else does that for you then you will not be satisfied because you have no control over it. You will be back at square one in no time. I recommend you start small if you proceed with this project. Try getting a group of cubes to move together in unison first. RTS games have a lot of similarities with tabletop wargames. Use their rules to get a grasp of how your game should function before adding your own taste to it. Plan it out to demystify the needs of the program and then learn to code. One step at a time, friend.


It literally is AI though, how else are you supposed to think of it as. It will be complicated either way.


Guest
Guest
Quote
2023-06-05 21:56:19

It is not literally anything of the sort. It's all predefined by the programmer. By your logic a stoplight is intelligent. What is called "AI" in games is actually a finite-state machine (FSM) where the state of the thing in question is limited to only a single state at a given time. An enemy for example can have a series of states: idle, move, attack, flee, die, etc. The programmer defines when these states transition. For example when an enemy is in the "attack" state and its health is less than 10%, it will transition to the "flee" state to avoid the "die" state. How many complexities the programmer adds to this model can go a long way to increasing the illusion that this enemy is an intelligent being but it's all just smoke and mirrors.


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