Jump to content
The Dark Mod Forums

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


7318

Recommended Posts

you do know that the half-life 2 source code is downloadable, all you need is steam, a copy of half-life 2, and you then have access to the sdk in tools, and in the sdk you can create a mod, and then get the option to download the source code to source, then you can look at that to see how there 3d skybox works and how 3d skybox doesn't work as intended in doom 3, then you could write code for how a 3d sky box would work in doom 3, seeing as the source for doom 3 is available. I wouldn't directly copy half-life 2 source code as thats copyright infringement.

 

but according to the code the 3d skybox view is created from the map origin, and then that view is sent to the player, and not like it is in doom 3 where the 3d skybox is created from the player origin.

Link to comment
Share on other sites

  • 4 weeks later...

excuse me, but my skyportal code mimics the skyportal code of half life 2. please don't confuse others on what my code might do, just try it, you'll see that the same thing you pointed in your half life 2 video you posted happens in my testbox, a part of the central column is done with the real dimensions in the map, but the topmost part is done at a 16th of the size in the skyportal part of the area and they match all the movement correctly (movement of the player and bob movement of the player)

 

with my implementation you have 3 portal skies system, a general system, a local system and the old ROE implementation (which is still the default ) so my code will never break any pre-existing maps that use the old system!

 

why do you refuse to test it out and see it with your own eyes!? is just a simple mod that you can test in doom3! no need to install anything special

 

download it here: https://github.com/BielBdeLuna/portalSky/blob/master/portalSky.v1.2.7z?raw=true (save the file in link instead of entering it)

  • Like 1

Biel Bestué de Luna - Github

Link to comment
Share on other sites

  • 3 weeks later...

I brought 7318's code changes into TDM and they work very nicely.

 

I tested with Sotha's and Baddcog's maps. Baddcogg's has two towers whose lower parts sit in the map and whose upper parts are in the skybox. With the changes, the tower parts stay together as the player moves around. Seamless. In Sotha's, distant buildings in the skybox rotate correctly as I move around the map, providing a changing view.

 

I've pinged 7318 with a couple questions, but I don't see any reason why we couldn't begin bringing more realistic skyboxes into TDM missions.

 

I saw two problems: Of the three types of skies that can be painted, one of them painted everything in the skybox black. That will need to get fixed. Also, Sotha's test map allows the player to walk right up to the edge of the map, and depending on which direction you walk in, you get the impression that you're on a boat that's sliding around on the sea. For objects in the distance, this isn't a problem. But it is for objects you can get close to. I don't know if this means the map has to be designed differently, or if there's a code bug, or if the scaling is an issue.

 

Existing missions should continue to work as they do today, since invoking the "follow the player" behavior is done by adding a spawnarg to the info_portalsky, and that spawnarg won't be there in existing missions, defaulting them to the "classic" behavior.

  • Like 3
Link to comment
Share on other sites

Very cool! Thanks!

My testmap can certainly have a scaling issue: I have never created a truly working 3d skybox. This one was built blindly without knowing what really works and what doesn't.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The issues I noted above with Sotha's test map are due to positioning of the player relative to the camera at map start.

 

Once I figured that out and corrected the player's position and the camera position, the "on a boat" effect went away.

 

Scaling was fine.

 

I'm adding to the map now, and continuing to test. I'm "pushing" the map out into the skybox with miniatures, and making sure the transitions are seamless.

 

I haven't started to debug why I'm getting a black screen for the "global" option. Need to solve that before we can use this. The "default" option works fine; I tested it with a couple existing maps (including Knighton), and didn't see any problems. For my testing, I'm using the "local" option, which works fine, and can substitute for the "global" option as long as you don't want to switch skyboxes.

 

Mantling and crouching work as expected: the seams stay hidden.

Link to comment
Share on other sites

I fixed the problem of the black sky. It was tickled by the "Hit Attack button to start game" GUI at mission start, and was caused by some data the feature needed that wasn't read until after the Attack button was hit and the game clock started ticking.

 

I'm going to test a few more existing maps, then check this stuff in. I'll also check in Sotha's test map, which I've added to.

  • Like 2
Link to comment
Share on other sites

7318's skybox contribution is now in SVN rev 13482. Windows DLL included.

 

I'll write a wiki on how to use the different skyportal types.

 

I checked in maps/test/skiestdm.map so if you're using SVN, you can see what the different types give you. This map was created by Sotha, and I extended it to show the differences in the skyportal options.

 

When you start the map, the sky is the default STANDARD type. Everything is painted relative to where you started, and it stays that way. This is what all published missions will use, since it's the default.

 

On your right, there are three buttons against the wall.

 

