Jump to content

Wchris

Members
  • Posts

    281
  • Joined

  • Last visited

Posts posted by Wchris

  1. I can't tell what is going on from your images, but the position of a fixed joint doesn't matter much, since there is no axis of rotation. I suppose it would probably be more stable when the joint is near either body, and not 10000 units away, but that's the only difference I can think of.

    I know images are not enought, i'll try mack's sample and investigate further. Thanks for providing your opinion Josh.

     

     

    seems to work fine for me in this little example:

    just thinking out loud here, but couldn't you get the same effect if you just parent the booster to the lander in your example instead of using a fixed joint? Or is there a particular reason behind needing a joint?

     

    I'll try your sample with my models this evening and report here. Thank you for your help.

    There are no examples in the wiki yet and it's good to have a working reference.

     

    at first glance, joint were just the most evident way of doing it. Normaly they are not just a link between 2 objects ... they should also control how the energy and forces are dispatched between the linked bodies. when the booster bumps into something a part of the forces is automaticaly dispatched to the lander hull. Parenting cannot do that i think. But if i cannot bring it to work i'll search for a workaround. I was just surprised by my result.

     

    again many thanks for the working sample. maybe it should be added to the wiki with metatron's above answser and the two good answers i've found here previously http://www.leadwerks.com/werkspace/topic/3837-joint-creation/page__p__34303__hl__joint__fromsearch__1#entry34303

  2. Joints positions are always relative to the position 0,0,0. This means you need to make the joint when your bodies are at position 0,0,0, or manually add the offset to the joint if they are somewhere else.

    Tryed to follow your advice, but no luck so far i still get the same result.

    Hopefully a good night of sleep will help :D

    Thank you

  3. Hello,

     

    I need a fixed joint. I have used ball joints before and it worked well so i thought fixed joints would be easyer ... but i ran into a problem i do not understand.

     

    Here's the problem. i have 2 models. One big and one small. (the body of my "lander" and a "booster")

     

    the lander body is at position -4,110,-253

    the booster is at position -5.5,110,-253

    the joint is setup like this Fjoint := LECreateJointFixed(Fparent.Entity, Fchild.Entity, Vec3( -5.5,110,-253));

     

    if i set the models mass to 0 i get

    post-44-0-34448600-1320263453_thumb.jpg

     

    and if i set the models mass to 1

    post-44-0-37767300-1320263464_thumb.jpg

     

    why is the small model inside the big one ? I expected it to be fixed on main body side like when mass=0 ?

     

    i really don't understand what's wrong. if someone has an idea I'm all ears. Many thanks

  4. we have laptop and its graphic card is -Core 2 Duo- does that work

    Core 2 Duo is not a graphic card chip, it's the kind of processor.chip

     

    computers usually made of 3 chips

     

    the CPU (Central Processing Unit) : in your case the 'core 2 duo

    the GPU (Graphics Processing unit) that handles 2D and 3D graphics

    and the Bridge chip that handles communications between CPU, GPU and the motherboard components.

     

    in your case the CPU is ok but the GPU is not strong enought.

    most laptops are not designed for games and include a weak GPU because laptop builders know that buyers usualy don't understand what a GPU is.

    only the most high priced laptops include a powerfull GPU.

     

    most well know GPU brands are Nvida's GeForce chips and ATI Radeon chips. Those firms specialize in powerfull 3D GPU but no CPU.

     

    at the opposite Inter specializes in powerfull CPU but crapy GPU. Because intel is a CPU specialist not a GPU specialist. (Of course that may change, because intel has the money to buy GPU ingeneers and become a GPU specialist someday, but not yet)

  5. Working on it when I'm in the mood. The pre-pre-pre-Alpha is available here: http://projects.limetric.com/projects/rm-bin/wiki

    glad to hear you're still working on it :)

     

    the title "race maniacs" reminds me a hana barbera cartoon called "wacky races"

     

    http://en.wikipedia.org/wiki/Wacky_Races

    http://www.search-best-cartoon.com/images/wacky-races-02.gif

     

    do you plan to make realistic cars or more fun cars like wacky races ?

    There was allready a game about wacky races, and there's probably a copyright ... but you can make a game with the same spirit.

    i think you should go for such a delirium and fun race game. first because you cannot rival with colin mc ray or race driver grid productions and because LE2 physics engine is limited. But for a fun race game LE2 should be ok.

  6. What is it?

    A small minigame I worked on a while ago. Published it at some other website, but I never bothered to do so here.

     

    Technical specs

    • Coded in Delphi (Object Pascal)
    • Custom libraries in C++ (FreeType text etc.)
    • Minigame itself was coded in a day. The framework/base code was already available at that time and is part of months of work (and can do far more than shown here).

     

    Requirements to play

    Decent videocard ( NVidia Shader Model 3.0 GPU or ATI/AMD Shader Model 4.0 graphics card (NVidia GEForce 6600, ATI Radeon 3000) ).

    OpenAL and MSVC++ redist need to be installed. Both of these packages are included in the extra folder! (install them if you have startup errors).

     

    Download

    Version 0.1.0.0 (28th August 2011)

     

    Post scores! :)

    hI Ywa

    Scored 67 !

    i like the interface, the sound and the fonts.

    How is your race game going ?

    Cheers

    Wchris

  7. I have small objects in my game,some of which can be picked up by the player with a keypress. Whats the best way to highlight them to indicate which ones are pickupable?

    Hi cassius,

    For me the best way is to outiline the objects like in starcraft interface.

    i did something like this in the past but it's not trivial and took me way too much time to find out how to alone ... this should be 1 command in the engine that sets an entity as selected and accepts a parameter to define selection kind.

     

    program cubeoutline;
    
    {$ifdef FPC} {$mode delphi} {$endif}
    {$H+}
    
    uses Classes, SysUtils, LeadWerks;
    
    const
      FullScreenDefaultWidth = 800;
      FullScreenDefaultHeight = 600;
      OutLineDefaultLineWidth = 6.0;
    
    var
      Framework: TFramework = 0;
      Lua: Pointer;
      World: Tworld;
      Camera: TCamera;
      Light: TLight;
      Material: TMaterial;
      Mesh, Mesh2: TMesh;
      MeshVector: Tvec3;
      Ground: Tmesh;
      Outline_World_Buffer: TBuffer = 0;
      Mem_buffer: TBuffer = 0;
      Post_shader: TShader = 0;
      Outline_world: Tworld = 0;
      Outline_camera: Tcamera = 0;
      OutLineWidth: Single = OutLineDefaultLineWidth;
      key: integer;
    
    begin
      RegisterAbstractPath('D:\Program Files\Leadwerks Engine SDK 231');
      SetAppTitle('Exemple1');
    
      try
         // Set graphics mode
         if Graphics(FullScreenDefaultWidth, FullScreenDefaultHeight)=0 then Exception.Create('ERROR: Failed to create set graphics mode.');
    
         // Create framewerk object and set it to a global object so other scripts can access it
         Framework := CreateFramework;
         if Framework=0 then Exception.Create('ERROR: Failed to create Framework');
    
         if Framework<>0 then
         begin
            // Set Lua variable
            Lua := GetLuaState;
            lua_pushobject(Lua, pointer(Framework));
            lua_setglobal(Lua, 'fw');
            lua_pop(Lua, 1);
         end;
    
         World := GetLayerWorld(GetFrameworkLayer(0));
         Camera := GetLayerCamera(GetFrameworkLayer(0));
         PositionEntity(Camera, Vec3(0, 0, -2));
    
         Light := CreateSpotLight(10);
         RotateEntity(Light, Vec3(45, 55, 0), 0);
         PositionEntity(Light, Vec3(5, 5, -5), 0);
    
         Light := CreateDirectionalLight(0);
         RotateEntity(Light, Vec3(45, 45, 45), 0);
    
         Material := LoadMaterial('abstract::cobblestones.mat');
         Mesh := CreateCube;
         PaintEntity(Mesh, Material, 0);
    
         Ground := CreateCube;
         ScaleEntity(Ground, Vec3(10, 1, 10));
         PositionEntity(Ground, Vec3(0, -2, 0), 0);
         PaintEntity(Ground, Material, 0);
    
         // Activate Framework Postfilter Effects if needed
         //SetAntialias(2);
         //SetDistanceFog(1);
         SetStats(2);
         //SetHDR(1);
         SetGodRays(1);
         SetBloom(1);
         //SetSSAO(1);
    
         //SetShadowQuality(3);
    
         Outline_world := CreateWorld;
         SetWorld(Outline_world);
         Outline_camera := CreateCamera;
         PositionEntity(Outline_camera, Vec3(0, 0, -2));
         Mesh2 := CreateCube;
    
         Outline_World_Buffer := createbuffer(GraphicsWidth, GraphicsHeight, BUFFER_COLOR or BUFFER_DEPTH);
         if Outline_world=0 then Exception.Create('ERROR: Failed to create Outline_World_Buffer');
    
         Post_shader := loadshader('', 'outline.frag');
         if Post_shader=0 then Exception.Create('ERROR: Failed to create Post_shader');
    
         SetWorld(World);
         Mem_buffer := currentBuffer;
         while (KeyHit(KEY_ESCAPE)=0) and (AppTerminate=0) do
         begin
            if AppSuspended=1 then UpdateApptime
            else
            begin
               TurnEntity(Mesh, Vec3(AppSpeed*0.5, AppSpeed*0.5, AppSpeed*0.5), 0);
               UpdateFramework;
               RenderFramework;
               MeshVector := EntityRotation(Mesh);
    
               SetWorld(Outline_world);
               SetBuffer(Outline_World_Buffer);
               RotateEntity(Mesh2, MeshVector);
               UpdateWorld;
               RenderWorld(ENTITY_MESH);
               SetWorld(World);
    
               key := GetChar;
               if keyhit(KEY_UP)=1 then
               begin
                  freeBuffer(Outline_World_Buffer);
                  if Graphics(round(GraphicsWidth * 1.1), round(GraphicsHeight * 1.1))=0 then Exception.Create('ERROR: Failed to create set graphics mode.');
                  Outline_World_Buffer := createbuffer(GraphicsWidth, GraphicsHeight, BUFFER_COLOR or BUFFER_DEPTH);
                  if Outline_world=0 then Exception.Create('ERROR: Failed to create Outline_World_Buffer');
                  OutLineWidth := round(OutLineDefaultLineWidth * (GraphicsWidth/FullScreenDefaultWidth));
               end
               else if keyhit(KEY_DOWN)=1 then
               begin
                  freeBuffer(Outline_World_Buffer);
                  if Graphics(round(GraphicsWidth / 1.1), round(GraphicsHeight / 1.1))=0 then Exception.Create('ERROR: Failed to create set graphics mode.');
                  Outline_World_Buffer := createbuffer(GraphicsWidth, GraphicsHeight, BUFFER_COLOR or BUFFER_DEPTH);
                  if Outline_world=0 then Exception.Create('ERROR: Failed to create Outline_World_Buffer');
                  OutLineWidth := round(OutLineDefaultLineWidth * (GraphicsWidth/FullScreenDefaultWidth));
               end
               else Leadwerks.DrawText(100, 100, chr(lo(key)));
    
               SetBuffer(backbuffer);
               SetShader(Post_shader);
               BindTexture(GetDepthBuffer(Outline_World_Buffer), 1);
               SetShaderVec4(Post_shader, 'color', Vec4(1,0,0,1));
               SetShaderVec4(Post_shader, 'alphacolor', Vec4(1,0,1,0));
               SetShaderFloat(Post_shader, 'linewidth', OutLineWidth);
               SetBlend(BLEND_ALPHA);
               DrawImage(GetColorBuffer(Outline_World_Buffer), 0, GraphicsHeight, GraphicsWidth, -GraphicsHeight);
               SetBlend(0);
               SetShader(0);
    
               SetBuffer(Mem_buffer);
    
               Flip(1);
            end;
         end;
      except
         on E: exception do
         begin
            Applog(PAnsiChar(' Exception occured ! '+E.message));
         end;
      end;
    end.
    

     

    and the shader code

    uniform vec2 buffersize;
    
    void main( void ) {
    
    vec2 _texcoord = gl_FragCoord.xy/buffersize;
    
    vec2 _pixelsize = linewidth/buffersize;
    
           float _depth = texture2D( texture0, _texcoord ).x/2;
           if (_depth != 0)
           {
              gl_FragColor = alphacolor;
           }
           else
           {
          	   float tl = texture2D(texture0, _texcoord + vec2(-_pixelsize.x, -_pixelsize.y)).x;
              float tm = texture2D(texture0, _texcoord + vec2(0.0, -_pixelsize.y)).x;
              float tr = texture2D(texture0, _texcoord + vec2(+_pixelsize.x, -_pixelsize.y)).x;
              float ml = texture2D(texture0, _texcoord + vec2(-_pixelsize.x, 0.0)).x;
              float mm = 0; //texture2D(texture0, _texcoord).x;
              float mr = texture2D(texture0, _texcoord + vec2(+_pixelsize.x, 0.0)).x;
              float bl = texture2D(texture0, _texcoord + vec2(-_pixelsize.x, +_pixelsize.y)).x;
              float bm = texture2D(texture0, _texcoord + vec2(0.0, +_pixelsize.y)).x;
              float br = texture2D(texture0, _texcoord + vec2(+_pixelsize.x, +_pixelsize.y)).x;
    
              float dpt  = tl+tm+tr+ml+mm+mr+bl+bm+br;
              if (dpt != 0)
              {
                 gl_FragColor = color;
              }
              else
              {
                 gl_FragColor = alphacolor;
              }
    }
    }
    

     

    post-44-0-41316900-1318759932_thumb.jpg

     

    Notice you'll have to resize the outline buffer manually if you change screen resolution.

     

    also with this method, if you want to select an animated entity, you'll have to animate it twice.

     

    But i'm pretty sure there's a way to do this without worlds, only with a shader. and even with a glow efect. but my shader knowledge is not good enought.

     

    Cheers

    Chris

  8. Hi Wchris,

     

    thanks for your reply, but is possible to have header-generator and try it?

     

    Thanks

    Paul

    I have restored the links (that got destroyed by admin server backups) in the "asset store" tools section.

     

    but i guess as a visitor you have no access to the downloads ? you must be a LE2 engine customer.

  9. Hi all,

     

    i'm new. I have downloaded the evaluation copy. I am a Delphi developer and I read on the forum that there is a Pascal wrapper. Is possible to share it?

     

    Thanks in advance

    Paul

    Hi Paul,

     

    Well, in facts there are 3 wrappers.

     

    #1 one generated via a header-generator (that requires the original C++ headers) wrote by LUPIN http://www.leadwerks.com/werkspace/user/42-lupin/ and now maintained by me

     

    #2 one (most recent) generated via another header-generator (that requires the original C++ headers) wrote by LUPIN http://www.leadwerks.com/werkspace/user/42-lupin/ and this time object oriented

     

    #3 an alpha version (incomplete and bugged) of a component set based on #1

     

    sadly :

    #3 was not released yet, and #1 & #2 got erased from asset store last time Josh tryed to restore the server data on the new server.

     

    all 3 are useless if you don't have the original C++ header (that i'm normally not allowed to send to visitors).

     

    you must also know that you will get no help with all 3 versions, you'll be alone ... and as you see delphi/pascal items strangely decay and disapeas, just because nobody cares :)

     

    sorry to feel so pesimist

    but it's my current mood

    maybe it'll change

     

    That said leadwerks syntax is simple, easy and fun to use. But you must code everything. currently the engine is only a mix between a great renderer and a physic engine. No ingame feature available until LE3 that will introduce pathfinding (wich is a must have for 90% of the games except tetris).

  10. I think you are mistaking modular components that fall off a character based on a hit point as true slicing of a mesh. Also, Paul was discussing the merits of doing this with CSG models only.

    If you find severance try to play it :lol: the full name was "severance blade of darkness"

    you really get the feeling it's random slices. but in facts you are right it is not.

     

    here is a screenshot but you'll find more with google

    post-44-0-17274500-1318511123_thumb.jpg

     

    one more ;)

    post-44-0-24958600-1318511387_thumb.jpg

     

    a 2001 game from codemasters ! never seen something like that since severance. those guys were really "code masters" !

     

    EDIT: from a mod site i found it was not realtime slicing http://www.moddb.com/games/severance-blade-of-darkness/tutorials/severance-blade-3d-by-r3d it was pre-computed parts.

    The feeling was really there ... but setting up all small breakable parts is too much work for an indie. CSG is our only hope with a fill texture for the new faces created.

  11. I'm much more interested in real dynamic breakage, but no one has done it yet. I think our CSG solids can be used for this because they can be split and carved in real-time. We'll see how it goes.

     

    I drew some sketches on paper, and I think the proper way to go about complex structures is to have assign a list of entities that break when a particular entity breaks. This would actually let you set up complex structures that collapse, instead of just shooting paint off of walls.

    hi Josh

    i have merged two of your posts.

     

    what about extending the gmf format in LE3 to add CSG solids that define parts that would break appart when collided ? This would be cool because it would remove the work of creating the separate objects for the destructed model. Is this something you're thinking about for LE3 ? The problem is see here is LODS ... you'll have to do this with lods too or remove lod functionnality for breakable objects ?

  12. I think it would be incredibly performance hogging (slicing multiple CSG at a single time after multiple impacts and applying material to the sides of each chunk), for hardly any benefit or with even reasonable looking results, on CSG only environment assets. All of that together sounds like a waste of time. But, Josh will do what he wants.

     

    i'm not sure about this .. i have played "severance" a long time ago (a good game by the way) where you could slice opponents with a sword without a slowdown at all. so it is feasible. (but requires math skills of course )

  13. Hello,

     

    I have a problem with my editor, each time i make a syntax error and try to save, i get two times this message popup

    post-44-047333600 1289338841_thumb.jpg

    and only the third popup is the true error message.

     

    Does someone know why ? Do you also get this behaviour when you make an error ?

  14. Take for instance the game Red faction Geurilla. Entire buildings are collapsing while most of the debris just goes straight through each other. Bullet would be ideal for that. If you would have a game like Amnesia, Newton is probably better because the physics need to be accurate and there are only few physical entities active at the same time.

    yes i think it depends on the game your are writting, in some case bullet is better, in other cases newton is better, so it would be usefull if we could choose between the two with LE3 even if only newton is officially supported.

     

    A C++ abstraction layer for physics engine already exists here on Sourceforge http://www.adrianboeing.com/pal/index.html#intro

    but i don't know if Josh knows about it.

  15. I will publish Bullet.lib soon, of which the basic version is free, but maybe a commercial version will have more features.

    i thought bullet was opensource and free like newton ? there is a commercial version ?

     

    Hey ! i get 4 FPS with newton and 85 FPS with bullet :):):blink: i can't believe it, is this true ???

     

    If this resuilt is true... then.. why do we wait for 4 apples to fall down from the tree on newton's head, when we can have a wheelbarrow filled with 85 apples with bullet ? Or maybe newton should be named bullet, because this thing is shoooting itself in the foot ? LOL

     

    The only advantage of newton is that more bodies come to rest, and also they come to rest faster.

    Bullet is not as good with this, but maybe it is due to a cache system that keeps alive the objects who have a hight probability of being collided ? But LE engine could perhaps force the objects far away from the camera and outside camera vision to stop updating physics and help bullet .

  16. Attached a screenshot and a movie from the game GalaxyTrader i am working on. It is mainly a space game but you can enter space stations and in this one something went obviously wrong...

    looking good ! the video is really convincing bravo :)

    can't wait to see more of this

  17. [installation]

    Unzip this in the models/Environment folder (or somewhere you like within your SDK/Editor folder) and restart the Editor.

     

    Keep in mind that this is still WIP and needs tweaking on various aspects, also I will add moving clouds in a later version.

    I hope you like it and I waiting for feedback.

     

    thx klepto2

    Thank you for sharing Klepto ! :)

     

    edit: i solved all my problems , it was my fault :) it is working well now.

  18. I notice that the physics body is actually in front of the mesh. Is there any way to fix this? Thanks.

     

    In this thread Flexman says he encountered a similar problem too http://leadwerks.com/werkspace/index.php?/topic/3009-helicopter/page__p__27820__hl__%2Bhigh+%2Bspeed__fromsearch__1#entry27820

     

    He is probably one of the most skilled LE devellopers around, so if he says there is a problem with physics at high speed i tend to believe him.

    Maybe there is a synchronisation problem between the physics engine and graphics engine after all. Only josh can tell.

  19. So if it isn't too much to ask, could you point me out how i exactly can do this?

    Hi Daril,

    This is an easy one, it's the first sticky post of this forum section "If you need access to the forums..." http://leadwerks.com/werkspace/index.php?/topic/127-if-you-need-access-to-the-forum/

     

    ;)

    Welcome back

    if you did not loose your first name, last name and email adress it should not be a problem :blink:

     

    if you want us to tell you what's news since your version, then you should start by telling us what version number you currently have.

     

    2.3 adds Lua script programming in the editor

    2.4 adds rendering speed optimisations for heavy scenes

     

    if you don't need scripting and don't have heavy scenes you can stick with a vesrion previous 2.3 (my opinion) and wait for LE3 big jump.

  20. Ok got it working :) ,

    post-44-015722300 1287875644_thumb.jpg

    loading my mesh into the framework transparency world was not enought

    The trick was to render the transparency world myself after RenderFramework like this :

            RenderFramework;
            SetWorld(GetLayerWorld(GetFrameworkLayer(2)));
            RenderWorld;
            LEsetWorld(GetLayerWorld(GetFrameworkLayer(0)));
    

    Why is framework not doing this itself in RenderFramework :) ? I have no clue but there is probably a reason.

     

    this is the final material file

    ***********************************************************************
                     Material Generated by ADN 1.1 R3 
    
    *********************************************************************** 
    texture0="abstract::red.dds" 
    clamp0=0,0,0 
    color=1.00000000,0.141176477,0.141176477,0.589999974 
    blend=1 
    depthmask=0
    depthtest=1
    alphatest=0 
    overlay=0 
    zsort=1
    cullface=1
    castshadows=0 
    specular=0.759999990 
    bumpscale=3.06999993 
    gloss=0.460000008 
    shader="abstract::mesh_diffuse.vert","abstract::mesh_diffuse_specular.frag" 
    shadowshader="Abstract::mesh_shadow.vert",""
    

  21. You need call first UpdateFramework(), then your code, then RenderFramework(), then Flip(0).

    But also your code first, then UpdateFramework, then RenderFramework(), then Flip(0) works in most cases.

    I'm not 100% which one is the better approach, but the worst is to call UpdateFramework(), then RenderFramework(), then your code, then Flip(0), because then the physics bodies are totally out of sync with the meshes.

    i don't think it's a coding problem, in my sample i have attached the body to another one with joint and i start the body looping with a collision by throwing a very fast cube body on it. So the movement is initiated by the colilsion and there is no specific code to render the looping cube, the engine is doing this alone.

    But i still think this is not a bug, it's just a visual artefact when debugphysics is activated on a very fast parented body. The physic is probably continuing to update asynchronously during the renderframework command, so with very fast bodies the mesh is drawn at the body position but the "debug physic"s is not done at same time, instead it's drawn on top later ... so in the little timelapse, between meshs drawing end debugphysics drawing, the body has already moved and is drawn at a different place by debugphysics. But this just affects debugging visuals and not real gameplay.

    Of course only josh can confiirm this is how debugphysics works.

     

    but Lumooja is right do Updateframewrok before renderframework. First you set the positions of the 3D objects in the world with updateworld, then you render the world with renderworld. It's more logic than the opposite.

  22. In my main loop, I'm calling RenderFramework first, then UpdateFramework, then Flip. Even switching UpdateFramework with RenderFramework doesn't make any difference in my case.

    I can reproduce the problem , the meshs out of sync with their parent body at hight speed.

    It has nothin to do with the setvelocity command, it also occurs when a body is collided and bounces at high speed, the attached mesh lags behind.

     

    I have no idea how to solve this, you probably should PM Josh and point him to this thread.

     

    post-44-051389000 1287836470_thumb.jpg

     

    *screenshot edited with paint net and combined layers so you approximately see what's on screen (a normal paused screenshot would only show one body and one mesh cude)

×
×
  • Create New...