Topic: Few more questions (sorry)

hey, I'm back again with a few more questions.

I'm not entirely sure how to word it as its quite a broad question. How do I go about creating game behaviour, such as AI, character movement and things like flickering lights?
Do I do that using scripts with LUA or do I need to get cracking with C++?
Also, I'm not entirely sure what the 'game plugins' do?

Thanks,
Rich

Re: Few more questions (sorry)

Hi,

the best is to do extensive and repetitive code in c++,
you can make a light flick in lua (using a cos and the time value for example),
but it will be a pain and it will be slow to do AI in lua (except if it is very basic).

To add behaviors in the behavior-tab of Maratis, you have to use c++ and make a dll plugin.
You can find a tutorial with a simple example to download here : http://www.maratis3d.org/?p=500

And you can find an example called "WaterGameDemo" in the Maratis package you can download on the website, it is c++ code for fish AI, it is compiled as a "Game.dll" plugin (Game.dylib on mac).

Basically, a game plugin permit to extend Maratis, you compile a dll that is loaded by Maratis :
   - by coding behaviors (MBehavior class) that will appear in the interface, which you can use like you use the "LookAt" behavior.
   - optionally by customizing the Game class (MGame class), to change the pipeline of the game, do special effect...

When you want a better flexibly for the game design and level design, the best is to create a bank of Behaviors specific to your game, for example a "Player" behavior, a "Alien" behavior, a "Door" behavior... You code how they are interacting, so when it's done, you just have to create your level, say that one mesh is the Player, the other is an Allen etc

In the WaterGameDemo, if you load a fish mesh, you just have to select the "RedFish" behavior or the "BlueFish" behavior, set the speed they are moving, and the fishs are interacting immediately. It's done with a c++ game plugin.

Hope it helped,
Anaël.

Re: Few more questions (sorry)

Thank you for the quick response smile

It was very helpful.

I'm really enjoying working with this engine, am I ok to post a few screenshots of my project in the showcase section? Its very much a work in progress at the moment, and quite a casual project (I have to fit it in around university work) but I should have some pictures soon.

Re: Few more questions (sorry)

Cool smile
yes please, show us !

Re: Few more questions (sorry)

I'm running into a few problems getting my mesh's imported.
For some reason when I load them into the editor, they dont have their textures applied to them (I've made sure the textures are in the maps folder). The texture files are all of dimensions of power 2 and all in TGA format.
Also, the model seems to be smoothed when it is loaded into the editor, is there any way I can make sure it isnt?
Last question (sorry), my model is made up of different areas but it isnt casting any shadows? Its getting illuminated by the light, but for example, pillars are not casting shadows on the floor?

Thanks,
Rich

Re: Few more questions (sorry)

Are you using the StandardRenderer or the FixedRenderer ? (fixed renderer doesn't support shaders and shadows)

About the textures, did you follow this tutorial ? : http://www.maratis3d.org/?p=277
You maps are in the project/maps directory, that's good, and in Blender did you load the textures also from this directory ?
If you have a doubt for the path, open the mesh using a text editor to check it.

For the model smooth, in Blender push the "smooth" button to have the same preview than maratis, and then apply the "edge split" modifier to make the edges you want visible.

Re: Few more questions (sorry)

hi, sorry its taken me a while to reply.

The advice you gave to solve the smoothing problem worked perfectly, thankyou smile

However, it appears now as if the UV maps are not importing correctly. I have them mapped in blender fine, however when I import them into maratis, the textures appear (along with the relevent normal maps ect), but they are not mappedcorrectly. Do I need to remap them once I've applied the edge split modifier or something?

Re: Few more questions (sorry)

Hi,

for the texture, are you sure to use the good uv channel ?
You normally don't need to remap after the edge split, is it working when you don't apply it ?
Can you send a screen-shot of your object in Blender and in Maratis ?