Project Ice Weasel

Announcements and news updates to your projects using Urho3D.
Forum rules
If you have images or videos, you can attach them in the showcase post. Please use small thumbnail as link to original media resources.
When you post in this forum, you have to agree that Urho3D main website as well as the Facebook page have the permission to republish your post with all the related images or videos. The original images must have width larger than 890px for best viewing result in all the supported viewports by main website.

Project Ice Weasel

PostPosted by TheComet » 04 Jul 2016, 23:12

I finally feel comfortable enough using Urho3D to begin working on a game with a team. We've envisioned a multiplayer first person shooter with a kind of cyber-punk, perhaps "surreal" atmosphere at times.

One unique feature of this game will be "localized gravity". I've modded the editor to allow placement of "gravity probes", which can be seen in the following screen shot as blue arrows:

Image

Each probe defines a directional vector and a multiplier. The scene can be queried for gravitational forces at any location in 3D space. The system is very rough right now (I search for the closest probe and just directly use its direction and force, so transitions are very jagged), but I was thinking about building a tetrahedral mesh out of the probes and use some form of spacial partitioning to decrease lookup time. That way you can query in which tetrahedron you're in and interpolate the gravity parameters between its 4 vertices, and transitioning between probes would be smooth and unnoticeable.

With this system it will be possible to create things a là M.C. Escher, but most likely we'll be going for something less drastic and less confusing. Having half of the map at a 90° angle could open some interesting tactics for snipers, as they'd be able to shoot across half of the map.

Here is a video:

I'm a non-binary non-cis sexually fluid cephalopod identifying genderqueer mocha frappé latte
User avatar
TheComet
Active user
Active user
 
Posts: 122
Joined: 29 Jan 2014, 14:07
Location: Germany

Re: Project Ice Weasel

PostPosted by hd_ » 04 Jul 2016, 23:48

Wow that's a really cool concept ! The projectiles will follow localized gravity too?
User avatar
hd_
Contributor
Contributor
 
Posts: 220
Joined: 21 Jul 2014, 08:55
Location: Australia

Re: Project Ice Weasel

PostPosted by TheComet » 05 Jul 2016, 00:25

hd_ wrote:Wow that's a really cool concept ! The projectiles will follow localized gravity too?


If I choose to simulate projectiles with bullet, then yes! The physics engine will also use localized gravity instead of the PhysicsWorld gravity. Things like actual bullets might be too fast to be noticeably affected, but I can imagine throwing grenades could be interesting!
I'm a non-binary non-cis sexually fluid cephalopod identifying genderqueer mocha frappé latte
User avatar
TheComet
Active user
Active user
 
Posts: 122
Joined: 29 Jan 2014, 14:07
Location: Germany

Re: Project Ice Weasel

PostPosted by Enhex » 06 Jul 2016, 09:35

Have you thought about a system that will automatically handle gravity direction instead of gravity probes?
Probes add a lot of work to the level designer and human error is possible.
User avatar
Enhex
Most active user
Most active user
 
Posts: 325
Joined: 31 Dec 2014, 12:23

Re: Project Ice Weasel

PostPosted by gawag » 09 Jul 2016, 16:58

Cool.
Reminds me of the gravity generators in SpaceEngineers: https://youtu.be/x2aI_yQc6do?t=2m13s
They have two types of generators by now. One has a box shaped field (with independebly adjustable height, width and depth as shown in the video) and pulls everything in this box with a specific force (adjustable between -10G and 10G or something).
The other is sphere shaped with a custom radius.
Both have a gravity which is range independent (the gravity has the same strength everywhere in the field) and the radius has a maximum of 50 meters or something like that.
If an object is inside multiple fields the vectors simply get added. If a player is in multiple fields he will be rotated towards the resulting direction vector (so if two fields are 90° to each other the player would be 45° between).

By now SpaceEngineers does also have planets with gravity and there the sphere shaped gravity "field" actually gets weaker depending on the distance until a certain distance with 0G is reached (in reality an objects gravity does stretch infinitely but can usually be neglected at some distance).

For performance reasons you could divide your world into big 3D chunks that are bigger as the maximum size for a gravity field (for example 100x100x100 meters). Then you query all fields in the current chunk and the directly adjacent chunks, that should be all fields that could influence that object. Then you could also summarize all gravity strengths.
Your idea with the tetrahedral "mesh" with interpolation would have weird properties as only the four closest "fields" would somehow influence the object though a fifth field could still be close by. Also the strengths would depend on the space between the points which would also be odd.
Old Unofficial Urho3D Wiki: http://urho3d.wikia.com/
"Newer" Unofficial Urho3D Wiki: https://urho3d.miraheze.org/
My GitHub: https://github.com/damu (changed my name recently from gawag to damu there)
User avatar
gawag
Active user
Active user
 
Posts: 192
Joined: 12 Feb 2015, 03:48
Location: Germany

Re: Project Ice Weasel

PostPosted by Modanung » 09 Jul 2016, 23:59

gawag wrote:Your idea with the tetrahedral "mesh" with interpolation would have weird properties as only the four closest "fields" would somehow influence the object though a fifth field could still be close by. Also the strengths would depend on the space between the points which would also be odd.

