• What Are You Working On? Mesh Edition - August 2012
    650 replies, posted
I've been working on a stealth system based on Splinter Cell: Chaos Theory. Features include: Light level indicator. (top right corner) Light level based visibility. View cones that modify the range at which a NPC is able to detect a player. Noise from movement. Noise from weapons. NPCs search for the cause of a NPC's death. NPCs move to a player's last known position. Still a work in progress though. [media]http://www.youtube.com/watch?v=sR42BVVlUwA[/media]
[QUOTE=Silverlan;37358928]Because the brushes are stored as planes in the bsp. You have to calculate the plane intersections to build the whole mesh, which is quite expensive if the mesh has a lot of sides. [b]The planes are not enough to find an accurate trace intersection.[/b][/QUOTE] Actually they are enough but you still need the mesh so it doesn't matter.
[QUOTE=ralle105;37359394]Actually they are enough but you still need the mesh so it doesn't matter.[/QUOTE] How are you supposed to find whether a point is within the bounds of a polygon without knowing the bounds? (Which is what you need the plane intersections for.)
Which one should I use for my RP? [img_thumb]http://cloud-2.steampowered.com/ugc/918985153599360289/76C44C5854D00A6CBF8E077C9DACA375B233AFDF/1024x480.resizedimage[/img_thumb] [img_thumb]http://cloud-2.steampowered.com/ugc/918985153673954188/78F743CE9C6946136D8FD6BFB03F4F21714359FA/1024x480.resizedimage[/img_thumb] And unfinished: [img_thumb]http://cloud-2.steampowered.com/ugc/902097924237533801/C13588FCF435092E77B6779B49DA073CEE4A48F8/1024x480.resizedimage[/img_thumb] Or something completely different?
[QUOTE=Coffeee;37359566]Which one should I use for my RP? [img_thumb]http://cloud-2.steampowered.com/ugc/918985153599360289/76C44C5854D00A6CBF8E077C9DACA375B233AFDF/1024x480.resizedimage[/img_thumb] [img_thumb]http://cloud-2.steampowered.com/ugc/918985153673954188/78F743CE9C6946136D8FD6BFB03F4F21714359FA/1024x480.resizedimage[/img_thumb] And unfinished: [img_thumb]http://cloud-2.steampowered.com/ugc/902097924237533801/C13588FCF435092E77B6779B49DA073CEE4A48F8/1024x480.resizedimage[/img_thumb] Or something completely different?[/QUOTE] I like the style you use for the bars in the 3rd picture, but they take up WAAAAAAAAAY too much of the screen. I'm finding people are starting to like big bulky HUD's but I personally can't stand them. They distract too much from the game. You shouldn't constantly be staring at bars in an FPS.
[QUOTE=Silverlan;37359525]How are you supposed to find whether a point is within the bounds of a polygon without knowing the bounds? (Which is what you need the plane intersections for.)[/QUOTE] I meant they were enough to find the point of intersection. Also wouldn't you be able to create the meshes on the fly? Seems to me that doing plane intersections in real time wouldn't be so slow what with the bsp format making it easy to find only the planes affecting the mesh shape.
[QUOTE=LEETNOOB;37358956]I've been working on a stealth system based on Splinter Cell: Chaos Theory. Features include: Light level indicator. (top right corner) Light level based visibility. View cones that modify the range at which a NPC is able to detect a player. Noise from movement. Noise from weapons. NPCs search for the cause of a NPC's death. NPCs move to a player's last known position. Still a work in progress though. -video-[/QUOTE] I'm curious, what are you using to calculate the light level? render.GetLightColor?
[QUOTE=pennerlord;37360212]I'm curious, what are you using to calculate the light level? render.GetLightColor?[/QUOTE] Yep, and it's buggy on a lot of maps. Just created a thread and am hoping Garry will look into it.
[QUOTE=Silverlan;37358928]Because the brushes are stored as planes in the bsp. You have to calculate the plane intersections to build the whole mesh, which is quite expensive if the mesh has a lot of sides. The planes are not enough to find an accurate trace intersection.[/QUOTE] Shouldn't it be possible to refine your search from the BSP by searching for matches from traceres.HitNormal and traceres.HitTexture? Not sure if you're doing that already, but it seems like it would be a pretty significant optimization.
[QUOTE=Ghor;37360331]Shouldn't it be possible to refine your search from the BSP by searching for matches from traceres.HitNormal and traceres.HitTexture? Not sure if you're doing already, that but it seems like that would be a pretty significant optimization.[/QUOTE] You still need to find the plane in the bsp tree though.
[QUOTE=ralle105;37360390]You still need to find the plane in the bsp tree though.[/QUOTE] It would still be faster than computing the plane intersections for every brush in the map, since you would be excluding any brushes that don't match the normal or the texture of the hit plane. Testing the hit position for coplanarity should actually be able to narrow this down even further. Create the meshes by computing the plane intersections of brushes in the matching set, and then cache the results for faster lookups later. You could also give the user the option to generate the map cache all at once.
Seems messy to compare normals and stuff but I guess it could be faster.
Dear Silverlan. You are a powerfull wizard. Let me be your apprentice! Just kidding. Probably I will just go through your code and try to learn on my own. Your last video brought me my old idea... hm hm hm... But. I've got a question, maybe stupid because probably someone already asked you about that. Are those spawned things meshes generated in lua or real brushes?
Meshes generated in Lua
I can't get physics on meshes working correctly for the life of me. How do you do it so perfectly, Silverlan?
Bitch, I'm a train. A flying antigravity train. [img]http://filesmelt.com/dl/gooby1.PNG[/img]
[QUOTE=Solece;37362320]I can't get physics on meshes working correctly for the life of me. How do you do it so perfectly, Silverlan?[/QUOTE] PhysicsFromMesh works perfectly if you define it [B]shared[/B]. If you have a convex shape though you should definitely use the new [I]Entity:PhysicsInitConvex({v, v, v})[/I] Garry also added [I]Entity:PhysicsInitMultiConvex( {{v, v, v}, {v, v, v}} )[/I] if that's helpful. Again, Shared.
Gee. I've been out of commission since Sunday due to fucking Windows (9)8 deciding it would be nice to convert all my partitions to a dynamic type, which Apple's EFI doesn't like to boot from. It also managed to destroy part of Windows 8 too, and I resorted to using Notepad to transfer files, which was useless since XP decided to remove all the partitions because they're a dynamic type, yet it says it loads the support drivers for it... Took a pain to install the right drivers by transferring files through the iPhone's PTP service. I'm glad I backed up some stuff on Dropbox before downgrading to Windows 8. Aside from another tangent of digression, I've been working on getting a way to get the blockplayer's current block they are standing on, as well as one block for the torso, and one for the head, for calling events such as drowning, playing step sounds, etc. A little code snippet (Coding in Notepad and using Paint to visualize is horrible...) [lua] function Player:GetCurrentBlocks( zOFFSET ) -- Define 'zOFFSET' as 0 instead of nil if it's undefined. local zOFFSET = zOFFSET or 0; -- Creating a somewhat one liner instead of multiple lines just to 'math.floor()' it. local PLAYER_CHUNK_POSITION = { X = math.floor(((CHUNKS[Player:GetCurrentChunk()].Position - Player:GetPos()) / CHUNK_SCALE).x); Y = math.floor(((CHUNKS[Player:GetCurrentChunk()].Position - Player:GetPos()) / CHUNK_SCALE).y); Z = math.floor(((CHUNKS[Player:GetCurrentChunk()].Position - Player:GetPos()) / CHUNK_SCALE).z); }; -- Calculates the distance the player is away from current chunk's origin, where it's scaled up or down to be 1:1 with the blocks. -- Get the current chunk local CURRENT_CHUNK = Player:GetCurrentChunk().Name -- If the target block is out of the current chunk's bounds... if PLAYER_CHUNK_POSITION.Z + zOFFSET > CHUNK_SIZE_Z then CURRENT_CHUNK = string.format( CHUNK_NAME, Player:GetCurrentChunk().X, Player:GetCurrentChunk().Y, Player:GetCurrentChunk().Z + 1 ); -- Offsets the target chunk by Z + 1. elseif PLAYER_CHUNK_POSITION.Z + zOFFSET <= 0 then CURRENT_CHUNK = string.format( CHUNK_NAME, Player:GetCurrentChunk().X, Player:GetCurrentChunk().Y, Player:GetCurrentChunk().Z - 1 ); -- Offsets the target chunk by Z - 1. end -- Retrieve the target chunk's blocks. local CHUNK_BLOCKS = CHUNKS[CURRENT_CHUNK].Blocks; -- Return the target block. return (CHUNK_BLOCKS[PLAYER_CHUNK_POSITION.X][PLAYER_CHUNK_POSITION.Y][PLAYER_CHUNK_POSITION.Z + zOFFSET]); end [/lua] [del]Alas, there will be some [i]slight[/i] complications with this due to chunks being infinite up and down, so the block beneath the player's feet can be in one chunk, while the torso and head are in another. When Windows 7 is installed, I'll probably add a check to see if it's out of the bounds of the table by using something similar to my block face calculation.[/del] It should work. I haven't tested it out yet, since it's been ages since I've looked at my code for proper variables, but adjustments can be made as needed. Perhaps I'll start working on some idea I had recently. So, client-side's been fixed, and it's safe to continue coding?
It's not THAT dark in game, but it is fairly. My compression just made it darker. Grrr [media]http://www.youtube.com/watch?v=at6IRU0johE&feature=youtu.be[/media] I have yet to code the ACTUAL slenderman. He is soon to come.
It's not entirely Lua related, but porting Garry's Mod IDE to [B]WPF[/B] and trying out some syntax highlighters. [IMG]http://undergroundhacker.co.uk/res/projects/gmodide/gide2_1.png[/IMG]
You should probably use a monospaced font.
Better? [URL="http://screencloud.net/img/screenshots/8fb5f6a751f90fe6653583042295767c.png"][IMG]http://screencloud.net/img/screenshots/8fb5f6a751f90fe6653583042295767c.png[/IMG][/URL]
[QUOTE=KillerLUA;37372026]Better? [URL="http://screencloud.net/img/screenshots/8fb5f6a751f90fe6653583042295767c.png"][IMG]http://screencloud.net/img/screenshots/8fb5f6a751f90fe6653583042295767c.png[/IMG][/URL][/QUOTE] It looks waaay nicer and is easier to read now. Monospace fonts exist in programming environments for a very good reason.
[quote][img]http://cloud.steampowered.com/ugc/540684781023698674/97EDF4E95CD2FF27539297082DA9D1B881882E47/1024x576.resizedimage[/img][/quote] Working on my amazing forest generator :v: The levitating trees are supposed to be there btw /sarcasm
[QUOTE=jrj996;37375635]Working on my amazing forest generator :v: The levitating trees are supposed to be there btw /sarcasm[/QUOTE] oh god what happened to the bottom of the trees D:
I don't even know anymore it just does whatever it wants + Source Modeling
[QUOTE=jrj996;37375635]Working on my amazing forest generator :v: The levitating trees are supposed to be there btw /sarcasm[/QUOTE] Those are some nice winter tree models :P If you do want them on the ground.. :rolleyes: Use [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index766f.html"]Entity.DropToFloor[/URL] if possible
[QUOTE=brandonj4;37376201]Those are some nice winter tree models :P If you do want them on the ground.. :rolleyes: Use [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index766f.html"]Entity.DropToFloor[/URL] if possible[/QUOTE] They're already told to do so but InitPostEntity fucked up that's why they're all over the place. See how the trees above the water are the same height as the ones which are actually on the floor?
At first I thought about making that stealth mod as a standalone mod, but after lots of testing I'm starting to want to turn it into a stealth HL2 campaign gamemode. :X Anyways, HUD. [img]http://i.imgur.com/gRe78.jpg[/img] The top rectangle is obviously the health bar. The middle green boxes is the movement noise indicator. The lowest part of the HUD is the light level indicator. I tried to keep it as authentic to SC:CT as possible, and even there are differences (minor) I still like the way it looks.
[QUOTE=LEETNOOB;37376468]HUD[/QUOTE] That looks really nice.
Sorry, you need to Log In to post a reply to this thread.