1. Hitmaps.
An older and buggier (plus not all sprites have been done) version of this is showcased in this April video:
The hitmap is in a way similar to a brightmap (hence the name), see this old thread. Its purpose is assigning "damage zones" to a sprite. For example, the GARDA1 sprite of the Nazi soldier on video is being assigned a hitmap with zones Helmet, Head, Chest, Arms, Stomach, Groin, Legs. (Remember Red Orchestra 2?)
The damage dealt to the actor depends on the zone. For example, a headshot is an instant kill, but a helmet hit only deals half of the base damage. With custom damage types or projectiles you can, of course, make rifle shots penetrate the helmet.
The hitmap has to be a Doom format image in a specific palette (SladePalette.pal in the archive - it is a maximal color distance palette taken from Stack Overflow), of the same width and height as the original sprite (offsets are unnecessary).
I just ain't parsing PNG with ZScript when the original Doom image format is that simple.
In the attached file (227KB) you'll be able to shoot actors with BoA Afrika Korps guard sprites using a special projectile pistol, like in the video. The imps (note that some of them are flat and roll-rotated) respond to pressing 'use' instead: if you high five one, it opens the exit door; if you slap its face, you will be subject to punishment.
Notes.
1. For the hitmaps, pitch black (index 0) and transparent are interchangeable.
2. You can easily adapt the projectile logic for hitscans.
3. Nonzero floorclip will make the visuals inconsistent with shooting results. It either needs to be accounted for or switched off altogether.
4. UDB visual mode shows +ROLLSPRITE actors not in the same way they appear in game.
5. The process of drawing hitmaps manually over the sprites is exceptionally time-consuming even with all the shortcuts, so I planned to write a (semi-) automated tool for this. However, instead of coding (not that I would have done it in a timely manner), with time my plans evolved into the patchwork actors initiative. A tool would still be very useful, any volunteers? (I guess not.)
6 (important). In the original hitmap suggestion thread Nash raised a good question. Does anyone have a reference on what kinds of data are possible to overwrite in multiplayer GZDoom? My hitmaps are just binary files placed in a separate '/hitmaps' folder in the pk3 root, they are technically not images; are these multiplayer-protected by hashing?
2. Models.
Two videos of very old versions (however the demo is also quite old):
Here are some 3D model tanks that respond to faux-projectile hitscans designed by Matt. The closer the shell trajectory to the armor plate normal and the thinner the plate, the higher chance the shell will penetrate and damage the tank.
The tanks use the visible higher-detail model and a lower-detail one that is used for detecting collisions with shells. The armor plate thickness is stored in 3D models - just in the names of MD3 groups. I used Maverick Model 3D to simplify BoA models and add this information.
You can test the demo as an IPK3 build (6672KB):
Code: Select all
gzdoom -iwad "tanks.ipk3" -file "doom2.wad" "tanks.pk3"
use a tank while outside = ride it
mouse wheel = zoom in or out (1x to 25x)
1, 2, 3 = change shell type
RMB = fix turret and gun position (only the hull can move)
Notes.
1. As seen in the command, doom2.wad is to be loaded as a PWAD, so you'll need it in the folder.
2. The BoA HUD is here mostly for the moving crosshair. That is quite a lot of code; if you do not need it, you can remove it.
3. More on the crosshair: it is disabled outside the zoomed ("sniper") viewmode because of a difficulty to find a proper position for it, rather than balance reasons: you'll have to dynamically check its position using the same intersection code as for shots. It is not going to be great for performance.
4. Speaking of the performance, a good way to optimize the bruteforce over model triangles would be an octree. It would be better to generate it outside of Doom and just load it on startup.
5. 'External modules' of the tanks (that are not protected by armor) are purely visual and are not used for shell collision. I was just being lazy, it'll be very easy to add them. They would like to see some special effects, such as decreased accuracy for damaged main gun, reduced driveability for tracks, or a fire for the fuel tanks. You will then also want to include internal modules; then you'll just have to consider all ray-triangle intersections instead of just the first one.
6. The code here is way messier even than in my other recent topics, and I remember this being buggier. Please report any problems you stumble upon.
7. Sherman and Tiger are not finished. However the models are done, IIRC you only need to link the actors. There are also some serious problems with MODELDEF and ZScript offsets/scaling for model parts, including the 'working' T-34 and Pz. IV.
8. It might in the end be fruitful to merge all tank classes into one, as I did with the patchwork.