#My cursed statue

1 messages · Page 1 of 1 (latest)

timber mulch
#

Hey ! this is a showcase of my "cursed statue" addon I'm making, this all started with me finding about Lynn chadwicks's work and wanting to do a similar model and render it, and upon finishing that render and showcasing it to a few people one of them said it looked like a monster funnily enough (whilst Lynn Chadwick is renowned for his work revolving around a couple) and it made me want to actually turn this into a monster in gmod !
Although I had no experience programming in glua but thankfully chatgpt helped me get the hang of it and the wiki to consolidate some stuff.
Also strangely enough this model's texture (which I made using substance painter) converted insanely well as metal to gmod which I usually struggle too so that made me be more motivated to finish this project and so now here I am almost finished with it !

As of writing this message here are the current features :

  • when not looked at the statue will try to teleport to a player's previous location, making sure that location isn't in the air and not currently being viewed (kinda finnicky) and not too close
  • will play sounds (that I mixed from original samples I found online) upon teleporting
  • will play a half life 2 sound when looked at for a certain amount of time
  • will leave a blood spray at its current location before teleporting
  • some settings can be changed of the statue individually in the entity's property
  • some additional sound settings can be changed in the utilities settings

feel free to give feedback or suggestions !
https://youtu.be/R0PXS3yCmN0

#

I'm terribly sorry if I did something obviously wrong this is my first real addon previously I just did models & textures
I'm trying to gather feedback to improve

short halo
#

I've been working on something similar on-and-off, different goals but we're both working with the idea of "the player must never see it moving". What method are you using to detect if it's visible to the player?

#

I'm using a combination of checking if the entity's Draw has run recently (if 'yes' then it's within the player's screen bounds, but it's possible it's behind a wall so it's not guarunteed to be visible, and if 'no' then it's definitely not visible) and if that returns true then checking if util.PixelVisible is true at a few points representing the entity's position (if any of the PixelVisibles return > 0 then the entity is visible on the player's screen, if they're all 0 then the entity is fully obstructed by a wall or something, assuming the PixelVisible is sized and positioned correctly).

I'm curious if you've got a more efficient method. Or alternatively if you weren't aware of these, maybe you'll find them useful for your project. Our goals are a bit different so the methods might not be suitable, but it's interesting anyway.

sudden wasp
#

Get OBB min + max corner vectors, toscreen all of them, and then check screen coordinates against scrw and scrh?

And for checking if it's behind geometry do a trace from the player's eyepos to the obb corners

#

that's what i'd do ¯_(ツ)_/¯

short halo
#

that method works for a lightweight check, where if any of those corners are visible then the entity is definitely visible and don't need to do any further checking (I might try that as a possible way of not needing to check util.PixelVisible in some cases). if the result is false though, you'd still need to do some additional checking as part of the entity might be visible even if all corners are obstructed.

see this high quality MS Paint diagram for example, from inside the building behind spawn in gm_construct:
right one has bottom corners visible so no need for additional checks, it's definitely visible. left one has no corners visible, need additional checking as it is actually visible

umbral isle
# short halo that method works for a lightweight check, where if any of those corners are vis...

Begin by capturing and storing each previous frame. Disable lighting and color the Entity a specific RGB value, then capture each frame and check if any pixel matches the specific RGB value. If it does, the Entity is visible. In that case, replace the current frame with the previous one and stop moving the Entity
||This is the worst and most naive functional solution to this I can think of||

glossy echo
#

im doing something similar i just found an aimbot script that tries to hit each hitbox lol

umbral isle
wicked vault
#

Just do it properly with a Dot product

umbral isle
#

Dot product can only tell you if you’re looking towards it but it cannot tell you if you can see it

#

Something may be in between you and it

wicked vault
#

Sure but a dot should be one of your checks

short halo
umbral isle
#

Wonder if the square size is a hard limitation or something negotiable

short halo
#

The wiki used to say it's a "sphere in the world", the Source SDK says it's a pyramid, Rubat says "In reality it appears to be just a box" and updated the wiki to say "square that is always pointed at the camera in the world-space"
https://github.com/Facepunch/garrysmod-requests/issues/2804

GitHub

util.PixelVisible checks for visibility of pixels within a 3D spherical space, and returns 0-1 with the percentage of the sphere visible. 0 for not visible, >0 for partially visible, 1 for compl...

umbral isle
#

Strange

umbral isle
short halo
#

stuff like what GolemMan is doing and what I and others are doing/done, just doesn't feel right if you see the thing move. really important aspect of making it cool

urban root
# short halo I've been working on something similar on-and-off, different goals but we're bot...

i must propose:
create a 256x256 rendertarget with shared depth (you can go even lower without losing precision)
when all opaques are rendered, clear to black, render the model with depth equality check via stencils, then color everything matching white
blur with values that fit (tinker here), https://wiki.facepunch.com/gmod/Global.DrawColorModify pp_colour_contrast 255 to not lose pixels from blending, repeat that a few times (tinker here too), https://wiki.facepunch.com/gmod/render.CapturePixels, https://wiki.facepunch.com/gmod/render.ReadPixel in a grid (4, 8 samples per axis i.e.), if any are not 0 - player sees the object

also you can just spam-render the image onto itself with an offset instead of blurring, might be cheaper (especially if you make a pixel shader like that): just (pseudocode)

float4 accumulatedColor;
for(int x = 0; x < sampleCountX; x++) {
    for(int y = 0; y < sampleCountY; y++) {
      accumulatedColor += sample(wrap(u + x / float(sampleCountX)), wrap(v + y / float(sampleCountY))));
    }
}

there are a lot of different things you can do here with rendering, its pretty simple really (and pretty cheap too)

timber mulch
#

oml I didn't know people actually had talked in here I'm so sorry

timber mulch
# short halo I've been working on something similar on-and-off, different goals but we're bot...

ehhh I mostly got chatgpt to do that part, from my understanding it's a combination of dot product and some other math shenanigan I'm really bad at vectors in math sadly so I can't explain well, I also used a native glua function but it's not really that great but combining both does give some promising result, also a small issue with my implementation is that it doesn't change with the user's FOV so someone with hugeee fov will see it move

#

this was my first glua project and I didn't have much time lifet so I kinda tried to get something easy to add & that works okay-ish, and this dot product combined with some other stuff (that I forgot) worked somewhat well enough although I do appreciate all the idea you guys have proposed I might come back to it one day

#

@short halo