#Dreams
1 messages · Page 1 of 1 (latest)
very interesting, im confused how you're moving while out of bounds of the map O_O
Ray-plane intersection & inside out test on face solids in player move hook
What makes that necessary as compared to creating a collision mesh for it and using the built-in collisions?
Built in collisions dont work outside map bounds
impressive
This is is cool, could also probably be adapted to so many other scp's
was already gonna do scp-1499, if you have any ideas im all ears
You should be aware, if you aren't already, that this project has larger potential than "just" SCP-related recreations
@sonic moon This seems relevant to your interests
this actually started out as a recreation of LSD Dream Simulator
someone literally just made beds too so thats going to be one of the next projects
https://steamcommunity.com/sharedfiles/filedetails/?id=3418671232&searchtext=
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
oh yeah this could be revolutionary
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
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
glorious and spaghettified shitcode here https://github.com/alexswad/gm-scp106-pd
That link 404s. Is the repo public?
oops sorry still waking up
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
that would be possibly the biggest improvement in that addon's 10+ year history
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
I'm sure prop interactions wouldn't work though? At least not like normal physics
:x
This looks insane btw and id kill to see 1499 but actually good
860 as well
do I have news for you
I made an addon using the doors library so unfornautely I've read its code more times than I'd like to admit trying to get it to work
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
I wonder if I could like modify infmap or something, it uses meshes and deters a bunch of things already
@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
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

