Challenge.

Blitz3D Forums/Blitz3D Programming/Challenge.

Paul "Taiphoz"(Posted 2011) [#1]
Hay all, I have a project ahead of me now that I actually have spare time.

Problem is I'm not sure how to best go about it, so I'll give you the basics and see if maybe you can help.

My Game world/levels will be sphere's think mario galaxy, and no its not a mario galaxy clone but the mechanic of having a small character running around a sphere world is the same.

My plan, was to create a mesh in something like blender, to create the sphere add some hills, terrain features, then load the full mesh into blitz, but I can see that being an issue with rendering if the polly count is to high.

I think I can work with the polly count tho if I somehow split the mesh up into segments and then only show the segment the player is on.

My real puzzel is how to make the player stay on the world and how to move him around it, my initial thought was to parent child it, and then use rotate/pan and tilt on the child which would be the player to make him move around but im not so sure thats a good idea or the best idea.

Well there it is. if anyone has any thoughts ?


Yasha(Posted 2011) [#2]
my initial thought was to parent child it, and then use rotate/pan and tilt on the child


That sounds good. Except add an extra layer of pivot in between, so you have a minimum of three layers:
- planet
- pivot
- player

Have the player entity be a child of the pivot, and attach that pivot to the relevant planet as you move between them. That way you can use turn/rotate freely without worrying about affecting the planet. Turn/rotate the pivot to achieve the player's movement in X and Z relative to the planet's surface, and use the player's own Yaw and Y for the mesh's orientation and their jump height.


Paul "Taiphoz"(Posted 2011) [#3]
sounds like an idea.

Thinking of collisions, a collision check against a complex mesh thats rather large might cause me issues, is there an easy way to check the height from centre of the plant so that I know where to place the player ?

I vaguely recall line pic, I could line pic from the player to the plant to get the distance and then set the players height to that. not coded in a while so I may be way off.


Warner(Posted 2011) [#4]
I believe that LinePick uses the same functions internally as the collision routines. Maybe it is more suitable to find a data-only solution for this.
Perhaps you could create a separate program first that converts the mesh to a lookup table that returns height data, indexed by latitude/longitude coordinates.
This data could be written to a (data) file, that is read along with the 3d mesh.
Your main program could convert the players coordinates to lat/long coords, and then find the right heightdata for that point.
This might be a faster solution than using LinePick.


Uncle(Posted 2011) [#5]
Charlie was doing something similar a couple of weeks back. Perhaps you should check out this thread...

http://www.blitzbasic.com/Community/posts.php?topic=94377


Paul "Taiphoz"(Posted 2011) [#6]
thanks for that, actually reminded to me to get minib3d which I had been meaning to do for a while now.