Shared AI memory

Shared AI memory

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Shared AI memory

Post by krogothe »

I noticed the CreateSharedMemArea function on the callback class...
how does it work? Can i store different data types in that area? anyone tried using it?

Because so far it seems pretty pointless since AIs can easily share variables (and probably arrays and pointers, havent tested that but im pretty confident it works), which works for speeding up things like loading/saving data (only 1 AI does it, checks flag) and sharing enemy and allied information.
If all that can already be done, without juggling about data in a limited, confusing thing why does that function exist?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

how exactly are you juggling your data then? Granted I know of many ways, but I'm curious how you're doing it.

Look at OTAI v1.01/2 specifically its mex algorithm, ti uses these functions extensively.
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

ill have a look thanks for the tip!

theres no juggling, you declare the variables and theyre shared....
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Using these functions, AI's from different DLLs can share memory, not only from the same dll... But I agree that's a very limited use :roll:
User avatar
krogothe
AI Developer
Posts: 1050
Joined: 14 Nov 2005, 17:07

Post by krogothe »

yeah so they are like world peace, a great idea but it just aint gonna happen :-)
glad i havent missed anything important in my plans yet!
but sometimes shared vars is plain annoying! I had 2 KAIs allied and one kept building cons and the other kept building attack units since they shared the units and this coincidence happened. Its all fun and games having one KAI doing the economy and the other attack/defence until after the fifth minute where the military AI has such a small base it gets crushed and then its 1v2
User avatar
Veylon
AI Developer
Posts: 174
Joined: 21 Sep 2005, 19:45

Post by Veylon »

You can use it to share any kind of data. If you have an array of some sort, it is pretty easy to put that array into shared memory. Like AF said, I used it for the mex positions. You could also use to have common attack teams, understanding about metal patches, reservations of prime real estate, or anything else.

We really should have a thread for discussing how the different AI's could have a common communication interface.
Post Reply

Return to “AI”