|
You last visited: Today at 22:22
Advertisement
One question (AI-Bot)
Discussion on One question (AI-Bot) within the CO2 Private Server forum part of the Conquer Online 2 category.
03/24/2010, 16:52
|
#1
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
One question (AI-Bot)
Hello, I have this code but not work well ... Someone could help me?
Here is the code:
Code:
Random XCoords = new Random();
int FinalX = XCoords.Next(40, 60);
Random YCoords = new Random();
int FinalY = YCoords.Next(40, 61);
Jump((ushort)FinalX, (ushort)FinalY);
And the problem is ... why my bot just jump in rect line like this photo?
Thanks!
|
|
|
03/24/2010, 17:03
|
#2
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
When you initialize a random it uses a seed to determine what the next random number will be, this is based on the current time i think for the standard .net random class, so if you initialize them both at roughly the same time then they will both generate a random number which is identical, instead you should define a random number as a static for your entire server to use, that way whenever you use it it will always generate a different number.
Or if you insist on intializing it everytime you move its position just intialize one:
Code:
Random Rand = new Random();
Then
Code:
int X = Rand.Next(40, 60);
int Y = Rand.Next(40, 60);
|
|
|
03/24/2010, 17:15
|
#3
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
very good explanation, thanks!
|
|
|
03/24/2010, 23:28
|
#4
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
Sorry for double post but is just for bump,
i have another question and i don't want make another trhead.. =).
Is just make sit the bot. I know the Action is 250 but if just type "Action = 250;" he don't sit, i need send the packets really? Can you help me with this? =S Or tell me where is the site where when i press the Site button he work. I don't find that! =S. Sorry for my english >.<'
Thanks guys!
|
|
|
03/25/2010, 01:28
|
#5
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
You will need to send the action packet to everyone in the local area.
|
|
|
03/25/2010, 01:33
|
#6
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
Quote:
Originally Posted by Korvacs
You will need to send the action packet to everyone in the local area.
|
Ok and how i can do this? =S =S
|
|
|
03/25/2010, 01:41
|
#7
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
The same way your sending the jump packet locally.
|
|
|
03/25/2010, 11:11
|
#8
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
Ok here is all jump packets:
Code:
GC.MyChar.Loc.Jump(BitConverter.ToUInt16(Data, 8), BitConverter.ToUInt16(Data, 10));
^This is just for jump, i don't need this one.
Code:
Game.World.Spawns(GC.MyChar, true);
^Maybe is this but, i tested with command and not work =S
Code:
Game.World.Action(GC.MyChar, Data);
^And here, i think this one is needed but don't work too.
I tested both in the same command too.
But, what is "Data" in the Action packet?
Thanks =]
|
|
|
03/25/2010, 23:59
|
#9
|
elite*gold: 20
Join Date: Apr 2006
Posts: 1,341
Received Thanks: 886
|
Data should be "250" or rather the ID of the action you want your bot to express.
|
|
|
03/26/2010, 12:27
|
#10
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
Thanks andy ... And now whats fail with this code? =S
Code:
byte[] BotAction = new byte[250];
Game.World.Action(MyClient.MyChar, BotAction);
When i use this my client crash.. (Conquer.exe)
I tested this with the bot and not working (client crash when i active that with a command) Then, i tested the code with another command, here is: And crash the client too ...
Code:
if (Cmd[0] == "@testsit")
{
GC.MyChar.Action = 250;
[COLOR="Red"]byte[] BotAction = new byte[250];[/COLOR]
Game.World.Action(GC.MyChar, BotAction);
}
This don't give error in the C# but, i think is this conversion what make the error =S
What fail? o.0
|
|
|
03/26/2010, 13:33
|
#11
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Nono, your sending a packet which is 250 bytes long, you dont want to do that at all....
You would need to send something like this i would think:
Code:
Game.World.Action(GC.MyChar, Packets.GeneralData(GC.MyChar.EntityID, 250, 0, 0, 81).Get);
|
|
|
03/26/2010, 15:06
|
#12
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
LOL =D I need learn more
And your code work perfectly Korvacs! Thanks again guy!
|
|
|
03/26/2010, 15:25
|
#13
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Btw you shouldn`t just do random coords IMO. Read some articles on AI programming, a random bot is just... a random bot.
|
|
|
03/26/2010, 15:53
|
#14
|
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
|
Is just the jump and just when the stamina is going up. Then the bot jump random and if is not in any rage with the enemy, then sit and up the stamina.
When is full stamina he start jump (random but followin the player) and launch FBs or SSs. With diferents dificulties, the bot can never fail a fb obviously ... then i'll maked dificulties and again i puted a random adding or subtracting coords, and the bot fail just for 1 - 4 coords range.
Soz i know my english fail, I'm Spanish
|
|
|
03/26/2010, 16:18
|
#15
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
|
Quote:
Originally Posted by cakobu
Is just the jump and just when the stamina is going up. Then the bot jump random and if is not in any rage with the enemy, then sit and up the stamina.
When is full stamina he start jump (random but followin the player) and launch FBs or SSs. With diferents dificulties, the bot can never fail a fb obviously ... then i'll maked dificulties and again i puted a random adding or subtracting coords, and the bot fail just for 1 - 4 coords range.
Soz i know my english fail, I'm Spanish 
|
Don`t worr I have understood you :P It seems nice, I`d like to see it in action :P
|
|
|
Similar Threads
|
[QUESTION]How do i bypass Xtrap for any private server?[QUESTION]
10/12/2009 - Cabal Online - 3 Replies
Exactly what the title says.
I keep on getting an xTrap error when i try and load ANY private server that uses XTrap and it's driving me absolutely insane.
I cant figure out why it's showing me the error. If anyone has any bypasser for Helix / PaRaDoX
or any other server u know that has xTrap can u either PM me the bypass or post it here pls......this is driving me nuts
Bump.
|
[QUESTION]How do i bypass Xtrap for any private server?[QUESTION]
10/02/2009 - Cabal Private Server - 2 Replies
Exactly what the title says.
I keep on getting an xTrap error when i try and load ANY private server that uses XTrap and it's driving me absolutely insane.
I cant figure out why it's showing me the error. If anyone has any bypasser for Helix / PaRaDoX
or any other server u know that has xTrap can u either PM me the bypass or post it here pls......this is driving me nuts
|
All times are GMT +1. The time now is 22:23.
|
|