About Store Forum Documentation Contact



Post Reply 
AI ineisis problem
Author Message
Pokan Offline
Member

Post: #1
AI ineisis problem
Hey people ,

I try to get the AI to ineisis but :

No compilation error but , i have 0 AI in the game.

0 error compile perfectly but no AI in game.

This is my Server.main :

Quote:/******************************************************************************/
bool Init()
{
REP(1000)ai.New().createAI(i,"Warrior",Vec(RandomF(0,20),RandomF(0,20),RandomF(0,20)),10, Game.ObjParamsPtr(UID(1789382582, 1118947404, 2757836681, 1453939461))); // THIS CODE IS FINE OR NOT HERE ?
// server shouldn't load client specific data, use dummies to preserve object paths
Skeletons .mode(CACHE_DUMMY_NULL);
Animations .mode(CACHE_DUMMY_NULL);
Images .mode(CACHE_DUMMY_NULL);
Materials .mode(CACHE_DUMMY_NULL);
Meshes .mode(CACHE_DUMMY_NULL);
PhysBodies .mode(CACHE_DUMMY_NULL);
ParticlesCache.mode(CACHE_DUMMY_NULL);

CreateStorageFolders();
SQLConnect ();
InitObj (); // initialize objects before loading world
InitScheduler (); // initialize scheduler before loading world
InitWorld ();
InitMailer ();
InitMsgPerf ();
if(!Server.create())Exit("Can't create Server TCP Socket");

// Add Gui Controls
flt y=D.h(), h=TextStyleParams(true).size.y;
Gui+= bLocalAddressCopy .create(Rect_RU(D.w(), y, 0.15, 0.045), "Copy" ).func( LocalAddressCopy ).desc( "Local Address (Local IP) is the address visible in the Local Network.\nYou can use it to connect with other computers in your network."); y-=h;
Gui+=bGlobalAddressCopy .create(Rect_RU(D.w(), y, 0.15, 0.045), "Copy" ).func(GlobalAddressCopy ).desc("Global Address (Public IP) is the address visible in the Global Network.\n\nYou must use it if you want to connect with computers\nwhich are not located in your network.");
Gui+=bGlobalAddressResolve.create(Rect_RU(D.w(), y, 0.15, 0.045), "Resolve").func(GlobalAddressResolve).desc("Global Address (Public IP) is the address visible in the Global Network.\n\nYou must use it if you want to connect with computers\nwhich are not located in your network.\n\nResolving Public IP address requires connecting to external websites."); y-=h;

Gui+=bLogMessagePerf.create(Rect_LD(-D.w(), -D.h() , 0.4 , 0.05), "Log Message Perf" ).func(LogMessagePerf);
Gui+=bOpenStorage .create(Rect_RD( D.w(), -D.h() , 0.4 , 0.05), "Open Storage Folder").func(OpenStorage );
Gui+=bWarnOfClose .create(Rect_RD( D.w(), -D.h()+0.05, 0.25, 0.05), "Warn Close" ).func(WarnOfClose );

StartScheduler();
return true;
}
/******************************************************************************/

What's wrong?
02-20-2015 10:08 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #2
RE: AI ineisis problem
Do you create AIs before creating world?
02-20-2015 10:24 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #3
RE: AI ineisis problem
what you mean?

I use ineisis online in the store and the world is not like other project , he is in the server but, you think i need to create a world before creating AIs?
02-20-2015 10:29 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #4
RE: AI ineisis problem
I think you need to create AIs after you created world.
02-20-2015 10:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #5
RE: AI ineisis problem
I need to create a world with the editor and after?

Quote:REP(1000)ai.New().createAI(i,"Warrior",Vec(RandomF(0,20),RandomF(0,20),RandomF(0,20)),10, Game.ObjParamsPtr(UID(1789382582, 1118947404, 2757836681, 1453939461)));

This code create 1000 AI Warrior normaly that why i dont understand.
(This post was last modified: 02-20-2015 10:37 AM by Pokan.)
02-20-2015 10:37 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #6
RE: AI ineisis problem
No, just place this code after your InitWorld ();
(This post was last modified: 02-20-2015 10:50 AM by Houge.)
02-20-2015 10:50 AM
Visit this user's website Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #7
RE: AI ineisis problem
bool ServerUpdate()
{
FREPAO(ai).update();
}

However with some modifications to the code you can have the AI perform better, adding them into the Net.World using area partitioning and you don't need as many loops as you'd only have to use neighbors and spawn for them. Maybe it's time for an update of this system..
02-20-2015 11:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #8
RE: AI ineisis problem
I tried to place the code to InitWorld(); like this:


Quote:void InitWorld()
{
Net.Worlds.replaceClass<World>();
SetWorldAreas();
LoadWorld(MainWorldID);
LoadEditorWorld(MainWorldID);
REP(10)ai.New().createAI(i,"Warrior",Vec(RandomF(0,20),RandomF(0,20),RandomF(0,20)),10, Game.ObjParamsPtr(UID(1789382582, 1118947404, 2757836681, 1453939461)));
But no AI in the game , what's wrong?
(This post was last modified: 02-20-2015 01:12 PM by Pokan.)
02-20-2015 01:12 PM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #9
RE: AI ineisis problem
Because you need to update them each frame.
02-20-2015 01:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #10
RE: AI ineisis problem
are you updating the ai, are you drawing the ai?
02-20-2015 03:30 PM
Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #11
RE: AI ineisis problem
I do the tutorial here and do the tutorial by Fex :

http://esenthel.com/community/showthread.php?tid=5826

so i dont know what i need to do for AI is in the game.
02-20-2015 03:34 PM
Find all posts by this user Quote this message in a reply
A_Gris Offline
Member

Post: #12
RE: AI ineisis problem
hey, yeah Ozmodian should have the actual right version that is in page 2 of this thread.

he just omitted to say that you need to update it via

Code:
bool Update()
{
   if(Kb.bp(KB_ESC))return false;

   Gui.update();
   REPA(ai) ai[i].update();
   Server.update();
   Time.wait(1);

   return true;
}

in Main of the server part.

let me know if you still have issue with it
02-21-2015 05:44 AM
Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #13
RE: AI ineisis problem
Thanks that working! grin
02-21-2015 09:12 AM
Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #14
RE: AI ineisis problem
I have a question , how i can make a AI killable?

Like a monster AI or animals.
03-09-2015 09:28 PM
Find all posts by this user Quote this message in a reply
Pokan Offline
Member

Post: #15
RE: AI ineisis problem
Up pls
07-01-2015 09:36 PM
Find all posts by this user Quote this message in a reply
Post Reply