I'm planning make game for Android. Yeah, Maratis is not ready for Android yet, but I'm wait and hope smile
Standard two-circles controll (one for direction and one for look) is stupid.
I realized controls throught single touch (only forward move support).
Example project here - https://dl.dropboxusercontent.com/u/241 … lerFPS.zip

It's a dirty code. I need dostring-function to make its better.

2

(0 replies, posted in Engine)

I suggest a new type of behavior.

In common, behavior is

  1. variables + type

  2. update procedure

It can be realized in lua

// behavior_lookat.lua
// pseudo-code
behavior_lookat.vars = {var => type}
behavior_lookat.object_depended_vars = {}
behavior_lookat.update = <function code here>

In editor add lua-behavior by filename.
Editor parse vars-table and show var-list.
Editor values stored in object_depended_vars-table with object-name as table-index.

In main loop

  1. get next object lua-behavior

  2. get object name

  3. execute <behavior_name>.update with vars from object_depended_vars.objectName-table

The lua function list is short, so lua-beheviors will be scant. But it's simple way to extend engine wink
What do you think about this?

Example: if we want to create FPS then add player, head and camera on scene, add behavior_controllerFPS.lua to player-object, define vars "head" and "camera".  This is all you need to do.

3

(36 replies, posted in Scripting)

1. debug (text) - write "text" on screen/console. If lua file contains errors then error text display on same place.
2. dostring (str) - execute lua string, e.g. dostring("On"..<getObjectUnderCursorName>.."Click()")
3. I think that GetSystemTick is not necessary function and can be replaced by os.clock() (standard lua function).
4. timer(msDelay, AfterDelay_LuaStringToDo). It's can be realized as lua-library throught "dostring".
5. if <smth>.lua is not-correct then dofile(<smth>.lua) must return error. 
In MScript.cpp -> doFile change luaL_dostring(L, text); to

int result = luaL_dostring(L, text);
if (result != 0)
         printf(lua_tostring(L, -1));

4

(2 replies, posted in Scripting)

com3D, yeah. Thanks.
I thinked that IsVisible return reverse value of "Invisible"-attribute
http://sgeproject.narod.ru/pics/Maratis/invisible.jpg
But it's my mistake smile

P.S. He-he, I look to engine-code. Visible check use described above algorythm with BBox smile

5

(2 replies, posted in Scripting)

I need to detect events - "object appear on screen" and "object dissapear from screen".
Can you advise the best way to do this?

Currently my plan is check object-visible in onSceneUpdate() by next algorythm:
1. Find camera look direction => vec3_A
2. Find vector from cameraPosition to objectPosition (center) => vec3_B
3. Find angles between vec3_A and vec3_B and compare with angles defined by camera fov/screen width and height.
It's a dirty algorythm with "unknow visible state" zone and can be improved by cheking all BBox-vertices (inaccessible yet) instead of center.
P.S. I don't need accurate detection.
P.P.S. Next step is visible level, e.g. 1 - object under cursor +-, 0.8 - object near cursor, 0.4 - object near screen border, 0 - object invisible.

anael, I think, unicode is not drug. The font creates as texture and font with all unicode symbols is bad.
Maybe use first way? User define own alphabet in option as string, e.g. "ABC...abc..." and when texture created then only user sympols apears there.

I cann't find lua-function to work with player data. Are they exists?
Surely this data may be stored as lua-script

// pseudo-code

function SaveData()
    file = io.open("player_data.lua", "w+")
    file:write("player_data_vars={}")
    for key,value in pairs(player_data_vars) do
        file:write("player_data_vars[<<key>>]=<<value>>")
    end
    file:flush()
    file:close() 
end

function LoadData()
    dofile("player_data_vars.lua")
end

But this code create stand-alone lua-file with platform-depends place (in Windows7 used exe-same folder).
Perhaps, I wrong and place not depended.

Wait yours remarks smile

I planning to use Maratis for my game. My language is not english.
When I try use national simbols then TEXT (object) is not display nearly correctly (one simbol ё is wrong).
I analized source-code, make some fix and now TEXT appears correct.

// MFreetypeLoader.cpp

bool M_loadFont(const char * filename, void * data)
{
    ...
    error = FT_Load_Char(face, n, FT_LOAD_RENDER); 
    // replace twice to
    error = FT_Load_Char(face, (n < 192) ? n : n + 1040 - 192, FT_LOAD_RENDER);  
    // My national symbols (russian) begin from 1040 position in unicode. First 192 symbols are common. 
    ...
}

http://sgeproject.narod.ru/pics/Maratis/font.jpg

So, I see two ways to support non-english languages

  1. build font by user-defined alphabet

  2. add new option "language" for define start position of national symbols

It's just remark for thinking, not request smile
I'm not professional C++ engineer (=> My C++ is very weak) and gamedev is my hobby.
So you can find more elegance way to support other language.