Jump to content

Rick

Members
  • Posts

    7,936
  • Joined

  • Last visited

Posts posted by Rick

  1. There is a shader somewhere that helps aid in this I think. I don't think it's part of LE but might be able to find it by searching on the forums. Your green part in the image above would obviously be a rectangle (since all images are rectangle) but the shader would use a mask to define where the green part should be visible. Shadmar might have created it. I've used it some time ago. That really should be part of the LE engine itself because this is pretty common task in games.

  2. Main.lua is pretty brute force honestly. It should be setup to have callbacks at certain points (like Gonan mentions) and then the idea being we never actually touch Main.lua but instead work in the lua callbacks for our personal code. Include a Game.lua at the top of Main.lua and have that be where we define these callback functions. If we wish to make changes that have to do with the main loop we can do it in these. It's probably cleaner for new people as well to do custom things in this file vs Main.lua. This would allow us to hook into the main loop without changing Main.lua and having update issues. Each function should be checked for nil in Main.lua and not called or defaults provided if it's expecting a return result. This would future proof it and allow more hooks to exist over time and not crash if they aren't provided. The idea then is Leadwerks never updates Game.lua. We as the developer own it 100%. If we want to take the risk of changing Main.lua we still can, else we just use these hooks.

    There would probably be more than these functions but the basics would be:

    
    -- something like this that returns an object that configures the window
    function WindowConfig()
    	return { x = 0, y = 0, width = 800, height = 600 }
    end
    
    -- after the window/context/etc are setup
    function InitGame()
    end
    
    function UpdateGame()
    end
    
    function PostRenderGame()
    end
    
    -- we define how to end the game
    function EndGame()
    	return false
    end

     

    • Like 1
    • Thanks 1
    • Sad 1
  3. 5 minutes ago, Josh said:

    Maybe you could add a 45 degree bevel at the top to catch the light? I feel like the added chambers should be completely out of view.

    It was just a bug I was trying to figure out as to why you could see them at the start. Just fixed it so now you can't see them at the start anymore and when you move from room to room they do go completely out of view so all good on that front.

     

     

    • Like 1
  4. The thing I don't like about totally black ambient is losing the top part of the walls. When everything is black those are black too and the walls look paper thin which looks odd. What part specifically are you thinking doesn't work well when you see this in action?

     

    Note, there is a roof on these that use the shader that makes it invisible but that's after lighting is applied to that the room is lit correctly and doesn't bleed outside the top of the room. Which is why when ambient is totally black the top of the walls can't be seen either.

  5. On 3/22/2018 at 3:19 PM, gamecreator said:

    My version was going to have different size/shape rooms so my solution was to have a hole in the walls for each exit and also a hidden door and a hidden wall.  Then, depending on where the room had doors versus walls, I unhid the door or wall accordingly.  Worked pretty well.

    Thanks for the idea on this. I used this and it really works out great! I now have random dungeon rooms that match doorways correctly working which is just fun to regenerate new dungeons :)

    Now I'm moving onto room prop population. The plan is that each room itself is a 2D array that's used for both AI pathfinding and prop placement. Since I can have 15 different rooms with exits ({ "n", "s", "e", "w", "nw", "ns", "ne", "sw", "se", "ew", "nsw", "nse", "swe", "nwe", "nsew" }) the plan is to have multiple room configurations per room exit type (can keep building on those over time). Since each room will be a 2D array I'll have each prop have an ID and just put the ID in the 2D array. So I'll have preconfigured prop placement rooms per room exit type to pick from after it's determined which room to make.

    When the props are 1 tile in size this is easy. I have to figure out a way to do this with things that are greater than 1 tile and rotation of said object. I suppose I'll have to include rotation with the ID for the props.

  6. If you've ever used .NET then you've heard of linq. I found a sweet lua linq library. This allows you to query tables in a clean and powerful way. It's pretty slick. https://github.com/xanathar/lualinq

     

    Just download it all and look in the Release folder and unzip the lualinq.zip in there and it's just the lualinq.lua file that you need. Looks like in there is another querying framework called GrimQ. Something Legend of Grimrock used I guess. Pretty neat!

  7. 1) I make some csg where one of the csg is the parent and others are the child and give them dummy scripts.

    2) If you hide the parent csg at this point the children get hidden. All great right!

    3) Now make this a prefab. Delete this from the scene.

    4) Bring the prefab in and now changing the hidden flag (or in code too) of the parent does NOT show/hide the children

     

    • Like 1
  8. 12 minutes ago, gamecreator said:

    Middle one (the one that's just a link) says it's unavailable.  Never clicked it before.  I guess that explains why it can't embed it.  The other two are ok.

    Hmm it plays for me. I'll have to dig into some youtube menus where I can't find anything.

     

    OK, it was private. Changed to public. Try now please.

  9. 32 minutes ago, gamecreator said:

    It's easier to load in rooms models, like I tried to do.  But you have to generate a navmesh via code and world->SetSize is broken.  So I'm curious, Rick: how were you planning on generating the rooms and how would you handle enemy navigation?

    Honestly, I've had bad luck with LE's navigation. Just always ends up being a decent amount of little issues to it when it comes to the AI moving along it. My plan is to just use A* with something like this since each room will be a square like shown. I'll grid out each room and have them move that way. I'll place props on the grid as well so it's nice and easy. I'm not allowing monsters to move from room to room, but when you are in a room I might sometimes block the doors until you kill the monsters so you are stuck in there and can't just go out to the next room to rest/heal. This example was 2 rooms in the map itself. The 2nd room wasn't generated on the fly but that would be the plan eventually.

    Room generation is interesting. First everything would be on 1 level. I don't have plans to move up or down. Each room has at least 1 exit/entrance but can have more. My idea was to have a room model for all variations of exits. North.mdl, NorthSouth.mdl, NorthSouthWest.mdl, NorthSouthEastWest.mdl, etc. On map load the entire dungeon is generated. Start with the first room and pick a random exit room model, and build out from there. The themes would just be the material used on the rooms. Since each room is gridded for navigation I can also put the props on the grid as well. If each prop/enemy has an ID each room just becomes a 2D array of numbers. So these configurations can be built out in an editor but ultimately as just 2D arrays stored to file and picked from on load of the dungeon and creation of a room. This way I can have a bunch of predefined configurations to pick from so they look good. I could even make sure each level gets a certain configuration for each room if I wanted. Lots to think about.

    • Like 2
  10. Is there any API I can use to check a games page download file and then download it? I like the games page and I'm thinking about creating a little launcher app for my game that would check the games page for my game to see what version the download link is and if newer than what is locally installed download it and unzip it for the user so they don't have to come here to see if there is an update and manually download. I can parse the HTML if I have to but would prefer not to do that as it's error prone.

  11. I have a point light in my scene that is basically a room. When I have the Cast Shadows setting to any of the Static settings my character has a shadow but obviously doesn't move with the character (doing a top down view). If I change to dynamic then there is no shadow. What should I be checking that might cause such a thing?

  12. 1 minute ago, VampyrEngel said:

    I am new here but I would love to make a  Futuristic 3D 1st/3rd Person game with Space Battles  both with one man fighters and Space Cruisers/Carriers  And you can fight from both if you wishand also fight on a proper cyberplanet surface with hovertanks and walkers e.t.c Not DFT (Dynamic Flat Terrain)  it would be set in the Solar System so you can fight and die and claim worlds  in the Solar System but no where else at first ( later games you could use Jumpgates and Portals to other Solar Systems in the Galaxy and eventually other Galaxies but not for a first game) you could choose your faction and fight . Leadworks looks very promising for this so who knows if I got people interested or I can find a and also develop C++ code it might well come true

    Welcome to Leadwerks Vampyr! Sounds like a cool game. I would love to own my own planet :)

×
×
  • Create New...