Jump to content
IGNORED

More Impressive 3D Engine: Rebellion vs. ID


Schmudde

Recommended Posts

I haven't really played AVP, so I am merely curious - is the Alien behaviour different from Marine in terms of AI ? Does Alien crawl over walls and ceiling (as in the PC version) ? If not, then they must use the same pathfinding routines - thus the CPU performance cost of their movement is identical.

However, every single characteristics that is different (meaning, if one entity has more types of behaviour than the other one) will affect framerate.

 

What kind of a pathfinding do the Alien/Marine have ? How far can they track you across the level ? Proper pathfinding on a 68000 is very expensive...

 

Aliens just use a basic/linear chase when in proximity 'routine' (as you call it, I'm not a programmer). Basically, when you enter the proximity of their line of sight, they will give chase - without remorse. Aliens also only have one dimension and cannot be approached or seen in any other dimension aside "face on".

 

However, by comparison, the Marines are constantly active/self-automated and do perimeter patrols of rooms/areas, whereas the Aliens simply lie there waiting, until you appear. They also have 4 different dimensions to them (front, rear, left & right).

 

Also, Marines are susceptible to reacting differently whilst using the Predator - depending on if you are using the cloak or not. Nothing overly technical, however, their ability to detect you and their proximity to do so is lessened considerably. If you get to close, or bump into a Marine whilst cloaked, the Marine will detect you and then gun for you.

 

The Marines definitely more complex than either the Aliens or Predators...

Link to comment
Share on other sites

 

Aliens just use a basic/linear chase when in proximity 'routine' (as you call it, I'm not a programmer). Basically, when you enter the proximity of their line of sight, they will give chase - without remorse. Aliens also only have one dimension and cannot be approached or seen in any other dimension aside "face on".

 

However, by comparison, the Marines are constantly active/self-automated and do perimeter patrols of rooms/areas, whereas the Aliens simply lie there waiting, until you appear. They also have 4 different dimensions to them (front, rear, left & right).

 

Also, Marines are susceptible to reacting differently whilst using the Predator - depending on if you are using the cloak or not. Nothing overly technical, however, their ability to detect you and their proximity to do so is lessened considerably. If you get to close, or bump into a Marine whilst cloaked, the Marine will detect you and then gun for you.

 

The Marines definitely more complex than either the Aliens or Predators...

Thanks a lot for the explanation. Looks like - from the CPU perspective - there is at least an order of magnitude more workload when processing the AI for Marines.

 

Aliens:

Only a single condition has to be performed each processing frame - if (DistanceToPlayer < InactiveDistance) StartMovingTowardsPlayer ();

Note, that this does not even have to performed each rendering frame - say if game runs at 30 fps, it may be enough to do every 10th or 15th frame - e.g. 2-3 times per second.

 

Whereas for the Marines - you are looking into state machine of multiple states:

for each Marine in ActiveMarines

if (Marine.CurrentStatus != Status.Dead

{

....Waypoint = Marine.WaypointList [indexOfCurrentWaypoint];

....{

........if (Marine.CurrentStatus == Status.OnPatrol)

........{

........Marine.CurrentPosition = GetCurrentPosBetweenWaypoints (CurrentTime, Waypoint.Start, Waypoint.End)

........if (CurrentTime >= Waypoint.EndTime) IndexOfCurrentWaypoint++;

........if (IndexOfCurrentWaypoint >= WaypointList.Count) IndexOfCurrentWaypoint = 0;

........Marine.CurrentAngle = CalculateAngle (Waypoint.Start, Waypoint.End)

........for each Alien in ActiveAliens

........{

............if (Distance (Marine.CurrentPosition, Alien.CurrentPosition) <= Marine.PursuitDistance) CurrentStatus = Status.InPursuit;

........}

........}

 

........if (Marine.CurrentStatus == Status.InPursuit)

........{

..........if (Distance (Marine.CurrentPosition, Alien.CurrentPosition) <= Marine.AttackDistance) CurrentStatus = Status.InAttack;

..........else Marine.CurrentPosition = GetCurrentPos (CurrentTime, Marine.CurrentPosition, Alien.CurrentPosition)

........}

 

........if (Marine.CurrentStatus == Status.InAttack)

........{

..........if (Distance (Marine.CurrentPosition, Alien.CurrentPosition) <= Marine.AttackDistance) Alien.HP -= DamageFromMarineToAlien;

..........if (Alien.HP <= 0) Alien.Status = Status.InProcessOfDying;

........}

 

........if (Marine.CurrentStatus == Status.InProcessOfDying)

........{

..........if (CurrentTime >= Marine.PlannedTimeOfDeath) CurrentStatus = Status.Dead;

........}

....}

}

 

And this is just a rough quick outline of few basic states. In reality, there would have to be a bit more syncing with regards to current frame, current frame's timing and last update's timing.

Of course, you need to be smart about updating the list of CurrentMarines and CurrentAliens - since you do not want to process all of aliens/marines in current level.

And add to that the fact, that you want only certain portions of the above code to run only on very specific frames - since you do now want everything to run at every frame, or the CPU will just get overloaded with the AI...

 

Few of those states (inProcessOfDying, Dead, InPursuit) would apply to Aliens too, of course...

Edited by VladR
Link to comment
Share on other sites

Weird? So the Jaguar games are all written in C? What are the dots for... is that just to eliminate white-space, or did you do it to show indention between the begin / ends and nested if statements?

Of course, they are not. But C is pretty high-level that if you name variables and functions properly then it almost reads as an English language.

 

Now imagine if I wrote the above code in Assembler and filled 10 screens. The above pseudo-code should be relatively obvious even to a non-coder. With ASM - definitely not.

 

The above code was just a pseudo-code, anyway - just to illustrate the high-level cost of the AI between Aliens and Marines ( based on description I received above) . The dots had to be used, since the code tag did not work for some reason today. Well, thinking about it it barely does, actually....

  • Like 1
Link to comment
Share on other sites

Of course, they are not. But C is pretty high-level that if you name variables and functions properly then it almost reads as an English language.

 

Now imagine if I wrote the above code in Assembler and filled 10 screens. The above pseudo-code should be relatively obvious even to a non-coder. With ASM - definitely not.

 

The above code was just a pseudo-code, anyway - just to illustrate the high-level cost of the AI between Aliens and Marines ( based on description I received above) . The dots had to be used, since the code tag did not work for some reason today. Well, thinking about it it barely does, actually....

 

 

Sorry, I didn't realize it was pseudo-code. I was just cruising through the thread and saw what looked like basic C.

Link to comment
Share on other sites

The AvP source code is available.

 

Thanks a lot for the explanation. Looks like - from the CPU perspective - there is at least an order of magnitude more workload when processing the AI for Marines.

 

Aliens:

Only a single condition has to be performed each processing frame - if (DistanceToPlayer < InactiveDistance) StartMovingTowardsPlayer ();

Note, that this does not even have to performed each rendering frame - say if game runs at 30 fps, it may be enough to do every 10th or 15th frame - e.g. 2-3 times per second.

 

Whereas for the Marines - you are looking into state machine of multiple states:

for each Marine in ActiveMarines

if (Marine.CurrentStatus != Status.Dead

{

....Waypoint = Marine.WaypointList [indexOfCurrentWaypoint];

....{

........if (Marine.CurrentStatus == Status.OnPatrol)

........{

........Marine.CurrentPosition = GetCurrentPosBetweenWaypoints (CurrentTime, Waypoint.Start, Waypoint.End)

........if (CurrentTime >= Waypoint.EndTime) IndexOfCurrentWaypoint++;

........if (IndexOfCurrentWaypoint >= WaypointList.Count) IndexOfCurrentWaypoint = 0;

........Marine.CurrentAngle = CalculateAngle (Waypoint.Start, Waypoint.End)

........for each Alien in ActiveAliens

........{

............if (Distance (Marine.CurrentPosition, Alien.CurrentPosition) <= Marine.PursuitDistance) CurrentStatus = Status.InPursuit;

........}

........}

 

........if (Marine.CurrentStatus == Status.InPursuit)

........{

..........if (Distance (Marine.CurrentPosition, Alien.CurrentPosition) <= Marine.AttackDistance) CurrentStatus = Status.InAttack;

..........else Marine.CurrentPosition = GetCurrentPos (CurrentTime, Marine.CurrentPosition, Alien.CurrentPosition)

........}

 

........if (Marine.CurrentStatus == Status.InAttack)

........{

..........if (Distance (Marine.CurrentPosition, Alien.CurrentPosition) <= Marine.AttackDistance) Alien.HP -= DamageFromMarineToAlien;

..........if (Alien.HP <= 0) Alien.Status = Status.InProcessOfDying;

........}

 

........if (Marine.CurrentStatus == Status.InProcessOfDying)

........{

..........if (CurrentTime >= Marine.PlannedTimeOfDeath) CurrentStatus = Status.Dead;

........}

....}

}

 

And this is just a rough quick outline of few basic states. In reality, there would have to be a bit more syncing with regards to current frame, current frame's timing and last update's timing.

Of course, you need to be smart about updating the list of CurrentMarines and CurrentAliens - since you do not want to process all of aliens/marines in current level.

And add to that the fact, that you want only certain portions of the above code to run only on very specific frames - since you do now want everything to run at every frame, or the CPU will just get overloaded with the AI...

 

Few of those states (inProcessOfDying, Dead, InPursuit) would apply to Aliens too, of course...

Link to comment
Share on other sites

Aliens just use a basic/linear chase when in proximity 'routine' (as you call it, I'm not a programmer). Basically, when you enter the proximity of their line of sight, they will give chase - without remorse.

Well you're half right. Based on interviews around the time AvP was released, it's generally believed that every Alien on a level is trying to move toward the player at all times, with no range or line-of-sight checking. This is why the frame rate gradually improves as you clear out a level, because the AI processing time decreases linearly with the number of Aliens present.

 

The reason this unbounded behavior doesn't result in the player being utterly swamped is of course because of the bare-bones movement algorithm they use. There is no attempt to pathfind around obstacles, so they'll easily get stuck in their part of the level.

 

It's basically two very dumb systems that, in combination, create the emergent illusion of more sophisticated behavior.

 

 

The AvP source code is available.

The 1999 PC AvP source code is available. If the 1995 Jaguar version's source code was ever released, I can find no evidence of it.

Link to comment
Share on other sites

It's on the Jaguar Source Code Collection CD from JSII.

How the hell has a resource like that faded into utter obscurity? Googling for "Jaguar Source Code Collection" yields one YouTube video, an AtariAge thread from six years ago, and then a bunch of warez and link farm sites.

Link to comment
Share on other sites

How the hell has a resource like that faded into utter obscurity? Googling for "Jaguar Source Code Collection" yields one YouTube video, an AtariAge thread from six years ago, and then a bunch of warez and link farm sites.

 

Yeah, it's bizarre how something like that happens. I bought mine a few years ago, and now you can't even find an article on it. It's got all kinds of Jaguar awesomeness on it. The high-lights include AvP, Tempest 2K, and VLM.

Link to comment
Share on other sites

Surely thats enough time to learn how to do it?

Obviously, and I would have too if that was the ONLY thing I've been wanting to do. However, given the minimum level of technical knowledge required to dig into the AvP ROM, find both the graphics data and the algorithm to decode it (apparently a proprietary JPEG variant), then modify or re-implement the algorithm to dump raw image files to disk... the return on investment for time spent learning all that would be fairly dismal. It would be faster for me to manually reconstruct all the textures from screen captures.

Link to comment
Share on other sites

So now that the source is distributed, what's the analysis? Is ZB correct?

 

Oh my god stop talking what you're saying is completely idiotic. The gameplay as an Alien seems smoother for two reasons:

1. The Alien has a much higher turn and movement speed (you turn/move more per frame), so the low frame rate is less apparent.
2. In the Alien campaign the levels have a much lower AI density. As a Marine, every level is packed with Aliens trying to move toward you at all times, while as an Alien, the levels are lightly populated with Marines who patrol randomly. So the renderer does actually get to run a bit faster, on average, under the Alien campaign.

This ignorant nonsense about Rebellion setting a different frame rate for each character has been kicking around since AvP was released, spread by people who don't know anything about programming. Remember how people used to say that the asteroids in 2600 Asteroids flicker because of bank switching? This is exactly that kind of technical cluelessness.

Link to comment
Share on other sites

I took a quick skim through the AI routines (AMP.S) and it appears the popular belief wasn't entirely correct on at least one count-- it does seem there is a maximum distance from the player beyond which enemy AIs aren't active.

 

*************************************************
*						*
* Sleep Handler					*
*						*
*************************************************

; if the creature is "sleep_distance" away then put it to sleep to save processor time

sleep_distance	equ	128*9				; squares


sleep:		move.l	#sleep_distance,d7
		jsr	range_player
		tst.w	amp_proxflag
		bne	.nosleep
		rts
Looks like maybe AIs are only active within 9 squares of the player?

 

And here are all the weapon damage values. Neat!

alien_damage	equ	10			;10 points damage when hit by alien in close fighting
predator_damage	equ	10			;10 points when hit by predator in close fighting
fire_damage	equ	25			;20 points damage from a fireball
xfire_damage	equ	10			;20 points damage from a fireball
bolt_damage	equ	100			;20 points damage from a predator laser bolt
disc_damage	equ	50			;20 points damage when hit by a predator disc
bullet_damage	equ	100			;10 points damage when hit by a marine bullet
Funny how the comments don't match the actual damage values. Edited by ZylonBane
  • Like 1
Link to comment
Share on other sites

I took a quick skim through the AI routines (AMP.S) and it appears the popular belief wasn't entirely correct on at least one count-- it does seem there is a maximum distance from the player beyond which enemy AIs aren't active.

 

Looks like maybe AIs are only active within 9 squares of the player?

 

So I was about half-right with my assumption then re: proximity triggered...?

Link to comment
Share on other sites

  • 1 month later...

I loved AVP, from a visual point of view and going from that to Alien Trilogy on Playstation 1 (Which Mean Machines claimed was going to make Jag AVP look like the wizzard of Oz, based on CGI rendered cutscreen shots...), with it's block face huggers, Aliens milling about like sheep etc, i often feel the need to 'defend' what Rebellion achived with AVP, espically as it seemed the fashion to 'bash' Rebellion in the press soon after.

 

C+VG's Skyhammer review (Tom Guise) claiming it looked like a weaker 32X title, AVP looked much better (yet AVP was'nt allowing you same degrees of movement etc was it? and caption text went again'st review text as it said it had impressive textured 3D for the machine, game was entertaining, review said game was average etc).

 

I'd of liked to have seen just how far Rebellion could of pushed the Jaguar, espically with further optimised code on their engine, plus using Jaguar CD.

 

Would of loved to have seen how Legions Of The Undead turned out.

Link to comment
Share on other sites

As a Jaguar owner at the time, it was bloody frustrating to see how the (UK) press at the time seemed to have 'turned' on the Jaguar, in terms of unrealistic expectations from 3D engines running on it, sure Atari's marketing of the '64-bit' aspect put it straight in the firing line, but reviewers seemed to over-look fact Jaguar was designed as a powerful, 2D console with 3D abilities geared up towards plain polygons, limited texture-mapping etc, Playstation by comparison seemed designed to shift high number of texture-mapped polygons, at expense of 2D abilities.

 

Iron Solider also fell foul of C+VG who compared it to 32X Metal Head seemingly based on visuals 1st (yes Metal Head did look better, but was a weaker Mech game for myself) and who said there was'nt a single element to make you sit up and say wow, espically for a 64-bit machine.

 

 

It did seem unless your hardware was producing games with then cutting edge 3D engines, 1000's of texture-mapped, light sourced polys, you were in for a rough ride.

Link to comment
Share on other sites

Might be worth noting that when Rebellion approached Atari to do AVP they'd had limited experience in the gaming industry, Jason Kingsley had a degree in Zoology, written a few childrens books, worked as camera assistant on Killer music video, done games like Blade Warrior, Murder, Better Dead Than Alien, Hunt For Red October, etc and were at that point just a team of 6 people and a 3D demo for Atari, all working from a basement, it was'nt until the AVP deal was secured they set up the company itself.

 

They admit they and the team were inexperienced and they'd never built a game like this before and it was they who convinced Atari to do AVP as a FPS (Atari wanted a straight forward 2D scrolling beat-em-up) and that they could do a 2.5D ray traced FPS with texture-mapping, 16 bit photographic textures etc and they had no help from the movie companies.

 

I've respect for them for convincing Atari to go the 3D route for Jaguar AVP, rather than what could of been had Atari gone with it's thinking and gone 2D.

Link to comment
Share on other sites

Trust me, i'd love to be able to edit my posts, but having an utter nightmare with BT, taken 4 weeks and over 7 hrs (i kid you not) of phone calls just to get an Open Reach Engineer out here to confirm there's nothing wrong with phone line in the house, yet myself and many others exp.major broadband issues.

 

It'll let me read, but not sign in using Internet Explorer, so i'm having to resort to an outdated mobile phone browser, which won't let me edit posts on here.It's very frustrating...

 

BT are worse than Talk Talk for (poor) customer service.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...