#Dreams

1 messages · Page 1 of 1 (latest)

acoustic isle
#

When you say you wrote your own collisions, what exactly do you mean by that?

onyx jacinth
#

very interesting, im confused how you're moving while out of bounds of the map O_O

rose barn
acoustic isle
#

What makes that necessary as compared to creating a collision mesh for it and using the built-in collisions?

rose barn
#

Built in collisions dont work outside map bounds

stiff rune
#

impressive

arctic bolt
#

This is is cool, could also probably be adapted to so many other scp's

rose barn
acoustic isle
#

@sonic moon This seems relevant to your interests

rose barn
#

This turned into a quicker proof of concept since someone had already ported models/maps/etc. of SCP-106

#

it should be noted anyone trying to do this in the future, you will be doing work arounds for pretty much everything you've taken for granted

#

Oh and because I always wanted to do a deathmatch gamemode with walls changing gravity directions, this should also allow that too, very crazy to me all this is even working, I have tried this multiple times over several years and then suddenly get it right this go around

sonic moon
#

im not sure if this is applicable at all because the tardis addon uses standard models with normal collisions, not some custom written lua collisions like this project seems to be

#

however the ability to place interiors outside the map in the void and have the ability to move/interact would be game changing

rose barn
#

there might be a way to do that

#

im noticing now that with about 6 bots in the pd it lags the fuck out, this is before any actual optimization done to the code

acoustic isle
rose barn
#

over the next week im going to flesh out what I was originally working on to an obj hot loader and module system

#

and see if I cant retry these with props too, util.Traceline does have an IgnoreWorld option that I think works with prop collisions outside the map

sonic moon
#

not sure if you know anything about the tardis addon but for basic context it spawns an interior in the skybox that links to an entity on the ground

#

as such the maps it can be used on are limited by skybox space, some maps not being usable by the entity at all

#

being able to spawn it in the void would solve this problem entirely

copper flicker
#

I'm sure prop interactions wouldn't work though? At least not like normal physics

grave tinsel
#

This looks insane btw and id kill to see 1499 but actually good

#

860 as well

rose barn
rose barn
sonic moon
#

oh thats cool

#

i worked with it alot over the past year

#

well not too much with doors itself, mostly the tardis

#

which required some personal tweaks to doors

rose barn
#

I wonder if I could like modify infmap or something, it uses meshes and deters a bunch of things already

autumn harbor
#

@rose barn I am closely following this project, this could be utilized on my Pill Hide And Seek server, we have tons of different hunters from all types of different games (bendy,fnaf,scp,etc), I tried to add the addon to the server and it works good just some bugs and issues that need to be resolved. I am really excited for this project, good work man

rose barn
#

Boom, heavy optimzation brought it up to over 64 bots on my pc, and its somehow less laggier than rendering the actual map and all the bots together

#

Only took removing every single global and meta table lookup

autumn harbor
acoustic isle
grave tinsel
rose barn
#

Before any optimzation, it was 6 bots, after replacing pairs with ipairs, it was about 18, after rewriting everything and removing some redudnacy its around ~70

#

With that kind of headroom, it should allow servers or localplayers to use it and still have other things going on

rose barn
#

You could do this without doing that but I don't know blender well and baking one material is already hell

grave tinsel
#

im slightly sad to see you used gm_site19 :C

rose barn
#

?

grave tinsel
#

in rp_scp_site19 the whole thing is accurate

#

and has some animation in the corridor section

rose barn
#

oh I didnt know there was a better map, that changes some things

grave tinsel
#

i can throw together whole models if you decide to go for that

#

does it have to be one UV?

#

or baked i mean

rose barn
#

For the lighting yeah

grave tinsel
#

oh right

#

actually wait no i know a workaround maybe

#

iirc if theres a second $model defined of the same model it wont z-fight

#

so it could have a separate layer for baked lighting

#

id have to experiment with it though

rose barn
#

If you figure that out that'd be great

#

I do need the models split up + the vmfs due to how the physics work, dreams converts the vmfs directly to source-like solids so its less expensive than doing triangle-mesh collision

grave tinsel
rose barn
#

yeah

grave tinsel
#

i can handle the physics mesh

#

ill set up a vmf pack anyways if you still need it

rose barn
#

The models physics mesh isn't used, would be too expensive, so yes pls vmfs lol

grave tinsel
#

oh wait i see now

rose barn
#

you know I just had like a crazy idea and the guy who has worked on stormfox has already paved the path for me

#

I could just take compiled bsps and take their lightmaps and solid data

grave tinsel
#

niknaks?

#

idk what he called it lol

