First 3D World?

Hi folks.

I’ve written thousands of lines of 2D games and loved every minute, nearly. I’ve just moved into 3D and wish I had done a long time ago, no more bloomin sprite sheets!

I’ve spent the last couple of days writing a simple top down kind of asteroids thing just for learning bounding boxes and how to handle the 3D vectors, all good stuff and working fine.

However, I have this idea of a simple re-write of the old Atari ST Carrier Command game. There is Gaea Mission which is great, but it’s a bit more refined than I was thinking. I’d sooner go back to simpler graphics, an old look and feel. (Basically because my modelling skills aren’t great!)

There are 2 questions at this time I hope someone could help with:

  1. I use Blender for modelling, but I’ll need a grid of a never ending sea and want z moving verts. I have no idea how to create the ‘mesh’ on the fly.
  2. What is the best way to keep an object on the ground? If I have islands with slightly uneven surfaces how do I place objects ‘on to’ the mesh, calculating touch points between verts?

Another way to ask question 2, if the above makes no sense; if you have a car mesh and a track mesh, how do you keep the wheels on the floor!

I hope this makes enough sense for some kind folks to send me off to a couple of tutorials or help documents.

Many thanks.

For 1. I did something like that for a music visualization project I did last year: VR music visualization
The grid moves up and down based on a noise function and towards the user with its speed based on the intensity of the music. The implementation uses a 2D array of floats in the [-1 1] range. To form the waves I computed a number of points between all the neighboring floats in the 2D array with sine wave interpolation to smooth out the shapes. To move points at the start back to the end, you can use a circular buffer. You’d store the index where the first row of points is at. We only scrolled in one dimension, which simplifies things. If you scroll on both axes you’ll need one index for each.

For 2. I’d go with a physics engine. BepuPhysics is great. The author is working on a complete rewrite, bepu v2, but I’m not sure that’s ready for production use.

There are two samples about this where you can see how it’s done.

However @Jjagg is correct, you should use a complete engine, there is no reason to reinvent the wheel. Physics/collisions are hard.
The awesome-monogame currently lists three open-source 3D Physics engines, Jitter, BEPUphysics and BulletSharp.

It is now :slight_smile:

It’s not very beginner friendly, though- v2 is all about being speedy and exposing things in ways that allow speediness, which might be a bit of an obstacle. If you don’t need turbospeed, v1 or other engines would do the job just fine.

1 Like

Hi @Norbo,

I’ve hit that ‘unfriendly wall’ on v2 too trying to replace v1 with v2 in my game. The management of objects is too “low-level” for me and what’s worse, the errors bring me back nightmares that I thought were over when finally switched from C++ to C# 10 years ago.

Have you thought of ways to simplify its use? In example an (optional) layer to make
v2 more v1 akin (in terms of usage easiness, I don’t mean mimicking the v1 API) yet using v2 under the hood. The extra layer would make it (optionally) slower but would probably have a lower learning curve yet still be a lot faster than v1.

(sorry for the offtopic)

Certainly considered it; it wouldn’t even be that much work to make a ‘convenience layer’. Just a question of what compromises to make. Unfortunately, the ideal compromises depend on the user, so it’s a bit hard to find a one-size-fits-all solution.

I posted an umbrella issue for this sort of thing if you’d like to go through some of the difficulties you had: https://github.com/bepu/bepuphysics2/issues/76

2 Likes

You don’t necessarily need to have a vertice grid for water reimers had a xna tutorial on how to do it with a quad and a pixel shader im sure there are others. I implemented it at one point in xna never really finished it up though the results were pretty good. Im not sure if i ever converted this over to monogame though.

http://i936.photobucket.com/albums/ad207/xlightwavex/programing%20and%20concepts/adjustmentstoreimersshader_zps72f37e4d.png

Photobucket used to be better and i was using it at the time.

Anyways once you have a quad with transparency and reflection your like 90% of the way there.

thanks for the answer. The last time I tried to move to v2 was several months ago but I’ve mostly forgotten everything related with the port intent. I’ve been working too much and in too many fronts for the last months and the GC has already swept that part. I only remember the dreadful error messages and that it was hard to keep track of the assets (allocating/deallocating too low level) , but I couldn’t give any specific

If I try to move again to v2 I’ll definitively try to give some opinions on that thread! :slight_smile:

Thanks folks, some great information. The only issue might be I use VB. Will I have to get into recompiling libraries and all that nonsense?

If it’s going to be a case of transposing that’s fine.

Thanks again.

You can consume C# libs from VB. It’s all compiled to IL anyway :slight_smile: