Jump to content

Brutile

Members
  • Posts

    314
  • Joined

  • Last visited

Posts posted by Brutile

  1. I suspect this is to do with engine optimizations.

    Entities in your scene have a view distance setting, so maybe try to increase this to infinite on some of your walls and floor and see if that makes a difference.

     

    And also increase it on your light.

     

    Actually, more likely to be the case is the shadow draw distance. The darkness is simply a shadow cast on your room, so the shadows will only appear at a certain distance.

     

    Increasing the Light Quality will likely solve this issue.

  2. So, I am getting confused when you say to "add the exe with your game and install it separately"?

     

    - Does that mean that I burn the oalinst.exe file on the same disk that I burn the game files to?

    - Then, I am assuming that I install the oalinst.exe file first and then run the game.exe file, right?

     

    I meant that you would include the OpenAL installer when you give someone your game. It doesn't have to be on the same disk, but it would need to be installed one way or another. I'm sure there are ways to get it to install OpenAL when your game installer runs, but I don't know how to do such a thing.

     

    I tried running the oalinst.exe on a computer but that didn't seem to do anything. I got an error that said something about Win32?

     

    Try using the installer from the OpenAL website

  3. You have to manually install OpenAL for some reason.

    There was a previous post that said you can get the install exe from C:\Program Files (x86)\Steam\steamapps\common\Leadwerks Game Engine\_CommonRedist\OpenAL\2.0.7.0\oalinst.exe

     

    The version (2.0.7.0) might be different. Add the exe with your game and install it separately.

     

    I'm pretty sure you can also download it from https://www.openal.org/downloads/

  4. Need your help in testing. I want to make sure that not only works for me.

     

    2D Engine.exe - System Error

    The program can't start because MSVCP140.dll is missing from your computer. Try reinstalling the program to fix this problem.

  5. I figured it out, but it's quite slow.

     

    local hitPos = pickInfo.position
    local surface = pickInfo.surface
    local canPlace = true
    
    for v1 = 0, surface:CountVertices() - 1 do
    local vertPos1 = surface:GetVertexPosition(v1)
    for v2 = 0, surface:CountVertices() - 1 do
    if v1 ~= v2 then
     local vertPos2 = surface:GetVertexPosition(v2)
     if (vertPos1.x == vertPos2.x and vertPos1.y == vertPos2.y)
     or (vertPos1.x == vertPos2.x and vertPos1.z == vertPos2.z)
     or (vertPos1.y == vertPos2.y and vertPos1.z == vertPos2.z) then
     local closestPoint = self:ClosestPointOnLine(vertPos1, vertPos2, hitPos)
    
     if hitPos:DistanceToPoint(closestPoint) < (0.96 / 2) then
     canPlace = false
     end
     end
    end
    end
    end
    
    if canPlace == true then
    local bulletDecal = Decal:Create(self.bulletDecalMaterial)
    bulletDecal:SetPosition(pickInfo.position, true)
    bulletDecal:AlignToVector(pickInfo.normal * -1)
    bulletDecal:SetScale(Vec3(0.1, 0.1, 1))
    bulletDecal:SetParent(pickInfo.entity)
    end
    

     

    function Script:ClosestPointOnLine(vA, vB, vPoint)
    local vVector1 = vPoint - vA
    local vVector2 = (vB - vA):Normalize()
    
    local d = vA:DistanceToPoint(vB)
    local t = vVector2:Dot(vVector1)
    
    if t <= 0 then
    return vA
    end
    if t >= d then
    return vB
    end
    
    local vVector3 = vVector2 * t
    local vClosestPoint = vA + vVector3
    
    return vClosestPoint
    end
    

     

    Edit: This is slow because somehow the vertex count on a CSG cube is 128. WTF?

     

    Edit: It seems like the engine is combining CSG meshes with the same texture to save draw calls. This is causing the above code to be slow. PickInfo.face.surface would solve this issue, but it doesn't seem to work.

    • Upvote 1
  6. I have an idea. I'll put into pseudo code, then I'll try to figure it out in code.

     

    for all connecting vertices,

    find the closest point along that line to the hit point.

    If the distance between that point and the hit point is < 96 / 2 then don't spawn object.

     

    Edit: We would also need to ignore the line that goes diagonally.

  7. This code will do a basic job of doing what you want, but it has limitations.

     

    local hitPos = pickInfo.position
    local surface = pickInfo.surface
    local canPlace = true
    
    for v = 0, surface:CountVertices() - 1 do
    local vertPos = surface:GetVertexPosition(v)
    
    if hitPos:DistanceToPoint(vertPos) < (0.96 / 2) then
     canPlace = false
    end
    end
    
    print(canPlace)
    

  8. Try creating a new project and follow these steps:

     

    1. Create empty project.

    2. Create a floor.

    3. Create a box on the foor.

    4. Apply the default grass material to both.

    5. Set the grass material's diffuse alpha to 0 (the 4th value)

    6. Download the SSLR shader.

    7. Add the shader to the scene root.

     

    If that doesn't work, then something is wrong, because I did just that and it works fine.

    And make sure to pan the camera in different angles, as it's only visible in certain angles.

    • Upvote 1
  9. What are the assumptions being made? Are all the surfaces square? Are the surfaces CSG? or does it need to check for any possible surface?

     

    Edit: And what about the model being placed? Is that just a flat plane, or can this be a complex object?

  10. I've attached some images that will help to setup the shader. Keep in mind that some materials, such as ones with lots of bumpiness will show less reflection, as they are not flat.

     

    Let me know if anything is unclear.

     

    Edit: And I didn't even need photoshop or GIMP, or any other software to use it.

    post-9910-0-06451500-1454315584.png

    post-9910-0-18639600-1454315598.png

    • Upvote 1
  11. You can't expect everything to work out of the box. Some assets require some work to setup for your specific need. And it is a free asset, so don't expect the creator to keep it up to date and provide a detailed documentation. I'm just grateful that they put this out for people to use freely. If this was a paid asset on the other hand, I would expect them to help out.

     

    I'm going to install this shader and try to help you out. I'll do my best to understand it and help you use it.

    • Upvote 1
  12. If you click the root in your scene panel, you will see some settings. Post processing effects is one of them. This is where you add your effects. As far as I know, you need to add the .lua version of the shader, not the .shader file.

     

    It sounds like there is also a custom shader for the material, but I don't know for sure until I try to use it myself.

  13. Leadwerks doesn't use a set FPS value. There is a playback speed when you play the animation, so you can use any.

     

    As for the weapon going through walls, I believe you can fix this by using 2 worlds. One world will have your gun, and the other world will have everything else. I did this in a previous project, but can't remember exactly how I did it. I just know it can be done like this.

×
×
  • Create New...