#

i did see that bsp thingy

rose barn
#

let me look into that

#

nvm way more work than its worth

rose barn
#

@grave tinsel hows it going with the rooms

grave tinsel
#

and wondered if lighting even needs to be baked

#

could dynamic lights not be used?

rose barn
#

They have harsh shadows and you have a max of 8 I think?

#

It wouldn't look as good as baking it with extremely low res textures

grave tinsel
#

but ill still bake anyways

rose barn
#

oh its actually 32

#

gonna test it real quick

#

its just simply not working and I dont know if its because of it being in the void

grave tinsel
#

either that or the radius values are messed up idk

#

i know they can be a pain

rose barn
#

Im making a python script to convert vmf lights to blender ones

#

Absolutely hate the process entirely and if I can figure out how to put entire scenes together automatically that'd be sick

obsidian nimbus
#

ayo i could use this for my schizo addon

rose barn
stray creek
#

Typical 40℃ dream

shy ruin
#

is this all clientside?

rose barn
#

movement is shared, rendering is clientside models and other magic

rose barn
grave tinsel
#

z fighting i think is just in hlmv and would look fine in game

rose barn
#

looks absolutely beautiful just from that screenshot

rose barn
rose barn
#

maze generation with phys, been working a lot so progress has been really slow

rose barn
#

did this by mistake but thought it was pretty

rose barn
rose barn
#

@grave tinsel I just realized rp_scp_site19 also has the og 1499, do you mind if I use that instead of my shitty improv'd one xd

acoustic isle
#

The same thing but it's just carameldansen inside the gas mask

robust sedge
grave tinsel
#

A vmf if possible

rose barn
#

If you send the vmf I can make the model, no lights needed since its ambient lit

rose barn
rose barn
acoustic isle
#

Quick question

#

Is it lightmapped?

rose barn
#

Its lit by render.ModelLighting* functions, you would have to bake the lights yourself in blender rn to get vertex lightmaps

#

Im going to do local directional lighting from light entities but right now it just takes the ambient light

acoustic isle
#

Lightmaps in Source are textures, not per-vertex colorations

#

Half-Life and other GoldSrc engine games used per-vertex coloration for lighting though

#

If you're making the map with Hammer, it should produce lightmap textures as part of the compilation process

rose barn
#

I thought you were talking about the props ngl

#

Yeah everything is just baked directly on to the materials in blender rn.
implementing Naks bsp reader is on the eventual todo, afaik there already exists a tool to edit and extract lightmap lumps too, planning on using that as a reference once I get to that point

#

Right now though this is enough for me to do what I want creatively with the mod and not lose my marbles

acoustic isle
#

I only really ask because I think it would be valuable outside of the project, so if this works as-is for your project it's a moot point right now

rose barn
#

Right now the collisions system is held up by two traces for the player and this causes a lot of issues, I've spent past few days reworking most of how physics is calculated to use a cylinder bounding box for the player, and automatically use the appropriate AABB/OBB/Plane checks for each solid to prevent doing a bunch of extra work, a lot of work still has to be done to the vmf converter to properly optimize brushes and props
The final result will be on-par with most game engines in terms of performance and accuracy, very basic entity collision will be possible and easier to implement

#

Also moved the wiki to jekyll https://alexswad.github.io/dreams-wiki/
Not very accurate atm because everythings being reworked but will look much prettier

obsidian nimbus
#

👀

rose barn
#

obb from vmf done, pain in the ass

acoustic isle
#

Very nice

rose barn
acoustic isle
#

I have no idea what I’m looking at

rose barn
#

cylinder with obb collision with the direction it should move the player in

#

this has been my all my free time for about a week now

crisp cobalt
#

Why does the collision need to move the player? It only needs to block them from progressing no? That would be weird running around

If you had those brushes serverside you could use the default collision system or https://wiki.facepunch.com/gmod/Entity:PhysicsFromMesh and avoid making your own

rose barn
#

If you know how to hack VPhysics and make it work I would love you forever but afaik this is the only way

crisp cobalt
#

it isn't vphysics that controls collisions with brush/world for players/npcs, it's qphysics/gamemovement (hull/obb)

rose barn
#

didn't know that, I mean rn everything is being rendered completely seperate from the world in RenderScene like so

function DREAMS:RenderScene(ply)
    local view = {
        origin = origin,
        angles = angles,
        fov = fov,
    }
    if not self:SetupFog(ply) then render.FogMode(MATERIAL_FOG_NONE) end
    self:CalcView(ply, view)
    cam.Start3D(view.origin, view.angles, view.fov, 0, 0, ScrW(), ScrH())
    self:Draw(ply)
    cam.End3D()

    cam.Start2D()
    self:DrawHUD(ply, ScrW(), ScrH())
    cam.End2D()
    return true
