Not logged inOpenClonk Forum
Up Topic General / Feedback and Ideas / Improve Clonk AI
- - By Travis Date 2009-06-09 13:14
I'am really a fan of the basic Clonk gameplay that usually includes more Clonks than one, but when I play CR these days, I'am often really dissapointed about their AI, I mean there is not really some.
Clonks never even find the simplest ways to a base. An uncontrolled Clonk that falls accidently into water, just drowns like he was always commiting suicide. When you walk around with three Clonks, you don't get up a hill without frustration, because they always jump in different directions or just don't do what the "leading" Clonk is doing. Uncontrolled/unattended Clonks in a base are a good opportunity for the enemy to kill them all at once with a firebomb or something, and then just looks them burning like candles, because they never going to try to put the fire out.      
I hope there will be a change in OC, so the Clonks going to interact better with the landscape and some other "special" situations. To make it clear and simple, just some ideas/questions:

-is it possible that the game keeps analysing the landscape during the whole round, including any change, without too much effort, so the Clonks can find ways on there own?

-or is it possible that the whole waypoints did by human players during the round, are going to be saved, so they can be emulated by the AI-Clonks, without to much effort?

-is there any chance that the "leading" Clonk in groups, played by the human, sets up marks/waypoints, so the other Clonks not just move in his direction, but emulate his way in every single step?

- uncontrolled Clonks should react in special situations (like the examples above), they should try to hide from continous arrow-firing or Flint-throwing, perhaps they should even run away into the base, when the enemy seems to be stronger

-there should be an easy way to give one Clonk (with the mouse?) the command to collect gold-pieces in an area and put it into the lory, without falling down in a shaft or something

Of course I have even more little ideas about what could Clonks do alone, but at the moment I'am curios what you think about this ones.
I know at the moment Clonks are just "witty and nimble, if skillfully controlled", but I think in the future there is a chance that they are learning at least a bit, to do more things on their own and find ways without any help. :-)




  
     
Parent - - By Enrique [de] Date 2009-06-09 13:48
Yea you are right. But i would add something to

>uncontrolled Clonks should react in special situations


Well Clonks should also try to survive by their own, for example, if a clonk was used and then the clonk changes, but the old clonk is fallen in water (by earthquake or so) so that this clonk tries, if he cannot brathe, to swimm up for brathing.
Reply
Parent - By Travis Date 2009-06-09 18:08

>An uncontrolled Clonk that falls accidently into water, just drowns like he was always commiting suicide

Parent - - By Zapper [de] Date 2009-06-09 18:37

>Well Clonks should also try to survive by their own, for example, if a clonk was used and then the clonk changes, but the old clonk is fallen in water (by earthquake or so) so that this clonk tries, if he cannot brathe, to swimm up for brathing.


And what if you do not want your Clonk to act on its own? Like you want to drown your several offsprings in arctis. Or you just want to stay underwater because there is somebody at the land just waiting for you. You cannot just say "Only if you have not selected the Clonk" since at least I am playing with more than one Clonk at one time at lot
Parent - By Maddin Date 2009-06-09 18:56 Edited 2009-06-09 19:47

>Like you want to drown your several offsprings in arctis.


I always found that cruel. xD
Parent - - By Enrique [de] Date 2009-06-09 20:16
Well it is a different betwenn getting into the water by desaster or by player ;)
Reply
Parent - - By Zapper [de] Date 2009-06-09 20:54
How would you distinguish that? "Fell into water after pressing a key in the last ten seconds"? I don't like the idea of adding additional rules
Parent - By Enrique [de] Date 2009-06-10 17:15
No. If the have  a command like chop and fall then into water.
Reply
Parent - By Fireknight [ch] Date 2009-06-10 19:21
<And what if you do not want your Clonk to act on its own?

Context Menu ftw ;)
Reply
Parent - By ker [se] Date 2009-06-10 11:26
I'd rather not have my clonks do something on their own that I have not told them beforehand to do.

