Top
Best
New

Posted by sklopec 7 hours ago

Making Graphics Like it's 1993(staniks.github.io)
553 points | 88 comments
Teslazar 33 minutes ago|
Great article. I particularly enjoyed the approach to creating gibs. Although it was a tech demo, I created something like this around the mid 90s. One thing I did that I don't see mentioned in this article was I used 8x8 (or 16x16) light maps on the textures, which allowed me to easily have things like flickering torches and rockets that lit up the hallways as they shot down them. Lightmaps can also be used to "bake in" lighting if desired. Since the light map is "only" 8x8 you can afford to do some math on each luxel (each unit in the light map) to calculate distance and line of sight to light sources to determine a brightness value. When rendering the texture, the luxel was used with a lookup table to determine the actual color of the pixel being drawn. The light maps were updated 15 times a second if I recall correctly to help performance. Thanks to DJGPP, I was using inline assembly for the rendering. Since floating point math was slow at the time I used fixed point math which optimized well. The rendering was surprisingly performant on computers of the day.
pragma_x 9 minutes ago|
> I used fixed point math which optimized well.

I feel like the idea of fixed-point is under-utilized and very under appreciated. There are loads of applications where this is a better choice, let alone more performant.

corysama 3 hours ago||
If you want to play with software rendering, here's probably the shortest code that will get an ARGB8888 2D array from main memory to the screen efficiently for all platforms using SDL2 in C https://gist.github.com/CoryBloyd/6725bb78323bb1157ff8d4175d... you'll need to do the translation from a 320x200x8-bit palletized framebuffer to ARGB yourself ;)

If you want to get inspired by what can be done with palletized framebuffers check out http://www.effectgames.com/demos/canvascycle/ (click Show Options) and the GDC presentation by the artist https://youtu.be/aMcJ1Jvtef0

With that you can fire up https://github.com/mriale/PyDPainter for that classic Deluxe Paint IIe vibe. Or, https://www.aseprite.org/ for something more modern.

ferguess_k 1 hour ago||
I find the most interesting things are the internal tools -- like the Python script to generate the gib animation, or the other Python script to generate 2D spritesheet from Blender. OP is definitely a 10x engineer who can also do good arts. This is very rare IMO. I'm very surprised to find that OP has consistent art direction.
kridsdale1 1 hour ago|
It seemed, as a fan of the genre in the 90s, like these Renaissance Engineers were behind every major hit. I remember some of their names, they are true artists.

I have no idea the names of nearly anyone but a CEO or lead Director in the games industry of the past 15 years.

ferguess_k 1 hour ago||
As a side note, I checked OP's other projects, and looks like he/she was already OK with arts from earlier on:

https://staniks.github.io/articles/inferno/

https://staniks.github.io/articles/worship/

rob74 6 hours ago||
This is taking a lot of inspiration from Doom, but the actual raycasting engine is more like Doom's predecessors, the most well-known of which is probably Wolfenstein 3D: perpendicular walls, constant floor and ceiling height. Wolf3D didn't have textured floors and ceilings because of performance reasons, but several other similar games had them. Doom and IIRC Duke Nukem as well used a BSP engine which was much more flexible (walls could intersect at any angle, variable floor and ceiling heights), although the levels were still "flat" (you couldn't have several "stories" inside a level, e.g. you couldn't design a bridge that you could walk over and under).
badsectoracula 5 hours ago||
> Duke Nukem as well used a BSP engine

