Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Need ideas for realistic snake movement

Author
Message
Benjamina
22
Years of Service
User Offline
Joined: 7th Sep 2003
Location:
Posted: 7th Sep 2003 11:37
Hi,

I've been playin AxySnake (www.axysoft.com) recently and I have found it to be an awesome game. Highly addictive.

I am into making my own snake game, but instead of eating fruits the snake will be chasing/eating mice and avoiding assorted obstacles. I wanted to make a realistic snake movement because I want it to be a really good quality game.

I am wondering, what should I do to get the realistic snake movement (like in AxySnake). I am assuming that you would need to create a straight snake model and then create a fine bone structure and then export it (along with textures and all) to an .X file.

Now, would it be possible to do something like this:

When the head (main bone) moves, all the other bones follow recursively (bone 2 follows bone 1 and bone 3 follows bone 2 and so on in that order) I am thinking this would give you some sort of realistic snake movement (that's what I am thinking anyway)...of course, someone mentioned limbs (are limbs the same as bones in DBPro?).

I am just wondering if this is indeed possible in DBPro. I am sure this would be possible with memblocks and manipulating meshes, but that would be a hideously difficult task indeed (if at all possible) and probably a lot less efficient not to mention slower.

Does anyone else have any ideas...

I know DBPro supposedly supports bones (allowing us to work with individuals bones and to work with things such as spinal structures as in the case of a snake), so I'm hoping that I'll be able to do the sequential recursive bone moving technique rather than messing around with mesh manipulation.

Any ideas or suggestions would be greatly appreciated.

Cheers,
Ben

Many good things come in small packages
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 7th Sep 2003 11:48
if you have a look in the 20 line challenge forum, there are some snake entries there, but what you want to do sounds more complicated so i really have no idea


Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 7th Sep 2003 12:01
Yup. This can be done in DBpro. What you need to do is to create a skinned mesh in your favourite 3-D modelling package. When I say skinned mesh, meaning that you need to model your snake's bone and its skin separately.

I usually use MAX to model my game. So for your case, I will create a bone structure of the snake. The bone structure will most probably have several segments. Some segments might move according to other segments, i.e. something like our wrist bone moves according to our arm bone.

Once you had the bone structure done, you need to model the skin mesh. You will tie each vertices of the mesh appropriately to the bone vertices. By this way, when you animate the bone, the skin will stretch automatically following the bone. Neat eh? Just like the real skin and bone.

For animation, you can choose to animate it in your 3-D modelling package. Or you could animate manually by using the DBpro limbs command. If you need a fine control over the animation, I would said the latter choice is a better choice, but more tedious. You need to think of how to rotate each bone naturally by using some math. Maybe you can use some simple sine/cosine trigonometry. Afterall, snake movements do look like a sine wave. LOL!

Hoped this helps!
Good luck!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
zzabb
23
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 7th Sep 2003 12:08
good advice/good suggestions!!

makes me wanna go make a snake (-:

My advice is free -
unfortunately you get what you pay for (-:
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 7th Sep 2003 16:35
I've had an idea bout snake movement.
I'll go and test it out.
If it works, then I'll post the code.

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 7th Sep 2003 17:18
OK it may be jittery a buggy but it shows the principle:



Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 8th Sep 2003 01:42
That movement is rather elastic though. You should move the objects as soon as the leader is moved, rather than on a time basis.

Login to post a reply

Server time is: 2026-07-23 07:42:55
Your offset time is: 2026-07-23 07:42:55