FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Character Model and Collisions

3 posters

Go down

Character Model and Collisions Empty Character Model and Collisions

Post  hemmi Fri Oct 23, 2009 11:28 pm

Hello.

Let's say I have a model of a human being. When this is turned into physics by sio2, will it easily just fall over? I'm doing a fighting game, and I'd like to enable physics for the ground/platforms. Is the integrated bullet engine a good idea for this type of thing or is this something better done on my own?

hemmi

Posts : 15
Join date : 2009-08-27

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  sio2interactive Fri Oct 23, 2009 11:39 pm

Creating a fighting game is no pic-nic... Hope you have the full game bible ready and the concept art done... instead you'll have HUGE problems along the way...

Except that for the bullet part... I would do some test before starting your player engine... as will as for the AI...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  hemmi Fri Oct 23, 2009 11:49 pm

Thanks for the input Smile

I will definitely run some tests. It seems I have the choice of creating the player as a real mesh within the physics, or as a cube or something more primitive. The only problem is that it'd have to align right with the model so that the player's feel are touching the ground when the bottom of the cube is touching the ground. Given that hit detection is very unrelated to real physics, is it overkill to define the player in terms of real physics? I'm really only after jumping / collision detection for the ground and platforms. The calculation for a player hitting another is based on player distance, not real physics.

hemmi

Posts : 15
Join date : 2009-08-27

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  sio2interactive Sat Oct 24, 2009 12:03 am

For a traditional fighting game (like 2 player against each other) I don't see where can be a problem as long as you keep the characters below 1500 polygons.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  hemmi Sat Oct 24, 2009 12:19 am

I guess with that I'm just worried about a player falling over. But I guess I'd still have that problem anyways. I'm starting to realize that I can use bullet to restrict rotation. Thanks for that fast help Smile

hemmi

Posts : 15
Join date : 2009-08-27

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  hemmi Sat Oct 24, 2009 12:24 am

While we're on the subject of fighting games, is a use for lua typically something like performing game logic? Could I code the better part of the "fighting logic" in lua? From what I've heard, lua is pretty quick.

hemmi

Posts : 15
Join date : 2009-08-27

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  sio2interactive Sat Oct 24, 2009 4:15 am

I always suggest to implement the logic in c... Check the source of backyard war for more info about how to use LUA inside a real game scenario...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  Francescu Sat Oct 24, 2009 12:46 pm

I have used LUA for specific level logic and I have to say that it performs really well - can't really tell the difference versus C but of course I'm not over-using it.

It is always a matter of trade-offs and not abusing some mechanic / technic- for instance, you would not want to code everything in LUA but you can certainly code quite a fair amount of game logic, especially if this last one is specific to a scene / level.

From the LUA performance tips paper:
www.lua.org/gems/sample.pdf

Basic facts:

Before running any code, Lua translates (precompiles) the source into an in-
ternal format. This format is a sequence of instructions for a virtual machine,
similar to machine code for a real CPU. This internal format is then interpreted
by C code that is essentially a while loop with a large switch inside, one case for
each instruction.
Perhaps you have already read somewhere that, since version 5.0, Lua uses
a register-based virtual machine. The “registers” of this virtual machine do not
correspond to real registers in the CPU, because this correspondence would be
not portable and quite limited in the number of registers available. Instead,
Lua uses a stack (implemented as an array plus some indices) to accommodate
its registers. Each active function has an activation record, which is a stack
slice wherein the function stores its registers. So, each function has its own
registers2 . Each function may use up to 250 registers, because each instruction
has only 8 bits to refer to a register.
Given that large number of registers, the Lua precompiler is able to store all
local variables in registers. The result is that access to local variables is very
fast in Lua. For instance, if a and b are local variables, a Lua statement like
a = a + b generates one single instruction: ADD 0 0 1 (assuming that a and b
are in registers 0 and 1, respectively).

SIO2 bundles LUA version 5.1 for what it's worth...

As always, you can always do some performance testing (prototype) to validate what you intend to do with it but I think you would be pleasingly surprised as how well it performs. Check with Shark as well.

I only use it for level(s) specific logic.

Cheers

--Franky

Francescu

Posts : 136
Join date : 2009-03-18

Back to top Go down

Character Model and Collisions Empty Re: Character Model and Collisions

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum