Gravity, LoadAnimMesh, Future Goals!

Blitz3D Forums/Blitz3D Beginners Area/Gravity, LoadAnimMesh, Future Goals!

CuteNCreamy(Posted 2016) [#1]
NOTE: I am running Windows 10, and am always wary that this will affect something. Take that into consideration if you think it could be a problem. Thanks!

I feel like both of these following issues are things that newcomers such as myself experience a lot. Unfortunately, finding no suitable response to my issues, I have come here. The game I am programming follows a 3-D Third Person platformer style. My first issue, and also the thing that seems to annoy the veterans a lot is that I have no usable gravity system. I wouldn't need a gravity acceleration system, as I plan to implement wall climbing anyways, but an acceleration system would be convenient for a lot of things. I have tried a lot of the ones people have suggested, but noticed that most of them are constructed for 2-D, and the ones that are constructed for 3-D either give me the "Expecting End-Of-File" error, or the screen is just black. Anyone who knows about an easy 3D gravity system, please share! I repeat, I don't really need acceleration!

My second problem is that through Blender I have made an animated 3-Dimensional model file, which when I implement into the code, only shows my character static with the first frame of the animation. When I tell it to animate the character, I receive the error "Entity has no animation". I've heard this as a pretty common problem before as well. I'm certain that Blender is actually saving an animation, and I tried with both the .3ds and .b3d extensions just to make sure that wasn't affecting the process, but each one still crashes when I try to implement the 'Animate' command. Any thoughts on different programs, commands, file extensions to use?

SUM-UP

1. 3-D ThirdPerson Gravity System

2. LoadAnimMesh and then Animate doesn't work


The following items aren't at all pressing, just some things I was planning to add on the side. The first two items above are more important, and these ones are mostly here just in case anybody knows anything off the top of their heads about this and is willing to help:

1. Scanning system (Reminiscent of Goombella's Tattle Log in Paper Mario The Thousand Year Door, but inclusive of items that the player may collect)

2. Inventory/item system

3. Menus

4. Switching out characters

5. RPG-like battle elements

6. Fall damage

7. Climbing system(Press space[57] to advance upward by something like Y-Axis 0.4 on the surface of the wall)


I'm sorry if this post feels at all demanding, I was just trying to set out some of my goals for this game all at once to make it less tedious by divvying it up into several different posts. Please don't search too hard trying to come up with an answer, I despise being a hassle.


Thanks, community!


RemiD(Posted 2016) [#2]
About the gravity : very easy to implement a gravity which looks realistic enough, (with increasing gravityspeed)

You need one variable (for example GravitySpeed#) for the thing, and one variable (or simply a value) for the gravityforce (for example GravityForce#).

When thing is on the ground, GravitySpeed = 0
When thing is on the air, GravitySpeed = GravitySpeed - GravityForce, so GravitySpeed will become more and more negative so it will look like the thing is falling faster and faster.
then translate the thing with TranslateEntity(Thing,0,GravitySpeed,0)
A code example here : http://www.blitzbasic.com/codearcs/codearcs.php?code=2933
Take a look at these lines :
PlayerVY = PlayerVY - 0.0025 
TranslateEntity(PlayerCollider,PlayerVX,PlayerVY,PlayerVZ)



About the animations, as you may have seen in my tests, all works well, you have a problem on your side.
Before trying to make your own model and animations, i suggest to try to load and animate an existing b3d model that we know works well. For example the free models by psionic :
ninja : http://tempsend.com/68D58728AC
zombie : http://tempsend.com/FFEF7F4389
About how to manage the animations, i suggest to first determine the actionstate of the character depending on its previous actionstate and depending on the player/ai input, and then depending on its actionstate, turn/move and animate the character.


Before asking for something, it is good practice to search the forum and the code archives for previous discussions/solutions about your problem/request, and then post a more precise question/request if necessary.


Good luck,


Matty(Posted 2016) [#3]
Hmm...I know I'm being picky but when I see 'RPG Battle Elements" (nbr 5) I can't help but wonder what sort of RPG are we talking? Action RPG like Diablo? Pause/Realtime RPG like Baldurs Gate? Turn based first person like the old Might and Magic? Realtime first person like Eye of the Beholder? Side view group of sprites turn based like Final Fantasy? - it's a pretty broad picture I've painted there - maybe you could narrow it down a little....?


CuteNCreamy(Posted 2016) [#4]
@ RemiD
Thanks a ton for all of your help, you've cleared a lot of things up for me. Still working on implementing it, but things are looking up. As for the animations, I gathered the ninja and tried it out. Clearly I have misdeveloped the animation on my end, thank you for the clarification! I very much appreciate your comment on searching around the forum, as I was actually searching for a week, which tells me I'm just not being analytical enough about it. Thanks again for all of your help!


CuteNCreamy(Posted 2016) [#5]
@ Matty
No, you're 100% right there. It's actually quite a misguided term that I used. I realized, too late, my mistake. What I meant was using numeric values for stats like attack power, defensive power, and health power, which is not exclusive to RPGs, in fact. Also, considering the variable system used in Blitz3D, the system should be pretty easy, even for me, to work out. Sorry to confuse you.


RemiD(Posted 2016) [#6]
@CuteNCreamy>>Quick tip to search the forum/codearchives :
go to google.com
then type : keywords or question + site:blitzbasic.com
for example :
export animated mesh blender site:blitzbasic.com
Try to keep it short, only a few keywords.
Then when reading some posts, you will see others words to express the same thing, you can then use these words to try a new search.


Guy Fawkes(Posted 2016) [#7]
If you wanna climb a wall, shoot a linepick straight ahead. If the entity it hits is INDEED a wall & the player can see the wall & the player is colliding with the wall, then align the player to the Y-Axis Wall Vector. Then switch Gravity from subtracting to adding if the player is holding the climb button, else realign to the previous vector and set Gravity back to normal.

Hope this helps.

~GF


Rick Nasher(Posted 2016) [#8]
Now that actually sounds useful GF. Good call.


Guy Fawkes(Posted 2016) [#9]
Thanks! :)

~GF


CuteNCreamy(Posted 2016) [#10]
@RemiD

Good point. Google's advanced search has scarcely let me down in the past. Thanks for the tip! I'm off to give it a shot.


CuteNCreamy(Posted 2016) [#11]
@ Guy Fawkes

Sounds good to me. This most certainly has helped! That's a pretty unique way of thinking about it. I wouldn't have tried that for a while!


Matty(Posted 2016) [#12]
The easiest way to do fall damage assuming youve got working gravity is to apply points of damage based on the velocity of the entity at point of impact...if it exceeds a threshold apply damage that scales linearly with the velocity magnitude.


ThePaiva(Posted 2016) [#13]
About animations, maybe you have some childs of the mesh you're trying to animate and you're trying to animate the mesh instead of the childs. Blitz doesn't animate all the childs of the mesh and it might be the problem you're facing with your models not animating.
Try using findchild(mesh,"child_name") and animate it, it'll probably work.

for fall damage you could check the gravityspeed when the player touches the ground and have a minimum speed before it deals damage to the player, something like
if entitycollided(player,ground_collision_type) and gravityspeed>100 then playerlife = playerlife - (gravityspeed*0.2)


for the RPG-like battle elements, switching characters, tattle log, inventory system and all that stuff that you'll need to keep, change and check a lot of information you should definitely use TYPES, they're really useful for organizing a lot of variables. There's a good tutorial somewhere here in the forums, not difficult to find at all and explains everything in an easy way with examples.
Here's a small example of how to use it for what you're trying to achieve:


About menus, you can use drawimage(x,y,image), check the mouse position and if mouse was clicked to check what button the player clicked at.


Matty(Posted 2016) [#14]
RemiD comments about gravity are good.

Code archives has plenty and samples does as well....the castle demo in the mak folder has this.

Gravity = acceleration so not sure i follow when you say you want gravity but dont want acceleration. But check out the samples....especially the castle demo.


Guy Fawkes(Posted 2016) [#15]
I'll try and code an example tomorrow... Too tired tonight...

~GF