The left button activates the STANDARD skyportal.

 

The middle button activates the GLOBAL skyportal. This option paints the sky each frame from the perspective of the 1/16th you over in the skybox. That little you moves around in sync with the big you in the map, so the view changes. If you go to the north and south of the street, you get to where you can't progress any farther. The roadways beyond you at each point are in the skybox, not in the map. The tall building in the middle of the street has an iron ledge halfway up. The part below the ledge is in the map. The part above the ledge is in the skybox, including the miniature light at the top.

 

The right button activates the LOCAL skyportal. This causes the skyportal in the skybox to start painting the world relative to where you are when you activate it. So everything in the sky looks shifted when you press this. Over on the tall brick building, there's another LOCAL button. Note how the sky repositions itself when you press that button. LOCAL skyportals are useful if you're changing skies, similar to what I did in In the North, where the main sky was clear and the ending cutscene was stormy with snow. If you're planning different skies, and you want each to change what it paints relative to where you are in that part of the map, you'll want to use LOCAL.

 

There are two moons in the sky. Sotha pointed this out in his description of this map. When in STANDARD, both moons are stationary. In LOCAL or GLOBAL, the moon that's painted into the skybox (stars, clouds) is stationary, but the tiny moon that's an object in the skybox moves around as the player moves. Take this into consideration when designing moons for such skies.

 

That's all I can think of for now.

 

A big thank you to 7318 for contributing these changes!!!

  • Like 1
Link to comment
Share on other sites

I'm sorry but unless you've changed it, I think you were wrong in your description:

 

Local portal sky when triggered always starts in the place you set the entity, it still follows you like any other portal sky but the point of start that is taken as a reference when triggered is that of the local_portalSky entity that you set in the level editor. so you essentially control where does the local portal sky starts.

 

This is not the case with the Global portal sky entity: the point of start of that kind of portal sky is taken once in the beginning of the map, it keeps following the player, even when you have another kind of portal sky active, so you can always return to it and it will always maintain the parallax correctly since the beginning of the map.

Biel Bestué de Luna - Github

Link to comment
Share on other sites

If I activate the LOCAL portalsky when I'm in the southern part of a map, I get one version of the skybox.

 

If I activate the same LOCAL portalsky when I'm in the northern part of a map, I get a second version of the skybox.

 

Are you saying i should be getting the same version, regardless of where I am in the map when I activate it? That if I activate it in the north, then run to the south, I'll see the same sky when I get there that I'd see if I activated it when in the south?

 

I don't think that's what I'm getting. I think I get two different versions of the skybox. The camera syncs itself to wherever I am at the point the activation occurs, which means I'm going to get two different skies from two different activation points.

 

And--no--I didn't change anything other than what we discussed in the PM.

Link to comment
Share on other sites

first I got to say that I don't know the map you're referring to, I don't know how is done in this map but...

 

if you trigger THE SAME local portal sky you should always get the same local portal sky starting point (in fact this is the point of the local portal sky)

 

obviously, if you trigger ANOTHER local portal sky you'll get a different starting point (that is a different starting point for every local portal sky entity)

 

let me add that you're not limited to one local portal sky per map unlike global portal sky where you are.

 

 

also, I've tested the changes that we discussed in the PM, I've tried them in Doom3 and they work ok, my testmap runs ok. and works correctly.

Biel Bestué de Luna - Github

Link to comment
Share on other sites

  • 3 months later...

Yes. I asked the same thing in the "testing 2.0" thread. grayman gave a testmap and said,

 

 

It has 3 info_portalsky entities in the same spot.

 

type 0 - the default, standard sky we're used to

 

type 1 - the GLOBAL setting - the sky follows you wherever you go

 

type 2 - the LOCAL setting - the sky follows you until you retrigger the info_portalsky, at which point the sky resyncs with your eye position and follows you from there

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

If the comments in Tracker 3108 are still correct, there should be 3 example maps on SVN located

 

 

maps/test

 

named: skybox, skies, and skiestdm

Edited by nbohr1more

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

skiestdm is the one I was working with.

 

I'll write a wiki on this after 2.00 is released. I'm going to be implementing this in my WIP, and wanted to get some way into that before wikifying, so that I was presenting the most accurate picture of how to do this.

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...
  • nbohr1more changed the title to [Resolved in TDM 2.06] implementing 3d skyboxes that follow the player

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

    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
    • The Black Arrow

      Hope everyone has the blessing of undying motivation for "The Dark Mod 15th Anniversary Contest". Can't wait to see the many magnificent missions you all may have planned. Good luck, with an Ace!
      · 0 replies
×
×
  • Create New...