951

(35 replies, posted in News)

I guess the lower framerate issue has something to do with the thing I added to reduce the processor use,
it was working fine on all my computers, but I guess the "sleep" function is not stable on all machines... mh...

I note the scripts things for the mouse hide and the rayHit

952

(35 replies, posted in News)

actually the mouse only hide in fullscreen mode

953

(35 replies, posted in News)

Done ! The news builds are on the download page,
and in bonus, with a lower CPU usage smile

thanks smile

I just deleted and recreated MWin32Window.cpp, it should be ok now (I hope)
tell me if it's ok for you on windows.

Good, thank you,
for pushPointer normally you should use lua_pushinteger instead of lua_pushnumber

There is a recurrent problem with MWin32Window, it's at least the third time I'm resending it because the encoding is wrong, now it seems to be also wrong for you... strange I don't understand the problem. Is it also wrong if you delete it and update it to be sure there is no merge ?

956

(35 replies, posted in News)

Hi, yes I'll try to rebuild everything for tonight,
please give use feedback if something else need to be fixed

yes pushPointer is better and clearer smile
can you also commit a "void * getPointer(unsigned int arg)" ? for the reverse use.

Yes you are right, we could add a "script->pushPointer" or change "script->pushInteger" to take long instead of int

959

(35 replies, posted in News)

it will keep putting the files in the first project dir, not the current.

I found, my fault...

For the mac problem it's a bit of a mess, the xcode app and the scons app don't have the same structure...

Ok, corrected in svn !
sleep now...

960

(35 replies, posted in News)

Yes.. it also seems to be broken on mac, the published app is not working, it's strange because it worked on linux... damn...

961

(35 replies, posted in News)

Hi,
it's time to test a new version of Maratis, fresh from svn :

You can find builds for windows, mac and linux here :
http://code.google.com/p/maratis/downloads/list

Here are the new features !

Editor :

- File packing system and automatic publish button (File > Publish Project) : thanks to Nistur !
- Object list selection and custom shortcut : by Mario Pispek
- Focus selection ('F' key), parent field (transform tab) : by Sergey Pershin
- Faster loading when published
- General Bug correction and improvement

SDK :

- Behavior drawing in-game / in-editor and M_VARIABLE_TEXTURE_REF variable
- Physics rayHit and multiple collision test
- Camera scene layer system and render to texture system

Script :

- rayHit
- quit, to quit the game from script
- getScene
- getObject modified to access other scenes
- getClone to clone objects from script
- enableCameraLayer and disableCameraLayer
- enableRenderToTexture and disableRenderToTexture

Thanks to everybody for the forum moderation, the patchs, the documentation and more.

Please let us know if the builds are working and I will publish the news on Maratis front page !
[EDIT] For the bugs, lets use the issues system on google code : http://code.google.com/p/maratis/issues/list


smile

Anaël.

962

(4 replies, posted in Scripting)

Normally, the -1 is used to parse arrays and special messages,
so it depends what you want to do ?

Are you making a custom function or something different ?

963

(4 replies, posted in Scripting)

I've used that to create custom function from c++, it was a long time ago so it's not fresh in my mind,
but I think it was something like :

int myCustomFunction(void)
{
    if(script->getArgsNumber() == 2)
    {
        int firstArgument = script->getInteger(0);
        int secondArgument = script->getInteger(1);

        // do a simple addition
        script->pushInteger(firstArgument+secondArgument);
        return 1; 
    }

    return 0;
}

script->addFunction("myCustomFunction", myCustomFunction);

I just finished the builds, so lets wait the first debug pass...

Yes, for example you can load a quad mesh with a blank texture and a post-process shader, set an ortho camera in front of it - it will be the "view" camera. Then from script you can tell that the "game" camera is rendering into the blank texture.

It can also be used to do a live screen camera (for a sport game etc)

For the windows version, check that MCore.lib, MCore.dll and MEngine.lib, MEngine.dll are up to date and that the dll are the same used by the editor and game.dll.

965

(36 replies, posted in Scripting)

I personally don't know how to do a class like system in lua, after doing some research to find how to do it from c++ I felt it was complicated, I didn't think about doing it in lua, it's quite a fast language, if you are interested in doing that for the rest of the engine it will give some nice manipulating classes smile

