Jump to content
The Dark Mod Forums

[Resolved in TDM 2.06] implementing 3d skyboxes that follow the player


7318

Recommended Posts

hi! i'm from doom3world.org and i've posted there this:

 

http://uploading.com...7/portalsky.7z/

 

it's a change in the skybox code, it lets you create skyboxes that follow the player moves (a la HL2) but without scripting.

 

i've added two new entities:

 

- clasical skybox

the skybox from ROE, doesn't follow the player, this is for compativility with old maps, uses the classic entity.

 

- global skybox

this skybox follows he player since he started the map, if you retrigger it or you come from another skybox

you will get the skybox in it's current position, wich will be always correct since the player started the map

because it continously follows the player

 

- local skybox

this skybox follows the player from the point where the skybox is set in Darkradiant, if you retrigger the skybox

it will start from the same point set in Darkradiant. so it will always go back to that specified point while following

from there the player moves.

 

there is also an option for changeing the amount of scale the player moves are divided by with the keyarg "scale" wich is set to 16 (skybox is 16 times smaller then, but changeing this you could get a different scaling)

 

keep in mind I've done this from the gpl source of doom, you can test in in doom, it's not addpated in darkmod.

i've added all this new skybox source code straight from the gpl, you should just copy and paste it and compile it, there's already the linux binaries in there though, and there is also a testmap.

 

credits:

new skybox code: 7318

old skybox code adpated from ROE: Neurological, Ivan_the_B

 

 

