{"id":22243339,"url":"https://github.com/galaco/bsp","last_synced_at":"2025-07-28T01:32:39.764Z","repository":{"id":29577101,"uuid":"121054033","full_name":"Galaco/bsp","owner":"Galaco","description":"Go package for parsing Valve's Source Engine .bsp (Binary Space Partition) map files","archived":false,"fork":false,"pushed_at":"2024-09-01T07:40:22.000Z","size":6135,"stargazers_count":37,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-23T11:08:01.504Z","etag":null,"topics":["bsp","hammer","map","parser","source-engine","valve"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Galaco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-10T21:02:51.000Z","updated_at":"2024-07-15T17:45:35.000Z","dependencies_parsed_at":"2024-06-18T20:23:49.388Z","dependency_job_id":null,"html_url":"https://github.com/Galaco/bsp","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fbsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fbsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fbsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaco%2Fbsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Galaco","download_url":"https://codeload.github.com/Galaco/bsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227853589,"owners_count":17829763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bsp","hammer","map","parser","source-engine","valve"],"created_at":"2024-12-03T04:26:01.356Z","updated_at":"2024-12-03T04:26:01.820Z","avatar_url":"https://github.com/Galaco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/Galaco/bsp?status.svg)](https://godoc.org/github.com/Galaco/bsp)\n[![Go report card](https://goreportcard.com/badge/github.com/galaco/bsp)](https://goreportcard.com/badge/github.com/galaco/bsp)\n[![GolangCI](https://golangci.com/badges/github.com/galaco/bsp.svg)](https://golangci.com)\n[![Build Status](https://travis-ci.com/Galaco/bsp.svg?branch=master)](https://travis-ci.com/Galaco/bsp)\n[![CircleCI](https://circleci.com/gh/Galaco/bsp/tree/master.svg?style=svg)](https://circleci.com/gh/Galaco/bsp/tree/master)\n[![codecov](https://codecov.io/gh/Galaco/bsp/branch/master/graph/badge.svg)](https://codecov.io/gh/Galaco/bsp)\n\n# Bsp\nGo library for handling Source Engine .bsp map files.\n\n### Features:\n* Read support for (most) non-xbox360 BSPs (v20,21). v19 support limited, may work\n* Freely modify and resize any Lump data\n* Limited write support, mostly untested\n\n##### Not all lumps are currently supported, but can be freely read and modified, as they are treated as `[]byte`\n\nThe following lumps currently have a full implementation for v20 \u0026 v21 BSPs (tested against CS:S \u0026 CS:GO):\n\n```\n0: Entdata\n1: Planes\n2: Texdata\n3: Vertexes\n4: Visibility\n5: Nodes\n6: Texinfo\n7: Faces\n8: Lighting\n9: Occlusion\n10: Leafs\n11: FaceId\n12: Edges\n13: Surfedges\n14: Models\n15: WorldLight\n16: Leaffaces\n17: LeafBrushes\n18: Brushes\n19: Brushsides\n20: Areas\n21: AreaPortals\n26: DispInfo\n27: OriginalFaces\n28: PhysDisp\n30: VertNormals\n31: VertNormalIndices\n33: DispVerts\n34: DispLightmapSamplePosition\n35: Game lump (partial: sprp only)\n36: LeafWaterData\n37: Primitives\n38: PrimVerts\n39: PrimIndices\n40: Pakfile\n41: ClipPortalVerts\n42: Cubemaps\n43: Texdatastringdata\n44: Texdatastringtable\n45: Overlays\n46: LeafMinDistToWater\n47: FaceMacroTextureInfo\n48: DispTris\n51: LeafAmbientIndexHDR\n52: LeafAmbientIndex\n53: WorldLightHDR\n54: WorldLightHDR\n55: LeafAmbientLightingHDR\n56: LeafAmbientLighting\n58: FacesHDR\n59: MapFlags\n60: OverlayFades\n```\n\n##### This library may reorganise lump order during the first export. This is intentional to handle lump resizing, but will change your checksum if you export without changes.\n\n# Usage\n\nMinimal example of obtaining entdata from a BSP. The following will print the entdata\nlump (entdata is a single json-like string) of a specified .bsp to console.\n\n```go\npackage main\n\nimport (\n\t\"github.com/galaco/bsp\"\n\t\"github.com/galaco/bsp/lumps\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tf,_ := os.Open(\"de_dust2.bsp\")\n\n\t// Create a new bsp reader\n\treader := bsp.NewReader(f)\n\t\n\t// Read buffer\n\tfile,err := reader.Read()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tf.Close()\n    \n\tlump := file.Lump(bsp.LumpEntities).(*lumps.Entities)\n\tlog.Println(lump.GetData())\n}\n```\n\n## Real World examples\n* Proof of concept BSP viewer: [https://github.com/Galaco/kero](https://github.com/Galaco/kero)\n* Insert game_text newline placeholder characters (avoids Hammer crash) as a compile step: [https://github.com/Galaco/CS-GO-game_text-newline-inserter/tree/golang](https://github.com/Galaco/CS-GO-game_text-newline-inserter/tree/golang)\n* Bspzip filelist generator from a mountable resource directory: [https://github.com/Galaco/bspzip-traverser](https://github.com/Galaco/bspzip-traverser)\n\n\n# Contributing\nAll contributions welcome. Known unsupported games/maps are especially useful.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalaco%2Fbsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalaco%2Fbsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalaco%2Fbsp/lists"}