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.

AppGameKit/AppGameKit Studio Showcase / Procedurally Animated Spider [Tier 2]

Author
Message
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 13th Sep 2013 13:11 Edited at: 27th Oct 2013 21:36
Procedurally Animated Spider







I needed something interesting for an assignment I had to do and this is what I came up with. It is mostly complete, just a few loose ends need tying up. If anyone wants to use this then let me know and I'll tie up those loose ends

* feet always placed perfectly on terrain or obstacles
* add as many abdomens and legs as you wish(only two limbs per leg)
* can walk up walls
* fast
* create as many spiders as you want


creation:


update:


The current legs are for debugging only, I have not tried it with a spider model yet.

There is a demo to try in my next post.


EDIT: 27/10/13
You can now download project with source code attached to this post. It's not complete but source was requested by someone so I am sharing with everyone, hopefully someone can find it useful.

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 13th Sep 2013 13:12 Edited at: 16th Sep 2013 19:54
Demo attached.

Edit: updated

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Sep 2013 13:32 Edited at: 13th Sep 2013 13:34
That's really cool!

There's a game in there, just waiting to come out - like that Dangerous Creatures, on the Wii, where you play as a spider, scorpion etc, really good fun and interesting to watch too.

I'd love to see a game where your on say, a bed, and you have to sneak around someone sleeping to find a good spot to bite them, without them waking up... or make webs and try and catch flies, like a free-roaming survival game. Hope you develop the idea further.

I am the one who knocks...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Sep 2013 15:01
Just great! I'd love to play a developed game of this. I can't imagine there are many people who wouldn't. Reminds me of an old DBPro competition I won with a similar system for a biped robot like ED209... procedural animation is under used!

Well done!

"Everything should be made as simple as possible, but not simpler."
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th Sep 2013 19:56
Thanks guys, I'm sure there is a game in there too somewhere

I have updated top post with a video, I have also updated the demo so you can try different surfaces.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th Sep 2013 21:38
Very cool!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 17th Sep 2013 00:13
Really cool

Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 17th Sep 2013 00:48
Wow, the way its legs move could fool me into thinking someone animated that spider in Blender. Looks so natural.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Sep 2013 14:04
Love the way it walks around any 3D surface. If you want to make it look slightly more realistic (in terms of movement) you could add a slight "bobbing" up and down as it moves. Long legged spiders tend to move like that and it would really add to the realism.

On a slightly related note this project convinced me to look up an old project I started in AppGameKit Tier 1 (2D). It's one of my backburner projects but I had a fiddle with it to make a quick demo to share. I don't think it warrants its own thread and I hope you don't mind me posting the demo here matty?

It's a small procedural(ish) biped that you control by dragging it's feet / legs. It's physics based but with some procedural control to keep the player upright and moving naturally. My idea is to turn it into a touch based game where you are a robot attacking a city (or something like that), kicking tanks out of the way and stomping on army dudes...

"Everything should be made as simple as possible, but not simpler."

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Sep 2013 15:56
Bobbing could be added by changing the abdomen height each frame, I may try that, should be pretty easy to add in.

Tried your demo, I can imagine this being quite fun, like Rampage, that was awesome. Stomping on people might be even more fun

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Sep 2013 16:02
Quote: "Tried your demo, I can imagine this being quite fun, like Rampage, that was awesome. Stomping on people might be even more fun"

Yes, something like Rampage is exactly what I had in mind

"Everything should be made as simple as possible, but not simpler."
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 18th Sep 2013 18:01
That's pretty nifty!
Nice work and the motion is quite natural looking.
I might add just a little random variation to where the legs land so it doesn't "look" procedural, but still very very cool!

mr_d
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 21st Sep 2013 05:11
This is really cool! I've always wanted to do something like this myself, but have the spider interact/respond to user input maybe via the camera or a motion detecting device like the kinect.

