May 23, 2012, 05:18:17 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Movement test  (Read 1031 times)
davidochoa
Newbie
*
Posts: 34


View Profile
« on: February 24, 2011, 12:19:03 PM »

I read somewhere cylinder collision was broken, so I decided to test how broken it is and ended with this movement script:

Movement Test

TODO list:
Movement refinement
Add more actions
Create AI movement script
Add behavior tree (very basic)
Logged
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #1 on: February 24, 2011, 01:22:52 PM »

Nice work Wink It's good to see new stuff from users.
Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
davidochoa
Newbie
*
Posts: 34


View Profile
« Reply #2 on: March 17, 2011, 01:41:51 AM »

OK, here is the second test: AI movement.
AI Movement Test

The NPCs are using the same script as the player to manage movement and actions, I'll add more actions with the behaviour tree implementation and then I'll release a playable demo.
Logged
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #3 on: March 17, 2011, 05:57:58 PM »

What kind of gameplay it will be : action/adventure, rpg... or, if I let my mind wander, seeing your NPC jump near the mark : a clone of Lemmings  Grin
Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
davidochoa
Newbie
*
Posts: 34


View Profile
« Reply #4 on: March 17, 2011, 07:38:04 PM »

During the tests I also tought of lemmings: if the pathpoints are too high or too low the NPCs keep doing circles around  Wink.

I'm making this with an adventure game in mind, the lemmings thing would need to dinamically create the path points and I'm not interested in that, my main concern is the AI but I'm finding difficult to create it with the implemented version of AngelScript (I guess it's like 2.1.0)
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #5 on: March 18, 2011, 08:15:10 AM »

I am liking what I am seing, someone doing a real demo and showing and all. THere are to few now so I hold my thumbs for your project Smiley
Logged
davidochoa
Newbie
*
Posts: 34


View Profile
« Reply #6 on: March 29, 2011, 06:36:44 PM »

Almost all the planned states are ready, but I'll not update this project any further, let me explain:

As I mentioned it all started to check if the cylinder collision was as broken as I read on some posts, so the code was focused on moving the player and after that I somehow forced the AI part in the original scritpt. I learned a lot, but I need to make more tests to undestand at full what I can and cannot do with Gamecore and then I'll take all this experience to implement a more integrated behaviour tree, probably something like the gambits from FFXII, in the meantime I leave you the example program:

http://cid-8d882df8ef61586a.office.live.com/embedicon.aspx/P%c3%bablico/AdventureGame.zip

I'm evaluating to create a very simple project to show how the behaviour tree was implemented and release the source code so others can learn or give feedback from it.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #7 on: March 30, 2011, 03:25:19 PM »

That is a nice contribution. I Will dl asap and look at it. I have not looked through all but why cylinder collision?
Logged
davidochoa
Newbie
*
Posts: 34


View Profile
« Reply #8 on: March 30, 2011, 04:46:18 PM »

I've used ellipsoids with other engines and they adjust better for what I want to do, a capped cylinder is the closest shape to an ellipsoid. I must admit it was frustrating at the beginning, but after I solved some issues things have been flowing nicely.

I'll look for your comments.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #9 on: March 30, 2011, 06:29:21 PM »

ok, just tried the demo and its pretty slick. By some reason the NPC names only popup almost when they are out of camera reach.

The reaction is good. Bad enemies chase you, good npc turn towards you. The good run away when you try to hit them. It is quite solid. I would like to be able to run and hit at the same time. Now she stops.

I am very pleased to see this
Logged
davidochoa
Newbie
*
Posts: 34


View Profile
« Reply #10 on: March 30, 2011, 07:32:03 PM »

Thanks for your comments.

For the names I just copied the code from the templates, maybe using UI controls instead of sprites can solve the issues.

Run and hit will be implemented, but as I mentioned I'll not update this particular project, I'll take what I learned as a base for my real project.
Logged
gekido
Guest
« Reply #11 on: April 05, 2011, 01:30:29 PM »

If you copied code from one of the default scripts, they are set to only display the names when objects are within a predefined range.

look in the AnimAdvance function for something like this:

Code:
Vector screenPos = GetGameManager().GetViewport( "Main" ).ProjectToScreen( object.GetInterpMatrix().Project( 0, object.GetBoundingBoxMax().y + 0.25, 0 ));
if (screenPos.z > 0 && screenPos.z < 5)
{
int x = NormalizedToPixelCoord( screenPos.x );
int y = NormalizedToPixelCoord( screenPos.y );

The check for screenPos is basically seeing if the object is in front of the camera (ie screenPos.z is greater than 0) and whether the object is closer than 5 meters from the camera ( screenPos.z < 5)

I did this so that I didn't end up with a bazillion names on screen when I was using the traffic manager for a project with a lot of characters - adjust to flavour ;}

Also, great work!  Looks good so far, keep it up!
« Last Edit: April 05, 2011, 01:33:12 PM by gekido » Logged
davidochoa
Newbie
*
Posts: 34


View Profile
« Reply #12 on: April 06, 2011, 11:47:16 AM »

OK, I adjusted the distance to 25 and it looks good, my first tought was to use the GUI controls because now they have depth and I want the indicator to resize by a distance factor, but the SetSize method should be enough.
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!