I added a system to enable a camera to render to a texture easily,
in c++ :

camera->setRenderColorTexture(colorTexture);
camera->setRenderDepthTexture(depthTexture);

in lua :

enableRenderToTexture(Camera, "maps/texture.png", 256, 256) -- texture.png will be replaced by the camera rendering 256x256
--disableRenderToTexture(Camera)

I think I'll stop there and make the builds, it should be a good start version for this project,
and we'll add things when you find features are missing.

967

(36 replies, posted in Scripting)

Hi,
nice ! you look to know more about lua than me smile

For the framerate drops, yes it works, even if the rendering is 60fps or 15fps (the logic and the rendering are separated).
It just stops synchronizing if the framerate goes below 1fps (because the system cannot recover).

yes, I'm also thinking of the documentation a lot, I didn't find the time yet...
I'm trying to finish improving the script functions and I'm making the build, I'd like to do it tonight because next week I'm going to work for a studio in Marseille.

Do you see something missing in the script ? I was thinking of adding something to say to a camera to render in a texture, but it's maybe not so urgent. Maybe a function to get the mouse position in the 3d world (to use it as a rayHit), access to bones and basic vector functions...

Hi,
I added a simple function in script to enable a scene layer to be draw on top of a camera
(each camera can have a different layer)

Example, to draw the scene2 on top of "Camera" :

Scene2 = getScene("Scene-2")

Camera = getObject("Camera")

enableCameraLayer(Camera, Scene2)
--disableCameraLayer(Camera) -- to disable it

970

(4 replies, posted in Engine)

Hi,

I added optional arguments to "isObjectInCollision" :

static unsigned int collisionList[MAX_COLLISION]; // objectId list of other physics-objects in collision
int nbCollision = physics->isObjectInCollision(objectId, collisionList, MAX_COLLISION);

I also added a function to set/get physics-object user pointer, which is the entity pointer in MEngine by default,
so you can get the entity pointer of the physics-objects by using :

for(i=0; i<MIN(nbCollision, MAX_COLLISION); i++)
{
    MOEntity * entity = (MOEntity *)physics->getObjectUserPointer(collisionList[i]);
}

We can keep that for later, at least it's possible to do static loading screen which is not too bad.
By the way, it is possible to divide the loading of a level / scenes by selecting "Data Dynamic" instead of "Data Static" in the scene properties (where you can change the gravity). I also prepared a progressive loading depending of the visible objects but didn't finish it.

Yes, it's interesting, I never did animated loading screen, only static image.
Just, doing it every M_fread will maybe slow down too much (lots of calls) as we need to draw and update the framebuffer, also, the external libraries don't use M_fread. There is also the problem of knowing the total size if it is a percentage bar.

What takes time to load are meshs, textures and sounds.
We could be delaying the loading of all this data at the end of the level loading to have the total number of stuff to load
(the MDataRef for textures, meshs and sounds) and call MDataRef update to actually load the data while counting ?

973

(4 replies, posted in Engine)

No... there is no other way right now, I'll see if I can add it.

Hi ! Ho, yes, sorry !
Sure, you can commit it thank you smile

I'm also working on improving the script before making the builds,
I added some stuff that I will commit after you :

- get objects from other scene in lua : using getScene(sceneName)
- clone objects : getClone(object)

-- default is current scene
toto = getObject("toto")
box = getObject("box")
boxClone = getClone(box)

scene2 = getScene("scene2")
totoScene2 = getObject(scene2, "toto")

gravityCurrentScene = getGravity()
gravityScene2 = getGravity(scene2)

Previous code is compatible, but internally getObject now uses a pointer and not an id (to deal with the different scene)
So, after I commit, you will need to send the object pointer to your function instead of the id : lua_pushinteger(L, (lua_Integer)object);

- also added a function to send a ray test : rayHit(pos1, pos2, object)
- and a function to quit from script : quit()

975

(36 replies, posted in Scripting)

Hi, yes a minimum vector match would be good,

for delta time : you don't need delta time for the scipt, it's handled internally, the script is always synchronized at 60hz.
(in c++, the game update too)