thread in doom3world (although they don't seem to be that interested...)

http://www.doom3worl...hp?f=56&t=25275

 

what do you think? are you interested in this?

  • Like 2

Biel Bestué de Luna - Github

Link to comment
Share on other sites

I've already built a map that had a skybox just like Source, 16th scale and all.

 

The issue i had was the skybox camera bobbed with the player head. I think there is a script on the player for this and it interefered with the camera.

 

I mentioned it and got the response 'it shouldn't do that' or 'it was already fixed' and as far as i know that was that.

 

It would be a great addition to have it all working properly though.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Thanks!

 

I saw this over at Doom3world and was gonna post it but it seemed that you were working on getting multiple "global" skyboxes to work so I thought I should wait for the verdict on that.

 

Now all we need is a better version of pbmax's "Prey style portals" and GoliathVT's day cycle mods.

 

(Or any version as both of those are now MIA... )

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

let me repply here also... thanks guys, this is gpl so you're free to implment this in dark mod, have fun!

 

I've been somewhat disappointed on lukewarm reception in doom3world about this i'm glad of the reception here, i gues this is due it being compiled for Linux. can you guys help me compile it to Windows so i can post the result there and they can see it?

 

let me first go back and implement a new feature, I wanna have it to recognize the "rotation" keyag so the portalSky can have their own rotation set in Darkradiant if any is set.

i would like also to include a code optimitzation so no cycles are wasted when no portalSky is put in the map. I'll get in touch with you when i got it set it up.

 

meanwhile you can try the current code, is fully functional. warning only 1 global portalSky that might be the only bug right now (and i don't know how to solve it)

Biel Bestué de Luna - Github

Link to comment
Share on other sites

Excuse my ignorance, but what exactly is the benefit/usage case of a "skybox that follows the player"?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

hl2 style portalSkies without the need to do it through scripts. put the entity and call it via script or via trigger, then it will do it's work... or what is the same: waste the cycles that you wasted before following the player ( with all sort of restrictions ) with other more important issues.

Edited by 7318

Biel Bestué de Luna - Github

Link to comment
Share on other sites

hl2 style portalSkies without the need to do it through scripts. put the entity and call it via script or via trigger, then it will do it's work... or what is the same: waste the cycles that you wasted before following the player ( with all sort of restrictions ) with other more important issues.

 

Erm, I guess you still haven't answered my question. What is a "hl2 style portalsky"? I never played HL2, so I wouldn't know.

 

Of course a script is slower than native code, but what does it do? How does it work? Is there a video somewhere or a description? Why would I want the sky to "follow the player" (what does this mean, anyway?)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Basically it is just a 16th scale skybox that you hide in a box out in the void. It has a camera in it that matches 0,0,0 in the world. (basicaly what our current custom skybox is.

 

So you can build a full city of minitures that will be rendered behind world terrain at all times.

 

The benefit is that it can be seen from anywhere at any time, and it's sealed off in it's own area so no portal issues trying to build layers and layers of city (especially good from rooftops).

 

In Source it was a major performance benefit because all airspace is split into leafs (like Dromed) and the more leafs (auto visportalling basically) you can see into the worse perfomance is.

 

So having a tiny skybox rendered larger saves the source engine from having a ton of taxing leaf areas . (you can fit the entire skybox into one leaf).

 

For us it's mainly having a small tight easily portalled area but making it look like a huge city.

16th scale really doesn't matter in this engine, the polys rendered will still be the same, there isn't an issue with size. The main benefit is just having a small area in space used instead of surrounding your map terrain.

 

Hammer games (Source) also have a library of skybox resources. Really small crappy textures, tiny models with little detail, etc.. Just helps keep the overhead down for things that aren't seen up close.

We are lacking on 16th scale models, so if you wanted a lampost in an unreachable area we would need to make 16th scale models for that.

------------------

 

As ours is you don't really notice small seperate things or the stars bobbing as you move.

 

In my test map I extended a tower (16th scale in skybox) above a matching base of terrain brushes. In Hammer you can have an enterable world spawn base, then have the tower reach into sky above the map, and done right you can't even tel there is a seam between the world and skybox.

 

My map showed though that the top of the tower bent and swayed above the base terrain, it looked really bad and completely broke the illusion.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Er, I know what a portal sky is - I have used it myself. And I know that is is 1/16 scale.

 

But why should it "follow the player"? How does that work?

 

(I get the feeling I am trying to speak chinese here....)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

but there is also the addition to movement. its not fixed as in ROE but following the movement of the player (divided by the "scale" value) so you have matching presepective every tick without the need of further scripting. if you move left in the map, the portalSky ent moves left/"scale" in the skybox room, as you are seeing from the portalsky pov you see the skybox-scenery matching the scenery on the map, the effect for the player is a much bigger space when it's not. and you don't need to do all this "moving the portalSky ent" with scripting.

 

the scale is improtant because it let's you do huge scenes by changeing that number at Darkradiant to a bigge rnumber. with 32 you have double the space to show.

Edited by 7318

Biel Bestué de Luna - Github

Link to comment
Share on other sites

I think it means that the skybox objects move as the player moves around

 

Look at knightons. It has a skybox. When the player moves around, the objects in the skybox do not get close. They are always at their position. This is immersion breaking. In KM it doesen't matter much since the distant skybox objects are far away. It does not feel terribly wrong that the objects do not get closer as the player moves.

 

I think the guys mean that with this new skybox, the skybox objects would get more near when the player move in the area where the skybox is seen. This means prop buildings of nearby houses can be used in the skybox as they will move realistically as the player moves.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I'd think we'd probably want to stick to one scale. As for the scale model issue. 16th scale could give us a pretty damn huge looking skybox anyway. If someone changed it to 32 then there would need to be additional scale models...

 

And for the most part maps are dark. So it's mostly for silohette, but having some light around the city would be great, and the current solutions either don't allow lights to be seen (using func_statics) or the break when terrain is supposed to match closely.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

@Tels. As I'm reading it, a traditional portal sky is for very distant things like the stars & moon, which of course would have no relative motion as a person moves, but a skybox camera that follows the player (at 1/16 speed I gather?) would be for more nearby objects like surrounding buildings just outside the outer walls of your map built in the skybox, where you can expect relative motion as the player moves and it'd look bad if there weren't. Like BadCog was saying, it's basically not that far from literally building the surrounding buildings out there in your map, except it's just more convinent sometimes to build a minature cityscape of buildings in the skybox and just project it on the skyportal behind your outer walls and have its camera move with the player. (I suppose they have to be distant enough the camera won't run into buildings when "walking" around the skybox), and you can save polys compared to normal geometry e.g., with 1/16 sized objects.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I'm giving functionality, if you don't use it's up to you, why limit the creative process at the soruce code... in your tutorials on skyboxes there is a lot of rotating the sky texture, why not rotate the portalsky entity? that's the reason why want to implment this "rotation" keyarg thing, if you don't want to use it, you won't be penalized in any way.

 

no the object's are not moved, the point of view (pov) gets moved every tick, that is the portalview entity origin (respecting of course the peculiarities of every type of portalSky entity that i've created.)

Edited by 7318

Biel Bestué de Luna - Github

Link to comment
Share on other sites

This is how I translate this:

 

Think of standing at the southern end of Bridgeport. Looking around, the portal sky paints the buildings that are in the southern part of your 1/16th cityscape.

 

Now walk to the northern end of Bridgeport. When you get there and look around, the portal sky paints the buildings that are in the northern part of your 1/16th cityscape.

 

At any point along your walk through Bridgeport, the portal sky changes what it paints to reflect where the 1/16th version of you is in that 1/16th cityscape.

Link to comment
Share on other sites

correct, this is how it works.

 

but the process is not limited to this, it can be used for some very creative effects that are not restricted to fixed scenery or fixed points of view,

 

the sky is the limit.

Edited by 7318

Biel Bestué de Luna - Github

Link to comment
Share on other sites

The Global skybox would always render the entire skybox behind world terrain at all times, just like the stars.

 

I suppose multiple Local skyboxes could be set up to do what you are saying grayman.

 

Really the biggest (best) thing this would bring to TDM is getting around the head bob code that is on the player, keeping it from screwing with the skybox camera also. Nobody wants bobbing buildings. And it keeps the skybox in perspective realative to the player.

 

it really would be the best skybox we could have and while someone else needs to do the work to get it into the code I see no reason why it should be put in there. Having it in by 1.08 would be awesome.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I think your'e wrong, bobing was an arduous process to get into the portalSky. bobing should be in the portalSky as "the portalSky is part of the world" to the player.

if you want skybox without bobing I can modify the code, but you won't like the result for sure... the scenery in the map and the scenery on the skybox wont' match.

if you can play with the submited map (linux only i'm afraid) and you will see every one of the portalSkies realtime.

Biel Bestué de Luna - Github

Link to comment
Share on other sites

You could use fraps to make a short video and upload it to YouTube too.

That would help those of us with Windows here & at D3W to see what's going on.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I think your'e wrong, bobing was an arduous process to get into the portalSky. bobing should be in the portalSky as "the portalSky is part of the world" to the player.

if you want skybox without bobing I can modify the code, but you won't like the result for sure... the scenery in the map and the scenery on the skybox wont' match.

if you can play with the submited map (linux only i'm afraid) and you will see every one of the portalSkies realtime.

 

Well, I tried a test map(3 years ago) and the bobbing made the buildings in the skybox bob. (it should still be on the SVN server as skybox_test.map I believe).

 

We want a skybox that is realative to the player in x,y,z, but it shouldn't tilt with the players head. Does a building tilt when you move your head to the side? No. When your head moves to the side can you look around a building? Yes. If the sky camera moves with the players head movement, leaning to look around a building would make that building move with your head and you couldn't look around it.

 

This is the issue we currently have, as the players head goes up and down (but the surrounding terrain doesn't) the skybox terrain also goes up and down, so it is out of synch with the world terrain. So if your code doesn't fix that we still have that problem, your code might take scripting burden off and improve performance which would still be welcome.

 

But head movement and players relative world movement need to be seperated.

---

 

Like I said in my first post, I brought up this issue with the sky box bobbing 3 years ago and made a test map that's been on the server ever since. And nobody looked at it, they just said the issue should have been fixed.

 

And we still can't use a basic skybox technique.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

OK, it was a long time ago, here's the original post I made, unfortunately it's Member's Only.

 

http://forums.thedarkmod.com/topic/10549-regarding-skyboxes/page__hl__skybox__fromsearch__1

 

-----------

 

It seems as though I had to add a script to my map (that I got from Doom3 World)

test/skybox

 

And it made the info_portalsky entity adjust the skybox properly and far as relative position (though it was a bit high in the z plane and I just had to experiment loweinr gthe skybox until it aligned).

 

But the head bob issue was there.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I can see what 7318 is saying too if there is no skybox bob and the surrounding geometry bobs with the head-camera but the skybox doesn't, then it'd look noticibly out of synch. Was the issue that the skybox bob needs to be scaled to a 1/16 bob?

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...