Archive 19/01/2023.

Tech Demo #1: Open World

Don

Hello all,

After about a year of meddling with Urho, @RCKraken and I have some progress to show on our project. We have been testing the capabilities of Urho to provide a high performance multiplayer experience with a large world. Though some modification was necessary, we have found it very well suited to our needs. This is the general overview of what has been changed from stock Urho:

-Terrain shading with normals
-Modified vegetation shader for fitting large models
-Automatic imposters for LOD purposes
-SSR based water shading
-Day/Night cycled skybox based on ProcSky (thanks @jmiller )
-Custom level caching for networking

Thanks to the whole community for answering our dumb questions, and special thanks to those whose code we modified for use in our project. (ProcSky, JTippetts level editor)

We hope to work on features such as chunk based AI, SSAO, high level simulation, and vehicles as we move forward in our project. We’ll keep this topic updated as improvements come forth.

Best,
Don & Orion

slapin

Hi,
Your project looks really cool!
Could you please elaborate on how you implement automatic impostors?
Thanks!

Eugene

Great, I’m happy to see that somebody succeeded with open world demo.
Some dumb questions:

  1. Do you animate LODs swtiching?

  2. Are you going to do smth with these funny artifacts? I am 73% sure there are some fallback algorythms that are less conspicuous…
    image

  3. What about wind animation?

Don

I’ll do my best here.

SSR was a relatively new addition to this project, and it’s not entirely polished off yet. I’m not aware of any method that can be used to patch holes in the reflections, but I will do some research on it if you think it’s doable. A fading effect at the edges of the screen-space is also in the works.

Right now we are just using the default animation on the grass and nothing on the trees. I hope to remedy both of these in the near future. For trees, I was thinking something along the lines of Crytech vertex painting , but with reduced complexity and features.

The system we use right now is an extension of the BillboardSet class. Imposter billboards are first created wherever the objects are in the scene manually. On scene load, the component automatically renders images of the object from a multitude of directions with both diffuse only and normal only shaders.

E4C0DC1C_albedo
E4C0DC1C_normal

These textures are then used by the imposter shaders to render a passable copy by blending the textures based on direction and running the standard lighting calculation.

The only real animation is between the real model and the imposter. This is done by having a fade shader on both objects, but in reversed directions. The fade effect just layers a perlin noise threshold image over the object, and fades over the course of several meters based on it. Here’s an older picture that sort of shows the process.

You can see that the tree is partially transparent, and so is the billboard.

-Don

franck22000

@Don very interested by the billboard technique. I have sent you a PM.

Enhex

Do you deal with input lag and/or prediction with your networking?

Don

Nay; we haven’t really noticed an issue with it as of yet. Do you have any recommendations regarding that?

Enhex

if you’re using kinematic controller I have an old repo for client side prediction (it doesn’t work with physical bodies since that requires re-stepping the whole physics world because Bullet doesn’t allow adding time on individual bodies). This implementation is quite old and only tested with a simple demo.

Other than that I’m experimenting with new approach for CSP which involves full prediction of the game state (not only player’s character movement), and it will be implemented on top of Urho’s scene replication (so it benefits from its optimizations). This approach is more work intensive since it requires running several frames when predicting, and it will be very high quality.
By high quality I mean that games that don’t do full prediction still suffer from latency for other things.
For example waiting for the server when opening a door.

if you want to keep it simple, client authority (client telling the server the player’s poisition) is the way to go.
for simulating network conditions I recommend Clumsy:
https://jagt.github.io/clumsy/

Eugene

FYI, I’ve “ported” Unity wind system for Urho.
Both global and local wind zones are supported, instancing-friendly.
It works for generated trees with additional metadata, could be ported for classic models…

Details

Shader:
https://github.com/eugeneko/Urho3D-Sandbox-Dirty/blob/master/Asset/Architect/Shaders/HLSL/StandardCommon.hlsl
https://github.com/eugeneko/Urho3D-Sandbox-Dirty/blob/master/Asset/Architect/Shaders/HLSL/StandardShader.hlsl

Wind system code:
https://github.com/eugeneko/Urho3D-Sandbox-Dirty/blob/master/Source/FlexEngine/Graphics/Wind.cpp

Tweaked static model:
https://github.com/eugeneko/Urho3D-Sandbox-Dirty/blob/master/Source/FlexEngine/Graphics/StaticModelEx.cpp

https://youtu.be/WuDGsA88eWI?list=PL2nDMBpXYaqHfWRmWS_rRTo9UIKcbO29Q

slapin

Do you procedurally generate foilage? Could you explain how you do it?

Don

Thanks, that’s a huge help for wind. I’ll take a look at that repo as soon as I have the time. Is the performance good for large scenes?

Any idea when this new system will be complete and stable? I’d love to use it.

Sort of. The trees and grass models are all the same as of now, and are pre-made. At server startup, these models are placed randomly throughout the map. There isn’t really an intelligent spawning system in place right now…

dev4fun

I really liked this, congratz :smiley:

@ U have made a modification on ProcSky? I see that have some textures on the sky, looks amazing.

Enhex

I got some tasks related to Hellbreaker before I can get back to work on it.
It should be soon (~less then a month) unless there are any surprises.

Eugene

Meh, I didn’t really tested it. It should be as efficient as possible with current Urho architecture and component design. Unless you want to make 1k of local wind zones.

RCKraken

Yes, I made the ProcSky changes. The night time sky is just a texture, and the day time sky is standard ProcSky with variables that are dependent on time. Both are interpolated based on a function of game time:

(atan(8 * sin(cTimeOfDay)) + 1.5) / 3

This function seemed to work quite well^

Also, I’m looking forward to adding clouds :grinning:

Orion

monkeyface

Is this staying closed source then? It looks like there’s a lot of awesome stuff in there that could be added to the open source engine or shared as extensions…

Don

Thanks for asking. Yes, this project will be closed source since the end goal is a commercial product. With that said, we plan to PR many of the features that people would like in upstream Urho. This will likely include things such as the auto imposters, SSR ocean, and SSAO. It is simply the case right now that these features are not mature and I do not have the time to PR them at the moment. Sorry.

However, I am more than willing to answer any questions about implementations.

-Don