random walking speed, random risetime

ABK

Well-known member
I wanted to add some variations to enemies ingame, i dont like they way they all fall in groups and fly the same path then rise in the same time, i would like to add some randomness, i gave enemies running animation and its working kinda ok, not what i wanted but fine.
Is property "risetime" controlled by script ? I would like to make it random lets say from 10 to 1000 after each fall so every enemy would have random risetime and would rise sooner or later than others.
Also is there some quick way to control enemies walking speed and keep it random at all times so enemies walk faster/slower whenever they want ? Now running is activated only when enemies are far.
Or do i have to give enemies risetime 1000 and then use script in their rise animation to adjust how long they wait until rise from the floor?
---
OK so far i have this in rise animation and it adds a lot IMO to overall feel, game feels more "real" and not so automatic and robotic cause each character gets up a bit sooner/later :) Also my risetime is 1000 cause more = faster
Code:
anim	rise
	loop	0
	offset	164 196
	bbox	0 0 0 0 0
	delay	25
      @script
    void self = getlocalvar("self");
    if( frame == 0){
      int r = rand()%30;
      if( r > 11){
        changeentityproperty(self, "animpos", 1);
      } else if( r < -10){
        changeentityproperty(self, "animpos", 2);
      } else if( r < 0){
        changeentityproperty(self, "animpos", 0);
      } else if( r > 0){
        changeentityproperty(self, "animpos", 3);
      }
    }
	@end_script
	frame	data/chars/zboj/fall6.gif
	frame	data/chars/zboj/fall6.gif
	frame	data/chars/zboj/fall6.gif
	frame	data/chars/zboj/fall6.gif
	offset	164 200
	delay	8
	frame	data/chars/zboj/rise1.gif
 
bWWd, I take it you want to add randomness to same enemies. I usually mix various enemies to give randomness in levels and patterns of enemies to beat.

Also is there some quick way to control enemies walking speed and keep it random at all times so enemies walk faster/slower whenever they want ?

There's scripted way but before that what actually you mean by "whenever"? you need to define when exactly script would be run.
 
If you only want random speed, you can just change "speed" property using script, for example, in walk or idle animation.

However, if the speed varies too much, you may need to consider edelay as well, otherwise you walk animation just looks strange.
 
edelay is for changing delay in frames ? I would like delay to be in sync with velocity so i use running now for faster walking.
I would have to take a look at final fight to see when enemies walk faster.
 
Ive seen this speed variation in streets of rage, usually when you turn your back on an enemy they walk frames are sped up, and when you face them they slow down. perhaps you can script that.
 
running for faster walking? but then all the enemies with the run animation will have the same "faster walking" isn't it?, instead of walking the same.

I really liked your thread, hope someone give a good solution for random behaviour.
 
they dont start running in the same time, sometimes enemies run when theyre close and sometimes when theyre far so it looks fine, also i give to all different type of enemies different walking speeds.
Biggest problem was with rise animation when they got up in the same time like robots.
 
Another problem is dropv. You may also want to do something in fall animations to randomize its velocity.

I was thinking about a weight property, but I'm not sure how it should be, so just script it.
 
that could break juggling and air combos a bit but would be nice if it would be available and bigger characters wouldnt fall as high compared to smaller ones.
 
thx, that weight property really wouldnt help because im trying to have my enemies to fall a bit different and its only a problem when the same enemies are hit in the same time so youve got 5 clones flying in the same manner, so weight would be the same for them unless weight would be something defined in stage not in characters header and still it wouldnt make that much of the difference.
When im watching AVPredator cps2 game then isee that human enemies have variable walking speed and its changing in realtime, speedsup and slowsdown while walking, how to do that effect and keep velocity changing as well ?
That variable walking speed makes enemies a bit more unpredictable and game is more challenging cause when you know how fast enemies are moving then you kinda know how much time you have and with enemies changing walking speed you must be careful at all times.
I also see that enemies tend to attack you from behind in final fight more often, they come around and attack even if they were closer to attack face to face
 
It would be cool if some parameter can be controlled by map on the level text. Let's say on the stage street.txt, the enemy
Code:
spawn cop1
map 3
coords 200 175
at 100
have different speed walking, and/or different fall value, and/or different rise anim, different run, and maybe also different idle/faint. This will make the same sprite based enemies more unique, without the need to create another enemy.
 
You know, if you don't like default AI, you could make your own enemy AI :). It's tough work so you need to make sure the result is significant.
Really, all the hard work making AI would be meaningless if player can just bash their way with running attack or other attack.

Personally, I rather play with 3D attacks, defense and enemy formation then playing with fall speed and risetime
 
yes but what you mentioned is technical stuff , my problem was just visual, i dont like when enemies stand up all in the same time, having some randomness makes them more alive, not so robotic.
 
Another problem is dropv. You may also want to do something in fall animations to randomize its velocity.

I`m interesting in this. I think it is possible to make onspawnscript that will assign a random antigravity property. For example: antigravity can be A and it can vary in +-10, it will be R. So you input A and R, in result you have A+R antigravity.
Is it possible to load several spawnscripts for one entity? I mean:
onspawnscript data/scripts/script1.c
onspawnscript data/scripts/script2.c
onspawnscript data/scripts/script3.c
in the header of enemy, and they will not rewrite each other?
 
Back
Top Bottom