Rolling world effect

I found this video very convincing, and wanted to replicate it.
Animal Crossing Fan Game - Rolling Log Effect - YouTube
Unfortunately, the python script won’t work, and I could use a “rolling log” effect to simulate what you’d see in animal crossing.

This is useful for planets, for example.

But I cannot get it to work… It seems like you need a script that somehow uses the worldPosition, and other factors to bend the BGE world around you, converting a flat BGE world into a nice spherical effect.

Any help would be appreciated, and it would be useful if I could tweak the script that handles the distortion too!

1 Like

It’s pretty easy, i did it for a game some time ago, you have this setup: your orld is a huge sphere (or cylinder), your character hitbox must follow the normal of this object world, use the following planetary gravity script instead of BGE gravity, parent your camerato your character hitbox and voilà ! (I’m not the creator of this script)

from bge import logic
from mathutils import Vector

GRAVITY = 30

def main():

scene = logic.getCurrentScene()
cont = logic.getCurrentController()
own = cont.owner

for obj in scene.objects:
    if "gravity" in obj:
        
        # Get vector to planet center
        
        down_vec = Vector(obj.getVectTo(own)[1])
        
        # Apply force in that direction to simulate gravity
        
        down_vec.magnitude = GRAVITY
        obj.applyForce(down_vec)

player = logic.getCurrentScene().objects["Player"]
up_vec = own.getVectTo(player)[1]
player.alignAxisToVect(up_vec, 2, 1)

To use it : WorldObject > Always (true level triggering) > Module: PlanetaryGravity.main
Affect all dynamic objects with the prop “gravity”

I saw this post the other day but haven’t been playing animal crossing before I had no idea where to get started, however someone posted some useful trick to get things rolling here on stack exchange

Tried the script, but it does not give the desired effect of curvature. It just lifts my object up into the air, and the materials on the object are messed up. What I wanted was this effect, it applies to all objects in the scene you’re in, like this:
/uploads/default/original/4X/4/b/6/4b6a0e2433391ffbffe9b07c4412fcf35df4e7b0.jpgstc=1
If you focus on the image, you’ll see what I mean. The world appears to “roll” as you walk, and trees appear to fall away and vice versa when you’re walking up.
Could someone provide an example of this rolling log effect? This effect converts a flat world to a spherical like one, and it rolls as you walk and it is faster when you run. Objects appear to fall back when below the horizon, and they come up as they approach the horizon.
A property named “player” is required to define the player object. This excludes everything else, and the curvature rolling log effect is applied to everything without a property named “player”.

Attachments


That’s strange it didn’t work, it works for me (still with blender 2.77a), if your world object is a cylinder you just have to make another object emitting gravity at the center of this cylinder and under your character, then make it copy the location of your player object on the axis corresponding to the length of the cylinder ((ex: your cylinder has its length parallel with the Y axis, make your gravity object copy the player’s Y position) don’t know if I’m clear :confused: )