Live data from Hacker News

Making Graphics Like it's 1993

staniks.github.io

121–130 of 169 posts

Re: Making Graphics Like it's 1993

#122

Earlier quoted context omitted.

I recall that Diablo 1 (and 2) has a lot of enemies that are essentially the same sprite but different palette. Is it the same trick?

it used to be a hardware thing, so if your pixels were represented by a nibble, and the definition of the color for each of the 16 possible value is in table the hardware references, you just update that table (on a vsync, or even an hsync) and you could get cool animations effects (for the time) random example from the Atari 800xl https://www.youtube.com/watch?v=uPjLZ4MVKCc (you can see how slow it is to draw a scen…

Thanks for the tip!

Re: Making Graphics Like it's 1993

#123
post #31

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.

I always found it really funny that PC's had these absolute monsters of CPU's relative to the consoles of the time but because of the graphics setup they struggled to do smooth scrolling like Mario on the NES in 1985. But that weakness meant you could essentially do a lot more work per pixel on screen and thus allowed these ray casting/BSP tree systems.

So while it didn't have custom processors for sprites and background layers it meant there wasn't a rigid fixed function nature to what the PC could do.

By the mid-late 90's with dedicated 3D processor this wasn't an issue any more but there was a brief time in the early 90's where there was this wonderland of unique visual rendering.

Re: Making Graphics Like it's 1993

#124

This is so great. Another fun trick we used in the 90s was palette animation -- by swapping the palette you can create incredibly cool effects at a low runtime cost.

Changing the pallette mid-frame is fun, too. You have to pay a lot more attention to timing since you don't have a copper (like the Amiga) on the PC, but it's still feasible.

Re: Making Graphics Like it's 1993

#125
post #115

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 fra…

It's certainly the most rudimentary. Small optimisation on the inner-loop would be to pre-calculate the scanline offset before going into the pixel loop: int s = y*screenRect.w; for (int x = 0; x >3, y+frame, x+frame); }

I'd be surprised if the compiler didn't make that optimisation on its own.

Re: Making Graphics Like it's 1993

#126
post #117

Earlier quoted context omitted.

> 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 (i…

The funny thing is that looking backwards, I would never use a grid of squares for a raycaster like wolfenstein3d did. If I were to do a raycaster today, I would use convex sectors with portals, basically like duke nukem, but constant wall heights. You can do drawing very simply by just doing a linear pass across the sector, recursively stepping into other sectors. Then you can at least do arbitrary level geometries.

Yeah, that is basically what i did around 2009 when i was making a 3D engine in Haxe for Flash, RayFaster 2 (it was the successor to another Flash game engine, RayFaster, which did Wolf3D-like raycasting and i used to make a simple FPS[0] though with Flash's input limitations i couldn't do mouselook and didn't feel that great).

The engine used Build/Doom-like maps and would simply raycast against the camera's current sector (sectors could be any shape not just convex) and used connections between sectors as portals to recursively follow the (2D) map until it hit a solid wall - so basically Build's portal rendering approach except using raycasting instead of trapezoid rasterization. It could also do sprite rendering (you could have both sprites facing the camera and "aligned" sprites that could be used for decals) and even had some simple 3D model rendering (the triangles were sorted and clipped against the portal during rasterization). Unfortunately Flash isn't available in browsers anymore and Ruffle isn't compatible with it (it can run the engine -much slower than real Flash- but the palette is all wrong), so i took some shots using the standalone Flash "projector"[1][2][3][4]. Also making maps for it was certainly much more laborsome than making maps for a Wolf3D-like game and that combined with me losing interest in making Flash games meant i never made a game with it.

[0] https://www.youtube.com/watch?v=Z81NhEbl3q8

[1] http://runtimeterror.com/pages/iv/images/01feb493af6dd3184b8...

[2] http://runtimeterror.com/pages/iv/images/136a8753b211ed7e3d1...

[3] http://runtimeterror.com/pages/iv/images/84c2012258982b82053...

[4] http://runtimeterror.com/pages/iv/images/e94cc334c7735e1aacb...

Re: Making Graphics Like it's 1993

#128

Earlier quoted context omitted.

> 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 ei…

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.

> They're definitely rare. Mirror's Edge is almost 20 years old

You probably didn't play many FPS recently: from the top of my mind, CS2, Battlefield {1, V, 6}, CoD {BO3, Vanguard, MWIII}, Control, the Borderlands, Far Cry {5, 6}, CP2077, Fallout {3, NV, 4}, Destiny, Prey, Valorant, Rainbow 6, Apex, Overwatch, all have female player characters.

And if CS2/CoD/BF/Valorant/Destiny/Apex have female players, that's more or less 90% of the current market.

I took a glance at the the most played FPS list from Steam[0], but I was too lazy to scroll far enough to find one without a playable female character.

[0] https://steamdb.info/charts/?tagid=1663

Re: Making Graphics Like it's 1993

#129

Earlier quoted context omitted.

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…

"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 th…

It isn't a lot but i wouldn't say it is rare either.

Re: Making Graphics Like it's 1993

#130

This is so great. Another fun trick we used in the 90s was palette animation -- by swapping the palette you can create incredibly cool effects at a low runtime cost.

Indeed, and I highly recommend this website for some stunning examples of the technique.

http://www.effectgames.com/demos/canvascycle/

Post reply on HN