Somehow I think using a mesh's normals would be ideal to determine the gravity's direction since you could split edges to avoid interpolation on top of smooth detail with ease. Simply look for the closest normal and its direction. The mesh could contain gaps. When split up into separate meshes these could each be enabled and disabled to create - for instance - walkways that can be activated and deactivated.
My skullgut tells me this would best be implemented as a GravityMesh component. Or better even a SetMesh function within the GravityProbe.
for (Person* p : people)
ΞΞΞΞp->StopUsingWindows("https://www.linuxmint.com");
User avatar
Modanung
Active user
Active user
 
Posts: 171
Joined: 22 Jan 2015, 14:53
Location: The Netherlands

Re: Project Ice Weasel

PostPosted by TheComet » 12 Jul 2016, 02:04

Thanks for the feedback!

I was able to implement the Bowyer-Watson algorithm for the Delaunay triangulation of 3D points into a tetrahedral mesh:

Image

I also started writing a paper to document all of the math and stuff. There's quite a bit more to it than meets the eye. The paper is very incomplete and a WIP, but it will improve in time.

gawag wrote:Your idea with the tetrahedral "mesh" with interpolation would have weird properties as only the four closest "fields" would somehow influence the object though a fifth field could still be close by. Also the strengths would depend on the space between the points which would also be odd.


4 is all you need. In the real world where you can derive a continuous function for mapping position->gravitational vector, you only need 1 directional vector at any point in space. The infinite number of other vectors don't "influence" you, no matter how far or close they are to you.

Remember, this is a vector field, meaning that it is the solution to the differential equations created by multiple bodies of mass. Since it's not possible to have an infinite number of vectors, I have to create a discrete vector field and interpolate (read the introduction to my paper, I think it explains it pretty well).

I too could approximate the vector field a planet's gravitational field would create by spacing the gravity vectors at inverse proportional distances from the planet. It might look something like this: http://i.imgur.com/2fOVpxa.png

Modanung wrote:
gawag wrote:Your idea with the tetrahedral "mesh" with interpolation would have weird properties as only the four closest "fields" would somehow influence the object though a fifth field could still be close by. Also the strengths would depend on the space between the points which would also be odd.

Somehow I think using a mesh's normals would be ideal to determine the gravity's direction since you could split edges to avoid interpolation on top of smooth detail with ease. Simply look for the closest normal and its direction. The mesh could contain gaps. When split up into separate meshes these could each be enabled and disabled to create - for instance - walkways that can be activated and deactivated.
My skullgut tells me this would best be implemented as a GravityMesh component. Or better even a SetMesh function within the GravityProbe.


Using normals isn't going to cut it for what we have planned. We have lots of cases where gravity won't be collinear with the face's normal vector. That's why I've created a system where you can arbitrarily define gravity, no matter what the mesh looks like.
I'm a non-binary non-cis sexually fluid cephalopod identifying genderqueer mocha frappé latte
User avatar
TheComet
Active user
Active user
 
Posts: 122
Joined: 29 Jan 2014, 14:07
Location: Germany

Re: Project Ice Weasel

PostPosted by godan » 12 Jul 2016, 12:50

Nice work with the tet mesh implementation. It's definitely not a trivial algorithm.

As for interpolating gravity - have you considered multi-variate interpolation? https://en.wikipedia.org/wiki/Inverse_d ... _weighting. It's a great way to interpolate n-dim vectors associated with m-dim points (in this case, 3d gravity vectors associated to 3d position points). The nice thing is that you don't have to care about the structure of the points, nor do you need to interpolate a function over the tet regions. And you are always guaranteed to have at least one nearest neighbor, so the base case of a single gravity defining point works nicely. Note that with this technique, it is not the magnitude of the gravity vector that responds to the inverse distances, rather it is the value.

I used it a while ago to try to make mesh shapes respond to 3d position and time....https://vimeo.com/23699024
User avatar
godan
Active user
Active user
 
Posts: 122
Joined: 23 Sep 2014, 20:28

Re: Project Ice Weasel

PostPosted by TheComet » 06 Sep 2016, 19:34

Progress is slow. I've mostly been working on the character controller (walk, run, crouch, jump) and on a menu.



godan wrote:Nice work with the tet mesh implementation. It's definitely not a trivial algorithm.

As for interpolating gravity - have you considered multi-variate interpolation? https://en.wikipedia.org/wiki/Inverse_d ... _weighting. It's a great way to interpolate n-dim vectors associated with m-dim points (in this case, 3d gravity vectors associated to 3d position points). The nice thing is that you don't have to care about the structure of the points, nor do you need to interpolate a function over the tet regions. And you are always guaranteed to have at least one nearest neighbor, so the base case of a single gravity defining point works nicely. Note that with this technique, it is not the magnitude of the gravity vector that responds to the inverse distances, rather it is the value.

I used it a while ago to try to make mesh shapes respond to 3d position and time....https://vimeo.com/23699024


I'll give it a look! I don't think inverse distance weighting is a good approach for this problem though. Also keep in mind that it will take longer to find the relevant tetrahedrons if you want to do fancier interpolation. With linear interpolation you only need to find one tetrahedron and you're done.
I'm a non-binary non-cis sexually fluid cephalopod identifying genderqueer mocha frappé latte
User avatar
TheComet
Active user
Active user
 
Posts: 122
Joined: 29 Jan 2014, 14:07
Location: Germany

Re: Project Ice Weasel

PostPosted by Lumak » 07 Sep 2016, 16:44

lol at the finger! Nice :)
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Next

Return to Showcase

Who is online

Users browsing this forum: No registered users and 0 guests

cron