[Project] Third Person Shooter

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.
 

onisagi

New Member
Reaction score
6
Well... you can disable abilities using triggers. Just disable "Attack" xD and add it back in wen yu need it. Hope that works...
 

wingdnosring

New Member
Reaction score
16
Good idea. I'm trying to fix the pitch angle of beam weaponry that's been bugging me for so long.

This is what I have so far:

Code:
General - If (Conditions) then do (Actions) else do (Actions)
If
   CurrentWeapon[BulletCreationLoopPlay] == 3
Then
   UI - Display "attached" and play Marine_DeathFXSilentKill for (All players)
   Actor - Attach SPR Missile Actor Beam Attachment to Center on (Picked unit)
   Actor - Send message (SetRotation (Cos((Camera Pitch of Player(BulletCreationLoopPlay)))) (Sin((Camera Pitch of Player(BulletCreationLoopPlay)))) (Sin((Camera Pitch of Player(BulletCreationLoopPlay)))) (Cos((Camera Pitch of Player(BulletCreationLoopPlay)))) (Sin((Camera Pitch to actor (Last created actor)
Else

I run that just after creating a beam missile. But nothing shows up :(. I tried attaching it to my shooter with each attack instead and it worked fine.

Is it possible you can't attach actors to units too soon after they've been created?

[Edit]: That disabling ability suggestion did the trick for the AI ;).
 

tom_mai78101

The Helper Connoisseur / Ex-MineCraft Host
Staff member
Reaction score
1,681
There are some things I might have not known yet so far:

There seems to be some offset misalignment or something. Is this normal?
thirdpersonshooterbug1.jpg
What is this one? (The numbers the red arrow is pointing at)
thirdpersonshooterunkno.jpg

Some divide by zero errors.
thirdpersonshooterbug3.jpg
thirdpersonshooterbug2.jpg
 

SerraAvenger

Cuz I can
Reaction score
234
Are you using the Atan somewhere? Please look if you can replace it with an Atan function that uses two parameters. Normally those are called "Atan2"
 

wingdnosring

New Member
Reaction score
16
The offset is intentional, it's just a style thing. It also makes it easier to see what's in front of you if your character isn't in the way.

Ignore the messages on the side, they were an error check I was using just before release that I forgot to remove.

I am aware of the divide by zero issues, but thank you for posting them anyway. The next version will have a fix in place.
 

SerraAvenger

Cuz I can
Reaction score
234
For which problem? :confused:

Divide by zero.


@dnos:
I have seen you're using Custom Values of units.
You should look at my UnitIndexing and SerraUnitIndexing libraries. Using Custom Values statically can mess up compatibility. Just imagine someone different uses the same indicies - and SWOOSH your stuff gets overwritten and no longer works.
Unit indexers prevent that. Since SC2 allows multiple custom values per unit, you can just allocate a couple of custom values and use them as indicies for the Custom Value functions. As long as others use the same system, you'll be fine.
 

onisagi

New Member
Reaction score
6
so what you're saying is... he'll still have the same problem with using custom values, just to a lesser degree using your library? Wouldn't it be easier for him to just use custom values of an arbitrary range and state that those custom values shouldn't be used when using his system? Like say custom values 100-110 are used for internal code and should be avoided within your maps.

Then he'll never run the risk of overwritting anything, even index numbers.

But your indexing system sounds interesting. I'll take a look at it.
 

SerraAvenger

Cuz I can
Reaction score
234
so what you're saying is... he'll still have the same problem with using custom values, just to a lesser degree using your library?

No, I say that if everyone used my library (or a similar) there wouldn't be any problems.

Like say custom values 100-110 are used for internal code and should be avoided within your maps.
The thing is that multiple systems might do what you're saying, and their custom value ranges might collide.
My library allocates them dynamically, such that no collision is possible.
He simply has to do something like
Code:
int MyCustomValue = Allocate Unique Custom Value

...

Set Custom Value MyCustomValue of ... to ...

But your indexing system sounds interesting. I'll take a look at it.
Thanks for the interest, but it is very simple indeed.
 

wingdnosring

New Member
Reaction score
16
I was encountering that very issue, where custom values were getting wiped out seemingly at random. Because of this, in version six I've lessoned my reliance on them. Very few custom values are used now. I wish I'd looked at your indexing library beforehand.
 

onisagi

New Member
Reaction score
6
use the find command (ctrl+f) and look for all instances where you change custom values, you mite be able to find what's going on.
 

SerraAvenger

Cuz I can
Reaction score
234
I was encountering that very issue, where custom values were getting wiped out seemingly at random. Because of this, in version six I've lessoned my reliance on them. Very few custom values are used now. I wish I'd looked at your indexing library beforehand.

I didn't make this system before I saw you used them.

If they are getting wiped like that, it might be another issue within galaxy itself. I don't know.
 

wingdnosring

New Member
Reaction score
16
Has anybody else noticed that ctrl+f seems to crash the editor? It was the same in warcraft's too...

I'm pretty sure you can only have a certain number of custom values at any one time. Once you exceed the limit, it wipes out old ones. Or something like that...I'm not sure. Anyway, I only use custom values for one reason now: remembering which units are using what weapons, since I don't want a new variable for every weapon being used on the map. I can't believe there are no variables to store weapons. :S
 

SerraAvenger

Cuz I can
Reaction score
234
Has anybody else noticed that ctrl+f seems to crash the editor? It was the same in warcraft's too...

I'm pretty sure you can only have a certain number of custom values at any one time. Once you exceed the limit, it wipes out old ones. Or something like that...I'm not sure. Anyway, I only use custom values for one reason now: remembering which units are using what weapons, since I don't want a new variable for every weapon being used on the map. I can't believe there are no variables to store weapons. :S

In that case, you should use GetUnitIndex instead of relying on custom values.
 

wingdnosring

New Member
Reaction score
16
I am so tired of messing with these grenades. I'm definitely starting to see that a parabola was just not the way to go.

If anybody could create a trigger that I could then copy into my map (and please explain the variables for me?) that coincides with onisagi's original vision a couple pages back, I would be extremely grateful. Grenades are pretty much useless as they are now, and attempting to mess with the values is getting me nowhere.

[Edit]: I've managed to angle beam missiles correctly, but once they move they reset themselves to normal angles. It's really irritating. I tried attaching actors to the missiles and altering those, but even attached actors seem to reset angles upon their parent unit moving.
 

onisagi

New Member
Reaction score
6
I'll see if i can implement that grenade thing i mentioned before into a test map i made yesterday. The traceline function i showed you from that tutorial actually works pretty well, and theoretically you can also apply different size bounding boxes to different areas on each unit. I'm working on making it more robust, but i can start work on the grenade thing first.

for your beams, make sure to add in something that changes ther facing angle to the point where they're heading to.
 

wingdnosring

New Member
Reaction score
16
I can change the facing angle to anything I wish, the problem is that when the missiles are told to move, they snap back to their default angle again, as do all their attachments. I wish there was just a normal projectile model with a really long-lasting particle trail...that would be so much easier.

Thanks for working on the grenade thing, I really appreciate it.

I'm also trying to find a way for this line to more accurately represent the height of bullets:

Code:
Unit - Change (Unit BurstLoopPlay from BurstGroupPlay) height to (((Ground height at Bullet_Temp_Creation_Point_Play) + (0.6 + BulletHeightTempPlay)) + (((WeaponBulletSpeed[CurrentWeapon[BulletCreationLoopPlay]] * 83.3) * (0.0 - (Sin((Camera Pitch of Player(BulletCreationLoopPlay)))))) / (Sin((91.0 - (Camera Pitch of P over 5.0 seconds

Yeah...it's kinda long. Anyway, it basically uses the law of sines as I had mentinoed using before. It takes the bullet speed of the users current weapon and multiplies it by 83.3 for the distance covered by one side of the bullet trajectory. Then it uses the law of sines to figure out the height the bullet needs to reach in 5 seconds. Most bullets don't actually last 5 seconds, but that's alright.

Now, my issue with it is that it only seems to work if my bullet speed is less than 1.5. Any more than 1.5 and the bullets tend to arc waaaay up in the air or way down. I'm not sure why it would work for 1.5 OR LESS, yet not more...weird.

[Edit]: I just tried a little experiment. I took a beam model and attached it to a normal unit that I put in the middle of nowhere. The beam shows up, but it never angles at all. All it does is angle the particle facing, rather than the actual beam itself. I suspect an actor event of some sort dictates where the beam needs to hit at the start of each attack. If I knew which event it was, I could simply alter it via triggers, but at the moment I have no idea which actor event I'm looking for. Anybody know enough about the data editor yet to help me solve this problem?
 

onisagi

New Member
Reaction score
6
so wut are yu doing exactly? are yu using an effect that launches a missile? you need to tweak the mover, i believe. Data editor is just too much information for me to process and memorize for now...

So.... i wrote the trigger for ya, well i was bound to make it anyways for my survival map.

At the end of the trigger, when the grenade unit hits the floor it creates an effect at the point. I modified siege tank siege mode cannon damage to use for the grenade. The modified effect has double the damage radius, and 200 damage. I also removed the shooting effect that comes out of the barrel of your gun (aka Launch Model,etc), and only kept the big blast at impact point. So you'll need to duplicate/make an "effect" like this to be used by the trigger.

I realized something when testing the trigger and fine tuning its trajectory... that its vertical flying angle (pitch) is abnormally high compared to its horizontal velocities, in my trigger i just divided the resultant velocity in the Z direction (upwards) in half, and it doesn't look as bad now. But i realized this is because my algorithm from page 2 is retarded math... i need to figure out a better way to calculate component vectors.
 

xxxtrickyxxx

(o Y o)
Reaction score
64
I haven't really looked past the first and last page of this forum but upon playing the map did you state any reason for the position of the camera and how the unit was shifted to the side?

Wouldn't something simpler like this work better? I just ripped out my simple third person camera I made for a map that I set aside until further news if the lag issue will be fixed because arrow keys are worse than wc3 online. Anyway, just run around with WASD and mouse and shift to sprint. I took out everything else so you can just set it to any unit.

http://www.hiveworkshop.com/forums/pastebin_data/qq1811/_files/Project_00.SC2Map
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top