Doing something to prevent death/damage while solving an automated problem (go chop wood, dig out that rock), now that would be something to talk about imo.
Parent - - By Zapper [de] Date 2009-06-09 14:35

>- uncontrolled Clonks should react in special situations (like the examples above), they should try to hide from continous arrow-firing or Flint-throwing, perhaps they should even run away into the base, when the enemy seems to be stronger


I really don't think they should do that. It is propably even more frustrating when your Clonks do anything stupid that you didn't tell them than when they just do nothing when you don't tell them. Like when a Clonk that is attacked runs straight into the line-of-fire of your cannon (and you really, really didn't tell him to do that!)

>-is there any chance that the "leading" Clonk in groups, played by the human, sets up marks/waypoints, so the other Clonks not just move in his direction, but emulate his way in every single step?


That could really be done - maybe even via script if there is better support (like just disabling the auto-control) for that.

>-is it possible that the game keeps analysing the landscape during the whole round, including any change, without too much effort, so the Clonks can find ways on there own?


Well, in which way would the game analyse landscape to make that possible? :)

>-or is it possible that the whole waypoints did by human players during the round, are going to be saved, so they can be emulated by the AI-Clonks, without to much effort?


That could really be worth a try. But will most likely be a lot of work - and maybe even eat up some valuable performance. So, is it worth it?
Parent - By Günther [de] Date 2009-06-09 16:42

> That could really be done - maybe even via script if there is better support (like just disabling the auto-control) for that.


The traditional method would be a ControlCommandFollow call. On the other hand, almost everything in C4Command.cpp could be done by script, with perhaps a few more exported functions.
Reply
Parent - - By Travis Date 2009-06-09 18:59

>I really don't think they should do that. It is propably even more frustrating when your Clonks do anything stupid that you didn't tell them than when they just do nothing when you don't tell them.


Hm perhaps a burning/attacked Clonk should just make a noise or something (with an arrow in the direction?), so you can help him on your own.
But I really like the idea, that there is some "basic-reaction-catalogue". For example you are fighting with a Clonk under the own base where your other Clonks stand around, and from a meteor the trees there start to burn and with him 4 of your clonks.
You can now choose to send every single Clonk home and try to stop the fire on your windmill, like it's the only way now in CR, or you just switch the "Advanced Clonk AI mode" in the Context menue on. The Clonks run into the main base to heal themselves, perhaps they even try to stop the fire with watterbarrels and fix the damage or something. They could also shoot on attacking Clonks with bows or whatever.

You are right it could be sometimes very frustrating. So what about the idea that the player can turn it on/off ingame like i told?     

>But will most likely be a lot of work - and maybe even eat up some valuable performance. So, is it worth it?


Yes I know it's a big decision. It has to do with my own vision of OC, much settle-melees and back to basic gameplay, stuff like that with many Clonks, in every players hand. Of course I know that this is not the stuff every Clonker is interested in.
Parent - - By Zapper [de] Date 2009-06-09 19:08

>Hm perhaps a burning/attacked Clonk should just make a noise or something (with an arrow in the direction?)


That sounds really like a good idea. Just marker in the direction of the clonk if one of your Clonks looses lifes. Maybe even with a small health bar that shows the remaining hitpoints.

>The Clonks run into the main base to heal themselves, perhaps they even try to stop the fire with watterbarrels and fix the damage or something. They could also shoot on attacking Clonks with bows or whatever.


Well, that may work. But for me I don't see the huge advantage. You can as well select all your Clonks with the mouse and send them back home all together :)
But if someone (you? :)  ) wants to code such an AI and it shows to be enriching for the game I see no reason why it wouldn't be integrated
Parent - - By Clonkonaut [de] Date 2009-06-09 20:04

> That sounds really like a good idea. Just marker in the direction of the clonk if one of your Clonks looses lifes. Maybe even with a small health bar that shows the remaining hitpoints.