I noticed in your video, that when your spider goes around corners or curves that exceed a certain angle that the first 2-4 of it's legs are kept raised while the other legs moves it over the corner; this doesn't look natural as I believe that a real spider continues to use all it's legs, with the front ones extended around to make contact with the surface using it's joints. Not sure if I'm explaining it properly...

Anyway, great work, and I also would like to see a game produced using this - could be awesome.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 21st Sep 2013 21:50
Thanks mr_d

If the spiders leg can't reach its desired location it defaults to that upward position. It works in some situations but you are right that it does not look correct coming over the bell shape. It can easily be corrected by making the legs longer or bringing in the desired locations so they are in reach more often.

Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 22nd Sep 2013 00:42
That does look cool Matty. I like it a lot.

Are you ray casting to determine the foot location? You might be able to solve the floating front feet by casting the ray from wherever you start casting to a position below the body part that the leg is connected to that represents the spider's full leg extension. Making complete sweeping guesses about how you've done it though. In any case, very cool and I agree with the others that there is a game in this.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Sep 2013 20:18
Thanks fallout.

The spider uses raycasts only, this way the user just implements the raycast callback and the spider should work on any platform with any collision solution.

It casts from/to the same position relative to the body and at an angle relative to the body angle. If it can't reach that point then I could/should try another closer point to make the legs more successful more often. Most of the time it hits because the default cast is closer than the full leg extension, this length is the test I use to see if the spider should use the hit position or ignore it.

Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 24th Sep 2013 15:20
Very impressive Matty, you're clearly both very technically minded and way better at coding than me - I wouldn't know where to begin something like this. Given the state of the market for Android games, you should totally look their if it's fast enough an android devices, it could be very successful if you went down the dangerous creatures route.
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 25th Sep 2013 05:40
I think he is making his racing game on the ios that is what he said. Besides there are bugs in this. Matty are you giving up dark gdk. I thought you liked it to much to give it up. Are you just getting sick of it.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Sep 2013 11:59
Thanks Santman. I have not tested on a mobile device yet but it should run fine with many spiders, the code is not very computationally intense.

@3d There are no bugs in this apart from the spiders of course I just need to add a few things to make it platform/api independent.

I probably will not use GDK again, AppGameKit is going more and more 3D and mobile is the future(or a big part of it) imo.

AGK so far has been much easier to work with when adding physics etc, Paul is doing a great job, there will always be bugs but I get the feeling AppGameKit is much better than GDK under the hood.

29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 27th Sep 2013 02:10
This is very cool and, yes, there is a game in here somewhere.

I was thinking some kind of stealth based third person game where the spider is maybe a scout, spy or sniper in some weird sci-fi world.

one of these days I'll come up with a better signature
Fallout
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 27th Sep 2013 10:16
Quote: "or sniper"


Omg, a spider with a machine gun mounted on it's back! I can see it now. Or maybe 100 of them!!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Oct 2013 21:41
I have attached a project with the source code to the first post. I still need to clean this up but someone requested it so here it is.

I have no time to help much with any issues for a few weeks, after that I will fix it up and document it to make it easier.

The spider currently can't walk upside down properly, any 3D math geniuses out there? If so then take a look and see if you can fix, it's just a simple raycast down and then matching the normal of the ground/walls but it does not work at pole

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2013 13:09
Ohh, one thing I always try when I have polygon collision issues, is to try and inverted raycast. Like, check (xa,ya,za,xb,yb,zb) and if there's no collision, check (xb,yb,zb,xa,ya,za). It might be some normals being detected wrongly, adding an inverted check should get around that problem.

I am the one who knocks...
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Oct 2013 13:14
Thanks VanB.

The raycast works ok, it's after that point there is some complicated calculations to orientate the body to the ground normal without losing the direction you are facing.

The raycast is always cast down local to the body so it detects the ceiling fine, but it then struggles to walk straight

French gui
19
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 28th Oct 2013 17:20 Edited at: 28th Oct 2013 17:21
Very nice! You're really an incredible coder.

Login to post a reply

Server time is: 2024-04-18 12:17:51
Your offset time is: 2024-04-18 12:17:51