[WIP] Skybox Solution
Posted: Sun Dec 23, 2012 4:09 am
I thought I would share a video of a skybox solution I came up with. It's not perfect, and there are a few bugs that I will need to look at, but preliminary tests show promise.
So basically, this is handled by creating two skybox assets. One skybox will be a decoration, and the other a projectile. They may or may not share the same model, but its easier if you use two, because the projectile skybox will have to ride above the ground slightly during player movement.
So the idea is that you spawn the skybox decoration right on the party. The skybox model itself is a huge piece that spans across several squares. When the party moves, you kill that skybox, and launch a skybox projectile starting on the tile the party is on, and have it travel in the direction that the party moves. After the time it takes the party to move to the next square, you kill the projectile and spawn the decoration where the party is standing again.
There are several problems I am currently facing here. One is that the projectile has to travel at the exact same speed as the party, and sometimes the party members are encumbered, making them travel slower. So logic must be put in place to compensate for that.
Another issue is that there is a maximum view distance, and then the skybox will get clipped by the renderer. So you must limit your skybox size to go like 10 squares or so at maximum.
Lastly, there must be some logic that prevents the projectile skybox from launching if the player hits a wall, blockage, altar, or monster. I currently have it only checking for walls.
Anyhow, I hope this gets some other people thinking about improving this implementation.
if I could appeal to Petri's good graces, what would be useful is some sort of event I can get when the player arrives on the tile he is moving to. (where he actually comes to a stop) because working with timers is an imperfect solution, and depending on what is going on in the game, you could get mixed results. Actually what would be even better is a way to retrieve the party's tile offset, and a way to change a decoration's tile offset. Then I could make the decoration match the party's exact position at all times, and not have to use projectiles.
Screenshot 1:
http://cloud-2.steampowered.com/ugc/596 ... 21F908729/
Video:
http://youtu.be/518q4QTzRUE
So basically, this is handled by creating two skybox assets. One skybox will be a decoration, and the other a projectile. They may or may not share the same model, but its easier if you use two, because the projectile skybox will have to ride above the ground slightly during player movement.
So the idea is that you spawn the skybox decoration right on the party. The skybox model itself is a huge piece that spans across several squares. When the party moves, you kill that skybox, and launch a skybox projectile starting on the tile the party is on, and have it travel in the direction that the party moves. After the time it takes the party to move to the next square, you kill the projectile and spawn the decoration where the party is standing again.
There are several problems I am currently facing here. One is that the projectile has to travel at the exact same speed as the party, and sometimes the party members are encumbered, making them travel slower. So logic must be put in place to compensate for that.
Another issue is that there is a maximum view distance, and then the skybox will get clipped by the renderer. So you must limit your skybox size to go like 10 squares or so at maximum.
Lastly, there must be some logic that prevents the projectile skybox from launching if the player hits a wall, blockage, altar, or monster. I currently have it only checking for walls.
Anyhow, I hope this gets some other people thinking about improving this implementation.
if I could appeal to Petri's good graces, what would be useful is some sort of event I can get when the player arrives on the tile he is moving to. (where he actually comes to a stop) because working with timers is an imperfect solution, and depending on what is going on in the game, you could get mixed results. Actually what would be even better is a way to retrieve the party's tile offset, and a way to change a decoration's tile offset. Then I could make the decoration match the party's exact position at all times, and not have to use projectiles.
Screenshot 1:
http://cloud-2.steampowered.com/ugc/596 ... 21F908729/
Video:
http://youtu.be/518q4QTzRUE