I like this suggestion: http://forum.openclonk.org/image_show.pl?img=http%3a%2f%2fattach.openclonk.org%2f32%2f632%2fNewHUD.jpg (http://forum.openclonk.org/topic_show.pl?pid=632)
Reply
Parent - - By Zapper [de] Date 2009-06-09 20:12
But I would only show injured crewmembers. If I have like five Clonks I don't want my HUD to be spammed with healthy grinning faces all the time :)
Parent - - By Newton [es] Date 2009-06-09 21:21
Instead of the portraits, one could show a full image which shows his clothes/armor and what he is holding/what what he is equipped. Or, if/when we use real time rendered Clonks, the Clonk could be rendered in big up there so that one can even see what he is doing right now (like - aiming with the bow, digging, jumping, running, burning etc etc)
Parent - - By Zapper [de] Date 2009-06-09 21:34

>if/when we use real time rendered Clonks, the Clonk could be rendered in big up there so that one can even see what he is doing right now


That is also possible right now - we could use one mode of SetGraphics for that. Good idea - but still, I would only show Clonks in special conditions :)
Parent - - By Asmageddon [pl] Date 2009-06-23 10:54
Hmmmm, small windows showing Clonk, and his surroundings when something is going on nearby?

An example picture:
Reply
Parent - - By Enrique [de] Date 2009-06-23 12:03
Maye only a notice, but no window, when i Clonk is in danger. Smth like
"Attention, %s is burning!"
"Attention, %s is attacked!"
Reply
Parent - - By Asmageddon [pl] Date 2009-06-23 13:31
I don`t think so, during melee nobody would have enough time to read all the messages, additionaly with windows like that you could just click portrait with mouse to select that clonk.

Also good idea would be to enable 'patroling' selected clonks, so in clonk menu players could select if they want to see that clonk all the time (for example to watch some tunnel if enemies aren`t approaching, or something like that).
Reply
Parent - - By Enrique [de] Date 2009-06-23 20:03
During a melee a Player should notice something like that. And even if not, a noisy sound would help :D
Reply
Parent - - By Newton [es] Date 2009-06-23 20:53
.oO(Sound = "AAAH I AM BURNING AAAAH!!!!")
Parent - By Asmageddon [pl] Date 2009-06-23 21:18
hehe, good and funny, I like this idea, maybe something like "Oh noez, we`re gettin' pwned!" ^^
Reply
Parent - - By Zapper [de] Date 2009-06-23 14:20
And what if you have ten clonks? :)
A similiar idea had already been posted, I will look for the topic..
Parent - - By Asmageddon [pl] Date 2009-06-23 14:23
You see, these windows could be smaller, but text message won`t be good too, because nobody will have time to read all the messages during battle, and also he couldn`t instantly switch to that Clonk. Also groups of clonks that are nearby and in danger could be displayed in a single window.
Reply
Parent - - By Zapper [de] Date 2009-06-23 14:34
I still think this would be a bit more fitting. Because it takes less space: you only see Clonks which are under attack, near an enemy or something - and the pictures are only potraits.
I don't like text messages a lot, too :)
Parent - - By Asmageddon [pl] Date 2009-06-23 14:40
It doesn`t take less space, it is only in higher resolution. And windows with clonks and things around them would show what is happening MUCH more exactly. It really makes a diffrence if one enemy clonk is approaching, and if there are ten enemy clonks with cannon and lorry full of flints. And as I said - it would enable you to see more, as you could set a clonk in vital place, and you will see what is happening at his place.

I think that my idea is better ^^
Reply
Parent - By Zapper [de] Date 2009-06-23 15:14

>there are ten enemy clonks with cannon and lorry full of flints. And as I said - it would enable you to see more, as you could set a clonk in vital place, and you will see what is happening at his place.


Yes, that is true. But you could only see that much if you had a very high zoom in the small areas. I am just a fan of simple warnings like "he, your Clonk took damage!" (visualized in those portraits) but of course your idea could turn out to be better for the real game (yet I think that it is quite confusing)
Parent - - By Simsi [de] Date 2009-06-24 20:15
In general I like the idea, but it should be selectable which clonks get shown and which not.
Parent - By Asmageddon [pl] Date 2009-06-25 09:12
I think, that I already said that, but I`m not completly sure. Also the size of window for every clonk should vary - guard on a tower should be more important than a low-rank clonk getting killed with a bomb.
Reply
Parent - - By Atomclonk [de] Date 2009-06-23 18:53
Fatal error: Kings don't burn. Oo
Reply
Parent - - By Luchs [de] Date 2009-06-24 15:33
They can, with timis rule.
Parent - By Atomclonk [de] Date 2009-06-24 16:27
Uh, oh.
Reply
Parent - - By Dragonclonk [de] Date 2009-06-30 13:12
Or with changed DefCore.
Reply
Parent - - By Luchs [de] Date 2009-06-30 15:10
UNCOOL!
Parent - By Dragonclonk [de] Date 2009-07-01 11:32
It's faster. xp
Reply
Parent - - By Carli [de] Date 2009-07-01 12:21
Maybe it's possible to replace the freepath-based Pathfinding through a action-based one. With this we have the possibility to calculate some SimFlights to not jump into acid. But also enemies should be noticed (maybe with a Script GetHeuristic(x,y))
Parent - - By Zapper [de] Date 2009-07-01 13:51
What exactly are you proposing? That sounds kinda vague :)
Parent - - By Carli [de] Date 2009-07-01 15:19
The PathFinder simulates a real clonk and not just the path he's going -> no acid-jumps
When the Clonk enters an area with enemies, a script callback says, how dangerous an enemy is (GetHeuristic())->avoiding enemy contact
+a script- supported Command-System: The knight script can overload the "Attack"-Mouse-Command of the engine; user-defined Commands (AddCommand("MyCommand"))
Parent - - By Zapper [de] Date 2009-07-01 17:09

