Let's Make A New Demo!

Discuss Daggerfall Unity and Daggerfall Tools for Unity.
User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Let's Make A New Demo!

Post by Nystul »

version 1.3 is ready, get it here:
http://s000.tinyupload.com/?file_id=009 ... 4480183012

currently it still lacks floating origin support - maybe you have already solved this issue (or Lypyl) ;)

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Let's Make A New Demo!

Post by LypyL »

Here's my update if you want to test it out yourself

This is actually slightly different than the one I sent to InterKarma, in that it offsets on the Y axis as well (I changed it w/ your 23k high mountains in mind lol). However, it makes your improved terrain go a little wacky - everything starts turning to ocean as you move higher - it's actually pretty cool looking :D . I don't know enough about your script to say for sure what's happening, but I'm guessing you use the height above "sea level" in determining the terrain? If so, it might be fixed by simply keeping track of the offsets. If not, I have no clue :lol:

edit: This was v. 1.2 I tested w/ this morning, I haven't tried 1.3 yet.

Anyways, in addition to offsetting on the Y, there is also an event in floating origin for position updates.

To subscribe,

FloatingOrigin.OffsetPositionEvent += LocalEventHandler;

Where LocalEventHandler is a function that should take Vector3 as parameter.

Every game object that subscribes should unsubscribe in OnDisable:

FloatingOrigin.OffsetPositionEvent -= LocalEventHandler;

If they don't, there is a good chance they won't be garbage collected.

Note that the StreamingWorld child objects are still being shifted just like before.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Let's Make A New Demo!

Post by Interkarma »

This is great work from everyone. I can't express enough just how amazing you all are.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Let's Make A New Demo!

Post by Nystul »

LypyL wrote:Here's my update if you want to test it out yourself

This is actually slightly different than the one I sent to InterKarma, in that it offsets on the Y axis as well (I changed it w/ your 23k high mountains in mind lol). However, it makes your improved terrain go a little wacky - everything starts turning to ocean as you move higher - it's actually pretty cool looking :D . I don't know enough about your script to say for sure what's happening, but I'm guessing you use the height above "sea level" in determining the terrain? If so, it might be fixed by simply keeping track of the offsets. If not, I have no clue :lol:

edit: This was v. 1.2 I tested w/ this morning, I haven't tried 1.3 yet.

Anyways, in addition to offsetting on the Y, there is also an event in floating origin for position updates.

To subscribe,

FloatingOrigin.OffsetPositionEvent += LocalEventHandler;

Where LocalEventHandler is a function that should take Vector3 as parameter.

Every game object that subscribes should unsubscribe in OnDisable:

FloatingOrigin.OffsetPositionEvent -= LocalEventHandler;

If they don't, there is a good chance they won't be garbage collected.

Note that the StreamingWorld child objects are still being shifted just like before.
I have to try to subscribe it, but I am still in the process of understanding what it does (I am watching the unity videos on delegates and events right now, update: i have subscribed the event, now I need to shift the far terrain correctly... tricky thing).

regarding my script: what is basically needed is that the farterrain (which is a unity terrain heightmap) needs to be shifted so that it fits the nearterrain. Without floatingorigin this is working as expected. The repositioning is done in function updatePositionWorldTerrain():

Code: Select all

            // world map level transform (for whole world map pixels)
            Vector3 worldMapLevelTransform;
            worldMapLevelTransform.x = xdif * scale;
            worldMapLevelTransform.y = extraTranslationY;
            worldMapLevelTransform.z = -ydif * scale;

            // get camera position of camera tagged as MainCamera, this camera position is used for the correct computation (local) translation inside world map pixel of the world map terrain 
            GameObject mainCamera;
            mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
            Vector3 cameraPos = mainCamera.transform.position;
            // local world level transform (for inter- world map pixels)
            float localTransformX = (float)Math.Floor(cameraPos.x / scale) * scale;
            float localTransformZ = (float)Math.Floor(cameraPos.z / scale) * scale;
worldLevelTransform is the amount coming from whole map pixels (extraTranslationY can be considered zero here), localTransform is the amount inside the mapPixel - depending from which side you enter the map pixel, you are at a different "inside fraction position" inside the mapPixel - therefor I used the cameraPos to evaluate this. You can verify the correctness by switching to scene view, switch to shaded wireframe mode and look from top at the scene so that you see both the near terrain as well as the far terrain. The high-detail terrain mesh of the near terrain should perfectly match the coarse resolution far terrain grid. This perfect-allignment must remain perfect even if you travel for long distances - that's why i test with superspeed mode and i run for a while then... my test run is (also well-suited to test if far-terrain "jumps" (used TerrainDistance is 3)): I start at position 573/27 and head to straight east, I switch to super-speed mode with key 'H' and run straight forward

the height map itself is in the same coordinate system/scale system as the near terrain. the improved terrain just modifies the heights as a "preprocess"-step but only once at startup - it does not change the scale itself, it only introduces a "multiplier-map" for every map pixel (to be exact for the heights of every map pixel). after initial startup water-level is only important for correct texturing (I use the water-level y-coordinate to texture tile fragments below with the water texture)