What is your metric for whether or not you can add a bot successfully?
Is the whole thing one model with one UV???
if adding it isn't going to bring my pc under 30 frames and the game is still comfortably playable
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
Each room is a seperate model with its own single UV, I used hammer++ propper tool, which has a lightmap atlas option
You could do this without doing that but I don't know blender well and baking one material is already hell
im slightly sad to see you used gm_site19 :C
?
in rp_scp_site19 the whole thing is accurate
and has some animation in the corridor section
oh I didnt know there was a better map, that changes some things
i can throw together whole models if you decide to go for that
does it have to be one UV?
or baked i mean
For the lighting yeah
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
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
split up as in each area, right?
yeah
The models physics mesh isn't used, would be too expensive, so yes pls vmfs lol
oh wait i see now
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 hows it going with the rooms
been busy but i do have the vmfs set up
and wondered if lighting even needs to be baked
could dynamic lights not be used?
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
worth testing because they have settings to look less bad and i dont think the limit is 8
but ill still bake anyways
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
oh maybe the void
either that or the radius values are messed up idk
i know they can be a pain
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
ayo i could use this for my schizo addon
please do it so I dont have to 😂
Typical 40℃ dream
is this all clientside?
movement is shared, rendering is clientside models and other magic
progress
z fighting i think is just in hlmv and would look fine in game
looks absolutely beautiful just from that screenshot
@grave tinsel Dreams has a lights to .usd converter now
https://github.com/alexswad/dreams/wiki/Creating-a-Dreams-Model-from-VMF#converting-to-phy-and-usd
Might help you make blender lights faster, can be directly imported under .usd option
maze generation with phys, been working a lot so progress has been really slow
did this by mistake but thought it was pretty
@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
The same thing but it's just carameldansen inside the gas mask
Yeah ill send you the models if you need em
A vmf if possible
If you send the vmf I can make the model, no lights needed since its ambient lit
I have to get the mod out before april 1st so this can be a reality
Allowing for props to automatically loaded from the VMF and baked into the physics data
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
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
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
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
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
👀
obb from vmf done, pain in the ass
Very nice
I have no idea what I’m looking at
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
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
Initializes the physics mesh of the entity from a triangle soup defined by a table of vertices. The resulting mesh is hollow, may contain holes, and always has a volume of 0.
While this is very useful for static geometry such as terrain displacements, it is advised to use Entity:PhysicsInitConvex or Entity:PhysicsInitMultiConvex for moving solid...
move the player as set/clear their velocity, also if you read the thread you'd know the entire point of this project is to not use the default collision system within world bounds, https://cdn.discordapp.com/attachments/1334930802579869696/1334930804866023434/2025-01-31_11-51-05.mp4?ex=6801dbf1&is=68008a71&hm=4fa0ae288e21c710c9d3d65261f5241b81872b2b3b749132581c35058ed7a8a0&
If you know how to hack VPhysics and make it work I would love you forever but afaik this is the only way
it isn't vphysics that controls collisions with brush/world for players/npcs, it's qphysics/gamemovement (hull/obb)
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
i'm not sure how the gravity hull designator did it, that was out of bounds too
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
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
wouldnt it be checking for CONTENTS_SOLID
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```
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
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
Pretty close actually, walking into the face of walls that are acute to the player is the only problem area
performance is pretty good too, 128 players in dreams and not lagging to death at all
fps being low is caused by the 128 bots more than anything else
easy patch fixed that
Interpenetrating can cause a fair amount loss too, if you decide to* use ShouldCollide for no collision between the players
i thought it worked like doors/tardis where it finds a random space as high up as it can but still within map bounds
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
mfw a PhysCollide class exists but was never expanded on 😭
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
wouldnt there already be an interface in vphysics? you'd just have to isolate it for that object, I'd imagine thats what IntersectOBB is doing
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
walking around displacements
cursed images
Have you got the logic for “slope too steep, slide down” ?
yeah, might look a little weird going down slopes though as you can go faster forward then you fall, making you bounce down it
I dont think its that bad though, and this only happens on planes specifically, OBB ramps should be fine
Ohh this is a known thing
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"
I think I fixed it as best I can
It looks pretty good
scp1499 by Waffles test
...can it do surf?
was wondering the same thing, sadly not rn because of the automatic air resistance
however decompiling entire maps and just throwing it in there works pretty damn well
hot reloading maps O_o?
one day possibly, many little steps to take before it's doable
you are literally making a game inside of a game rn
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
at some point Im going to have to port all the func_*, logic_*, and triggers_*, it will literally be the source engine in the source engine
and then made dreams 2 inside dreams
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
oh a box? with a dimension in it? its kinda like uh, bigger on the inside then?
im so making a bunch of stupid shit with this when I can
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
yeah this is a problem currently, im patiently waiting for rubat to implement a soundscape API lol
Make sure he knows that
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
whats the max size a dreams map can be?
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
Does dreams have prop collisions?
not like the way your thinking
@rose barn what is preventing hotloading maps?
What, like using Nak's BSP loader?
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
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
yeah I think it'd need to be redone and try to replicate the source engine 1:1 for surfing though
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
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
Depends on what you mean by "possible"
I saw some swep that did it, they just didn't have the CMove data, but replicated a lot of uhh of the core, ill try to find it
The world/map is made out of a fundamentally different type of "thing" than Entities are
The world cannot be modified through Lua
Your only option is to create the world from scratch out of Entities and IMeshes
does the world have like different interactions you're saying?
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
right right
ahh and you're saying that's not performant really
yeah :|, maybe hot reloadig is a practical nightmare
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
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
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
hmm, well shit, we will see, i would love to be able to do it
probably requires a combination of something like dreams + niknaks
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
ty
How does dreams do player on player collisions? I'm assuming AABB on AABB?
Yes
It doesnt
ah I was hoping it had, been trying to create performant AABB intersections for a psuedo NPC Im making
AABB intersection detection is quite simple, isn’t it?
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
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
Ah yeah, that sounds like it could be a problem
got things subdivided to grids internally to mitigate needless calls but its still pretty heavy
This seems like something that Garry's Mod should have built in
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
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
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
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 👍🏻
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?
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
but he moved them to https://github.com/noskill-archive/dreams and then i deleted my comment, didn't know it bumped the thread 😅
That's nice he archived it
gone but not forgotten 🫡
idk why he deleted the addon though
truly, like I'd just mark them as unsupported but leave them for archival reasons
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
How closely does this mimic source movement?
This is effectively a Lua reimplementation of vphysics and the player character right?
Player movement and collision yes
Entities and rag dolls no
But can be done, I am just focused on movement rn for surf
Mimics source movement effectively 1:1
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
That on its own might be valuable separately from the "fake" game world
Yeah, it is
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
It would be very cool to be able to make a custom character using this as a base
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
is it more performant than the usual trace?
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
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
For static zone detection you can make a brush type scripted entity
I wanted more accuracy and more control for surf zones