The Build engine didn't use BSP, it treated connections between sectors as portals and rasterized the walls as (90 degree rotated) trapezoids while performing clipping against those portals. This allowed it to have dynamic wall geometry (e.g. moving trains, rotating light fixtures, etc) as well as "room-over-room" setups as long as you couldn't see both rooms at the same time (in both Blood and Shadow Warrior they found a workaround for it allowing to create more "3D" spaces by making identically shaped sectors with the floor of one sector acting as a portal to the ceiling of the other sector - supposedly this wasn't "natively" supported by the engine, but it was flexible enough for the game studios who used it -without even having access to the source- to do it themselves).

The first level of Duke Nukem 3D does use a few Build tricks - e.g. another one is that sprites can be "axis aligned" instead of following the camera and they can also have collision - this can be used to create rudimentary 3D geometry by treating each sprite as an axis aligned quad and in the first level it is used to make a bridge between two buildings (right before the level exit button).

kridsdale1 1 hour ago||
I always loved that the bridge you mentioned could take damage and fall down, screwing you over in the very first level, unless you knew where the Jetpack was stashed.
bluedino 5 hours ago|||
> Wolf3D didn't have textured floors and ceilings because of performance reasons, but several other similar games had them

Blake Stone Rise of the Triad used later versions of the Wolf3D engine and had textured floors/ceilings

> Doom and IIRC Duke Nukem as well used a BSP engine which was much more flexible

Duke Nukem (Build engine) did not use BSP

https://www.jonof.id.au/forum/topic-137.html#msg1548

torginus 1 hour ago|||
With regard to floors, afaik even DOOM didn't do them correctly. With vertical walls, the perspective divide needs to be done only once per column of pixels for a given wall segment.

For floors, unfortunately there's no such luxury, and if I remember correctly DOOM subdivided floors into patches, and only did proper perspective at the corners, and interpolated inbetween.

Jare 15 minutes ago||
For floors the perspective divide is once per row, just like for walls it's once per column.

The BSP may have led to some floor subdivisions, especially as it needs convex sectors. I don't remember if the engine would coalesce adjacent floor spans into a single one, but I hope it did.

Grumbledour 6 hours ago|||
Later on, in Shadow Warrior, you could even do that, i think they used portals to implement it and i remeber it was a pain to set up in the editor.
classichasclass 34 minutes ago|||
Yes, essentially with a second rendering pass. Not cheap to implement which is why the game used it relatively sparingly.
kridsdale1 1 hour ago|||
That did give us our first software rendered transparent water rooms though (Quake had the water opaque unless you had 3DFX card IIRC)
mrob 56 minutes ago||
GLQuake introduced the r_wateralpha setting, which allowed transparent water, but the maps were still compiled with visibility calculations that assumed the water surfaces were opaque. You got visual artifacts unless you enabled r_novis to ignore the pre-calculated visibility calculations. Modern computers can handle it, but this was a heavy performance cost at the time.

To work around this, people used an unofficial tool to patch the maps to support transparent water:

https://vispatch.sourceforge.net/

scrumper 6 hours ago||
I thought at first it was just a skinned Wolfenstein 3D. Which is grossly unfair. A lot of work here.
mkl 4 hours ago||
Graphics programming in the early to mid 1990s was pretty fun: write pixel data into the memory-mapped video RAM and it appears on the screen! A pointer to 0xA0000 was all you needed - no API or anything. The reason for the non-square-pixel 320×200 VGA mode they mention was that the video buffer took 64000 bytes, which fit into a 16-bit segment, making addressing it easy in 16-bit code/CPUs.
badsectoracula 4 hours ago||
> A pointer to 0xA0000 was all you needed

Though your extender could make things a little more annoying on that front :-P

(DJGPP and Free Pascal -which use the same "go32" extender by DJ Delorie- do not do a full linear mapping so you need to do a bit more juggling to get stuff on screen there)

russdill 3 hours ago||
Until VGA came along....the story was much more complex.
Terr_ 24 minutes ago||
> Well, it would work, but the result would look terrible because pixel scale is no longer consistent.

This is my complaint with a lot of "graphical enhancement" mods for games like Deus Ex.

Unless they touch everything, the inconsistent level of detail is worse than consistently low-res meshes/textures.

rob74 6 hours ago||
I just noticed that this might be one of the rare shooters with a female protagonist: the cat has a calico pattern, and those are almost always female (https://en.wikipedia.org/wiki/Calico_cat).
embedding-shape 4 hours ago||
> rare shooters with a female protagonist

It's not that rare, is it? Off-hand, and very mainstream; Perfect Dark, Mirrors Edge, Dishonored (don't remember if it's the first or second one), Metroid and more are all kind of "shooters" with female protagonist, although maybe Mirror's Edge is more just "first-person" than "shooter" to be 100% accurate.

Not to mention the large selection of "RPG + FPS" where you can be either man or woman.

---------

Seems the author also realize the thing with the pattern and likely gender of the cat:

> After all, I do need to give the protagonist his fair share. [image] (Yes, I know it's a female, but call it convention rooted in dialect.)

wild_egg 4 hours ago|||
They're definitely rare. Mirror's Edge is almost 20 years old. Reaching back that far for an example just reinforces how rare it is.

If you tally all the FPS releases in a given year, a supermajority are going to have male protagonists.

amiga386 1 hour ago|||
???

Mirror's Edge has a female protagonist, but it's not an FPS (First Person Shooter). It's a parkour simulator which technically lets you shoot a gun in limited sections of the game, but the protagonist is a pacifist and you get a bonus for decommisioning guns rather than firing them.

If the thread would like some hard data:

- 19,526 games on Steam tagged "female protagonist" https://store.steampowered.com/search/?tags=7208&ndl=1

- 13,578 games on Steam tagged "FPS" https://store.steampowered.com/search/?tags=1663&ndl=1

- 727 games on Steam tagged both "female protagonist" and "FPS" https://store.steampowered.com/search/?tags=7208%2C1663&ndl=...

So it looks like the two categorisations, for the most part, don't intersect.

Notable counterexamples would include Rise of the Triad, Ion Fury, No One Lives Forever, Wolfenstein: Youngblood and Far Cry 6, but definitely rare. You'd be clutching at straws to describe Portal or Alien: Isolation as FPS (they're a puzzle game and survival horror game respectively), likewise the Resident Evil / Clock Tower / Fatal Frame / etc. games with the novelty option of switching to first-person view, they're naturally third-person perspective. Left 4 Dead has one female character out of four you can play. You might count that one DLC for Bioshock: Infinite where Elizabeth gets a shot (https://www.youtube.com/watch?v=1E1lh-pb6Is). You might count the few FPS RPGs that there are with customisable characters (so yes Fallout, but not Mass Effect as it's third-person). But female protagonists are massively more prevalent in survival horror, metroidvania, third-person shooters (Tomb Raider, Monster Hunter, Horizon Zero Dawn, etc) and other genres besides FPS.

embedding-shape 3 hours ago|||
> Reaching back that far for an example just reinforces how rare it is.

Choosing one specific example when I also made more recent ones, isn't such a big dunk you think it is.

> If you tally all the FPS releases in a given year, a supermajority are going to have male protagonists.

Sure, I agree, I'm not saying it's more popular, just that I don't think it's that rare, but I guess ultimately I'm a bit nitpicky (sorry) and we're just disagreeing with the specific definition of "rare".

EvanAnderson 3 hours ago|||
Not a "shooter", but the "No One Lives Forever" franchise is another example of a female protagonist in a first person game.

Edit: I completed forgot Chell from Portal, too!

wsc981 3 hours ago|||
Unreal actually also has a female protagonist.

https://unrealarchive.org/wikis/the-liandri-archives/Prisone...

KerrAvon 1 hour ago|||
If Portal counts, so does Control
egypturnash 34 minutes ago||
Control's not first-person. You are looking at Jesse's back for pretty much every moment of gameplay.
dabluecaboose 4 hours ago|||
> one of the rare shooters with a female protagonist

No, this isn't a Perfect Dark game

kridsdale1 1 hour ago||
Well done.
badsectoracula 5 hours ago|||
A lot of boomer shooters nowadays have a female protagonist, e.g. Selaco[0], Supplice[1], The Citadel[2] and its sequel[3], Zortch[4] (and its upcoming sequel[5]), Nighmare Reaper[6], COVEN[7], Viscerafest[8], Hedon[9], etc. If anything i'd say that nowadays there are way more boomer shooters with female protagonists than not :-P (combining the tags "boomer shooter" with "female protagonist" on Steam search gives 143 results, though that includes games where you can either choose your character's gender or you play as a woman for a part of the game even if you play as a man for most of it).

[0] https://store.steampowered.com/app/1592280/Selaco/

[1] https://store.steampowered.com/app/1693280/Supplice/

[2] https://store.steampowered.com/app/1378290/The_Citadel/

[3] https://store.steampowered.com/app/3371240/Beyond_Citadel/

[4] https://store.steampowered.com/app/2443360/Zortch/

[5] https://store.steampowered.com/app/3807500/Zortch_2/

[6] https://store.steampowered.com/app/1051690/Nightmare_Reaper/

[7] https://store.steampowered.com/app/1785940/COVEN/

[8] https://store.steampowered.com/app/1406780/Viscerafest/

[9] https://store.steampowered.com/app/1072150/Hedon_Bloodrite/

egypturnash 25 minutes ago|||
"boomer shooter": 1105 matches

"boomer shooter" + "female protagonist": 106 matches.

So a bit less than 1/10 of the games tagged with "boomer shooter". With your caveats above about being able to choose a gender, or a single brief segment where you're a lady in a game where you're mostly a dude. Is that a lot? I dunno, doesn't feel like a lot to me. Probably feels like a lot to the people who inevitably show up in the Steam discussions of any successful game that makes you be a lady for most of its length and complain about it being "woke", even one game with a female protagonist seems to be too many for them.

stronglikedan 3 hours ago|||
143 results means it's relatively rare.
lo_zamoyski 2 hours ago||
I doubt it was intentional, but in general, I am not impressed by that and don't find any value in that. Same with Hollywood's depiction of women knocking out guys twice their size. Unrealistic, ridiculous, and harmful.
canelonesdeverd 9 minutes ago|||
>Unrealistic, ridiculous