Unforunately it really needed the camera position to evaluate the correct shift amount - I would have loved to use the function StreamingWorld::PlayerTerrainTransform(), but I did not manage to solve it with this alone ;)

Where I would like to get with your and interkarma's help: I would like to make the far terrain perfectly match the near terrain again together with the floating origin position updates again.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Let's Make A New Demo!

Post by Nystul »

sry for double-post, but since it is important for the demo, i post the link here as well (for more details refer to the increased terrain distance thread):

version 1.4 with floating-origin support:
http://s000.tinyupload.com/?file_id=595 ... 2764678951

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Let's Make A New Demo!

Post by Interkarma »

Almost done. Everything pretty much just worked perfectly out of the box. Thanks again everyone for your hard work!

There are just a few issues I still need to resolve. For some reason the jet laser beam and targeting don't seem to function in a standalone build (works perfectly in editor). Probably just some quirk of how Unity is handling loading resources at runtime. I doubt its anything too serious, I'm just out of time for the weekend. :)

Please test and let me know how you go. All comments are welcome! Once we're all happy, I'll re-package with any changes and publish to the Workshop.

Edit: RC1 has been removed.

User avatar
Lord Berandas
Posts: 7
Joined: Sun Mar 22, 2015 7:19 pm
Location: Prague, Czech Republic
Contact:

Re: Let's Make A New Demo!

Post by Lord Berandas »

Hey guys! You're doing really awesome job! I just tried the new demo and it's completely perfect, all the fine details like grass or birds...just awesome!
But the messed up music bug is still present, don't know what's the reason for that, but my music plays very choppy or slow and this is happening since the very first demo you published.
Keep up the good work! ;)

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Let's Make A New Demo!

Post by Interkarma »

Thanks for the feedback. :)

I've been able to reproduce the choppy music through my 7.1 headphones. Not sure of cause yet, but at least I can repro on demand - that's always half the battle. I'll stick this in my bug list to track down at some point.

User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Re: Let's Make A New Demo!

Post by Uncanny_Valley »

Just tried the demo and it's really awesome seeing everything put together! The inclusion of my bird mod surprised me a little, but I approve. :D

Comments:

I think the demo needs a loading screen in the beginning, not only does it take a few seconds for the game to start but you also get a freeze frame in the game before everything loads. This might make some people believe that the game has crashed and they might try to shut it down before it really starts.
Your left weapon is rendered above the loading screen.
You can't use your weapons when inside a structure. I'm not sure if this is a feature when inside homes, but I would like to swing my weapon in dungeons please. :)
You can draw your weapon when flying the jet, it does disappear almost instantly but you can still hear the sound effect and sometimes see your weapon on the screen for a frame or two.

I think performance could be better, it's not too bad for this release but I think it needs to be a goal or priority if/when a new demo is made in the future . I will of course look at my own mods and see what I can do.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Let's Make A New Demo!

Post by Interkarma »

Uncanny_Valley wrote:Just tried the demo and it's really awesome seeing everything put together! The inclusion of my bird mod surprised me a little, but I approve. :D
It was too awesome, it had to be there. And thanks for all your feedback! :)
Uncanny_Valley wrote:I think the demo needs a loading screen in the beginning, not only does it take a few seconds for the game to start but you also get a freeze frame in the game before everything loads. This might make some people believe that the game has crashed and they might try to shut it down before it really starts.
No probs, will put this into demo.
Uncanny_Valley wrote:Your left weapon is rendered above the loading screen.
I've noticed this one as well. Will put in a quick fix to demo.
Uncanny_Valley wrote:You can't use your weapons when inside a structure. I'm not sure if this is a feature when inside homes, but I would like to swing my weapon in dungeons please. :)
No idea on this one, I'm not able to reproduce anywhere after quite a bit of testing. The weapons aren't aware of the player location at all, so it shouldn't matter where you are. Hmm, maybe there was an input glitch, considering jet and weapons both use Mouse1 for input. Can you try a freshly loaded demo and see if you can reproduce from the start?
Uncanny_Valley wrote:You can draw your weapon when flying the jet, it does disappear almost instantly but you can still hear the sound effect and sometimes see your weapon on the screen for a frame or two.
I'll see if I can iron this out, if LypyL doesn't get there first. Alternatively, implement a jet-based version of Joust. :D
Uncanny_Valley wrote:I think performance could be better, it's not too bad for this release but I think it needs to be a goal or priority if/when a new demo is made in the future . I will of course look at my own mods and see what I can do.
I agree completely. A big part of this is how Daggerfall's content is constructed, all those hundreds of tiny tiling textures. I already do a lot to atlas textures and combine meshes to help things get batched together. Fortunately there are still a few more tricks I can use before we start edging into "prebake" territory, which isn't somewhere I want to go.

Post Reply