Jump to content

Aily

Members
  • Posts

    465
  • Joined

  • Last visited

Posts posted by Aily

  1. Hi Aily... i am curious on how this project is coming along... its one of the few demos i have seen that truly has nice art and game mechanics and i enjoyed playing those 4 maps repeatedly... any progress on new maps? available for purchase yet? smile.png

    I agree with Mack, it looks great and plays very well.

    Thanks guys, it bring me back to work on this game. Last time i'm some disapointed in gamedev, little loose trust in this money-making work, and work on another projects.

     

    But now i realy want to continue it. Thanks for you support me ;)

  2. I have recently tried exporting a model to leadwerks via the 3ds max tools, and it is encountering an error. I am using max 2012, the model works fine, but I just don't know what I should do. I could always use blender for small precision modeling, it's just I just spend about 250 for leadwerks and I am not to keen on spending more for UU3D pro.

     

    What do you all think?

     

    Thanks.

     

    Convert model to EditPoly

    Select all vertices

    Press "Remove isolated vertices"

     

    90% - it will helps

    • Upvote 1
  3. Hi, Hello, everyone, and do you have this phenomenon?How to solve?

    When the controller collide with each other more, the program will become very slow.

    Liitle piece of your code will make us understand you much better :)

    Show how you UpdateController() function works in your code.

  4. If i would make such game - i will make physics body with form of punch area, attach it to player controller, make it collide with enemyes with responce "2", and on collide callback get enemy entity, get it user data (GameObject class), and do it player_hit() function.

  5. Thanks Naughty Alien.

     

    Important thing here is new operator.

     

    Couple weeks ago i was looking in to minib3d engine, found that it's turnentity() method does not works correct.

    Looking in to blitzbasic.com forum found this bugfix, there was functions for quaternion rotations, here's one of those functions:

     

    Function MultiplyQuats:TQuaternion(q1:TQuaternion,q2:TQuaternion)
     Local q:TQuaternion=New TQuaternion
    
     q.w = q1.w*q2.w - q1.x*q2.x - q1.y*q2.y - q1.z*q2.z
     q.x = q1.w*q2.x + q1.x*q2.w + q1.y*q2.z - q1.z*q2.y
     q.y = q1.w*q2.y + q1.y*q2.w + q1.z*q2.x - q1.x*q2.z
     q.z = q1.w*q2.z + q1.z*q2.w + q1.x*q2.y - q1.y*q2.x
     Return q
    End Function
    

     

    Local q:TQuaternion=New TQuaternion

    This line is some confuse me, because this means - each time i turn somethig - bMax allocates memory for TQuaternion

    type, makes it initializations.

     

    My test scene have 2000 same time rotating cubes - using this function, at FPS ~ 100

     

    Just for test i reworked this:

    Global single_q_3:TQuaternion=New TQuaternion
    Function MultiplyQuats:TQuaternion(q1:TQuaternion,q2:TQuaternion)
     Local q:TQuaternion=single_q_3
    
     q.w = q1.w*q2.w - q1.x*q2.x - q1.y*q2.y - q1.z*q2.z
     q.x = q1.w*q2.x + q1.x*q2.w + q1.y*q2.z - q1.z*q2.y
     q.y = q1.w*q2.y + q1.y*q2.w + q1.z*q2.x - q1.x*q2.z
     q.z = q1.w*q2.z + q1.z*q2.w + q1.x*q2.y - q1.y*q2.x
     Return q
    End Function
    

     

     

    As you can see - i creating temporary Global single_q_3:TQuaternion=New TQuaternion and use just like in source function.

     

    Yes, i'm lost some cool OOP thing - returning new TQuaternion, but - nothing breakes there in test, and same 2000 cubes start to run at 130(!!!!)FPS...

     

    This means - ~30% faster.

     

    So i know whell - better do not use constructions like

     

    PositionEntity(entity,vec3(1,2,3))

     

    in Leadwerks too.

  6. There is a scene in my game where I want my main character to push an enemy character down a hole in the ground. This was easy enough when my enemy character had no controller but with a controller I cannot make this work even though the main character has a mass of 60 and the enemy a mass of 5.Can anyone help?

     

    You can try to SetBodyVelocity(...) to charachter that you want to push.

  7. Oups sorry, I want to move the camera from point "A" to point "B" to point "C" and look at direction "(target)"

     

     

    Thank

     

    see picture ;-)

     

    First of all you need to write script for camera movement smooth path.

    Here's good example, but in actionscript.

    http://actionsnippet.com/?p=1031

     

    In result you must get path object that will be store all points on path, and one function to return smooth coordinates along path, where path will be started at 0 and finish on 1

     

    And while camera will moves along this path, point it to target.

     

    Like (in lua)

     

    ......
    
    path=create_path()
    path.add_point(x,y,z)
    path.add_point(x,y,z)
    path.add_point(x,y,z)
    path.add_point(x,y,z)
    path.add_point(x,y,z)
    path.build()
    
    t=0
    
    while KeyHit(KEY_ESCAPE)~=1 or t<1 do
    
    t=t+.01
    xyz=path.get_coords(t)
    
    PositionEntity(camera,xyz)
    PointEntity(camera,target)
    RenderWorld()
    Flip(1)
    
    end
    

  8. I can turn on Lua in bMax just like

    local LuaState:byte ptr = luaL_newstate()
    

     

    and then run my own scripts with this.

     

    Leadwerks on start creating own Lua state, and attach all of own methods to it.

     

    Do anyone knows, how can i get current Lua state in bMax?

  9. It easy to hack your engine for you Josh

    Just add funtion LoadUniqueMesh that will be add system time value to mesh,materials and shaders filenames before loading it.

    And engine will think - that it's absolute separate mesh with separate materials.

    And all will be happy biggrin.pngrolleyes.gif

  10. Last news

    This function don't have entity, and don't be work as we supposed. Wiki is wrong, wee need always look only to

    http://www.leadwerks.com/werkspace/page/Documentation/le2/_/command-reference/

     

    I maked not instanced materials, but for this i creating copy of mesh on HDD, load id, delete from HDD - have not instanced model, but materials is instaced.

     

    Parse all it surfaces, and same write copyes of materials to HDD, load it, assign, delete from HDD.

     

    Same with shaders...

     

    Looks like there is no another way.

  11. It was the original question Aily.

    The entity is not being passed to the material draw callback.

    So any function on that entity will result in a crash.

    In C, the entity is always NULL.

     

    As you can see - in my function in BMax - i don't do any with entity, line inside function is commented. And error spawn on renderworld.

    :) Good if it works in C.

     

    P.S. Yeah, i'm some mistaked with callback names before...

  12. http://leadwerks.com/wiki/index.php?title=SetEntityCallback

     

     

    ph34r.png it's not here

  13. This code is printing

     

    .............

     

    Camera

    Directionallight

    Camera

    Directionallight

    Camera

    Directionallight

    Camera

    Directionallight

    Camera

    Directionallight

    Camera

    Directionallight

    Camera

    Directionallight

    Camera

    ...........

     

    Framework leadwerks.engine
    registerabstractpath AppDir
    Graphics 800,600
    createworld
    cp=createpivot()
    cam=createcamera()
    entityparent cam,cp
    moveentity cam,vec3(0,5,-5)
    pointentity cam,cp
    b=createbuffer(800,600,BUFFER_COLOR|BUFFER_NORMAL|BUFFER_DEPTH)
    lt=createdirectionallight()
    moveentity lt,vec3(1,2,3)
    pointentity lt,cp
    c=createcube()
    mat=creatematerial()
    setmaterialcolor mat,vec4(1,0,0,1)
    paintentity c,mat
    Function on_paint(mat:tmaterial,ee:TList)
    For e:tentity=EachIn ee
     Print getentitykey(e,"class")
    Next
    End Function
    setMaterialCallback mat,on_paint,MATERIALCALLBACK_ENABLE
    Repeat
    
    If KeyHit(27) Or AppTerminate() End
    
    turnentity cp,vec3(0,.1,0)
    
    setbuffer b
    renderworld
    setbuffer backbuffer()
    renderlights b
    Flip 1
    
    Forever
    

     

    seems like second function parameter is the list of cameras\lights

     

    Want to know how to use it myself

  14. You've never had any issues with this? I've had it before where if the computer lags then Update on the controller will shoot the controller well past it's target.

     

    For now I'll do it that way, but just wasn't sure if there was a more precise way to avoid any lag issues.

     

    With this code walking 15 NPC at same time, and all is correct.

    But it makes sense... will think about it.

     

    Think at get next point we can store distance from current NPC position to it, and while move forward check not distance to target point, but length of way that passed NPC.

     

    Like this:

     

           if obj.target~=nil then
                   if EntityDistance(obj.body,obj.prev_point_pos)>obj.path_lenght then
                           PositionEntity(obj.prev_point_pos,EntityPosition(obj.body))  -- store prev point position
                           get_next_point(obj)
                           obj.path_lenght=EntityDistance(obj.body,obj.target)  -- distance to new target
    
                           return
                   end
                   PositionEntity(obj.head,EntityPosition(obj.body))
                   obj.head:Point(obj.target,3,obj.turn_smooth,0)
    
                   obj.body:Update(EntityRotation(obj.head).y,obj.walk_speed,0,0,40,1,0)
           end
    
           PositionEntity(obj.mesh,EntityPosition(obj.body))
           RotateEntity(obj.mesh,Vec3(0,EntityRotation(obj.head).y-180,0))
    

     

    This can free such lag.

    P.S. maybe this code is wrong, not checked, just concept.

×
×
  • Create New...