2 Years Ago
GameData (.fgd) is now managed, game entities are now loaded at runtime from their type information instead of from .fgd files. This also runs both ways and let's us access all GameData from C#. * Managed classes for GameData, can be loaded directly from LocalAddon or RemotePackage. * Map compiler doesn't load .fgds, make Hammer serialize g_pGameData to KV3 and load it in the map compiler * Clean up native GameData code (fgdlib) making it a shit load less confusing to work with, name globals, classes, vars.. properly, delete legacy code, document stuff etc. * Copy native GameData (loaded from core .fgd) back to C# GameData for usage in tools addon * [Hammer] attributes rewritten to not use StringBuilder, pass dictionary / list references and fill those up, obsolete the old tihngs * Remove FGDWriter for game entities, no longer need to serialize it every game start * Remove .fgds of anything that has a managed type, remove legacy syntax on remaining .fgd files (use KV3 so we can remove a lot of code) Give all entities nice [Display, Category, Icon] attributes Glue Hammer Entity tool UI to C#, can use entities for games straight from here, searchable, show what game it's from etc. needs a bit more work to not look shit though Enum properties create and populate their backing native GDIVItemSet New: Enums marked with [Flags] now get treated as flags properly in Hammer now Restore Hammer.CustomHeaderAttribute but obsolete it so it doesn't break older addons C# GameData.LoadConfig should be synchronous so Hammer blocks until everything is loaded - actual loading from each dll is still done in parallel though Obsolete [Spawnflags] it's confusing for mappers and hacky to implement - you should use a property of an enum with [Flags] on it Removed Spawnflags from BaseTrigger, the only flags that did anything were Clients|Everything - everything should just work with tags instead. FuncPhysbox spawnflags turned into a flags enum property instead (old maps will still work just fine) Get rid of FGDType( "flags" ) usages, we just derive this automatically now from [System.Flags] Sandbox.Tools gets addons compiled from Sandbox.Engine - Hammer uses these instead of recompiling them itself plus they're avaliable for other tools to reflect on too In Tools mode add all LocalAddon games to ServerAddons to compile as game opens save package idents in vmap ( e.g facepunch.dm98, valve.cstrike ) from used map entities, download these pkgs on map load if missing locally bitflags Update game selector dialog to use Package.Query API Delete game entities .fgd so you're not accidentally keeping it around for no reason Fix hotload crashes when Hammer isn't open Fix a couple more crashes with hotloading in tools Iterate map nodes on save properly so it catches entities in subworlds (prefabs, tilesets) Remove Spawnflags shit from FgdWriter Reload .FGD Files -> Reload Game Data (probably not needed since we hotload, delete after we port all native ents) Don't obsolete these, they're used by modeldoc fgd still Entity tool: default to prefer class names for now, probably sex up this tool a fair lot more Hotload game entities in Hammer fuck sake actually load the game variable type from KV3 Implement GDIVItemSet::ReadFromKV3 so the map compiler knows default values Don't block engine bootstrap with compile task