So, a videogame?

kridsdale1 1 hour ago|||
You don’t need a penis to hold a gun.
mrob 2 hours ago||
In the final video, it looks like the destructible vases take several shots to destroy. IMO, they should only take one. Real life vases only take one, so requiring more makes the gun feel weak. It seems to be cosmetic anyway, so there's no game balance reason to require more.
ogurechny 2 hours ago||
Step 0 is missing: having a great taste. One look at the video example is enough to figure out that the author keeps things in balance and in style. Explanations of why pixel grid mismatch looks wrong, or why mismatch between texture density and geometric complexity (in both ways) looks horrible, or why smoothing does not blend with pixel art are then made in retrospect.

Some details are a bit too cool for 1993, though, and assume high frame rate (won't work that well at low fps). Smooth weapon animations with a lot of frames, tiny per-pixel effects on bullet holes and flash sprites, smooth movement and object position calculations that use precise math instead of fast rough estimates resemble Chasm: The Rift or Quake (the concept of idle animations, e. g. objects moving in the starting view of difficulty selection room, assumes that there is some performance to waste on details that make the world less empty).

nopurpose 15 minutes ago|
What does he mean by inconsistent pixel scale when he talks against increasing sprite resolution?
pragma_x 12 minutes ago|
Just a guess: if you want to scale a sprite at anything less than a whole ratio (e.g. 1.5, 0.7, etc), you have to choose pixels to drop out and pixels to repeat , on some pattern that looks good. There are going to be scaling ratios that look like a hot mess, especially at a low resolution like 320x240.
mrob 1 minute ago||
In context, it's talking about sprites that are going to get non-integer scaled anyway (in-game pickups), so it's just about maintaining a consistent detail level. If those specific sprites had their resolution increased, everything else would need its resolution increased to match them.

Inconsistent resolution isn't necessarily a bad thing, e.g. Elite for the BBC Micro changes video mode part way down the screen so it can display both high resolution monochrome wireframe 3D and a lower resolution color map/UI below, but it's not idiomatic to the MS-DOS style this game is going for.

More comments...