===================================================================== Changes since Eternity Engine v3.33.02 ===================================================================== ===================================================================== 10/10/05 Fixed three more bugs for Shareware Heretic: * Automap level names didn't work; they all said "hidden level" due to code meant to catch E4 in registered and E6 in SoSR. * Intermission was disabled for all maps, for the same reason. * IDCLEV was disabled for all maps except E1M1, for the same reason. Note that these bugs weren't there originally, and had crept in after several changes made for SoSR support were added. This is the first time I've tested shareware Heretic for quite a while, so I did figure there would be a couple of easy-to-fix problems like these ;) ===================================================================== 10/09/05 After fraggle pointed me to the Chocolate DOOM webpage, I started browsing its CVS and found all kinds of great stuff that Eternity really needed sorely. fraggle is a genius and has already done a ton of great stuff on his new port. Added Chocolate DOOM's application state and focus tracking code to allow Eternity to give up the mouse when it's not being used in play, to flush events received during video init in a more reliable way, and to keep it from rendering the screen when it is minimized. Added Chocolate DOOM's ENDOOM emulation and totally changed Eternity's exit behavior. I had to move the call to SDL_Quit to after the I_EndDoom call, and I also had to shut down video earlier with an explict SDL_QuitSubSystem call in I_ShutdownGraphics. This allows fraggle's awesome TXT code to reinit video later to display the ENDOOM. Made a SMMU change to viewheight setting in P_TeleportMove more demo safe. I have no idea if that change could cause problems in demos or not, but there's no need to take the risk. Noticed that my change to the automap handlers was causing a problem. Turns out you can only initialize the first member of a union type in ANSI C, and the function pointer inside the keyaction structure is the second member. So, the automap handlers still have to be set manually in G_InitKeyBindings rather than in the static initializers for keyactions. Blah :P Rewrote CheckIWAD at long last to do away with the ridiculous obfuscated code and to add detection support for all 3 Heretic gamemodes/missions: shareware, registered, and Shadow of the Serpent Riders. -heretic and tempHereticMode are now a thing of the past. Doing this, of course, has revealed most of the last few things from DOOM still being used in Heretic mode (excepting player guns and sounds, which I obviously know about and cannot fix quite yet). The following were fixed as a result of this change: * STKEYS* lumps for the HUD were added that are appropriate for Heretic, and a change was made to gameModeInfo to specify the number of key icons used on the HUD in various game modes. * Completed Heretic's save and load game menus. I had to add a gap size override field to menu_t to enable proper spacing of the elements on these menus. Changes were made to gameModeInfo to specify the save and load menu objects used for each game mode, so that the console commands and key bindings can remain consistent. * The sound made by the screen size changing code is now mapped through the gameModeInfo menuSounds array, and uses ht_keyup in Heretic like it should, rather than DOOM's stnmov sound. * The format string used to load automap mark numbers is now mapped through gameModeInfo, and Heretic, which never supported automap marks originally, now uses its SMALLINV numbers to do this. They look great on the automap ^_^ "Raven mode" is toggled in Eternity through the simultaneous presence of three lumps: ADVISOR, the graphic used to show the RSAC rating on the title screen; TINTTAB, the Heretic-style translucency lookup table; and SNDCURVE, which was a precalculated volume curve that Raven added to optimize the sound code slightly. Eternity has no use for either of the latter two lumps, but it CAN look for them in concert to determine that either Heretic or Hexen is being loaded. I look for all three just to be extra secure that some modified DOOM IWAD won't accidentally trigger "Raven mode." At this point, it uses the following criteria to figure out the gamemode and mission: * If 9 E4M* maps were found AND the EXTENDED lump is found, the game mode is Heretic and the mission is Heretic: SoSR. I don't bother checking for E5 or E6 maps because the EXTENDED lump should only exist in SoSR. The check on E4 maps is just a sanity check, really, and doesn't add any overhead since the levels must be counted anyway. * Else, if 18 E2M* and E3M* maps were found, the mission is Heretic and the game mode is Heretic/Registered. * Else, if 9 E1M* maps were found, the mission is Heretic and the mode is Heretic/Shareware. * Otherwise, mode is indetermined. Someday in the vast future when Hexen support is added, it'll be simple to detect Hexen by looking for the number of MAPxy maps that were found under the same conditions. I discovered that my new text color range translations for Heretic missed one color which was only used on a single character, the number 2, and thus I had to fix every one of them. I also realized that some of the temporary standins I made using DOOM's font for important characters that Heretic was missing were ugly as hell, so I fixed them up, and they now look just like parts of the original font. ===================================================================== 10/08/05 Added support for boxed message widgets, and created a new function called V_FontSelect which allows engine code to easily pick from all the available font objects using a numeric id. This will be very easy to extend in the future to allow for user fonts to be used by both native engines and scripting. Made two new color range translation tables that can be used by EDF mods to enable the direct use of DOOM/Heretic sprites in the opposite game without editing the graphics at all. The translation tables remap each color index to the closest color in the other game's palette. Results for some sprites are more or less perfect, while some others (like the Baron in Heretic) are not very good at all. Interestingly, Heretic sprites look universally great in DOOM, but a lot of DOOM sprites look terrible in Heretic. I'm not quite sure where the asymmetry comes in :) ===================================================================== 10/07/05 Changed responder order to test it out. Seems the console works a little better when it gets first dibs on messages; this keeps the menu from locking out typing in the console, among other things. Finally began the long promised and long needed overhaul of the menu engine. First, I removed the menuitem_t array from menu_t and changed it into a pointer. Now, each menu points to a separately defined array of items, and this saves a TON of memory and removes an otherwise completely unnecessary static limit on menu items per menu. Added support back in for multipage menus. Using either newly defined key actions or ctrl+arrow keys, you can move between an unlimited number of pages for each menu. Next and prev indicators are dynamically drawn for such menus by the menu engine, and appropriate sounds are made on menu page transitions. This will help flatten out otherwise too-deep heirarchies, and makes the whole system feel better. Changed most of Heretic's text color range translation tables; the text is much more legible in all the colors now. This was a ton of work, which involved examining graphics from both Heretic and Hexen that already had some text of different colors on them, but it was WELL worth it because the results are positively awesome. I also changed the colors used for the menu in Heretic by moving them into gameModeInfo. It now uses gray by default, red for highlights, and green for variable values. ===================================================================== 10/06/05 Automap event handlers globalized to remove some silliness. 17 new parameterized ceiling specials have been added, and one new floor special has been defined. I have also begun implementation of parameterized stairs, though these are not finished yet. I added the ability to have Hexen-style synchronized stair building, which is so freaking cool, but there's no way to use it until param stairs are finished. Found a bug in the quad column buffer flushing code. If no column was drawn during a frame, the code would bomb out saying that the whole column flusher function was used uninitialized. R_FlushColumns needed to make certain that there was actually anything to flush before trying to flush the buffer :) ===================================================================== 10/05/05 Added support for named values that are translated to numbers in the MapInfo parser, and eliminated some of its code in favor of code in e_lib.c, which can be easily used in p_info even though it's not a libConfuse parser ^_^ Added the "leveltype" field to MapInfo, which allows the map author to override the default automatic map translation for a game mode. For example, this will be useful if authors want to make Heretic/Eternity maps that use the 7000-range doomednums and Eternity linedef/sector specials instead of creating pure Heretic maps that use the Heretic specs exactly and get translated at runtime. With this I could potentially allow some projects to have their own dedicated leveltypes. This is already probably going to be necessary to fix up Caverns of Darkness. With the leveltype facility in place, I was able to eliminate most of the uses of the temporary "tempHereticMode" variable, which is set when -heretic is used on the command line parameter. This variable, which is now only used in one place, has been moved to d_main.c and made static. It will soon be gone forever, and then you'll be able to use heretic.wad as an IWAD finally! ===================================================================== 10/04/05 Continued addition of Hexen map format support. Added support for the Hexen "height" field, both through ExtraData and the new map format. It allows you to move a thing up from the floor, or down from the ceiling if it spawns on it. This may be useful to Mordeth, who has been having problems with positioning things on 3DMidTex lines. Added shadowed text drawing to flesh out the Heretic intermission and menus. It looks pretty great and doesn't use anything even a bit like Raven's implementation. I just draw the string twice, the first time 2 pixels to the right and bottom using colormap #31 and using 66% translucency. Works for me. Also added the ability for text to use other internal colormaps besides the ones defined in the cr* lumps array. I thought I would need this for the shadowed text, but I didn't. I left it anyways because it could come in handy in the near future. ===================================================================== 10/03/05 Added loading of Hexen-format maps! Changes incurred to P_SetupLevel and P_CheckLevel, and new functions added to read Hexen things and lines. As in zdoom, Hexen format is decided upon by the presence of the BEHAVIOR lump (which Eternity does nothing with currently). P_CheckLevel now returns the format of the map, or a code for "invalid" if the lump it looked at isn't a map by its reckoning. In the process of testing Hexen map loading, I found a bug in the 3DMidTex switch code. If a 1S line got through with the 3DMidTex flag and could be pushed, the code would segv due to trying to access the non-existant backside of the line. Woops! ===================================================================== Changes since Eternity Engine v3.33.01 ===================================================================== ===================================================================== 09/30/05 Fixed an unapparent bug in the customized libConfuse lexer that would have prevented ifdef/endif style functions from working properly in one certain case. This bug never occurred because up until now there was no valid way to cause it, but it could have become a problem now that ifenabled, etc. can accept multiple parameters. ===================================================================== 09/11/05 Finished up some final adjustments before 3.33.02 launch preparations will begin. I cut the number of function calls made during column flushing significantly by effectively inlining the calls that were being made into new functions. The first case improved was when the column buffer needs to be flushed before it's full, or when some column inside it is totally outside the vertical range of all 3 other columns. This case now calls the function pointer R_DrawWholeColumns, which draws up to four complete columns out of the buffer. The second case improved was the head/tail drawing done before a quad flush. Eight function calls were made here to R_DrawSingleColumn before. Now one call is made to R_DrawHTColumns, which draws the heads and tails of all four columns in the buffer if necessary (only parts outside the area of the quad flush must be handled). This is the single most critical path of execution in the game engine so I am continuing to find ways to improve it. I have concern about word writes being done out of alignment, but I do not know if the penalty is worse than doing 4 byte writes or not. SoM is skeptical. Only Lee Killough would know this kind of thing unfortunately :( It should be possible to inline the DrawHTColumns functions into the quad flush functions themselves and reduce that case to 1 call. I'm putting this off for the time being, however -- mainly in the interest of expediting an already very delayed release. ===================================================================== 09/07/05 Did some more zone heap analysis and noticed that the BEX music names table was wasting 3x the needed amount of memory by allocating all the music names separately (like the previous issue with sprites). Fixed to allocate space for all the music names through one pointer. Also found the TXTRCONV lump (which allows playing DOOM maps under DOOM II and was added in SMMU) was similarly wasting a ton of memory first by using a static array of 256 texture entries when there are only 54 in the file, and then by using strdup to separately allocate the two texture names in every single structure. Now, the structures contain two char[9] arrays and are all kept in a dynamically realloc- ating array (ala boss brain spots). With these changes, the heap is starting to look a lot cleaner. In case one might wonder why lots of small allocations waste RAM in DOOM, the zone allocator (since BOOM at least) uses a minimum block size of 32 bytes (plus the size of the block header). This means that for each 9-byte string allocated, you waste a minimum of 23 bytes. Repeated for many structures, this turns out to be kilobytes, and Eternity is already threatening to expend the default 16 MB heap on some larger levels, so this IS important. Huge RAM is no excuse to be inefficient ;) These improvements also make those respective parts of the engine faster, since memory allocation is relatively expensive -- the fewer calls to it, the better. Halved the default number of particles allocated when I found out they were using 250 KB of RAM. 4000 seems like a lot of particles. If effects start cutting out severely, I'll either up the default or create an easier way for projects to override it (currently only a stupid command line option exists). Seriously, only areas on the scale of those in nuts.wad or Mock 2 could hope to have 4000 active particles, and allowing for the worst case all the time is silly. ===================================================================== 09/06/05 Changed the EDF ifenabled function to work on N parameters, so that you can simultaneously test the enabled state of multiple enable values. However, it uses AND logic, meaning all provided enables must be on. To fill in the gap, I also provided an ifenabledany function which uses OR logic, meaning that the block inside is evaluated if even one of the provided enables is on. I also added the following new functions: ifdisabled -- Tests N enable values. If all are disabled, the block is evaluated. ifdisabledany -- Tests N enable values. If any is disabled, the block is evaluated. ifgametype -- Tests the current real game type against N game type parameters, rather than simply whether or not definitions belonging to a certain gamemode are enabled. This was needed to allow Heretic and DOOM terrain types to be enabled only in the proper game type (HERETIC or DOOM respectively). While both sets of definitions could exist all the time, it would waste memory and processing time. ifngametype -- Tests the current real game type against N parameters, and evaluates the block if it matches none of them. ===================================================================== 09/04/05 New TerrainTypes system 100% complete! Corrected fall-to-ground particles to use deep water floors when they are higher than the normal floor of a sector. This will stop such particles at the surface of liquids, which is more realistic and will cause less trouble with drips that cause terrain hits. ===================================================================== 08/23/05 Bulk of new TerrainTypes system completed. TerrainTypes, like EDF strings, can be defined both within EDF, and within their own chain of lumps named ETERRAIN. Use of include_prev allows for optional cascading. The TerrainTypes-related sections are documented here: Splash Objects: splash { smallclass = smallclip = smallsound = baseclass = chunkclass = sound = chunkxvelshift = chunkyvelshift = chunkzvelshift = chunkbasezvel = } All thing types in the splash are optional. If invalid, those things simply won't be spawned. The cutoff for objects that make small splashes is, as in Hexen/zdoom, a mass of 10. All the velocity shift values default to -1, which means not to apply a randomized factor to the velocity. For X and Y, this means that there will be NO x or y velocity. For z, the base velocity is always applied, but may also be set to zero to result in no z velocity. Terrain Objects: terrain { splash = damageamount = damagetype = damagetimemask = footclip = liquid = splashalert = useptclcolors = ptclcolor1 = ptclcolor2 = } terraindelta { name = } The splash is optional. If left to default or set to a non-existant splash, this terrain definition will have no splashing behavior. To have areas inflict damage based on terrain, their flat's terrain must have a damageamount greater than zero. damagetype indicates what type of "Means of Damage" the damage is inflicted with, which currently only affects obituaries (but in the future may cause special death animations for various elemental attacks too). The time mask determines how often the damage is done. Footclipping is now customizable for each TerrainType. The normally defined types all use the previous hard-coded value of 10, but this can be set to anything zero or greater. The liquid and splashalert flags determine different behaviors of terrain. If a terrain is liquid, the normal player floor hit sounds won't be played. Generally, terrains which have a splash will want to mark themselves as liquid, but this isn't a hard rule. Some Heretic objects (which have not yet been implemented in Eternity) and some Hexen objects also react differently when they hit liquid terrain, so this will become more important in the future. Terrains with splashalert set will wake up monsters when the player falls into them, like in Heretic and Hexen. Unlike zdoom, this is optional, because in DOOM it would seriously change the playability of some maps in an unacceptable manner. useptclcolors and the two color fields determine what special colors are used for particle gunshots that hit the floor or ceiling. These were previously hard-coded. You can provide an RGB triplet to these fields which will automagically be resolved to the closest color in the game's palette (though you will not be pleased with the results if there is no color close enough). For this reason, it is also possible to specify a raw palette index from 0 to 255. This cannot be used across more than one game, of course. Terrain deltas are also supported, so that terrains can be edited in the same way as things, frames, and sounds. Floor Objects: floor { flat = terrain = } Floor objects tie a flat to a terrain object. These are, in effect the same as the old TerrainTypes as defined in the binary TERTYPES lump. In fact, Eternity still supports the old lump from within the new system, and will automatically convert the old TERTYPES lump into floor definitions, assuming that terrains named "Water", "Lava", and "Sludge" exist (if they don't, the floors in question are just set to the default Solid terrain). The flat need not even exist. If it doesn't, the floor definition will simply never get used by the game engine. The terrain, on the other hand, should be valid. If it isn't, the terrain will be reset to the default Solid type. ===================================================================== 08/21/05 Work on the new TerrainTypes system continues. Added string values for MOD types, which have been needed since the original version of EDF. ===================================================================== 08/10/05 Completed massive EDF restructuring/rewrite effort. EDF's code is now divided into the following modules: e_lib.c -- Contains utilities common to ALL "Extended Feature" modules, which also includes ExtraData. These are functions which are useful for any libConfuse-based system and have eliminated several cross-system redundancies. e_edf.c -- Still contains all the core EDF functionality, as well as all miscellaneous stuff such as sprites, cast, boss types, and misc variables. e_states.c -- All frame processing is now in this new module. e_things.c -- All thing processing is now in this new module. e_sound.c -- This module previously existed, but now contains ALL sound processing code. e_string.c -- This module previously existed, but now contains ALL string processing code. e_edf.c itself was reduced from a +4000-line disaster to only around 1500 lines of code. Entanglement was reduced, and all the individual modules are now much easier to manage. To facilitate this division, I also revamped the EDF verbose logging and error reporting facilities, and took the opportunity to fix several error messages that didn't give enough info, or didn't give the PROPER info (ie thing/frame internal number instead of a much more useful name). I also authored an EDF which, with individual lines uncommented, can trigger almost any error. This is really useful for bug testing and doc correctness checking. In the process, bugs were found. Default EDF fallback behavior was broken due to the presence of ifenabled() function calls in the EDF files. I forgot to enable these functions within the option arrays used when modules are processed individually for fallbacks. ===================================================================== 08/05/05 Added a generalized double-linked list with ** prev pointers, similar to the generalized queue code. This is Lee Killough's clever system that, while only allowing unidirectional traversal, treats all nodes the same and is extremely efficient at linking and unlinking. Particles now use this, as well as the chains of the EDF strings numeric id hash table, which must now allow string objects to be removed from the hash and then reinserted with new numeric ids (since entries amongst various ESTRINGS lumps may specify different numeric ids for like-named string sections). ===================================================================== 07/27/05 Finally got around to adding back the "Are you sure?" message to the skill select menu when the player chooses the Nightmare! skill. This was yet another fundamental DOOM feature that got lost in SMMU's menu rewrite. I didn't even know it was missing until a few months ago (I personally use the startmap, for what it's worth). ===================================================================== 07/25/05 Standardized the EE TerrainTypes objects for water, lava, and muck terrain. Eliminated several do-nothing Eternity TC codepointers and objects that used them, including the "broken axe" and "broken staff" that were thrown out by the Cyberdemon Guard when he woke up. Began implementation of the new EDF-related TerrainTypes system. This is going to take quite a while to finish, but it is coming along very nicely. If not for libConfuse syntactical restrictions, it would almost be source-compatible with zdoom -- despite using none of its code whatsoever :) ===================================================================== 07/24/05 Added EDF infrastructure to support separate lumps which can be parsed apart from the root EDF hierarchy, and any definitions which can be accepted in such lumps are additive over those found in EDF. Cascading is optional, and must be explicitly enabled via use of the new "include_prev()" function. This EDF function, only callable from wad lumps, includes the previous lump of the same name as the one being parsed. This means that if you load two wads back to back that both define ESTRINGS lumps, the parsing starts from the ESTRINGS lump in the second wad loaded. If that ESTRINGS lump calls the include_prev function, the first ESTRINGS lump will also be parsed. Making this optional is better than making it required, since not all modifications are going to be compatible, but some may be designed to work over other existing modifications. ===================================================================== 07/23/05 Found out what was causing the crusher demo desyncs that were report- ed on Doomworld's Demos forum. When adding the ability to have custom crushing damage via parameterized linedef specials, I missed a SINGLE line of code: if(crush == true) This line of code needed to be changed to the following: if(crush > 0) This is because "crush", which was once just a boolean telling the game whether or not it should be crushing stuff, is now an integer that, if greater than zero, means to crush stuff AND tells how much damage to deal while doing it. I overlooked this tiny line of code at least two dozen times while searching for the cause of this problem, which naturally drove me half-insane and had me barking up all the wrong trees, including at various points 3D object clipping and 3DMidTex clipping. Chalk up another retarded error. ===================================================================== 07/13/05 Began adding particle drip object, requested by the Millennium project. This object will require ExtraData so that it can be spawned with the proper mapthing argument values to determine color, size, frequency, and other properties. However, full implementation has been suspended pending completion of the new EDF-based TerrainTypes specification. Modified the FLIES particle effect and added a new sister effect called FLIESONDEATH, which works virtually identical to the Quake 2 fly particle effect. The effect now comes with its own sound effect, and to support proper sound behavior with this effect, I had to add a new EDF sound feature to the game engine: each sound definition can now specify customized attenuation behavior using two separate parameters: 1) The distance at which the sound is fully clipped away 2) The distance at which the sound should be at full volume Attenuation is currently always linear between these two distances. This allows sound in DOOM to have a much finer volume resolution than what was previously available, and liberal use of this feature should make ambient sounds in mod projects much less irritating. I am totally unaware of why this wasn't done in some other source port, like BOOM. It's a really great, easy, and logical feature to add ;) Restructured the code in P_MobjThinker that handles nightmare respawn because it was a nasty mess, and because the new FLIESONDEATH effect requires objects with that particle effects flag to have their movecount updated while they are dead, just as it is for nightmare respawning monsters. This requires the movecount increment to be done a bit earlier, before any returns are taken from that code segment -- otherwise, some objects wouldn't work with FLIESONDEATH. This could possibly impact some demos from older Eternity versions, but those are pretty much screwed to hell already with the changes to TerrainTypes and y-shearing, so I've stopped caring. AFAIK, no such demos exist anyway ;) ===================================================================== 07/08/05 Eternity removed collectable objects before checking them for the COUNTITEM flag. I changed this behavior as it seems a bit hazardous, even with deferred object removal. I prefer to treat removed objects as though they have been freed as much as possible. ===================================================================== 07/06/05 At long last, added a fix for DOOM thing heights when running in 3D object clipping mode. comp_theights toggles this on and off for full backward compatibility. Also, to maintain playability, a new flags3 flag value has been defined and has been given to all affected DOOM and DOOM II decoration objects that allows missile checks and ONLY missile checks to use the OLD, original height values of the objects. The entire reason decor objects had incorrect height information in DOOM and DOOM II was to allow projectiles to go through them. Changing this, even under a comp flag, unreasonably alters the playability of many maps, so I consider it unacceptable. Making the behavior flag-controlled also allows it to be applied to user-made objects, which may prove useful in the future. ===================================================================== Changes since Eternity Engine v3.33.00 ===================================================================== ===================================================================== 06/21/05 Began earnest research into what is necessary to give Eternity working netcode. The changes required or at the least prompted by this would touch several thousand lines of code. I have added more than seventy new FIXME's in the catagories of NETCODE, CONSOLE, DEMO, WEAPON, CONFIG, and COMPAT that are all interrelated to some degree. If this project is undertaken, it will end up removing most of the SMMU code that is currently left in Eternity and will nearly render it a new engine. It may require extensive borrowing of ideas and possibly code from Quake 2 and, to a lesser degree, zdoom. ===================================================================== 06/15/05 Added two new codepointers, RandomWalk and TargetJump, which are needed by CQIII for non-player characters. ===================================================================== 06/08/05 Noticed that patch widgets must account for a patch's offsets when erasing the area the patch covers. Added rangechecking to R_VideoErase in case user patch or text widgets extend off the screen. Attempting to erase off the screen would otherwise cause a very hard crash. ===================================================================== 06/07/05 Made crosshair highlighting optional by user request. Added a new thing flag, NOFRIENDDMG, by user request. Things with the flag won't take damage from any thing that has the FRIEND flag. ===================================================================== 06/06/05 Discovered a long-standing problem in the teleportation code while using the whistle command on ChexBuddy. He would always get stuck inside of inert objects, but not inside enemies. I discovered that for some reason, DOOM totally ignores objects without the SHOOTABLE flag when determining whether or not something can teleport to a spot. The comment there indicates that since the thing isn't shootable, it can't be telefragged either. However, the proper thing to do would be to deny the teleportation instead of sticking the player or other thing into the inert object. To fix this for specific applications of teleporting, I added a static global var and a new function called P_TeleportMoveStrict which sets it. When that var is set, PIT_StompThing will do a full clipping check when it encounters an unshootable object instead of ignoring it by returning true as if it doesn't exist. The whistle command now uses the strict function. Other teleports will still get you stuck inside inert objects, for full compatibility. ===================================================================== 06/04/05 Complete rewrite of hu_stuff.c and the HUD engine to streamline it and allow easier access by scripting. fraggle's widget system has been expanded to include all of the HUD widgets, and has been altered so that it acts like a class, with pseudo-inheritance and pseudo- polymorphism. It's as close as you can get to OO in C. Repaired player messages to use V_WriteTextColoured with the current configured message color. Of course, this color is overridden by any that might be in the string itself, so things like obituaries can still have their separate settings even with this change. Previously, for some bizarre reason, fraggle was only giving messages that orig- inated from picked up items the proper color. I knew of this problem a long time ago but put off fixing it. Fixed possible error with how the messages are erased when the player chat widget is active. ===================================================================== 05/30/05 Isolated and repaired one of fraggle's changes to vertical mouse sensitivity which was causing it to have to be cranked up to almost maximum in order to get any mlook response. Some people have misinterpreted this as a problem with mlook when it's actually a problem with the mouse input processing in G_BuildTiccmd. ===================================================================== 05/28/05 Isolated cause of yshearing-related sprite glitch after inspiration by a comment SoM made about it seeming like the column coordinate value was out of sync with the scaled length and step values of columns. In all 17 of the column drawer functions, the following change had to be made: //frac = dc_texturemid + (dc_yl-centery)*fracstep; frac = dc_texturemid + FixedMul((dc_yl << FRACBITS) - centeryfrac, fracstep); The first line is the original coord. calculation, which involves the use of "centery", which is the center of the view window chopped to an integer. With the new yshearing system, however, column positioning is influenced by centeryfrac, which is fixed-point and contains a decimal portion of the value lost by centery. Since this calculation was still using centery, the coordinate was too coarse and thus resulted in garbage at the end of columns. Changing this also remedied the slight but noticeable jerkiness of the new yshearing code. This was caused by the "chunky" increase and decrease of the integer centery value. Note: At least part of this calculation is constant across columns drawn for the same sprite. In zdoom, that part of the calculation is performed outside of the column drawers. This is a possible avenue for further optimization of the column drawer functions. ===================================================================== Changes since Eternity Engine v3.31.10 ===================================================================== ===================================================================== 05/26/05 Changed up to SDL_mixer 1.2.6, which finally includes the fix to native MIDI volume setting which had been in SDL's CVS for well over a year and had lead me to believe the existing code was in 1.2.5 and still malfunctioning. However, the desktop volume setting is still changed and left different, and I'm not yet aware of any way to fix this, since SDL_mixer cannot query the MIDI volume without an active MIDI playing. If I must, I may have to create a Win32-specific module to address that problem, which would open its own MIDI handle, query the volume at startup, set it appropriately to Eternity's setting and store the original, and then change back to the original setting on exit. Sounds like a big pain in the ass to me; the use of SDL is SUPPOSED to avoid the necessity of stuff like that. ===================================================================== 05/24/05 Applied SoM's patches to the portal rendering code that enable proper recursive rendering of anchored portals along with other fixes. Final preparations for v3.33.00 launch are being made. ===================================================================== 05/20/05 Completed all parameterized floor line types: 306 - Floor_RaiseToHighest(tag, speed, change, crush) 307 - Floor_LowerToHighest(tag, speed, change) 308 - Floor_RaiseToLowest(tag, change crush) 309 - Floor_LowerToLowest(tag, speed, change) 310 - Floor_RaiseToNearest(tag, speed, change, crush) 311 - Floor_LowerToNearest(tag, speed, change) 312 - Floor_RaiseToLowestCeiling(tag, speed, change, crush) 313 - Floor_LowerToLowestCeiling(tag, speed, change) 314 - Floor_RaiseToCeiling(tag, speed, change, crush) 315 - Floor_RaiseByTexture(tag, speed, change, crush) 316 - Floor_LowerByTexture(tag, speed, change) 317 - Floor_RaiseByValue(tag, speed, height, change, crush) 318 - Floor_LowerByValue(tag, speed, height, change) 319 - Floor_MoveToValue(tag, speed, height, change, crush) 320 - Floor_RaiseInstant(tag, height, change, crush) 321 - Floor_LowerInstant(tag, height, change) Unlike Hexen, all target types are supported with both raise and lower, and instant motion is possible if the target height is in the opposite direction of the indicated motion. Also unlike Hexen, all line types can specify the texture/type change properties and crush value. Like Hexen, however, crush damage is now customizable through these line types -- the crush parameter, if greater than zero, indicates how much damage to do at each "crush event" (which occur each time "leveltime & 3" is false). Customizable crush damage required a change to PIT_ChangeSector and its calling functions, as well as T_MovePlane, and parameter value changes everywhere those functions were called. ===================================================================== 05/19/05 Brought Eternity's Small version up to 2.7.3 and applied a patch to repair portability of AMX binaries to big-endian processors. Renamed all Small natives, defines, and enumeration values to begin with an underscore. All symbol names starting with an underscore will now be reserved for engine use. Began work on parameterized floor line types. Changed the API and semantics of some Small natives to make them better, before the APIs become public. ===================================================================== 05/01/05 SargeBaldy found another possible Look <-> Chase infinite recursion caused by calling Chase from an attack state. Repaired the same way as for seestate recursion. ===================================================================== 04/10/05 Had to add an elaborate set of functions to properly erase HUD center messages. fraggle neglected this in SMMU and it turned out they were leaving scraps on the border in smaller screen sizes (as for why I never tested this before, who knows). ===================================================================== 04/09/05 New mlook system is complete and flawless. Added a kludge to the HUD code that nudges the crosshair up and down based on your pitch angle to keep it matching more closely with where the player is aiming in screen sizes other than maximum. I still don't know why exactly this is a problem, but it's mostly taken care of now. I'm not aware of a way to make it match exactly (I'm sure it would be very complicated). ===================================================================== 04/06/05 Promoted "allowmlook" variable to sync-critical status, requiring it to be saved in demos and save games. This should have been there all along, and I have noticed several other such variables that are still not saved. I will have to catch them one at a time. ===================================================================== 04/05/05 Visual part of new mlook system is now complete, and work has begun on getting the player to shoot where he's looking again. Added an MSVC packing pragma and GNU C __attribute__((packed)) to the MUSheader structure in mmus2mid.c -- although the structure is by default aligned properly, this is by no means guaranteed. There are actually a large number of instances where DOOM is using structures not declared as packed to read/write directly to/from file. This isn't portable and needs to be addressed eventually. ===================================================================== 04/03/05 Began rewrite of the mlook system to make it based on a true pitch angle instead of a simple delta value to the center of the view screen. View centering will now work correctly, but v3.31 demos recorded with mlook on will no longer function (it is impossible and unnecessary to maintain both mlook systems). Removed some unnecessary FixedDiv calls in R_SetupViewScaling. SoM accidentally shifted up an integer and then used FixedDiv. Just dividing by the integer value works fine and is way faster. Renamed the "yprojection" variable to "yaspectmul", which matches the name zdoom uses for the y aspect-ratio multiplier, which must be used in the calculation to transform the player's pitch angle into a pixel offset. Fortunately, yprojection had been added earlier to support multiple resolutions. DOOM itself never had any use for that value as far as I know, and thus didn't calculate it. ===================================================================== 04/01/05 Added SoM's awesome code for blood particles that drip to the ground and then slowly fade. Altered it to use the style flags I added a while back that automate those kinds of effects, and also to happen randomly along with the existing "cloud of blood" effect, so that there's more volume. ===================================================================== 03/14/05 Tripped onto some bugs in ExtraData. The "tag" field was using a string for its default value when it was an integer field, which resulted in the value 15628 being put into every record that didn't specify a tag -- this value was the string's address truncated to a short. Also, a loop was assuming that lines have 8 arguments when they currently have 5 (this may be increased if I find I need more arguments, but right now 5 is the most I've needed, and is the same as in Hexen and zdoom). This was resulting in an infinite loop in E_EDLineForRecordNum, caused by the "next" and "recordnum" fields in maplinedefext_t getting overwritten with zeroes. As long as there was only one ExtraData linedef record, this wouldn't happen, so these bugs were hidden until now, revealed by a change to my param lines test map. ===================================================================== 03/13/05 While adding tweaks to the linedef activation system for parameter- ized specials, I found an oversight in SoM's plane shooting code that allowed 2S line specials to still be activated when a bullet passed through a floor or ceiling in front of them. The problem was DOOM's assumption that a 2S line with the same floor and ceiling heights on both sides of it could not possibly stop a bullet. When allowing planes to stop bullets, this isn't sufficient -- the bullet must always be clipped against the actual line opening. Changed P_ShootSpecialLine to take a line side argument, and changed P_UseSpecialLine and the button changing code to allow param lines to be used from the back side. Added a 1SONLY extflag for param specials to restrict a line's activation to being used/hit/crossed from the first side only. Normal line types are not affected by any of these changes. Removed a number of redundant "line->sidenum[0] != -1" checks that were scattered throughout the game engine. Lee patches such invalid lines at startup in the P_LoadLineDefs2 function, so checking for them during play is unnecessary. There may still be a few of these checks left, but it's ok since they don't *hurt* anything. Removed a redundant check on "underwater" in R_FakeFlat. The check was probably accidentally left by Lee when he rewrote the deep water lighting code for MBF. I found this while reformatting the code and removing a couple of signed/unsigned conflict warnings. This is one of only a scant few changes I've made to r_bsp.c the entire time I've worked on Eternity :) Added some new routines to my qstring pseudoclass: M_QStrUpr, M_QStrLwr, and M_QStrCreateSize. Eventually this class will probably include just about everything you can do with a string, but I'm holding off on most of it until I actually need them. There's no use having a million functions that aren't actually used. ===================================================================== 03/12/05 Rewrote various parts of the MapInfo parser to get rid of some ugly hacks left over from SMMU, including one potential buffer overflow involved in extracting the variable token from an assignment. This also fixes the bug I found where the last line of the lump wouldn't be parsed unless it ended with a line break. qstring helped me a lot with this. ===================================================================== 03/10/05 SoM, who has returned from his short programming vacation for a while, fixed some issues with anchored portals. They can now be made to work two-way, and they can work inside of each other as well (which I believe they were meant to do originally, but did not). He made a very impressive test map and posted screenshots on his website. Unfortunately, some people on Doomworld have misinterpreted the map as having true ROR, so we may be dealing with some unhappy campers after v3.33.00 release :P SoM also still wants to work on getting mobj_t's to be able to tele- port through anchored portals. I know there are a ton of issues in- volved with this, but I hope we can iron them out and make it poss- ible, since spatially connected anchored portals would basically be like ROR. ===================================================================== 03/01/05 Added two new types of parameterized doors, WaitClose and WaitRaise, which are like the "close in 30 seconds" and "raise in 5 minutes" sector types, but triggerable from lines. The only real difference with these doors are how the same fields are setup at the beginning, so it only took a few lines of code to add them. This brings the current parameterized line special list to the following: 300 - Door_Raise(tag, speed, delay, lighttag) 301 - Door_Open(tag, speed, lighttag) 302 - Door_Close(tag, speed, lighttag) 303 - Door_CloseWaitOpen(tag, speed, delay, lighttag) 304 - Door_WaitRaise(tag, speed, delay, countdown, lighttag) 305 - Door_WaitClose(tag, speed, countdown, lighttag) These 6 line specials implement more or less every type of vertical door possible. I will continue the implementation process by moving on to floors, ceilings, stairs, plats, lights, etc., until all functional catagories are covered. At that point, loading Hexen maps via runtime conversion will not be out of the question. Added ability to separate tokens within EDF compressed frame fields with commas instead of pipes. The result is more readable according to several users (including SargeBaldy) who requested it. ===================================================================== 02/28/05 While testing ExtraData, I discovered that loading lumps into libConfuse was broken again. At some point I forgot to add a call to the lexer_init function in cfg_parselump. Added calls to P_ActivateParamSpecial to P_UseSpecialLine, P_ShootSpecialLine, and P_CrossSpecialLine. All processing for param types is done inside P_ActivateParamSpecial, so the param specials aren't subject to any of the quirks or limitations of the original linedef special system. The extflags field now supports the following values: EX_ML_CROSS = 0x00000001, // crossable EX_ML_USE = 0x00000002, // usable EX_ML_IMPACT = 0x00000004, // shootable EX_ML_PUSH = 0x00000008, // reserved for future use EX_ML_PLAYER = 0x00000010, // enabled for players EX_ML_MONSTER = 0x00000020, // enabled for monsters EX_ML_MISSILE = 0x00000040, // enabled for missiles EX_ML_REPEAT = 0x00000080, // can be used multiple times EX_ML_1SONLY = 0x00000100, // activates from 1st side only Unlike in Hexen (and zdoom), CROSS/USE/IMPACT/PUSH are combinable. This allows the same line to be triggered in multiple ways. My first test map contained a door you can both shoot and use, and the multi- ple trigger methods in no way interfere with each other. Also, unlike Hexen, PLAYER/MONSTER/MISSILE triggerability statii are de-wed from the special activation type, allowing them to be indepen- dently combined. Finally, unlike Hexen, these flags go into a new field, and not the almost full normal line flags, so there's no danger of running out of line flags any time soon -- there are still 24 free bits in the extflags field, and I don't even have any planned uses for them yet. This is the real power of ExtraData finally showing itself. I should note that MISSILE|IMPACT isn't implemented yet, and the PUSH activation type isn't implemented at all yet. These trigger types require a hack to P_TryMove that I've not had sufficient time to consider yet. I don't particularly like the way Hexen does it and I fear it might have issues in Eternity if implemented the same way. Changed EV_TurnLightOnPartway to accept a line tag instead of a line pointer, so that param special doors can use an alternate lighting tag and so that specials started with no line don't have to have this feature disabled for them. This function was only using the line for its tag field anyways, so this changes absolutely nothing. Added ability for non-Push type doors to be treated as manual, so that zero tags for such doors don't result in the entire level closing like a door. This only applies when param specials are in action, so compatibility is not affected. ===================================================================== 02/26/05 Added ExtraData linedef record. Added new line fields args and extflags, for parameterized line special support. Format of the linedef record follows: linedef { recordnum = special = | | tag = extflags = args = { , ... } } The special field is the most interesting. All of the original and extended normal line types have been given names, although some of them are very hideous (like W1_Plat_Up32_c0t_Slow) -- I don't anti- cipate these will be used much. Generalized lines can be specified with the following type of syntax: Gen(+) = Floor|Ceiling|Door|DoorLocked|Lift|Stairs|Crusher = +',' The arguments taken are values like "W1", "yes", "CloseWaitOpen", etc., based partially on the BOOM generalized linedef specification documentation in editref.html -- this probably won't be used much either, but it is provided for completeness. It took a hell of a lot of code to implement, too >_< These types of specials are parsed with a finite state automaton lexer similar to the one used to parse cmp frames in EDF, so they're very lenient with formatting. Finally, param specials have very nice names that can be specified in this field, names like "Door_Raise" and "Door_Close". The argu- ments to these types of specials go into the args list, and may be strings of arbitrary format -- currently the strings are only interpreted as numeric values, but this is likely to change in the future to allow prefix:value pairs like in EDF (the code is already setup to allow this when it becomes useful). And of course, you can always just use the line special's number if the names don't suit you. ===================================================================== 02/24/05 Work has begun on parameterized line special support. Changed the hack case for raiseIn5Mins doors to use the new constant plat_special for the direction they're moving in. This allows the value to be used elsewhere consistently. ===================================================================== 02/23/05 Tweaked 3DMidTex clipping even further to allow things to be pushed off them by explosions and weapon fire, and to allow dogs to jump down from off of them. Also made the is/is not on 3DMidTex decision for purposes of ignoring dropoffs more rigorous. This didn't seem to affect behavior in SoM's Ogro Power Facility or in various test maps in any way. Attempted to eliminate things sliding across 3DMidTex when dead by disabling torque simulation for such objects, but it's not enough. They also slide because they are corpses, and this behavior would be very hard to correct given where it is handled in the code. I haven't given up yet, but I have put it off until much later. ===================================================================== 02/21/05 Changed previous patch to problem of particle events/effects going off during the boss brain explosion by adding a new internal thing flag MIF_NOPTCLEVTS which disables events for a thing. The things are now given this flag by the Boss codepointers and also have their effects field zeroed, which eliminates both rocket trails and rocket bursts. Added PS_FALLTOGROUND particle style flag, which causes a particle to live forever until it hits the ground, at which point it starts to age normally. This flag is needed for some of SoM's enhanced effects that still need to go in, as well as those Millennium effects I promised to get to a long time ago. ===================================================================== 02/18/05 Added another change to MIDI: * I_ShutdownMusic now both stops and frees any currently playing song rather than simply stopping it. There's a small chance that exiting without freeing the music causes a resource leak in MCI which, after repeated executions, could cause undefined behavior. It doesn't appear that SDL_mixer accepts responsibility for releasing native MIDI resources when it shuts down. * A song will not be played if a song has not been loaded (shouldn't happen). Also, after stress testing began to indicate that the native MIDI code in SDL_mixer is rock solid after all (except when dealing with rare, malformed MIDI files), I began to look for issues in the sound effects engine, which was taken from prboom 2.0.2, and has already had a large number of bugs fixed. Here's what I found: * There was a possible race condition between the game engine and the I_SDLUpdateSound callback, which may or may not be called from a different thread depending on the platform and sound drivers being used by SDL_mixer. If a channel's data pointer was modified between the time I_SDLUpdateSound checked it for validity and the time it actually used it (which is several times within its loop), the SDL_mixer thread would unquestionably crash. This race condition would tend to be rare and would be highly inconsistent, just like the crashes I've been getting ever since v3.29 Gamma added sound effects in Windows. This was fixed by placing a lock on the channel currently being processed by SDL_mixer. Until that lock is lifted, the other sound engine routines trying to use it must block. I also added some paranoid checks here too: * Added channel bounds checking to stopchan. * Added null sfx pointer check to addsfx. * Added null stream pointer check to I_SDLUpdateSound. With all of this, the sound code should be getting more robust. I don't doubt there are still some problems hiding in it, though. If so, they'll have to be slowly rooted out just as these were. ===================================================================== 02/17/05 After several SDL_mixer-related crashes I have again re-examined the MIDI playing code and I am also using a custom application to stress test the native MIDI code from that library. I have applied the following paranoid revisions to the SDL music code in order to ensure that nothing can be done that is inappropri- ate: * I_SetMusicVolume should never be called if a song is not currently playing. The native_midi_setvolume function in SDL_mixer doesn't test the HMIDIOUT handle it uses for validity, and the handle isn't valid when a song isn't playing. The MSDN docs for midiOutSetVolume do not say that behavior is defined with an invalid device handle, so this isn't safe. * Music won't be halted if no music is playing (shouldn't happen). * Music won't be unloaded if no music is loaded (shouldn't happen). * Music will be stopped before being unloaded (should already be stopped before call to I_UnRegisterSong). * Music will not be loaded without unloading the previous music (shouldn't happen). Because some of the native MIDI routines are intolerant to being called out of order, these paranoid checks make sure they can never be called out of order, eliminating any concern about that. ===================================================================== 02/09/05 Added the ability to load and parse EDF from wad lumps. I'm not sure what I was thinking earlier, because with a slight adjustment to my custom version of libConfuse I was able to let EDF "cross-talk" between wad lumps and files as much as it wants. First, I had to make cfg_lexer_include provide loading from data or from file as an option, which was simple -- it was previously only allowing inclusion of lumps from lumps, and files from files, but there's no need for that restriction at that point in the code. Then, I altered the EDF include function to have this behavior, since it can only load files from other files (it has to interpret the path relative to the current file). To make up for that deficiency, I just added a lumpinclude function that always includes lumps. So, you can use the include functions in the following ways: include * From file: can only include another file * From lump: can only include another lump stdinclude * Always includes a file from Eternity's directory lumpinclude * Always includes a lump bexinclude * Cannot call from within wad lumps (an error message will be given) This gives almost full flexibility to the system, and circumvents the problem of having the defaults already established as being stored in files, since stdinclude can still get to them even from lumps. The root EDF lump must be named EDFROOT, and it can include any number of lumps of arbitrary name. If an EDFROOT lump is present, it takes precedence over any other form of EDF root file specification. I can see this as being problematic, though, as people using EDF lumps might want to substitute in a file to test a temporary idea -- I'll think about how to make this work better before the next release. Made adjustments to M_GetFilePath so that it is more rigorous. It now properly distinguishes between paths relative to the root directory and paths relative to the current working directory, which it did not previously do under my last rewrite. It should now return the proper path for all possible absolute and relative file name strings under DOS/Win32 and Unix-based OSes. ===================================================================== 02/08/05 Implemented additive translucency for sprites and screen patches, so now you can have those burning-hot fireballs like zdoom has. I didn't use zdoom's code directly since Eternity still uses an 8k lookup table; I had to figure out how to do it with the lower precision, which wasn't difficult and ended up pretty much the same. I'm still satisfied with the look obtained with an 8k lookup so I don't plan on changing that any time soon. It also allows me to claim descendence of the code from DosDOOM and avoid any possible licensing issues ;) In the process of this, I found another bug in SoM's column buffering optimization -- single pixels at the top and bottom of the "common" area of a quad column flush would be drawn twice when the columns had areas above or below the common area. For normal sprites, this wasn't noticeable. For translucent sprites, it was negligible. But when it happened with additive translucency, it was horrible, since the intensity increases so much with each overdraw. The simple fix involved removing off-by-one errors when drawing the tops and bottoms of such columns. The R_FlushSingleColumn calls should run to commontop - 1 and from commonbottom + 1 respectively, since the quad flush already draws the pixels at commontop and commonbottom. Also added a BOOM-style translucent column drawer with translation support. They never added this in BOOM, so if you, for example, made the player translucent, he would always be green no matter what. I'm not sure why I neglected to fix this until now, I guess it just slipped my mind after addition of the flex-tran system, which has always provided a TR/TL column drawer. Rewrote part of R_DrawParticle to remove major inner-loop invariants. I have a feeling the compiler was probably fixing this already in the optimizer, but there's no harm in doing it myself and being sure about it. Basically, I was making the same translucency decisions on every iteration, and that was stupid. Of course, the function is quite a bit longer now, since removing the invariants required the inner loop to be duplicated 3 times ;) ===================================================================== 02/05/05 Corrected the allocation level of the TERTYPES lump. It was being loaded at PU_CACHE, but then subsequent allocations were being made before work with it was done. This could have messed up, although it was extremely unlikely to ever happen due to how the zone heap works. This has been wrong since the very first internal SMMU-based build of Eternity, and it's never triggered an error the whole time. Changed the gamemode info system so that the intermission objects are dealt with in the same manner as the status bar objects -- the game- mode-specific functions they point to are now static, and the objects themselves are declared in their respective modules. The interfns_t type is now defined in in_lude.h rather than d_gi.h. ===================================================================== 02/02/05 Added unscaled block drawers for solid and translucent blocks of a single color. I added these to support the new intermission features discussed below. The next feature of this sort to add will be masked block drawers to support rect blit fonts. Added EDF variables that manipulate behavior of the intermission. intermission_pause specifies a time in gametics that the intermission waits after drawing the background but before starting to show the statistics. intermission_fade and intermission_tl specify an optional color and translucency level to overlay the background picture with once the optional wait period has expired (if no wait period is specified, the overlay happens immediately). These two features together allow me to emulate the Contra III intermission for Chex Quest III, but I think other people will like them too ;) ===================================================================== Changes since Eternity Engine v3.31 Delta Pre-Release Alpha 2 ===================================================================== ===================================================================== 01/19/05 Fixed up various things in d_main.c, including an inappropriate use of AddDefaultExtension in the GFS code that probably could have caused a crash, or at the least, would have malfunctioned in the form of returning a bad GFS file name. ===================================================================== 01/17/05 Changed Eternity to use a minor revision version system instead of public beta releases. From now on, I'll just be incrementing the subversion until I think the next number should go up (and it should have done this a long time ago, but whatever :P). Perhaps this will relax those who think that beta copies of Eternity are too unstable to use, which hasn't been true since the horrors of v3.31 beta 1. Eternity has been increasingly more stable since that point, and has not crashed on me (while not in development) since then. ===================================================================== 01/14/05 Finished the unified font engine in the new module v_font.c -- This combines code that was previously duplicated in v_misc, mn_engin, hu_over, and mn_htic to provide a single, uniform interface for drawing fonts. A few special cases had to be mainlined, but this only improves the flexibility of the system. The "big" font can now be enabled for DOOM gamemodes simply by providing the proper FONTB* lumps. I'd like to provide a default FONTB for DOOM in eternity.wad, but I'm a bit short on graphics for it at the time being. I also intend to add support for fonts that are stored inside of a single graphic and copied to the screen with rect blit operations. This will require addition of masked block drawing functions in v_block.c, more than likely, and so I haven't even begun to tackle it yet. I find myself wishing I could use SDL's blitting like I do in RayCaster, but alas, that won't work here for various reasons. SargeBaldy noticed that the vpo_threshold console variable wasn't working. As usual, I forgot to actually add the command to the console command chains with C_AddCommand. I kinda wish there was a way to automate that, because I forget it almost every time I add a variable or command. ===================================================================== 01/11/05 Added the graphical hud for DOOM, which is actually a part of the status bar and reuses its health, armor, and ammo number widgets. I had to add a couple of semi-hacks into the status bar code to get it to allow this, but it was very easy and didn't dirty up the code at all. The most work was spent getting it to draw numbers outside the normal status bar background area and to disable the blitting of parts of the status bar background behind the numbers, and of course to get it to draw the widgets in the proper locations at all times. They wanted to jump back and forth on me at first due to some small errors in the code. ===================================================================== Changes since Eternity Engine v3.31 Delta Pre-Release Alpha 1 ===================================================================== ===================================================================== 11/16/04 I got sick over the weekend, so the second alpha release I had hoped for got delayed a bit longer. Today I've done a little work in the config file code, reformatting a bit of it, adding the vpo threshold variable, and adding a new variable that lets you disable the appli- cation of gamma correction to screenshots, a feature that Lee added but not everyone likes. It will be nice to be able to take normal screenshots without changing your local gamma setting. ===================================================================== 11/11/04 Big day for bug fixes: 1. 3DMidTex thing clipping is now repaired. The solution? Drop offs must be COMPLETELY ignored when a thing is standing on (or under??) 3DMidTex lines, otherwise proper clipping is impossible. This is done by setting the tmtouch3dsides flag in P_LineOpening and then when it is set in PIT_CheckThing, setting tmdropoffz equal to tmfloorz, effectively stating that there is no dropoff to be considered. This prevents the engine from even considering allowing the thing to jump off in the normal fashion, and allows our own code segment that looks strictly for floorz differences of 24 units to catch all things on 3DMidTex lines. It took both SoM and I working together to come up with this final fool-proof solution. 2. I noticed a while back that P_CheckPosition seemed to be broken when I saw some Maulotaurs respawning inside each other in Heretic while in Nightmare mode. I saw this again recently with some imps in DOOM II MAP01 and so I knew there was a problem. I fired up a test map and spawned a demon, killed it, and stood on top of it, and sure enough, whammo, I'm stuck inside it as soon as it comes back. I debugged the program and stepped through the P_CheckPosition call, and what should I find except that the code is working perfectly as it is written -- it's just written incorrectly, and the problem has been there since, guess what -- BOOM. I tested this in WinMBF to be certain (finding an unrelated bug in it in the process) and sure enough, standing on a dead thing in Nightmare mode nets you getting stuck inside it. SargeBaldy also complained that Archviles were sometimes getting stuck to things they respawned, or the things were getting stuck to other things in their vicinity. I knew these were clearly related. I wonder how no one has noticed this bug in all this time, as it is apparently in every BOOM-descendant source port. I checked prboom and its code does not compensate for this error, which turns out to be a result of Lee's fix to allow non-solid things to move through solid things inside the PIT_CheckThing function. P_CheckPosition doesn't take account of whether or not a thing is moving, and thus treats Nightmare and Archvile respawns the same as walking. This isn't appropriate, since the non-moving things being considered WILL be solid when respawned. I have currently repaired this problem by setting and unsetting the SOLID flag on the target objects around the calls to P_CheckPosition when demo_version is >= 331. Demo compatibi- lity for DOOM demos was already fortunately intact due to a check inside PIT_CheckThing. This is not an ideal fix to this, however. A better fix would be a way to tell P_CheckPosition about whether a thing is moving or if it is a non-solid being considered for respawn, but since the actual check on the SOLID flag is done in PIT_CheckThing, an iterator func- tion called by P_BlockThingsIterator, the information cannot be easily passed down to it except through an ugly global variable, and I do not want to introduce any more of those to the clipping code, which is already a labyrinthine nightmare. ===================================================================== 11/09/04 SoM made improvements to moving 3DMidTex lines to allow more flexible tagging and therefore more complex structures possible. This lets his 3D elevators in Lava Factory have independently movable guard rails. ===================================================================== 10/28/04 Removed my earlier -workdir hack and replaced it with new Win32- specific code in i_fnames.c -- this code utilizes the GetModuleFileName and PathRemoveFileSpec API functions to get at the real fully-qualified name of the Eternity process's EXE file. Unless these API functions are also broken under Windows XP, which I find unlikely, this should much more naturally resolve the issue of files not being found when the frontend starts Eternity on that platform. D_DoomExeDir currently calls WIN_GetExeDir only when compiling under Visual C++. I can add support for other compilers if it is also an issue for them (I am unaware if this problem affects the MinGW build). ===================================================================== 10/08/04 Fixed Cyb's outstanding crash issue -- it was caused by a zero-length sound lump. They are not technically valid, but there's no reason they cannot be accepted as meaning silence by simply playing no sound, which is what the code now does. prboom already fixed this at some point, apparently, as it did not crash when playing Cyb's map. BTW, I am aware that zdoom once had a problem with such lumps, but it was not the same as my problem. That problem was caused by an attempt to allocate a huge amount of memory, whereas my problem was actually an out-of-bounds index into a lookup table caused by the computed padded size of the sound being a negative number. ===================================================================== 10/04/04 Added support for percentage values in the EDF translucency field for thing types. Percentages must be base 10 integer numbers between 0 and 100, with the last digit followed immediately by a % character. All non-percentage values are still interpreted as numbers on a scale from 0 to 65536. Note the percentage is phrased in terms of the percentage of the foreground graphic that is used, as opposed to background. This is the same as other engine translucency metrics, so 100% is, in this case, not translucent at all, and 0% is invisible. ===================================================================== 09/29/04 Added the ability to customize the visplane overflow threshold used by the SMMU VPO detector HUD widget. As discussed in several places, this detector cannot be exact due to optimizations made in BOOM's visplane splitting algorithm (DOOM generated many more visplanes than it needed to draw a scene, which only exacerbated the effects of the static limit placed on them). Finally got around to removing the weird hack that Dave Taylor put into ST_Responder which allowed the automap to notify the status bar when the game was changing into or out of automap mode. The code to do that did NOT belong in ST_Responder, and the notification messages were being sent in via hacked event_t structures that contained values which were assumed to not alias any valid input. This made an unnecessary AND-op and branch in ST_Responder on every single input event, which is gross considering the nature of the hack. Created a function called ST_AutomapEvent which the automap code now calls instead of ST_Responder. ===================================================================== 09/26/04 Added the ability to reskin monsters with a new sprite via the EDF field "skinsprite." Monsters with a valid skinsprite will use that sprite value instead of any value which is in the frames they enter (with the exception of the S_GIBS frame, because enemy skins are cleared when a thing is crushed, and restored by an Archvile if it resurrects such a monster). Now you can have monsters which act the same but look different with a minimized EDF thingtype definition which simply inherits from the original type and sets the skinsprite. ===================================================================== 09/14/04 Eliminated all unused state enumeration values, converting the enum to use assigned values for the states that are needed. This makes maintaining EDF much easier. ===================================================================== 09/13/04 Fixed ANOTHER bug in the Heretic Imp's crashstate logic. If an imp hit a raised floor after calling the ImpXDeath1 pointer, it would enter its crashstate without ever calling the ImpXDeath2 pointer. This would cause it to keep the NOGRAVITY flag and hang in midair forever. This bug was in Heretic. Split the code in R_FlushColumns to create R_ResetColumnBuffer, which is now called from the main rendering loop instead of R_FlushColumns. This moves some redundant variable-clearing code out of the column drawing line of execution (the most critical line in the engine). Although the column quad cache rendered us a higher FPS, the code as is has a lot of room for futher optimization. ===================================================================== 09/12/04 Optimized the flex tran code in r_draw.c by calculating and caching pointers to the tran lookups when the first column is cached, rather than when every single column is flushed. All the columns in cache must share the same flex tran lookups, or they'll be flushed, so it remains constant during that time. Split up R_GetBuffer into several different functions which are called from the different R_DrawColumn versions. This allows maximum use of known information to minimize the number of branches. These functions are candidates for future inlining, as they are very small now. ===================================================================== 09/11/04 Fixed a bug in the column flushing code where it used the wrong tranmap for BOOM-style translucent columns. Unrolled a loop on a constant value in R_FlushQuadColumn and then reordered the function calls made within it to be in closest screen order, hopefully reducing possible CPU cache misses. ===================================================================== Changes since Eternity Engine v3.31 beta 7 ===================================================================== ===================================================================== 08/22/04 EE v3.31 'Delta' pre-release alpha will launch today. I'll let it stay up for a few days, wait to see if any problems are reported, and then I'll upload the final EE v3.31 release to /idgames. This is mostly to avoid the curse I suffer of uploading something only to find I left out one file, or a single line of the EDF is wrong, etc. I'm otherwise fairly confident that EE v3.31 is stable and has very few bugs. ===================================================================== 08/21/04 Added the ability to specify an alternative working directory over the command line using the parameter "-workdir". This is made necess- ary by bugs and compatibility problems in Windows XP which are break- ing the frontend. Not only does Windows XP's crt0 deliberately strip the absolute file path off of the exe name in argv[0] -- the CreateProcess API function on that system also fails to properly set the working directory. So, it is literally impossible for Eternity to figure out the appropriate place to get its files from when started by the frontend. I'll have to release a new frontend version that implicitly uses the -workdir command line parameter instead of only trying to set it via CreateProcess. It'll probably follow shortly after 3.31 Delta release since the change is very minor. I fixed the bug with explosions tangent to 3DMidTex lines by using SoM's suggestion of checking against mo->secfloorz instead of mo->floorz. The secfloorz field, which SoM added, always has the sector's floor height, whereas floorz may be modified by 3DMidTex lines. ===================================================================== 08/20/04 Absolute final preparations are being made for the pre-release alpha of Eternity Engine v3.31 'Delta' -- Delta is the name I decided upon for two reasons: first, it comes after Gamma, but second, it also stands for change in math, and Eternity is really changing and beginning to come into its own now. I completed beta versions of the MapInfo and ExtraData documentation today and during the past few days. It feels so good to have this stuff documented and completely ready for use by editors at long last. ===================================================================== 08/16/04 I was play-testing Heretic a bit more and found that the imps had a couple of oddities with the crashstate: 1. If an imp died above a floor but drifted into another sector where its z coordinate was EXACTLY equal to the floor, such that it never moves even 1 unit in the z direction, it could miss going into its crashstate. P_XYMovement must also check if a thing should enter its crashstate. This is done when the thing is no longer moving on the x or y axes and is at the floor z. This error happened by the yellow key area of Heretic E1M1. The imps there often spawn on the floor. 2. Under just the right circumstances, a dead imp falling down stairs or off a short ledge could enter the crashstate twice. I believe this happened in Heretic too, but I've fixed it by making the ImpDeath and ImpXDeath2 pointers set the MIF_CRASHED flag so that the movement functions won't cause a re-entry into the crashstate when a dead imp is sliding. So now you shouldn't get two sets of imp chunks from one imp, no matter what ;) I added the NOSPLASH flag to a few Heretic objects that really shouldn't splash, like PodGoo. Way too many sounds going on when pods blow up over water :P Somehow I managed to get stuck into an Iron Lich today when he tornadoed me on a lift. Not good, but the situation in which it happened was so esoteric and extreme that I'm not worried about it. If anybody can find a commonly creatable circumstance where you can get stuck into things with z clipping turned on, then we can worry. Until then, no. I doubt it'll ever happen again unless the exact circumstances are recreated. ===================================================================== 08/15/04 A while ago I got a bug report via email saying that dog jumping was broken, but I dismissed it at the time. Well, today I tested it my- self, and sure enough, dogs never jumped down. I found a code segment in P_TryMove which SoM added for 3DMidTex lines. Unfortunately, it broke dog jumping (and possibly some other stuff too). I had to comment it out for now, and I think the only ill side-effect is that monsters walking on 3DMidTex lines can hang a little bit too far off the lines, which just looks a little odd. If this cannot be fixed without breaking other stuff, we'll just leave it be. Things already hang off normal ledges a lot, even with Lee's falling physics, so I don't think it's a big deal. There's another bug with explosions that take place on the top surface of 3DMidTex lines -- they trigger terrain hits no matter how far above the real floor they are. Unless there's a reliable way to distinguish when a thing is and is not above 3DMidTex lines, I don't know how we're going to fix that. ===================================================================== 08/14/04 Finally applied SoM's patch to fix the spectre fuzz problem. The code wasn't caching the proper colormap to use when flushing fuzz columns, so it could get munged up. ===================================================================== 08/12/04 Repaired some minor but annoying sound bugs related to external cameras. Fraggle's sound code adjustments didn't always use the camera as the point of reference for sound, so sometimes sounds could pop back and forth between the player and the camera. This was only really noticeable with the chainsaw. Also, it seems like S_AdjustSoundParams could have dereferenced a NULL listener. I'm not sure how this hasn't caused problems in the past, but I added a check for it anyways. ===================================================================== 08/08/04 I fired up BOOMEDIT.WAD today to do some final rounds of regression testing (because I DO need to release really soon). Guess what should appear but a gaggle of previously undetected bugs! 1. Deep water ceilings clip off the bottoms of sprites, even when the 242 ceiling is even with the floor. This looked like a bug at first, but technically it isn't. 242 flat sprite clipping is and MUST be more rigorous than the normal interaction of sprites and flats. Normally a thing can extend into a floor practically as far as it wishes and it will be displayed. In order to have proper behavior with 242 effects however, the sprite must be clipped exactly. There is no easy way to detect the case where a thing is on a floor exactly even with the 242 ceiling within the sprite rendering code, and so I cannot change this. Even zdoom has the same behavior here. 2. BoomPushPoint and BoomPullPoint were broken, causing the point- source effects to work only intermittently and only at close range to the objects. Believe it or not, this was an EDF error. When I wrote InfoConv, a hacky little program that turned the info.c data into the initial Eternity EDFs, I assumed that all the mobjinfo entries had integral radius and height values. Alas, the radii and height of the BoomPushPoint and BoomPullPoint objects were only 8 for some reason, and not 8*FRACUNIT -- this means they should be 0.0001220703125, not 0.0 -- the change broke the visibility test on these objects done in the pushing thinker code. 3. The chasecam can still act iffy on some deep water boundaries. I dunno if I can make it any better or not. Now is not a good time for it, that's for sure. It will have to wait, possibly forever. (Can you tell I don't care about it very much? :P ) 4. BOOM Extended sector damage types were broken because of a really stupid error I made in the (possibly temporary) code which chooses between DOOM- and Heretic-style nukage damage. Note that currently, the game is using bit 12 of the sector type to indicate that a BOOM extended sector should do Heretic-style damage. I don't like this because it's not solving any problems; it's better than the system I had previously, which was hardcoded by gamemode, because it would let the user pick the damage type in any game- mode. I'm still not sure what the best combination of solutions for custom floor damage will be -- I say combination because in the end, the sector type, TerrainType, ExtraData, etc. could all have different means of providing damage values. The bit 12 toggle has never been documented and you should not try to use it. It is very likely to disappear, as there aren't that many free sector bits left and I think that toggling between 2 static damage types using one is wasteful when more general solutions are possible. ===================================================================== 08/07/04 Finished adding the very last Heretic enemies, the Gargoyle and Gargoyle Leader (the EDF and source call them Imps since I cannot type Gargoyle over and over >_<). Finally added the crashstate field to mobjinfo, and EDF support for it. So now your dead falling monsters can switch into a different frame when they hit the ground (note: not useful with the DEADFLOAT flag at all ;) I generalized the code in A_SkullAttack so that anything doing a pure SKULLFLY attack can call it (this includes the Heretic Imp, but not the Maulotaur, who does his charge a bit differently). The new function is P_SkullFly. I ripped out almost all the existing TerrainTypes and floorclip code and replaced it with a new system, with some parts adapted from zdoom -- some serious problems had crept in through the various versions and it was getting difficult to put up with it. Plus, if I want to generalize the floorclip system to allow variable terrain clipping or monster effects, it had to happen anyways. Three things happen as a result of this: 1. TerrainTypes now work perfectly with deep water! When a normal thing descends past a deep water surface, a splash is formed there at that time. When missiles or bouncers cross the surface at all, they splash (so shooting up OR down through water causes splashing). 2. Missiles now cause TerrainType hits. People requested this a long time ago, but with the state of the system I didn't even want to try it then. If you want a missile that doesn't splash, give it the flags2 bit NOSPLASH and it won't (that goes for anything else too). 3. v3.29 demos recorded with TerrainTypes on are forever broken. Sorry, it had to be done. I couldn't preserve the old system. This is much like when Lee ripped out BOOM's extremely inefficient thinker-based friction algorithm -- BOOM demos with friction cannot play back properly either, but he had no way to preserve the old friction system without either some serious hacks or total code explosion. SargeBaldy estimates the number of v3.29 Gamma demos to be exactly zero, and so I really doubt this hurts anyone anyways. In some ways it is fortunate that Eternity has not seen much use yet. It lowers the compatibility woes when things have to be changed in fundamental ways like this (which is rare). Note that recording demos with beta versions of Eternity is unsupported and always has been. I can't keep track of changes across betas, only across the major version number -- the code would become impossible to handle otherwise. If you need to record a demo on a beta version of Eternity, you better keep that beta version forever, because the demo will probably desync a few betas later. ===================================================================== 08/06/04 Added all the Heretic ammo objects, just for the hell of it. ===================================================================== 08/05/04 Eternity now officially has feature creep. I just can't quit adding stuff ;) After noticing what Heit did in zdoom, I added a function called P_SubRandom, which can safely subtract two random values without incurring ambiguity in order of evaluation. Lee Killough had alreadly eliminated all such expressions, but he did so by adding temp values everywhere, which while it worked fine, makes the code look messy and less readable. P_SubRandom fixes that. At some point I also went through and found anywhere that a thing is thrusted along an angle and changed all those calculations to calls to the P_ThrustMobj function. No use having a function like that if none of the code uses it. Having small functions for these common operations makes writing new code much faster and more uniform. ===================================================================== 08/03/04 Finalized various details on stuff done during the past week. Added ability for Iron Lich whirlwinds to update their tracer to the Iron Lich's new target whenever their current tracer goes bad. This allows the Lich to "direct" its existing whirlwinds toward any new target it acquires. This keeps them from spinning off into walls prematurely and just sitting there until they time out (although they still do that if the Lich doesn't acquire a new target that the whirlwind can follow). Added flags3 CANNOTPUSH flag and added it to everything from Heretic that should have it. I'm not aware of any DOOM items that should have this flag, as it mainly applies to objects that pretend to be missiles but are not (like D'Sparil's blue sparks and the goo that comes out of pods when you shoot them). The Eternity TerrainTypes splashes do need it, but I really count them as Heretic things anyways, since that's where they originated ;) I am beginning the final stages of preparation for v3.31 final release. There is still a ton of documentation work to be done :( ===================================================================== 08/02/04 Added Heretic Iron Lich. Added codepointers AproxDistance, LichFire, LichWhirlwind, LichAttack, WhirlwindSeek, LichIceImpact, and LichFireGrow. Added a damage field to mobj_t which mirrors the value in mobjinfo_t. This was necessitated by the Iron Lich's fire pillar projectiles, which must do zero damage until they have become visible. This adds more flexibility to the damage that things can do by making the value writable and determined on a per-thing basis rather than per-thing- type. Added flags3 EXPLOCOUNT flag, which is used to keep Iron Lich whirlwinds from blowing up like missiles until a certain condition is met. That condition is when the object's special2 (counter 1) field is greater than its special3 (counter 2) field. This flag is rather situational and probably won't see much editor use. Revised the CounterJump and HealthJump codepointers so that they can support both immediate values and values from counters. Added more operations to the SetCounter and CounterOp codepointers. Added extended parameters to the MBF Scratch codepointer so that it can get its damage value as a constant from Unknown 1 (as it always has), from the thing's damage field, or from a counter. This makes it very flexible without breaking compatibility. Added 2 new special effects to the HticExplode pointer -- Maulotaur floor fire explosions and Timebomb of the Ancients explosions. True that the Timebomb of the Ancients won't be in the engine for a while yet, but that code's there waiting for it and can, of course, be used by editors. Finally eliminated all the commented-out and #if 0'd code in info.c, reducing the file to nothing but some legacy comments and the declarations of the sprnames, states, and mobjinfo pointers and their corresponding NUM* variables. Eliminated all the unused DeHackEd number enumeration values for mobjinfo. The remaining ones are the ones that are actually used, and they use value assignments to make them keep the right values. I want to do the same thing for frames, but I'm having trouble finding out which frame enum values are used due to the sheer number of them and because of the difficulty of isolating only frame enum values in the source (even regexps catch a lot of identifiers that aren't frame enum values). ===================================================================== 08/01/04 Added the dmgspecial field to the EDF thingtype and support for it in P_DamageMobj. Added MaulotaurCharge and Whirlwind damage specials. ===================================================================== 07/31/04 Added SectorColormap Small function. ===================================================================== 07/30/04 Rewrote P_CollectThings and made it part of the new MobjCollection system. This is another OO-like structure which is manipulated only through functions which can be found in p_mobj.c -- this gets rid of some of the weirdness such as use of a pointer-to-pointer-to-pointer, and reduces some duplicated code in the segments that use reallocated mobj pointer arrays. Added Heretic Maulotaur, eliminating ETCMinotaurus and all of its associated resources in the process. As stated earlier, almost all of the Maulotaur's code was already in the engine. Added the flags3 INVULNCHARGE bit to resolve a fixme on the special treatment of SKULLFLY'ing Maulotaurs which was #if 0'd out after the addition of EDF. ===================================================================== 07/29/04 Added Heretic volcanoes. Added new codepointers SetTics, VolcanoBlast, and VolcBallImpact. Added a new parameter to the BeastPuff codepointer to allow disabling the application of momentum to the puff objects. ===================================================================== 07/26/04 Added a failsafe to the Chase codepointer so that it cannot cause infinite recursions when used in an object's spawn state. ===================================================================== 07/23/04 Got around to fixing a couple of issues in the menu system. String console variables being subjected to input via the menu system, such as savegame names, now have their current value copied to the tempo- rary input buffer (except when on the savegame menu and the value is "empty slot"). I also simultaneously fixed it to use the replaceable "empty slot" string that is defined through DeHackEd, rather than a locally defined copy of that same string. The DeHackEd string had been orphaned at some point and wasn't being used. This removes the painful necessity of retyping the same savegame name over and over every time you save to the same slot. I'm really not sure why fraggle left this out, seeing that it was in MBF already and the code to do it is only a bit more complicated than the code to clear out the input buffer. This was a heavily requested feature, but I put it off 'til now because (once again) I figured it was going to be difficult to fix. It wasn't. Also made a couple of the menu help messages (displayed at the bottom of the screen) sensitive to menu key bindings. They'll tell you one of the proper keys to press, rather than always displaying the engine default of "enter". There's one I haven't fixed, though. This is just misc stuff I'm mopping up while waiting to send the source to SoM so he can fix the Spectre bug introduced either by hires or by the column optimization code (he knows which but I do not ^_^). Once that's done, we'll be ready to make preparations for some beta testing and then the release. ===================================================================== 07/22/04 Moved par time determination code from g_game.c to p_info.c. Finished implementation of global MapInfo lump support. The global MapInfo lumps are named EMAPINFO (*not* MAPINFO to avoid future Hexen conflicts!). As mentioned earlier, they cascade and allow the latest definition for a map to become the one that is used. HOWEVER, I did NOT use the libConfuse parser! I started working on a libConfuse implementation, and before I was even half done I had about 150 lines of asinine and redundant code. I realized it wasn't going to work and trashed it all immediately. Instead, I put some extra code into the existing parser that lets it go into "global" parsing mode. It only adds about 10 or so lines of code to the existing parsing functions, and works MUCH better. Another obvious bonus is that the syntax is almost 100% consistent with in-header MapInfo (the difference is that in global MapInfo, the blocks are named for the maps they belong to (ie "MAP01"), and in the in-header flavor, there can only be one block which must be named "level info"). Did some minor testing of this, goofing with the START map and several DOOM levels. It seems to work brilliantly, but of course it needs a more thorough beatdown to be sure of its correctness. But no, the format is not zdoom/Hexen-compatible. Sorry. >:D This completes virtually everything in the code that is necessary for v3.31 final release. ::ominous drum rolls echo like thunder:: ===================================================================== 07/18/04 Moved the sky texture determination code from r_sky.c to p_info.c. ===================================================================== 07/17/04 Began the final changes for v3.31 final -- the implementation of the global MapInfo lump. Support for map header MapInfo is not being removed, but rather augmented. MapInfo embedded into map headers will override the information provided in global lumps. The global lumps will be additive, such that the definition for the current map will come from the LATEST MapInfo lump, but other maps can still come from prior ones. I am planning at this point to use libConfuse to parse the global lump, so its syntax will be EDF-like rather than the same as in-header info. The first course of action was to put all the info_* variables into a new struct (a long-standing TODO), the LevelInfo structure. This didn't take long at all. The second thing to be done, which will take longer, is "centralizing" MapInfo such that it becomes the DEFAULT place to get map-dependent information from, rather than an alternative to numerous other sources scattered around the executable and determined one-by-one through complicated decisions that muddy up the source code. This process has been started by moving the f_finale code for deter- mining the intermission text, backdrop, and music to p_info.c, and also the automap level name code in hu_stuff.c to p_info.c. I removed the commented-out list of sprite constants from info.h (the old location of the static thing types and frames). I said a while back I might leave that stuff for historical interest, but it adds +200kb to the source code and thus eliminating it is a good thing IMO. People can just download the BOOM or MBF source if they really want to sit and stare at the way things were once done ;) ===================================================================== 07/16/04 With the help of the zdoom source, I finally figured out what was breaking the rising pit at the end of Heretic E4M1. For some weird reason, Raven decided to make raiseAndChangeTexture plats go into an eternal stasis after completing their action. As you may know if you are an advanced editor, plats in stasis lock out any other floor actions on the sector in question. This is why the pit at the end of E4M1 does not rise more than once in Heretic, even though it would if you converted the map to DOOM. For now at least, these types of plats will go into stasis when playing in Heretic mode. It would be nice, of course, if a map author could control that somehow. ===================================================================== 07/15/04 Finally added the PrBoom comp_stairs fix for MBF. Lee accidentally munged comp_stairs up really badly, such that most levels wouldn't even work under it if comp_stairs was on (but would without it). I just decided to not spend a lot of time trying to exactly under- stand cph's fix, and copied the ENTIRE new function from PrBoom. I got around to this because someone finally found a map that broke because of it under Eternity and bothered to complain about it to me. If you need something fixed, please tell me. I base my priorities on the more minor stuff largely on user requests these days. ===================================================================== 07/14/04 Deleted the ClericSparkle Eternity TC object and its associated states and codepointer. Absorbed the previous functionality of the P_ClericSparkle function into the Heretic SpawnGlitter pointer by adding some new parameters to it. Added a new codepointer -- CounterOp. It lets you do an operation on two counters and store the result in a third (any of the 3 involved counters may be the same counter, too). This pointer makes the whole set of Counter codepointers a complete assembly language for frames! There are still a few things you can't do (ie store the result of a comparison rather than jump on it), but I'll probably address these based on user requests, since I cannot fully anticipate what is and is not needed. ===================================================================== 07/08/04 Finally got around to adding a filter parameter to the cmdlist console command, so now you can filter for commands that start with a particular letter of the alphabet. I also fixed a masked bug in that command -- if there had been any non-hidden commands that started with the letter Z, they wouldn't have shown up because it used a < where it needed <=. Of course, the only Z command is currently z_print, and it is an undocumented debug command ;) Fixed the MapInfo levelpic and endofgame to work properly under most if not all circumstances. I became aware of the endofgame issue after looking through the Caverns of Darkness source. Seems Joel fixed the problem for CoD but forgot to tell me about it ^_^ ===================================================================== 07/07/04 Added dynamic automap bindings, eliminating the automap key_* config variables. Had to change some semantics in the key bindings system slightly, as well as break up the logic in AM_Responder, for it to work properly. Twiddled the key repeat settings so that the delay is shorter and the repeat rate is slower. Also verified that key repeat *should* be enabled. Without it, a lot of stuff becomes irritating to use, and it is always on under Allegro in DOS too. Broke up the hideous mess in AM_drawWalls. Most of the insanely complex predicates in that function have been scooted off into their own static inline boolean functions. It is so much more readable now! ===================================================================== 07/06/04 Changed the SDL flags in i_main.c into a #define instead of using a local variable. Stack space on the main line of execution should be strictly conserved, as it can never be reclaimed during execution, but will never be used again. ===================================================================== 07/04/04 Repaired a bug in the cast call system that would ignore sound events which occured on the first missile or melee attack state. ===================================================================== 07/03/04 Began improvements to the key bindings system to support multiple binding classes. Binding classes allow a single key to have multiple bindings, as long as each one is in a different class. This restores the BOOM level of functionality while retaining the SMMU flexibility of being able to bind actions to more than one key. Added dynamic bindings for the menu system and eliminated the menu key_* variables. Made the -cdrom code in G_LoadDefaults be conditionally skipped when compiling under Linux, since -cdrom is currently broken for that platform. ===================================================================== 06/24/04 Got around to rewriting the EDF compressed frame definition code to relax the syntax of cmp fields significantly. They now allow arbi- trary whitespace, which is ignored, and quoted values. Quoted values allow stuff like BEX flag strings to contain characters that would otherwise be ignored or cause errors (like pipes and spaces). This is really how I wanted cmp fields to work from the beginning, but I was in a hurry during the initial implementation because many other things also needed to get done. This doesn't break any backward compatibility; it only improves what can be done with the formatting of cmp fields. ===================================================================== 06/21/04 See, I told you my pace was broken :( I have been more occupied by my many other projects -- Dungeon Keeper, CQIII, RayCaster, et al., and Eternity has been suffering because of it. CQIII development is going to need a new Eternity release, however, so I have a new incentive to get back to it. Found out wads added via GFS don't set the "modifiedgame" flag, because for some dumb reason, functions in d_main.c set that flag every time they add wads to the game, instead of having such a flag set somewhere in w_wad.c -- oh well, it's fixed now, and when a GFS adds wads, the game will realize it has been modified. Added code in w_wad.c to track the handle of the very first wad file added to the game. This handle will always belong to the engine resource wad (eternity.wad), and is therefore useful for figuring out if the user has replaced something inside it. This was needed to make the startmap auto-disable itself when new wads are added, but ONLY if the startmap comes from the resource wad. If a user modification provides its own startmap, then the game will still be able to use it because of this. I didn't want to disable the ability for user modifications to provide new startmaps, since that is a potential editing feature, and one we might choose to exploit for Chex Quest III, which is finally beginning to make some more serious progress now. ===================================================================== 06/01/04 After discovering that Eternity could attempt to call Small scripts recursively after all, despite my efforts to the contrary, I was required to rewrite the entire system for starting scripts, which has put a significant delay on the release of the final version of EE v3.31 (I estimate the delay will last the rest of the summer since it has seriously broken my pace of work and discouraged me for a while). Everywhere starting a script that could possibly be doing it recur- sively must now test if the VM it is using is currently executing, and if it is, it has to create a child SmallContext structure which contains a clone of the VM and its own invocation data. These SmallContext objects create a tree (more of a chain, really), and as each ends its execution, the data segment is copied back to the parent, and the parent continues. It's unfortunate that the Small VM isn't already reentrant when using the same AMX structure. For some reason, Thiadmer has kept the code and the context married to each other, rather than allowing multiple contexts to function over one code/data area, like languages such as Lua can do. I'll admit to actually considering changing to another scripting language again for about a day. But, I really LIKE Small despite its few ultimately minor problems, and the amount of work to change languages at this point would be astronomical once again. So I put that idea out of my mind and proceeded to come up with that elaborate and slightly hackish method of making Small behave as a reentrant system. I have yet to test scripts actually executing in a reentrant situation, however, and I dread doing so. ===================================================================== 05/24/04 Finally added savegame support for the Small scripting system. The levelscript and gamescript VMs both must have their data segments saved. Since Eternity doesn't support sleeping or waiting scripts, there is no need to save the heap/stack or registers, and thus the savegame code is significantly simpler than it would be otherwise. The list of currently scheduled callbacks also has to be saved. Although at runtime they are stored in a double-linked list, their order is considered undefined and therefore I can simply relink them on load. This allows me to store them just like thinkers are stored -- back to back with a special terminating value that tells me when to stop reading. So simple and easy I almost have to laugh. With this, the last true obstacle to releasing a version of Eternity with Small support for editing is eliminated. The only things that have to be done now are getting enough docs and tutorials done that people can learn how to use it effectively, and of course, continuing to add more native functions so that it can quickly catch up to and overtake ACS and other scripting languages. I believe I am well on the way to this, but I must keep up my current fast pace. Once all the natives are done, Small will be incredibly powerful; this isn't just conjecture any more. It's starting to become a reality, and I'm very excited about it. Added the ability for Small callbacks to pause under certain circumstances. The SetCallback function now takes a flags parameter that can specify those options. ===================================================================== 05/23/04 I should note that during the last month I have added a ton of Small native functions, but have not been mentioning them in the changelog. Mea culpa. Finally figured out a SMMU bug that was causing Eternity to think levels were new whenever you added a single lump file or played demos using -file or -playdemo. The code in w_wad.c that keeps track of the IWAD's file handle would inappropriately reassign the IWAD handle to any single file that was opened because it was using an uninitialized variable (damn it, fraggle! :P) Once again, SargeBaldy has helped me track down a demo sync problem. fraggle made it to where Lee's autoaim toggling could be used in the normal game and not just in beta emulation mode. The problem is, Lee depended on the value of "beta_emulation" to keep autoaiming on during old demos. When fraggle removed the beta_emulation variable, he inadvertently opened up a situation for demo sync problems. SargeBaldy was using a console script to force autoaim off at startup, since Eternity didn't yet save this variable in the config file (an issue directly related to this sync problem, as it wasn't saved in savegames or demos either). I've fixed it by, of course, saving it in demos, savegames, and the config file from now on. Sarge has been one of my most loyal users, and his concern over improving Eternity's usability and demo sync have proven themselves priceless over and over. I definitely think he is on his way to getting his name on the Special Thanks line of the help screen. He deserves it as much as anybody who's there already, if not more. ===================================================================== 05/20/04 Made the pause at the end of execution optional, by user request. The pause is there because Windows slams console windows for Win32 programs shut as soon as the program stops execution. This is rude and provides no time for the user to read any error or exit messages, making an at least optional pause necessary. ===================================================================== 05/16/04 By popular demand and because I think it is important for compatibi- lity, I have restored the BOOM/MBF "traditional menu" feature, which enables use of the original DOOM main menu. This should fix problems with various wads, including Hell Revealed 2, which rely on the precise behavior of the old main menu to be usable. The stuff that had to be done to emulate the old main menu fully included defining the actual menu, causing it to be modified at run time when in DOOM II, and then making the skull pointer behave differently (in DOOM, it used an absolute hard-coded height to skip to the next item; under fraggle's more intelligent system it auto- spaces the graphics and skull positions using the graphics, but this would break under wads like HR2). I also had to restore the "traditional_menu" config item and add a console variable for it. I'd say it took me about 15 minutes, so my earlier concerns of it being difficult were unfounded. Sometimes you just gotta try doing something before you know what kind of effort it will take :P ===================================================================== 05/07/04 Removed old FraggleScript EV_OpenDoor and converted the EV_DoGenDoor function to use the new EV_DoParamDoor. Parameterized specials are almost identical to BOOM extended linedef specials, except that they allow complete customization of the parameters, instead of being restricted to a set of speeds, heights, etc. This allows Small to create new effects without causing the code explosion which I had previously feared. The way in which the BOOM gen linedef code was written is quite amenable to being extended in this manner. All I have to do is add a new enum value after the generalized ones which indicates to use a value which was passed to the function in an "extended values" struct. So for gen linedefs, the code segments continue to function the same. For parameterized actions, they can get special values. Rewrote EV_DoGenFloor to use the new EV_DoParamFloor. Same as above, except for floors instead of doors. The Small FloorAction function is needed by the start map, which I am working on restoring to full functionality. Found a BOOM bug which was in Eternity that was fixed by BOOM v2.02 but missed by Lee (keep in mind that Lee was writing MBF while TeamTNT was still working on BOOM 2.02, so there are some inconsis- tencies like this which still need to be caught). The bug was an interesting one which was originally in DOOM. Floor and ceiling actions that raise or lower by the shortest lower texture would sometimes choose the wrong height if any sidedef around them had the "no texture indicator", which is "-". Internally, DOOM remaps this to the number zero. The problem is that the first texture in the texture directory is also number zero, and that happens to be the AASHITTY/AASTINKY which are notoriously unusable. The reason they can't be used is because of this -- DOOM considers them to be the same as no texture. The problem was in the check when lowering or raising floors and ceilings. id forgot they used zero to mean no texture, and so it was treating zero as if it were AASTINKY, and getting that texture's height. If it was shorter than any of the other textures around the sector, it would end up being chosen incorrectly. BOOM fixed this for the DOOM function in v2.00 or v2.01, and thus the original linedefs work properly when comp_floors is off. But, whoever wrote the BOOM generalized linedef code that does the same thing forgot to fix that bug there as well until Jim Flynn found it in v2.02. prboom didn't have this problem because it is based off of BOOM v2.02, whereas Eternity is descended from MBF, which is based on BOOM v2.01. ===================================================================== 05/02/04 Identified and repaired a possible crashing bug in Lee's LineEffect codepointer. It passed a locally declared dummy linedef to the activation functions. Unfortunately, some of the code called by those functions ends up storing pointers to the line which triggered the effect (ESPECIALLY for switches). Since once A_LineEffect returns, the line doesn't exist in memory any more, this could cause stack or heap corruption (the latter being extremely rare). Fixed by making it static, but I must note with some concern that activating line effects in this manner is just not a good idea. Yes, the original source does it a few times for the 666/667 effects, but then DOOM had a lot of stuff in it that shouldn't have worked, yet did by either luck or because of DOS4GW. No future code I write will allow use of linedef specials in this manner, since it could lead to some unreliable side-effects on the rest of the map. Found a dead structure type and function prototype in p_spec.h for the old BOOM thinker-based friction model. Lee rewrote this in MBF but missed killing this stuff in the header. I removed it all and left a comment to note where it went. ===================================================================== 04/27/04 Rewrote HU_CentreMsg into HU_CenterMessage, adjusting it in prepa- ration for use by Small (it was previously only usable via Fraggle- Script, and didn't use the standard message duration). It also now uses the qstring structure instead of maintaining its own reallocated string. Thus continues my quest to get everything using qstring that can use it. ===================================================================== 04/15/04 Added line continuation back into the custom libConfuse lexer, but only inside quoted strings. This allows them to be broken across lines, which may come very much in handy if I add the ability to define completely new string values in EDF. This might become needed to support other features soon. Replacement of builtin strings will still remain a BEX-only feature, however. It's done there much better than EDF would be able to do it, and there's no need to have the same functionality in two places (plus there's bexinclude, which really makes it like one place anyways). This would also allow long frame cmp fields to be split across lines. One has to be careful to preserve the terse syntax, however. Any extra whitespace before the line continuance slash would mess up the cmp field parser. Whitespace after the continuance is ignored, of course, allowing the start of the next part of the string to be arbitrarily indented (you could in fact even put in more linebreaks without additional continuance symbols, but this is considered deprecated and I won't document that ability, since it is detrimental to the syntax). ===================================================================== 04/13/04 Added a bunch of new codepointers: * SetCounter -- provides 12 different operations for manipulating the three internal "special" fields that things have * CopyCounter -- lets you copy one counter to another * CounterJump -- just like HealthJump, except it works on any of the three counter fields. * CounterSwitch -- this is probably the most powerful decision-making codepointer possible, and it is equivalent roughly to an ASM jump table or C switch statement. You give it the DEH number of the first state in a block of consecutively-defined states, and then the number of states that are in that block. It then uses the zero-based value in the selected counter field to branch to one of those states. When used with the RNDMOD operation in SetCounter, this is MUCH better than using chains of RandomJump states. I immediately rewrote ChexBuddy's AI in the CQIII EDF to use this pointer, and it's much cleaner and makes him use his weapons more uniformly. Fixed the V_DrawPatchTL calls to use a flex tran level approximately equivalent to the BOOM tranmap level. Much to my chagrin, this was forgotten in all the excitement before beta 7 launch. ===================================================================== Changes since Eternity Engine v3.31 beta 6 ===================================================================== ===================================================================== 04/11/04 Applied the final outstanding patch to the portal code to add anchor type 299, which I ALMOST forgot to do. Prepared all documentation for the new release. ===================================================================== 04/10/04 Made the last few minor adjustments required to compile the DOS version and tested it out. Seems to work like a charm. However, the assembly versions of R_DrawColumn and R_DrawTLColumn are now out of sync with the C versions, and thus need to be adjusted to work again -- but my x86 assembly skills are lacking. I may have to learn a bit more to fix them so that Eternity can remain at maximum speed on that platform. Added a new codepointer, HealthJump. It allows frame transfers to be controlled by the amount of health a thing has, and can compare that amount against a given number in seven different ways. This is one of a few new "frame scripting" codepointers I intend to add. Although Small will be able to do frame transitions eventually, I think these codepointers will prove useful for EDF mods even with scripting in place, because they are fast to use, allowing you to remain in one language rather than jumping back and forth. I really did want to release today, but various things, including my allergies, got in the way, so it won't happen tonight. Sorry! ===================================================================== 04/08/04 Finished work on V_TileFlat, which doesn't exist as a single func- tion at all now. The 2x version of this function won't work on any buffer, however, because making it do so would have just made it slower. The VBuffer setup function tests to see if the buffer is really 640x400 or not, and if not, makes it use the general scaled function instead. Turned out V_PatchWrapperS wasn't exactly kosher, as it started causing heap corruption again today. SoM and I together nailed down a series of small problems in the function, one of which was appar- ently a sensitivity to some bad patches in Heretic (!!!). Now it seems to work properly (and it might be a bit faster too). Eternity now locks almost perfectly at 35 FPS in 640x400 for me, something it didn't do before the rewrite. Since the major drawing functions are all pointerized now (V_DrawPatch, V_DrawBlock, and V_DrawBackground being the major 3), I can probably feel comfortable with releasing a beta really soon, as in possibly tomorrow if I can get everything ready fast enough. I still need to fix a couple of lingering DOS issues and test that build out. Hopefully no hidden problems will be revealed. Of course, the revisions to the drawing system are far from finished. I'll probably be revising and tweaking various elements of it for several versions to come, just to get extra speed here and there, or to make some of the old code nicer. We'd eventually like to be able to draw directly to the SDL screen surface instead of triple buffering like we have to do right now. Some of the work I've done in the past few days is amenable to having this happen in the future. ===================================================================== 04/07/04 Created module v_block.c Added a v_mode command-line parameter so that you can override the video mode stored in the config file, in case Eternity can't seem to work in the current video mode. You have to know the appropriate number of the mode you want though. I'll publish a list somewhere before release. Started rewriting the block drawing functions -- V_DrawBlock now works similar to the new patch system -- the proper version is called from V_DrawBlock through a function pointer in the VBuffer object passed to it (btw, I realized this is a form of polymorphism in C -- pretty sweet in my opinion). When I started to work on V_TileFlat, which is the function that draws tiled flat backgrounds for the menus and intermission screens, I found something weird in the code that does the lowres, 320x200 drawing: for (y = 0 ; y < SCREENHEIGHT ; src = ((++y & 63)<<6) + back_src) for (x = 0 ; x < SCREENWIDTH/64 ; x++) { memcpy (back_dest,back_src+((y & 63)<<6),64); back_dest += 64; } Since "src" is never used inside this loop, the statement "src = ((++y & 63)<<6) + back_src" has no side effects, EXCEPT for incrementing y by one. This means that it's doing a bunch of unnecessary work every time the top loop iterates. Now, I wondered why such a weird thing would be in this code, so I started tracing back its history. First I looked in MBF and as I re- membered, Lee Killough had rewritten the code there to support hires. I started to suspect that maybe he'd made a mistake, because it turns out his loop for hires has the same increment statement for its outer loop, but in that case, the inside of the loop DOES use the "src" variable. So, I checked the same code in BOOM, and it was the original code from Linux DOOM, which was a bit different. Here's what it looks like: for (y=0 ; y:D Changed the EDF thingtype doomednum field to not be inherited. This makes the most sense to me. ===================================================================== 02/15/04 Tweaked my fix to the sky code again, so that it acts uniformly with respect to single- and multipatch textures. Otherwise, "long" skies, which wrap less often around the game world, would be detected as multipatch textures and would not be stretched when they were short. This does, however, place something of a limit on what type of multipatch textures can be used as skies. If you have a multipatch texture with a patch larger than the texture but which is supposed to tile where the texture height cuts off, it will not work properly. Since I have to cut the texture off at the max of the texture height and the tallest patch height to support Heretic- and Hexen-style skies, I can't support general multipatch textures that are meant to tile at the texture's height, yet contain patches taller than the texture. I highly doubt this will cause any compatibility issues, but it might surface as an issue in the future. I'll probably add a note about it to the sky transfer linedef docs in the editref. ===================================================================== 02/12/04 Completely rewrote the console script running code. It was a gross, amateur-looking mess, mostly thanks to my early work on it to fix bugs from SMMU. Now, it is a formalized finite state automaton lexer, and it uses the new qstring structure I have written, which provides very secure reallocating string buffers. This removes a static limit on line length, and fixes the bug where commands on the last line of the file would not be run, since they didn't end with a \n. (Thanks to SargeBaldy for drawing my attention to this neglected code and the last line bug). Also rewrote the libConfuse lexer to use the qstring structure, since the code that m_qstr.c is based on was originally the qstring code in libConfuse 2.0 -- I have simply generalized and encapsulated it so it can be used throughout the engine. This is another unforeseen benefit of my having previously integrated libConfuse directly, instead of compiling it as a static library or even as a DLL. ===================================================================== 02/11/04 Found out that my previous fix to sky textures wasn't totally right. Tweaked the code further to be more correct. MBF's sky.wad example works much better now. ===================================================================== 02/04/04 Upgraded the internal Small VM to v2.4.0 -- this version has lots of fixes over the previous version, as well as a lot of new language and VM features. Added even more new Small natives. ===================================================================== 02/02/04 Added TID system for identifying mapthings in scripts. Restored StartScript codepointer to full functionality, and added several new Small natives to test out TIDs. Wrote a fixed point math module for Small. ===================================================================== 01/28/04 Fixed the fastspeed field for thing types to accept floats in the same way that the speed field accepts them. This is something I just forgot to do when I originally implemented the new speed field behavior. ===================================================================== 01/27/04 Added thingtype inheritance to EDF. E_ProcessThing is now potentially recursive. When a thingtype inherits from a parent, it tries to process the parent type first. If the parent type has already been processed, then it's ok and nothing will happen. Otherwise, it'll get processed, and recursively process any parent type it might have. When a thing type inherits from a parent type, its own definition will be treated more or less like a thingdelta, such that only fields that are explicitly specified will override those copied in from the parent. The only attribute which is not inherited is the DeHackEd number. This always has to be different, and must be resolved before thing types are processed, thus it cannot be inherited. Here's a small example that would create a new Baron enemy whose only real difference is that he would be 50% translucent: thingtype MyNewBaron { inherits = BaronOfHell doomednum = 20001 translucency = 32768 } As you can see, inheritance allows definitions for similar thing types to be drastically minimized, and absolutely no copying or pasting is required. Note some changes had to be made to the speedset and nukespecial code to allow for this, but they were very minor. ===================================================================== 01/26/04 Identified SargeBaldy's problem in a number of crashing maps to be zero-length REJECT lumps. Time for a lengthy explanation: In DOOM, maps with zero-length REJECT lumps are accepted and run ok, although possibly with undefined REJECT behavior (if I am right, the REJECT would act differently every time you play the map). Although all the REJECT loading code was the same as it is in Eternity, DOOM's Z_Malloc would return a 32-byte block when you requested a block of size zero. This is very odd behavior for any memory manager, and can result in the type of undefined behavior I describe above. In BOOM, the entire zone system was rewritten, and one change made to Z_Malloc was to make zero-size allocations return NULL, as C malloc and most other sane memory managers will do. This would, however, leave the rejectmatrix pointer NULL, and since the reject-using code never checks it for validity, it would segv the first time something called P_CheckSight. Apparently, this problem is common to all BOOM-derived source ports. prboom simply refuses to load such maps at all currently. I have fixed the problem (for now at least) by adding code which generates an "empty" reject matrix when the lump size is zero. It allocates a buffer of the appropriate size for the map, then fills it with zeroes (which means that the reject is not useful for helping reduce line-of-sight calculations). To be technical, zero-length REJECT lumps are NOT appropriate. The behavior in the original engine is undefined, and really only worked by accident. I believe part of the blame for utilities allowing zero- length REJECTS rests on the Unofficial DOOM Specs, which incorrectly say that the lump is "optional," which can possibly be interpreted as meaning it is allowed to be of zero length. Technically, this is not true, and the REJECT should ALWAYS be the proper size for the map, EVEN if it is only filled with zeroes. But, this problem is easy to detect and fix within the engine, so I will allow it, mainly because it fixes maps which worked (albeit inconsistently) with vanilla DOOM. My fix *could* be improved by actually building a meaningful reject matrix for the map, but this would require reject builder code to be added to the engine, and isn't something I want to undertake right now. Consider it room for possible future expansion. ===================================================================== 01/25/04 Another crashing problem in the portal code was identified within the past two days. SoM created a "bandaid" patch for the problem, but I finally nailed down the real cause today to be child portals not having their minx and maxx members initialized. Fix was simple. Restored my earlier code to functionalize the portal creation code in p_spec.c, and changed a chain of if/else if's in R_RenderPortals into a switch. Also fixed a couple of issues such as missing "void" key- words in parameter lists, and moved the rportal_t typedef back into r_portal.h along with its struct. ===================================================================== 01/22/04 An initial problem in the portal system has been fixed and it has been reintegrated. I have had to change the way particles are projected, however. As of right now, they won't work inside portals because of this. In order for particles to be compatible with portal rendering, they would need to be projected subsector by subsector, as other vissprites are projected. This would be a major architectural change for the parti- cle system, but I think it's probably the best direction to move in. ===================================================================== 01/20/04 Started portal code integration. Experienced problems immediately which would not be resolved for several days. Added code to z_zone.c which can print out the entire zone heap block structure to file. This will be very useful in the future for de- bugging and optimization. Also changed an assert call in Z_Init into a RANGECHECK define and altered the code to make it the same as it is in prboom. This "sanity check" code tests some zone system invariants which must be true, or else the entire system will not work. ===================================================================== 01/19/04 Fixed the graphic used on the video options menu to test translucency settings for all game modes. ===================================================================== 01/14/04 Modified libConfuse to support ignoring text between conditional function pairs. This allows an "ifenabled" function for EDF which can weed out DOOM or Heretic definitions when playing the other game mode. Now, this raises some issues, which I have addressed as follows: 1. By default, when Eternity loads its own root.edf, it will enable only the current game mode. The other game modes will be disabled, thus saving a bunch of memory. 2. When user EDFs are loaded, all game modes are enabled by default. This allows for backward compatibility, and also allows user EDFs to explicitly shut off game modes using the "disable" function. 3. As for non-EDF mods which rely on the existence of Heretic stuff in DOOM, I haven't solved this yet, but I'm working on some ideas. For now you'd need to make a dummy EDF that includes root.edf, just to force Heretic definitions to be read. That's kinda silly. ===================================================================== 01/12/04 Continued adding stuff that I need. 1. Added MissileSpread, which I also discussed in the forums a bit. It lets a thing instantaneously shoot out N projectiles evenly over a given angular sweep (the sweep is always centered on the actor's angle with this pointer). This relieves editors from the duty of making large sequences of MissileAttack frames with only the angle parameter being different. 2. Rewrote the translation table code and added support for custom sprite translations. Translation lumps are 256 bytes long and contain 1-byte indices (0-255) into the palette. This is the same format that's used by the BOOM hud/status bar CR* lumps, and also the same format used internally for player translations. Translation lumps must be between the new markers T_START and T_END. If no T_START lump is found, no custom translations will be available. To use this in EDF, you specify the "translation" field in a thingtype, like this: thingtype { translation = | } If a number is provided, the thing will use one of the internal player translations (valid numbers are 0 through 14, with 0 meaning no translation, and the rest of the numbers being in the same order as the colors are for the colour console command -- if a number outside the range is provided, it gets wrapped into range automatically). If a lump name is provided, the thing will use the custom translation contained in that lump (if the lump doesn't exist between T_START and T_END, an error will occur). This is something else I had always been planning on doing, but never got around to. This project has given me an excuse to wipe out a growing number of TODO's. This stuff ought to help Eternity gain a bit more credibility in the editing world. ===================================================================== 01/11/04 Since I've been working on a new editing project of my own, I've been adding some doo-dads which I've found myself needing. It would appear that editing for your own port is a very good way to find out what can be done to add more to it ^_^ 1. Added the BulletAttack pointer which I mentioned on the forums. Now enemies can use custom bullets too ;) 2. Added a variable to EDF called doom2_title_tics. It lets you set the length of time that the DOOM II title screen shows. I imagine I'll be adding a lot more of these kinds of misc settings eventually, but this is the only one for now. 3. Added a new flags3 bit, SUPERFRIEND. This allows you to make a friend which won't ever attack other friends, even in retaliation. Sometimes really powerful friends just shouldn't attack at all, since they'll more than likely kill you. Plus, if a friend is a meaningful character, it may not make sense for him to retaliate (would Robin throw a batarang at Batman? I should hope not!). 4. Added a console command called whistle. It lets you teleport one friendly thing of a given type to your location. This was inspired partially by Lee Killough's changelog note on trying to make a way for the player to call his dogs. While teleporting is not what he envisioned, it is much easier than overriding the normal AI, it will work from anywhere in the map, and for some types of friends, it may be natural for them to be able to teleport to you. It's a lot of fun when used appropriately ^_^ I also discovered a very sinister bug which was preventing EDF from being loaded by GFS. The "M_GetFilePath" routine which I wrote a while back was starting its process one off the end of the destination buffer. Apparently I have been very lucky, since this function is called all over the place, and could have caused serious effects by corrupting other variables (which is what it was doing to the GFS structure's EDF file name). ===================================================================== 01/05/04 Applied schepe's patch to SargeBaldy et al.'s problem of the game crashing when you alt+tab out of fullscreen mode. I_FinishUpdate needed to check the return value of SDL_LockSurface. If the lock fails, the surface is currently invalid and can't be written to. It just so happens that a DirectX fullscreen hardware surface isn't valid when you alt+tab out of an application using it, so this is where the segv was coming from. Unfortunately, the SDL docs are rather vague about when a surface could become invalid or what you have to do to handle it, so I never put any contingency code in for such an event. Thanks to schepe once again for fixing some of the ugliest problems to ever visit us ^_^ ===================================================================== 12/27/03 schepe helped figure out what was causing demo desyncs on so-called "death exit" demos. fraggle juggled some of the level transition code around such that the player wasn't getting marked as "reborn" before P_SetupLevel was called. So, when he would be spawned at level start, the same stuff that happened in DOOM would not happen. Fixed easily by restoring the original code order. Doesn't seem to affect anything adversely; this was probably just a mistake in SMMU. ===================================================================== 12/23/03 Finally fixed the LFN drag and drop issue. Problem wasn't with LFNs in general, but with paths that had .'s in them. I was using strchr to look for the extension, when I needed to use strrchr, which looks for the requested character starting from the "right" end of the string (ie where the file extension should be). ===================================================================== EOF =====================================================================