About Store Forum Documentation Contact



Post Reply 
how can be AI be created in the server
Author Message
shadow Offline
Member

Post: #31
RE: how can be AI be created in the server
Hi Elk,

Some ideas:

1. Check which AI object falls through the ground.
2. Stop the app
3. Change the code to create only that AI instead of all of them
4. Make it so that on the first frame of adding the AI, game world will no longer get updated (pause the world)
5. Move your camera and investigate the position of the AI and its physical controller actor (Physics.draw)

My guess is that you're creating it partially under the ground?
06-26-2013 03:20 PM
Find all posts by this user Quote this message in a reply
1991mirec Offline
Member

Post: #32
RE: how can be AI be created in the server
i don t think it is created partially under the ground cause even if we made to create it 50 above the ground we could see it falling from the heaven and it also felt down through the ground... and why we don t know. we have one AI called crystal giant and he is the biggest one and he doesn t fall down through the ground and if we made others the same size we haven t any problem but because they are smaller they do..
06-26-2013 08:19 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #33
RE: how can be AI be created in the server
I did try using different scale characters and I did have the same problem. I found a bug in the code for server spawn function that sets the initial position at a random y value. I fixed that and at first it looked much better. I needed to do a little more testing but didn't have time before I had to go to work. I hope to work on it more tonight.

What I actually think it is thought is a problem with the way we have collision set up. I think the big actors are actually "hitting" the little guys away and through the floor.
06-26-2013 09:47 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #34
RE: how can be AI be created in the server
Ok, i figured it out.

1) in your server main, make sure you don't repeat any IDs. For instance, in your code above, the following would create 2 actors with ID = 1

Code:
REP(20)ai.New().createAI(i,"Warrior","Obj/Chr/Warrior/0.obj",Vec(RandomF(0,20),RandomF(0,20),RandomF(0,20)),10);
     ai.New().createAI(1,"Humanoid Frog",      Vec(174.854, 0.076, 371.738), 20,Game.ObjParamsPtr(UID(580970731, 1326487568, 2947128993, 3190242514))); // golden bottom

2) In Server.AI::Spawn() we never initialized the Y value of the position vector. As a result, it took random bits from the memory allocation and set it to crazy numbers. I have changed this 1 line to set Y to 0 then add the HM offset and it seems to have fixed it.

T.pos(Vec(pos.x, 0, pos.z)+Vec(0,y,0)); //Add Y so that it doesn't spawn just under the map

3) This is where the real bug is. There is something weird going on with the Random extern when using a Circle or Ball. If you look at the video below, you will see the issue. For now, a quick work around is to replace the line

Vec test = Position +=Random(RadiusBall,true);
with
Vec test = Vec(RandomF(-10, 10), 0, RandomF(-10, 10));

and setting position to Position += Vec(test.x, 0, test.y);





4) **Edit** sorry 1 more thing. I needed to add the following to the client Physics.ignore(AG_AI,AG_AI); because some physics collisions between the bigger and smaller actors were throwing the little guys through the floor. I also noticed that if the little guys ran into a static building (terrain), they would also fall through the floor. I removed the item they were walking into and indeed no more actors fell through the floor. I am not really sure how to prevent this and hoped somebody could comment.
(This post was last modified: 06-27-2013 08:24 AM by Ozmodian.)
06-27-2013 07:55 AM
Find all posts by this user Quote this message in a reply
TheElk Offline
Member

Post: #35
RE: how can be AI be created in the server
Ozmodian

I just want to say thank you for trying to help us on this, hopefully in the long run we will be able to help others.

In the mountain areas they are still falling threw the ground, flat areas are better.

TheElk
06-28-2013 09:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #36
RE: how can be AI be created in the server
Also if your characters are falling with high speeds then you should use chr.ctrl.actor.ccd(true)
06-29-2013 10:26 AM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #37
RE: how can be AI be created in the server
bumping to look at the issue i reported with Random(RadiusBall,true)
07-02-2013 07:08 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #38
RE: how can be AI be created in the server
(07-02-2013 07:08 AM)Ozmodian Wrote:  bumping to look at the issue i reported with Random(RadiusBall,true)
Hi, do you mean a bug in the engine?
Last time I checked the randomizer for Ball and Circle worked fine.
There's even a tutorial in 07-Misc/Random which draws lots of random points in a circle.
You can also add this to the tutorial draw function:
Code:
D.text(0, 0, S+Random(Circle(1)));
D.text(0, -0.2, S+Random(Ball(1)));
Just tried it and it works fine.

Can you test if the radiusball (that you pass into the random function from ball) value is correct?
07-04-2013 12:36 PM
Find all posts by this user Quote this message in a reply
TheElk Offline
Member

Post: #39
RE: how can be AI be created in the server
Just wanted to say thank you for all of the help to the people that helped us on this, It is working now.

TheElk
07-22-2013 01:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply