Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Microsoft Windows

Passing data between AI Models with no scenes  [SOLVED]

Windows DX9/OpenGL 2 Standalone Apps

Passing data between AI Models with no scenes

Postby jharr100 » 06 Jan 2011, 19:42

Is there a way to pass data between two AI Models that are not associated with any scene? What I did was create a game and then create an AI Model. Now I want to create another AI Model and share data between the two AI models. I know about using the send event and post event but I think they have to be related to a scene and we are not working with any graphics or anything for this thus far. Sorry if this is long or confusing but thanks in advance.
jharr100
Fresh Boarder
Fresh Boarder
 
Posts: 17

Re: Passing data between AI Models with no scenes

Postby 8DashP » 06 Jan 2011, 20:15

You can create a scene without having to put any graphics in it. You can then use your main AI and write functions to pass data around if you want.

Apart from the main AI though, other AI,s are associated with instances of Objects, which exist in scenes. It's very simple to just put placeholder objects in a scene. You can use some of the default shapes in Shiva as placeholders for your AI's, since you'll need them eventually anyway.
Russell - http://store.synapticbytes.com - Software Store now open, including ShiVa3D assets
Checkout sbPhysics, the bullet physics plugin, plus the Partifex particle libraries on the store
User avatar
8DashP
Platinum Boarder
Platinum Boarder
 
Posts: 1123
Location: Queensland, Australia

Re: Passing data between AI Models with no scenes

Postby jharr100 » 07 Jan 2011, 15:44

Thanks a lot. I'm new to game programming and dont know too much about scenes. I assume that there will be multiple scenes. So, is an AI Model still usable when a scene is not visible?
jharr100
Fresh Boarder
Fresh Boarder
 
Posts: 17

Re: Passing data between AI Models with no scenes

Postby broozar » 07 Jan 2011, 18:26

a scene can be seen as some sort of level.

you can program (write ai models and execute them with the help of a game) as shown in the "vibration" example (read http://www.stonetrip.com/developer/wiki/index.php?title=TEST_Vibrations-20081116 for explanation of that particular example) without loading any scene.
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3515
Location: Berlin - Germany

Re: Passing data between AI Models with no scenes

Postby 8DashP » 07 Jan 2011, 20:02

Didnt rrealise you could have no scene at all. I guess a HUD is replacing the scene in this instance as the interface element, so that makes sense.

An empty scene is just a black screen anyway. So having the scene "visible" for a blank screen is the same as what you'd see with no scene anyway.
Russell - http://store.synapticbytes.com - Software Store now open, including ShiVa3D assets
Checkout sbPhysics, the bullet physics plugin, plus the Partifex particle libraries on the store
User avatar
8DashP
Platinum Boarder
Platinum Boarder
 
Posts: 1123
Location: Queensland, Australia

Re: Passing data between AI Models with no scenes

Postby jharr100 » 11 Jan 2011, 19:57

This conversation just went over my head. LOL. Sorry, but i dont quite understand how the vibration example goes along with the passing of data between AI models? I looked and I didnt get it. Could you explain it in detail? Thanks a lot.
jharr100
Fresh Boarder
Fresh Boarder
 
Posts: 17

Re: Passing data between AI Models with no scenes

Postby broozar » 11 Jan 2011, 20:21

the vibration example shows that you can write a game (application) without scenes and 3d content at all. it does not pass stuff between 2 ai models, that would be unnecessary. if you want to write a game without any actual 3d content, you can do it all in the main ai model.

if, for whatever reason, you want to split things into several ai models, you are bound to have at least one scene and dummy/placeholder objects, "carrying" those ai models. [edit] not really, check clockmaster's reply, i forgot about this option completely...

why not go with c++ in the first place, if your focus is clearly on code anyways?
Last edited by broozar on 11 Jan 2011, 20:39, edited 1 time in total.
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3515
Location: Berlin - Germany

Re: Passing data between AI Models with no scenes  [SOLVED]

Postby clockmaster » 11 Jan 2011, 20:25

I try to release the confusion :)

You create two AIModels. So then you put them in the Game Editor Modul into the User MainAI Area ( per Drag n Drop ). So you have now 2 User AIModels. You can now send Data with "user.sendEvent(...)" to the other AIModel without a Scene in your Case.

Some more explanations. There are two Types of AIModels. The User one ( Look Above ), and Object AIModels. Object AIModels are attached to Objects. So you need a Scene, if you want to use Objects ( with or without AIModel ). If you want to send Data from ObjectAI to ObjectAI, you must use "object.sendEvent(...)"

If you want to have Global Data Accessable to all AIModels, you can use the Environment System ( http://www.stonetrip.com/developer/343-environment-management ) or a XML File.

Hope it´s clear now :D
User avatar
clockmaster
Platinum Boarder
Platinum Boarder
 
Posts: 486
Location: Germany

Re: Passing data between AI Models with no scenes

Postby jharr100 » 11 Jan 2011, 20:35

Thanks so much Broozar and Clockmaster. @Broozar - I am working with a team and they have decided not to use the plugin option even though we recommended using it. The team is split into front end and back end so that's why us back end people really dont care to have the scenes. But I wish we could have used the plugins - it would have made life easier. LOL. Thanks again.

@Clockmaster thanks for the step by step.
jharr100
Fresh Boarder
Fresh Boarder
 
Posts: 17

Re: Passing data between AI Models with no scenes

Postby jharr100 » 11 Jan 2011, 22:30

I have just another question. I am not able to pass a table from AI model to AI model it seems. Is that true? There is a fix for that (getting the strings from the table and sending them one by one). But my question is - Is there any dynamic creation of tables?
jharr100
Fresh Boarder
Fresh Boarder
 
Posts: 17

Re: Passing data between AI Models with no scenes

Postby broozar » 11 Jan 2011, 23:32

jharr100 wrote:I am not able to pass a table from AI model to AI model it seems. Is that true?


yes.

http://www.stonetrip.com/developer/forum/viewtopic.php?f=13&t=21463&p=25421&hilit=table+sendevent#p25421 and
http://www.stonetrip.com/developer/forum/viewtopic.php?f=22&t=20810&p=22135&hilit=table+sendevent#p22135

jharr100 wrote:But my question is - Is there any dynamic creation of tables?


LUA tables can be created dynamically without problem. the sad thing is, stonescript tables and lua tables are a completely different thing.

http://www.stonetrip.com/developer/forum/viewtopic.php?f=13&t=21691&p=27302&hilit=lua+table#p27302
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3515
Location: Berlin - Germany


Return to Microsoft Windows