<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Some questions regarding the scripting system]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=711</link>
		<description><![CDATA[The most recent posts in Some questions regarding the scripting system.]]></description>
		<lastBuildDate>Sat, 27 Jul 2013 16:53:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4481#p4481</link>
			<description><![CDATA[<p>I&#039;m sorry I misunderstood then. Yes, it&#039;s all possible. I&#039;ve been working into moving game specific stuff (like the behaviours) into lua to allow easier/quicker development.</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Sat, 27 Jul 2013 16:53:31 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4481#p4481</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4480#p4480</link>
			<description><![CDATA[<p>For example, if I continue on this random example, the way I would do it is like this :</p><p>- create a game plugin in c++ with 3 behaviors (player, enemy1, enemy2)<br />- a custom MGame class if necessary (for example to handle path finding or global events)<br />- the variables (speed, power) will be attached to each behavior so it will be possible to edit their value in-editor<br />- a custom draw function for the player behavior to draw the field-of-view in-editor as an helper<br />- custom script functions in c++ to call special actions from lua<br />- the scene specific logic in lua</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 27 Jul 2013 16:23:42 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4480#p4480</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4479#p4479</link>
			<description><![CDATA[<p>Nistur, this was just a random example, as everything in it can be done already.</p><p>I&#039;m just saying that a good starting point to plan gameplay tools, is a real game situation and it&#039;s need<br />(one looking like this random example).<br />To point out was is possible and what is not possible with the current version of Maratis.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 27 Jul 2013 16:10:39 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4479#p4479</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4478#p4478</link>
			<description><![CDATA[<p>I think the issue with lua is how dynamic the language is. If we remove it and make the MVariables static types then that reduces the issues significantly. Exposing lua variables in the editor will be possible.</p><p>With regards to the example you gave. If the movement is straight line, I could have that working for you before the end of the weekend if you really wanted using MScriptableBehaviour. If you want proper path finding, you&#039;ll have to wait for MRecast to be hooked up.</p><div class="quotebox"><cite>anael wrote:</cite><blockquote><p>- be able to change the variables in-editor to fine-tune the game</p></blockquote></div><p>I really don&#039;t see the editor variables being a huge issue (although I am expecting a few perculiarities when trying to access the base class stuff from the editor)<br /></p><div class="quotebox"><cite>anael wrote:</cite><blockquote><p>- the entities interactions should be updated automatically</p></blockquote></div><p>I&#039;m not entirely sure what you mean by this. MScriptableBehaviour currently gives you <em>onBegin</em> <em>update</em> and <em>onEnd</em> callbacks. If you would want collision callbacks then it _should_ be fairly easy*<br /></p><div class="quotebox"><cite>anael wrote:</cite><blockquote><p>- I&#039;d like to call special actions triggered in lua</p></blockquote></div><p>Again, not entirely sure what you mean by that. MScriptableBehaviour is entirely in lua. It uses the same lua state as the scene script, so you have the same environment. If you want to call actions yourself, it is possible.</p><p>If you have a specific use case, like the one above, I&#039;d be very happy to know because it can help me make the system more well rounded and gives me test cases to make sure it works <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>* There is currently nothing like this in MScriptableBehaviour, but I can make a MEntity table in lua that will handle things like physics callbacks and behaviour lists. It can then call <em>onCollision</em> on any behaviours that implement that function...</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Sat, 27 Jul 2013 15:54:32 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4478#p4478</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4477#p4477</link>
			<description><![CDATA[<p>There is a way in lua to control objects : <a href="http://wiki.maratis3d.org/index.php?title=Lua_object_programming_example">http://wiki.maratis3d.org/index.php?tit &#133; ng_example</a><br />it can be helpful for some entities, however everything need to be written in lua and cannot be manipulated by the editor compared to the behavior system.</p><p>It is seductive to think about a data editor inside maratis to manipulate game variables, I taught about it when writing the behavior system, but I realized that it will be hard to be flexible enough and anticipate what a game will need (float, string are easy, but maybe you will need to store a complex table, a matrix or else).</p><p>kirilz, you wrote you&#039;d like to write the data definition in lua but operate it in c++, if you operate the data in c++ it means you have to know the structure of the data in your c++ code, so why no define the data in c++ ?</p><p>What I&#039;d like to discuss, and it&#039;s what I try to ask Nistur too, is a practical situation in a game that can be studied, like :<br />- a game with one player and 2 types of enemy :<br />&nbsp; - player : can move around a level. It&#039;s variable are : speed, life, score, field of view<br />&nbsp; - enemy 1 : is attracted by player, touching the player reduce player life depeinding on it&#039;s power. It&#039;s variable are : speed, power<br />&nbsp; - enemy 2 : is attracted by player when out of player field of view, and repulsed by enemy 1 if it&#039;s power is inferior as the one of enemy 1. It&#039;s variable are : speed, power</p><p>we should : <br />- be able to change the variables in-editor to fine-tune the game<br />- the entities interactions should be updated automatically<br />- I&#039;d like to call special actions triggered in lua<br />etc</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 27 Jul 2013 10:17:08 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4477#p4477</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4472#p4472</link>
			<description><![CDATA[<p>I&#039;m familiar with how Unity&#039;s Entity/component system works (also, I think I have that book somewhere). I think I was just a little confused by you splitting the data (component) from the functionality (behaviour).</p><p>The Maratis behaviour system currently uses an XML format for all the data. There is no way (yet) to reflect this properly in the script using MScriptableBehaviour but it&#039;s something I am working on. It is possible to use the standard lua API to access behaviours in C++ behaviours currently (<a href="http://wiki.maratis3d.org/index.php?title=GetBehaviorVariable">GetBehaviorVariable</a>, <a href="http://wiki.maratis3d.org/index.php?title=SetBehaviorVariable">SetBehaviorVariable</a>)</p><p>I&#039;m still not entirely sure what your &quot;ideal&quot; design is for this, but my current plan is:<br />- define &#039;types&#039; in lua such as MVariableString which are tables with :get and :set functions and, if invoked with parameters, set a default value ( <em>MScriptableBehaviour &quot;player&quot; { speed = MVariableInt(3), }</em> )<br />- from the C++, the class can query the definition with things such as <em>script-&gt;callFunction(&quot;player.getVariablesNumber&quot;)</em> and then initialise an internal list of the data (which can then be removed from the lua side completely) for exposure through <em>MScriptableBehaviour::getVariable</em><br />- the lua &quot;MVariable&quot; table can then be used with <em>:get</em> and <em>:set</em> functions which will automagically call through to the standard <em>getBehaviorVariable</em>/<em>setBehaviorVariable</em> function (no data stored in lua, no chance of going out of sync)</p><p>I haven&#039;t even begun to implement this, so I have no idea if there are any hidden gotchas yet. But it looks (to me) to be a workable solution. Any thoughts?</p><div class="quotebox"><cite>heartseed wrote:</cite><blockquote><p>I thought you liked grapple a bit, at least enough to base something off of ?</p></blockquote></div><p>I did quite like <a href="http://grapple.linuxgamepublishing.com/">grapple</a>, but it hasn&#039;t been maintained for 4 years (not a problem if it <em>mostly</em> works but looks like there are no grapple experts to quiz if things go wrong) and I could never get Windows support working, although, to be fair, I didn&#039;t try _overly_ hard. It&#039;s an option, but it&#039;s not really ideal.</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Sat, 27 Jul 2013 07:06:23 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4472#p4472</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4471#p4471</link>
			<description><![CDATA[<p>Data driven component systems aren&#039;t anything new, that&#039;s how Unity and the latest Unreal work. Pretty much this <a href="https://en.wikipedia.org/wiki/Entity_component_system">https://en.wikipedia.org/wiki/Entity_component_system</a>. There was also a good description of this pattern in the book &quot;Game Engine Architecture&quot;, which is a quite excellent read.</p><p>That said, while a quick-and-dirty implementation can be done in a day(hardcoding the component classes in C++), I am a bit of an idealist and would like to aim for maximum flexibility. Ideally I would like to write the data definition of a game entity in Lua, add triggers that apply certain behaviors (also defined in Lua), but store and operate on the data in C++.</p><p>P.S. E.g. Unity: <a href="http://docs.unity3d.com/Documentation/Manual/UsingComponents40.html">http://docs.unity3d.com/Documentation/M &#133; nts40.html</a> Note that some components simply have to be hardcoded, such as the physics, graphics, audio, etc. The rest, such as stats, abilities, dialog lines, can be defined purely in script.</p>]]></description>
			<author><![CDATA[dummy@example.com (kirilz)]]></author>
			<pubDate>Sat, 27 Jul 2013 03:58:55 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4471#p4471</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4469#p4469</link>
			<description><![CDATA[<p>HI nistur etal re: networking</p><br /><p>I thought you liked grapple a bit, at least enough to base something off of ?</p><p>It looked like a solid offering for game networking to me, though I&quot;ve never really dug into it.</p>]]></description>
			<author><![CDATA[dummy@example.com (VeganDev)]]></author>
			<pubDate>Sat, 27 Jul 2013 01:02:00 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4469#p4469</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4468#p4468</link>
			<description><![CDATA[<p>There&#039;s no networking support in Maratis yet, it&#039;s another of the things I&#039;ve looked into, but I&#039;ve not yet found a nice library to base any work off, and I&#039;ve not had the time or energy to write the system from scratch. In theory writing a bespoke networking library for a specific task is relatively easy, writing a generic one to suit an engine is considerably more difficult, so it might be that you&#039;re better off rolling your own and/or enlisting someone to help with your specific case. If you&#039;re feeling kind, the work could be rolled back into Maratis and made more generic for the community to use <img src="http://forum.maratis3d.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>I would be interested to know precisely what the plan is for the component/behavior system you have in mind. I think it should be possible to leverage MScriptableBehavior to do what I think you&#039;re wanting</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Fri, 26 Jul 2013 20:01:53 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4468#p4468</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4464#p4464</link>
			<description><![CDATA[<p>Thanks for the replies all.</p><p>Something I forgot to ask, what is the status of the networking features in the engine?</p><p>Nistur, what I am thinking about doing is implementing a module that allows you to use components(that hold data only) and behaviors(that operate on that data) as building blocks with which to compose your game entities. I did see your plugins and am reading through them to get more familiar with how Maratis is working.</p>]]></description>
			<author><![CDATA[dummy@example.com (kirilz)]]></author>
			<pubDate>Fri, 26 Jul 2013 18:15:42 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4464#p4464</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4459#p4459</link>
			<description><![CDATA[<p>Hi Kirilz,</p><p>Welcome to Maratis!</p><p>I was looking into trying to implement <em>require</em> recently but I never got around to it. I think there are some assumptions about what it does, regarding setting up modules and so on, which I haven&#039;t quite figured out yet.</p><p>About the behaviour system, I&#039;ve recently been working on a <a href="http://forum.maratis3d.com/viewtopic.php?id=698">couple of plugins</a> one of which provides scriptable behaviours like you suggested. It&#039;s still pretty early on but it more or less works. The multiple plugin framework is currently only available through a build of the <a href="http://forum.maratis3d.com/viewtopic.php?id=657">community branch</a> of the engine, but I&#039;m hoping to find the time soon to go through and test it fully so I feel confident enough to push it to the official repository.</p><p>Most of the stock lua API is very c-like, not reflecting objects at all. This, I believe, is done to keep the API simple. I have also been trying to make an optional object oriented API on top of this with the plugins, but using an automatic reflection thing I think might complicate the simple API a bit, plus, the system as-is, is pretty detached from the scripting system, adding automatic reflection would more heavily couple it to pretty much all the classes in the engine.</p>]]></description>
			<author><![CDATA[dummy@example.com (Nistur)]]></author>
			<pubDate>Fri, 26 Jul 2013 09:14:27 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4459#p4459</guid>
		</item>
		<item>
			<title><![CDATA[Re: Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4458#p4458</link>
			<description><![CDATA[<p>Hi,<br />welcome : )</p><p>- About require, nothing is preventing using it, but there is some limitation for now :<br />the dofile call has been modified to simplify the path search and to be able to access files inside a package transparently (npk packing), the same thing is not done yet for require.</p><p>- There is a behavior system to create complex entities behaviors, it can be extended in c++ using a game plugin, you can find some examples in maratis website and in the wiki (like &quot;WaterDemo&quot; implementing fish behaviors : <a href="http://www.maratis3d.org/?page_id=53).">http://www.maratis3d.org/?page_id=53).</a></p><p>The basics are explained here : <a href="http://www.maratis3d.org/?p=500">http://www.maratis3d.org/?p=500</a></p><p>- the lua API is hand-written.</p><p>For contribution to the official dev we can talk by mail about the planned evolution and some themes you could be interested of. Big help is needed to make small games/examples to test the pipeline and show how Maratis can be used, there is some key features to develop or improve like the lua API, Android port, publishing pipeline, particles system, level of detail, basic behaviors etc</p><p>General roadmap in the wiki : <a href="http://wiki.maratis3d.org/index.php?title=Roadmap">http://wiki.maratis3d.org/index.php?title=Roadmap</a></p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Thu, 25 Jul 2013 21:51:40 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4458#p4458</guid>
		</item>
		<item>
			<title><![CDATA[Some questions regarding the scripting system]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=4457#p4457</link>
			<description><![CDATA[<p>Hi all,</p><p>I&#039;m coming from Polycode, which is a similar engine in many ways, but at a much earlier development stage. </p><p>I have a few questions regarding the scripting system which I could not answer through searching the forums. </p><p>First of all, if multiple scripts have to be included by using the `dofile()` function in the main scripting file, is it possible to include them by using the `require` function instead? Is there anything specific in Maratis&#039; implementation that prevents that?</p><p>Secondly, is there any entity-component system in place currently? Specifically, similar to Unity&#039;s. I am guessing that the answer is &quot;no&quot;, since no properties can be added to an entity in the editor. I plan on implementing a plugin that remedies that, but it would be nice to know if the work would duplicate someone else&#039;s effort (in which case I can just help with that).</p><p>Third, is the Lua API generated or hand-written? There are number of tools that generate 1 to 1 C++ to Lua APIs, but I am not sure if this is the case here.</p><p>Lastly, are there any guidelines regarding contributing to the source code?</p><p>Thanks in advance!</p>]]></description>
			<author><![CDATA[dummy@example.com (kirilz)]]></author>
			<pubDate>Thu, 25 Jul 2013 21:25:34 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=4457#p4457</guid>
		</item>
	</channel>
</rss>
