|
2 registered members (TipmyPip, 1 invisible),
18,731
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
multiple c_move uses.. or (external c_move call)
#365044
03/23/11 00:18
03/23/11 00:18
|
Joined: Mar 2011
Posts: 11
RetroGamer
OP
Newbie
|
OP
Newbie
Joined: Mar 2011
Posts: 11
|
I read you shouldn't use c_move more then needed. I've examined the usage many movement/gravity codes with moving and gravity combined(even in manual they are in same function). The thing is i would like to create an independant function for calling gravity for all entities that are active (player and enemies alike). Would it be more feasible to create a single gravity for the player and one for all enemies: both variable. (main idea is gravity values might change for certain area's, thus why i think an external function might be better... since it can be called when needed and/or using changed values). Tho i believe having too many instances of the same function going, might be a performance issue. Or should i just use 2 c_move's one for player and one for enemies(containing both regular and gravity movement). can anyone please help. i just dont want to have 5000(exaggerated) c_move calls going at once. Perhaps a small external function example(if that is how it should its called). I've read the newest manual a few times also few diff lite-c tuts, So please pardon my noobness but i feel like i already know this, its just been along time. GS has come so far since i last used it... early A5 engine.
Thank You for any help that might be offered
ever hear the expression once you learn it's hard to forget... I think learning programming languages as,
I just mastered old school roller skating... Now they have roller blades, Same wheels, different setup
|
|
|
Re: multiple c_move uses.. or (external c_move call)
[Re: RetroGamer]
#366411
04/03/11 16:36
04/03/11 16:36
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
The idea is you never want to call C_move more than once per entity per frame. If you have multiple functions that handle entity movements it is very easy to do so as there are six directions an entity can be moved. It's personal XYZ and the world's xyz. If you have six c_moves you will kill your FPS especially if you have more than one entity moving this way.
The easiest way to only use one c_move one time is to use skills my.move_x - move_y - move_z move_world_x etc. Have functions that move your player, such as forward backwards strafe, gravity and jumping, wind directions, get called from your player movement function and have them set the skills for the player. I would go ahead and mutliply them by time_step at that point too. Then at the end of your function you use your c_move one time. To keep from having to use the c_move here add up all 6 of those skills and see if they are anything but zero, because if they are zero you don't need to use c_move at all.
Know when not to use c_move at all. Such as birds flying overhead or mice running across the ground which is all part of the scene and not part of the game itself.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: multiple c_move uses.. or (external c_move call)
[Re: RetroGamer]
#367043
04/09/11 02:45
04/09/11 02:45
|
Joined: Mar 2011
Posts: 11
RetroGamer
OP
Newbie
|
OP
Newbie
Joined: Mar 2011
Posts: 11
|
Thanks that what i thought. i havent been programming for a few years, last time those commands were just a coming out.. i had A6 previously.
Basically main function calls out the movements (which returns the changed var's etc... then before i end main function (before the wait(1)).. i use the single c_move with player movements in first vector(relative pos) and gravity and jumping with absolute vector.
ever hear the expression once you learn it's hard to forget... I think learning programming languages as,
I just mastered old school roller skating... Now they have roller blades, Same wheels, different setup
|
|
|
|
|
|