end
#

movement code is predicted clientside and calculated/networked serverside so players can see eachother

crisp cobalt
#

i'm not sure how the gravity hull designator did it, that was out of bounds too

rose barn
#

similar to infmap and doors by faking the real position by putting everything in a local box on the map and overriding meta and util functions to translate everything

#

this is to avoid all the problems that come with that, especially because conflictions happen very quickly

crisp cobalt
#
function GH.FindNowhere(rad)
    local nowhere = vector_origin
    while !((util.PointContents(nowhere) == CONTENTS_EMPTY or util.PointContents(nowhere) == CONTENTS_TESTFOGVOLUME) and 
            !util.RealTraceHull{start=nowhere,endpos=nowhere,mins=Vector(1,1,1)*-rad,maxs=Vector(1,1,1)*rad,mask = MASK_SOLID + CONTENTS_WATER}.Hit and --HIT EVERYTHING
            hook.Call("AllowGhostSpot",nil,nowhere,rad) != false)do
        nowhere = Vector(math.random(-16384,16384),math.random(-16384,16384),math.random(-16384,16384)) -- Find somewhere to put the ghost
    end
    return nowhere
end``` huh, i thought it was out of bounds
rose barn
#

wouldnt it be checking for CONTENTS_SOLID

crisp cobalt
#

that is what it does right there, guess not

local pos = vector_origin
    local rad = 0
    local amt = 0
    for _,p in pairs(welds) do
        if IsValid(p) then
            pos = pos + p:GetRealPos()
            amt = amt + 1
        end
    end

    if amt > 0 then pos = pos / amt end
    for _,p in pairs(welds) do
        if IsValid(p) then
            local mrad = p:GetRealPos():Distance(pos) + p:BoundingRadius()
            if mrad > rad then rad = mrad end
        end
    end
    local npos = GH.SHIPS[ent].NPos or GH.FindNowhere(rad)
    for k,e in pairs(GH.SHIPS[ent].Hull) do
        if !welds[e] then
            GH.HULLS[e] = nil
            GH.SHIPS[ent].Hull[k] = nil
            if IsValid(e) and IsValid(e.Ghost) then
                e.Ghost:DontDeleteOnRemove(e)
                e.Ghost:Remove() --WHO YOU GONNA CALL?
            end
        end
    end```
rose barn
#

I tried also moving the collision with an entity around like a track underneath the player but it was pretty jank, if there was magic to be done with modules its definitely out of my hands then

crisp cobalt
#

if i knew a way to disable collisions with the world (while still calling movement hooks) it might have been an option to use entities EnableCustomCollisions out of bounds

rose barn
acoustic isle
#

That's pretty good

#

How closely does it mimic the player's normal movement?

rose barn
#

fps being low is caused by the 128 bots more than anything else

crisp cobalt
sonic moon
rose barn
#

after a lot of testing in my short free time I got it accurate enough so the player should never fall through the map or walk through objects, OBBS with very specific angles can feel sticky but thats the only problem now

rose barn
acoustic isle
#

Yeah, it's a real annoyance

#

It might be something that could be expanded, but I think you would need to have specific function requests and would need to provide the algorithm for it. Ideally already in C++ so Rubat doesn't need to write it from scratch

rose barn
acoustic isle
#

I don't really know what's going on behind the scenes there

#

Whatever the case is, it's important to make this kind of change as easy as possible for Rubat

#

So if there's an existing function in the Source SDK, find it and include it in the request

rose barn
rose barn
#

cursed images

acoustic isle
rose barn
#

I dont think its that bad though, and this only happens on planes specifically, OBB ramps should be fine

acoustic isle
#

I forget exactly what it's called, but if I remember correctly the fix is to basically treat the ramp on the ground the same way that you treat a wall the player walks into and slides against

#

It makes the player "stick" to the ground

#

I think it's like "if the player is on the ground and their next position is in midair and their next position has a floor within a small distance of their feet then move the player down to touch the ground"

rose barn
acoustic isle
#

It looks pretty good

rose barn
acoustic isle
#

...can it do surf?

rose barn
#

however decompiling entire maps and just throwing it in there works pretty damn well

rose barn
radiant vector
#

you are literally making a game inside of a game rn

sonic moon
#

oh it would be really interesting to combine this with jazztronaut's beyond-the-map void and have the player walking around on the squiggly road out of bounds

rose barn
stray creek
rose barn
acoustic isle
rose barn
#

fun stuff like this is also possible

#

made sure to try to keep it easily renderable outside of the dreams context so people could do creative stuff with it

acoustic isle
#

Scale it way down

#

Put the dream world in a little box

rose barn
sonic moon
rose barn
#

im so making a bunch of stupid shit with this when I can

sonic moon
#

im curious

#

how does a dream dimension handle soundscapes?

#

does it have its own soundscapes and does it override a map's default soundscape?

#

else you might have random/unfitting soundscapes for your current dreams dimension depending on where it spawns in the map

#

like construct bird chirping while you're in the backrooms or shit like that

rose barn
#

yeah this is a problem currently, im patiently waiting for rubat to implement a soundscape API lol

acoustic isle
#

Make sure he knows that

sonic moon
#

been waiting for like a year for any soundscape api at this point

#

if it happens in the next two lifetimes ill let my descendants know

shy ruin
#

whats the max size a dreams map can be?

rose barn
#

technically infinite? depends on how much you're trying to do at once

#

but it still has to be within max world bounds due to networking limits

#

something like infmap wouldnt be super hard to do

shy ruin
#

Does dreams have prop collisions?

rose barn
onyx jacinth
#

@rose barn what is preventing hotloading maps?

acoustic isle
#

What, like using Nak's BSP loader?

onyx jacinth
#

I've seen niknak do some sort of hotloading

#

but I would love to hotload surf maps, I know the movement isn't there yet, but I would try to do that part, I just don't know much about BSPs or the area around BSPs, so it's out of my realm

acoustic isle
#

I'm pretty sure that Dreams is effectively replacing the normal movement and collision system with a "best guess" approximation using Lua while you're in the dream world

#

I haven't used it myself so I can't say for sure, but I would guess that it probably feels quite different from normal movement and physics

onyx jacinth
#

yeah I think it'd need to be redone and try to replicate the source engine 1:1 for surfing though

acoustic isle
#

I suspect it would be a pretty large task to create a functional and performant 1:1 recreation of the game's movement system in Lua

onyx jacinth
#

main thing I wanna know is if hot reloading bsps is possible, like having a real empty bsp, and then using that to load in bsps

acoustic isle
#

Depends on what you mean by "possible"

onyx jacinth
acoustic isle
#

The world/map is made out of a fundamentally different type of "thing" than Entities are

#

The world cannot be modified through Lua

acoustic isle
#

Your only option is to create the world from scratch out of Entities and IMeshes

onyx jacinth
#

does the world have like different interactions you're saying?

acoustic isle
#

It would effectively be like cutting the map up into a bunch of little models, then spawning them from the spawn menu and freezing them in place

onyx jacinth
#

right right

#

ahh and you're saying that's not performant really

#

yeah :|, maybe hot reloadig is a practical nightmare

acoustic isle
#

It's definitely possible to do, it's just an enormous undertaking

#

The infinite worlds addon creates its own map using Lua, but even that has a ton of caveats

onyx jacinth
#

the infinite map has to be a repeating map, right?

#

I haven't looked much into it, but i'm gessing you can't have 50 unique chunks/maps

acoustic isle
#

I think it can be generated as the player moves similar to Minecraft generating chunks

#

But I also haven't looked into it much so I could be wrong

onyx jacinth
#

hmm, well shit, we will see, i would love to be able to do it
probably requires a combination of something like dreams + niknaks

rose barn
#

The movement system is performant enough to do player movement only so with a few tweaks you could pull off source accurate surfing

#

Afaik the performannce bottleneck is rendering bsps in forms of meshes without vvis or culling

#

I haven't really touched this since I started a lot of work related projects but niknaks bsp loader could definitely work with it, although if your starting from an empty map its better to do regular collision meshes, infinite map would be more your thing @onyx jacinth

#

iirc that is an .obj loader + random terrain generator that hotloads the map on start

#

Dreams is more for making fake pocket dimensions on any map

onyx jacinth
#

ty

shy ruin
#

How does dreams do player on player collisions? I'm assuming AABB on AABB?

stiff halo
#

I just discovered this entire thing, looks awesome

#

Might use it for some stuff

shy ruin
#

ah I was hoping it had, been trying to create performant AABB intersections for a psuedo NPC Im making

acoustic isle
#

I don’t mean to imply that you would be dumb for not knowing how to do it intuitively, I just want to understand the problem

shy ruin
#

yeah, Im not much of a math guy, its all good

#

Basically recreating entity movement in a shared environment, so I can have entities exist without taking up edict count. I dont want them to walk through eachother so I wrote my own AABB intersection, but when you've got ~40+ grinding on eachother the performance drops

