Game tricks

Blitz3D Forums/Blitz3D Programming/Game tricks

Kryzon(Posted 2010) [#1]
Just thought I'd share a little realization I had when playing Kirby 64 - The Crystal Shards in some emulator.

I really like playing games in this emulator because from the Wireframe mode to the special hardware flags and cheats that you can set up (even bugs like camera positions and field-of-views), you can really see the innards of those games and how they were made.

Here's a quick video showing some stairs in Kirby 64. Take a good look at the character's shadow:

Kiryby64_CollisionMesh.avi - 2.6MB

The placing of the shadow must have taken into consideration the invisible collision-mesh.
The main reason I can think that they'd put such a slope on these stairs would be to make a smoother motion through the steps - if there were no slopes, you'd see the character snapping when getting on top of each step (or being completely blocked by their height).

If I find other interesting techniques (not from this game but from others as well), I'll try to record them so we can see things in action.
Thanks for reading.

Last edited 2011


BlitzSupport(Posted 2010) [#2]
I saw a Nintendo patent a few years ago where they defined a method of using simplified character meshes as the character moves faster and faster -- sort of 'speed-based level of detail'. It might be interesting to see (via wireframe/changing camera placement) if they actually put this to use -- I think it was intended for Super Mario 64.


Kryzon(Posted 2010) [#3]
Hi,

well, so far I've noticed Banjo-Kazooie's simple LOD, based on the camera distance to the protagonist:



When the camera is farther away from the main character you can notice a slight change on the "topology" (it's easier to notice by looking at the model's heels).


Vorderman(Posted 2010) [#4]
Such tricks are really common - for Rollcage the track renderer that we had would dynamically cut the polycount down as the track was drawn into the distance, in some cases leading to huge seams in the ground where 2 angled polys would be reduced into a single flat one - we had to be really careful how we designed the tracks to try and avoid such issues, or else just place some scenery object over the problem :)

Drive around some of the tracks in reverse and there are just problems and popup all over the place...

Also the LODs for the vehicles in the distance were incredibly simple, in some cases just a couple of tris, because on-screen they only covered a few pixels.

I can remember putting in huge bodged collision blockers to prevent the vehicles jumping out of the tracks into buildings where they shouldn't have gone, because the collision systems were so simplistic and couldn't cope with the car landing on stuff.

We also had some really nasty AI hacks on some of the racing games I've worked on, where AI vehicles that dropped too far behind would totally ignore physics and collision and just zoom straight towards the player to catch up - it looked terrible if you happened to catch a glimpse of their markers on the radar as they did this...

The amount of dodgy stuff that goes on behind the scenes is just staggering!

IIRC the sea level in Wheelman (you can get right up to the water at various points across the lower edge of the map) is actually at different levels in different places, because level design would put a big hill in somewhere without thinking that sea level was now 100m lower..you don't notice when playing, but a quick zoom around in the Unreal editor revealed all sorts of nasty stuff...


_PJ_(Posted 2010) [#5]
You worked on ROllcage, Vorderman? That was a lot of fun for me and my friends way back when... 2-player on the PS1 :)

Anywhoo - LOD techniques are really handy because of course you want to be able to show really nice, detailed and smooth models up-close, but when there's a lot of them, and further away, it's crippling for the processing.

An example that seems to work flawlessly is that used in the Total War games, the meshes are cut right down and finally dissappear to sprites at extreme range, but up close, fine texturing, animation and light effects are all displayed in all their glory.

I suppose there's a toss-up along the way between the processing time/power used to effect the LOD transitions and how many levels of detail you may need, but certainly in general doing some tricks in the right circumstance will really make things smoother.

I've been toying with simple ideas by replacing 3D meshes with simpler sprites at long range, but of course it all very much depends on the circumstances. Some methods (i.e. maybe just swapping for a lower-poly mesh) will work better in some circumstances than others.


Kryzon(Posted 2011) [#6]
Hi,
another realization.

This is in Rayman 2 - The Great Escape (also for the N64), a game which still amazes me to this day with its looks.
I've noticed that instead of dynamic lighting, this game uses 'zones' that dictate the way the main character is tinted.
Despite the change in lighting being very sudden (going from one zone to the other) we don't end up noticing this sharp transition.
Here are the images:


The camera is fixed in this position while the character walks around this room. When closer to the foreground, the character has a reddish tint, and you can see he blends with the foreground surroundings.


When I walk slightly back, he penetrates another 'lighting zone' and thus gets tinted with another color. This time, notice how he blends in with the background (which is where you are supposed to head to).
If you use a tabbed brower, open each image into different tabs and keep alternating between them to see the difference better (they are hyperlinked for this reason).

There are more extreme cases throughout the game where the character is in a dark room and heads towards an open area - from a dark tint he goes to a normal one.
This is a good way to avoid having to dynamically change the place of your fixed-function lights - you bake the lighting onto your character's mesh per-zone with LightMesh() or use a direct light that is linked to your character and moves with him, changing color depending on the zone (the latter might be a better solution to avoid having statically-lit vertices in animated characters).
The torches do have a point light that smoothly lights the main character depending on the distance, but these are very scarce through the levels and other characters and objects aren't influenced by it (notice the barrel - that brown object near the torch - it's right next to it but completely dark).

This is also interesting to help us realize that even sharp changes to color like these can go unnoticed in the middle of the game, but still help greatly with immersion (the character really looks like is part of a certain room or environment).


Adam Novagen(Posted 2011) [#7]
Banjo-Kazooie actually uses that exact same lighting method; I noticed it while playing it on my actual N64 a coupla weeks ago. Apparently our brains just don't notice it under normal circumstances, and instead interpret it as the character walking out from under a shadow or some such. Didn't know about the LOD, though.

Speaking of which, that's still being done even by modern games like TrackMania Nations Forever; if you set the track geometry to "Fast," the individual track segments will toggle through at least three different LOD meshes that I've been able to spot. Visual trickery is a wunnerful thing, innit? Oh, and unless I'm mistaken, Banjo-Kazooie also uses LOD tricks with the textures and mesh for the "surroundings" scenery, you know, the stuff that usually makes up the cliff walls or whatever's around the levels.


Who was John Galt?(Posted 2011) [#8]
Interesting topic!

Game trainers such as this (excellent) free one search for patterns of changes in a variable to figure out where the variable is stored. They are very easy to use and generally are used to hack something like lives, however you can try it with any old variable and they can be used to hijack stuff like camera position. Could be useful if you really want to investigate the seams of a game.
http://memoryhacking.com/


Kryzon(Posted 2011) [#9]
I was looking for something like that. So far I only knew the Cheat Engine, which I believe does something similar if not the same. The FAQ for the cheat-engine at least is very worth the read!

If someone discovers more interesting optimizations or game elements used in a smart way, don't hesitate to share.

Last edited 2011


Kryzon(Posted 2012) [#10]
The subject of transitions recently came up, and just for the sake of posterity I re-uploaded some of my old demos.

Here they are:


http://blitzbasic.com/Community/posts.php?topic=85924#1123946




http://blitzbasic.com/Community/posts.php?topic=85480



Guy Fawkes(Posted 2012) [#11]
RAYMAN! I LOVE THAT GAME! O_O =D