wingdnosring
New Member
- Reaction score
- 16
Every weapon has a variable called WeaponVariation. The starting weapon (assault rifle) has a very high variation (1.7). When each bullet is created a random number between negative WeaponVariation and positive WeaponVariation is added to the height and moving angle of the bullet. So, in the case of the Assault Rifle, 1.7 WeaponVariation means that the final spread of the bullets is roughly 0-3.4 in a circle, which is a massive spread. That's more like something you'd see in a shotgun normally... On top of that, I put in a hipfire vs aiming check. Aiming only takes 40% of the WeaponVariation spread.
My other weapons have lower values. The Flamethrower actually has a variation of 0, which keeps a perfecly straight stream at all times.
As for your unit state idea, I already added that in for checking collision height. I add useless buffs to units when they enter certain states and then use 'unit has behavior' booleans to detect what fighting style their in. I haven't done anything with it yet beyond make people in cover more difficult to hit.
I created a quick and simple method of forcing enemies (and allies) into cover, but I've hit a snag. The whole thing relies on them using an ability (creatively named "Get Into Cover") on those blocks you see all over my map. They seem a little reluctant to actually do so though. I suspect its because the blocks are all hidden via triggers early on. I suppose it could be my apparent defficiency with the Data Editor too .
Anyway, I'm working on an alternate solution now...maybe just bypass Data Editor involvement altogether for getting enemies into cover. Hmmm...
I would like it if you could post some ideas you have regarding AI. At the moment, I'm keeping it really simple, but that's only because I don't know what I want my final AI to look like. The cover system that failed involved computer controlled units having chances to do things upon taking damage.
So they have a 25% chance upon taking damage of looking for nearby cover and running to it (there is a check in place so the cover will protect them from the nearest enemy). While in cover, they have a 12.5% chance upon taking damage of abandoning their current cover and relocating. Not ideal, but I just wanted to get it working before mucking about with details.
[Edit]: Alright, I tried to do as you said and created a timer that expires every 2-10 seconds. I then select all enemy units within X distance and change their states.
These are the current values:
Hiding In Cover - Halves the unit's collision height, but prevents them from attacking.
-60% chance to switch to Aiming in Cover
-30% chance to switch to Out of Cover States
Aiming in Cover - Returns the unit's collision height to normal and allows it to attack while locked onto cover.
-30% chance to switch to Hiding in Cover
-10% chance to switch to Out of Cover States
-The rest of the time a target is selected at random for the unit to fire at
Out of Cover States not defined yet.
Not bad, I guess, but I can't really test it because all of the enemies auto-attack. Is it possible to prevent units from attacking on their own? I really dislike resorting to pausing units :S.
My other weapons have lower values. The Flamethrower actually has a variation of 0, which keeps a perfecly straight stream at all times.
As for your unit state idea, I already added that in for checking collision height. I add useless buffs to units when they enter certain states and then use 'unit has behavior' booleans to detect what fighting style their in. I haven't done anything with it yet beyond make people in cover more difficult to hit.
I created a quick and simple method of forcing enemies (and allies) into cover, but I've hit a snag. The whole thing relies on them using an ability (creatively named "Get Into Cover") on those blocks you see all over my map. They seem a little reluctant to actually do so though. I suspect its because the blocks are all hidden via triggers early on. I suppose it could be my apparent defficiency with the Data Editor too .
Anyway, I'm working on an alternate solution now...maybe just bypass Data Editor involvement altogether for getting enemies into cover. Hmmm...
I would like it if you could post some ideas you have regarding AI. At the moment, I'm keeping it really simple, but that's only because I don't know what I want my final AI to look like. The cover system that failed involved computer controlled units having chances to do things upon taking damage.
So they have a 25% chance upon taking damage of looking for nearby cover and running to it (there is a check in place so the cover will protect them from the nearest enemy). While in cover, they have a 12.5% chance upon taking damage of abandoning their current cover and relocating. Not ideal, but I just wanted to get it working before mucking about with details.
[Edit]: Alright, I tried to do as you said and created a timer that expires every 2-10 seconds. I then select all enemy units within X distance and change their states.
These are the current values:
Hiding In Cover - Halves the unit's collision height, but prevents them from attacking.
-60% chance to switch to Aiming in Cover
-30% chance to switch to Out of Cover States
Aiming in Cover - Returns the unit's collision height to normal and allows it to attack while locked onto cover.
-30% chance to switch to Hiding in Cover
-10% chance to switch to Out of Cover States
-The rest of the time a target is selected at random for the unit to fire at
Out of Cover States not defined yet.
Not bad, I guess, but I can't really test it because all of the enemies auto-attack. Is it possible to prevent units from attacking on their own? I really dislike resorting to pausing units :S.