acoustic isle
#

Ah yeah, that sounds like it could be a problem

shy ruin
#

got things subdivided to grids internally to mitigate needless calls but its still pretty heavy

acoustic isle
#

This seems like something that Garry's Mod should have built in

shy ruin
#

it has OBB intersections, but I never bothered to test it, which I probably should

#

only issue is I dont need orientation since its axis aligned so I figured it wouldnt be performant as what I could do

shy ruin
# acoustic isle AABB intersection detection is quite simple, isn’t it?

Thoughts?

    -- selfPos and entPos are the world positions of the intersecting entities
    
    local wMins1 = mins1 + selfPos
    local wMaxs1 = maxs1 + selfPos
    local wMins2 = mins2 + entPos
    local wMaxs2 = maxs2 + entPos
        
    -- Check intersection
    if (wMins1.x <= wMaxs2.x and wMaxs1.x >= wMins2.x) and
    (wMins1.y <= wMaxs2.y and wMaxs1.y >= wMins2.y) and
    (wMins1.z <= wMaxs2.z and wMaxs1.z >= wMins2.z) then
        print("Intersected")
    end
acoustic isle
#

That sure looks like how I would do it

#

I'm not sure exactly where the "borders" are between C++ and Lua, but as far as I know you should be able to get good performance doing that calculation many times as long as you keep everything within Lua and don't have to wait for C++

#

Not sure if ent:GetPos() causes Lua to wait for C++ or what, but that might be something to check on

shy ruin
#

its all in lua excluding traces, been trying to keep functions for my fake ent as similar to actual entities as possible

#

Thanks for taking a look 👍🏻

acoustic isle
#

Okay

#

This thread just showed activity in Discord

#

But there's nothing here as far as I can tell

#

Was there some spam that was removed, or is Discord just reminding me of threads from last year?

onyx jacinth
#

I bumped it cause I was trying to look at the source and it looks like the owner retired from gmod and deleted his gmod related projects

shy ruin
#

That's nice he archived it

onyx jacinth
#

gone but not forgotten 🫡

shy ruin
#

idk why he deleted the addon though

acoustic isle
#

Insane choice

#

Taking your addons when you leave is wild

graceful siren
onyx jacinth
#

https://streamable.com/9l7yt9

I'm making my own version, code isn't ready to be released or shown yet.

edit: https://streamable.com/wd926t

infinite procedurally generated bhop platform, 0 entities... im guessing my fps tanked at the end there due to me being out of bounds and turning around triggered me to render the entire surf_ace map lol

also that demo is entity-less, meaning no custom ShouldCollide is being used, it's 100% custom movement

Watch "2026-05-08 02-09-26" on Streamable.

▶ Play video

Watch "2026-05-08 03-39-01" on Streamable.

▶ Play video
acoustic isle
#

This is effectively a Lua reimplementation of vphysics and the player character right?

onyx jacinth
#

Entities and rag dolls no

#

But can be done, I am just focused on movement rn for surf

onyx jacinth
#

It’s a port of gamemovement.cpp

#

And cmovedata

#

And commandnumber between server and client

#

First videos movement looked bad bc no command number implementation was there

acoustic isle
onyx jacinth
#

Fake world is like 2% of the code

#

The fake game world is something I need, but I’m being very careful to keep it 100% decoupled from the port

#

The port isn’t 100% gmod accurate yet, some oddities happen when I overlay it on normal gmod movement

#

Specifically around spirit and walk spamming and landing on jump, friction seems correct , idk I’ll figure it out I’m sure

acoustic isle
#

It would be very cool to be able to make a custom character using this as a base

onyx jacinth
#

Yeah, I also added a bunch of hooks that allows modification throughout the entire thing

#

Also a way to change the trace system being used with just one line

#

Hopefully someone in the future will do something niknaks with that, since niknaks has its own tracer for its bsps ( and so does my world / collisions system )

#

Or I might lol

shy ruin
#

I was looking into making a lot of fake entities that can move around and ran into issues with traces and OBB collisions between themselves

onyx jacinth
#

possibly, but the version I did was for quick and dirty for testing that demo, I have proper swept AABB collision maths and swept poly collision maths I use for detecting the "subtick" when a player leaves a surf start zone and enters a surf finish within my surf gamemode, once I am done quadruple checking the movement stuff, i'll probably implement something like that, no idea if it'll be faster

graceful siren
#

For static zone detection you can make a brush type scripted entity

onyx jacinth
#

I wanted more accuracy and more control for surf zones