>The PathFinder simulates a real clonk and not just the path he's going -> no acid-jumps


Uh, I think that would significantly lower the speed of the pathfinding algorithm
Parent - - By Sven2 [us] Date 2009-07-01 17:25
Not necessarily.

The number of places a Clonk can actually go to is rather limited. If you think of an untouched  standard landscape, this would be along a line just atop the surface.

If the pathfinder is redesigned to work on a data structure containing only the "walkable" (+scalable/hangle-able) positions, plus their connectivities available by jumping (not every possible jumping position would have to be considered - you could limit it to the amount necessary to connect the accessible positions), it could in fact become much more reliable and faster. It would probably also be much closer to the way a human solves pathfinding tasks.

It would be a challenging task to handle that data structure and keep it updated. You would probably have to invalidate an area each time a single pixel changes; then recompute it whenever the pathfinder crosses it. Additionally, you would have to recompute it completely if your Clonk physicals change.
Parent - By Carli [de] Date 2009-07-01 18:14
full ack
Parent - By Atomclonk [de] Date 2009-07-02 13:04

>It would be a challenging task to handle that data structure and keep it updated.


But only, if a clonk uses the pathfinding algorythm and not alltime? Then it would slow the game not significant, but still a bit, while it's often not used.
Reply
Parent - By PeterW [de] Date 2009-07-23 20:35
It's mind-boggling how long we actually have that idea lying around without having tried it. I remember discussing it on my very first CM ;)

Just a quick note: We could try to dodge the whole problem of persisting path-finding information. The current pathfinder already works by having a "rough" phase followed by some code generating Clonk movement commands out of that. The latter could use some sort of simulation to quickly check wether the given commands actually have the desired effect.

This could make a lot of difference if done right. At least it makes it easy to fix some of the more annoying bugs like the Clonk falling into lava or trying a hundred times before getting a jump right.

... the hardest part, imo, is that we have to simulate the ever-complex Clonk physics. How to really predict jump angles? We need some vertex friction calculation for that, if I remember correctly. And how to make the pathfinder use scripted stuff like the dolphin jump? I guess it's not getting easier with OpenClonk...
Up Topic General / Feedback and Ideas / Improve Clonk AI

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill