All Projects → Galaco → bsp

Galaco / bsp

Licence: Unlicense license
Go package for parsing Valve's Source Engine .bsp (Binary Space Partition) map files

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to bsp

Lambda
A custom Source Engine level editor written in Go
Stars: ✭ 34 (+17.24%)
Mutual labels:  valve, source-engine, bsp, hammer
lambda-client
A Source Engine BSP Renderer written in Go.
Stars: ✭ 14 (-51.72%)
Mutual labels:  valve, source-engine, bsp
kero
Kero is a Source Engine game engine client implementation written in Go.
Stars: ✭ 25 (-13.79%)
Mutual labels:  valve, source-engine, bsp
map-compiling-toolkit
Tools for map compiling in Source Engine, tailored for Garry's Mod (and metastruct, sorry)
Stars: ✭ 17 (-41.38%)
Mutual labels:  valve, hammer
NextBot
A Git-based fork of Valve's NextBot code.
Stars: ✭ 30 (+3.45%)
Mutual labels:  valve, source-engine
sledge-formats
C# parsers and formats for Half-Life 1 and related engines.
Stars: ✭ 35 (+20.69%)
Mutual labels:  valve, bsp
Sourceengine2007
Description
Stars: ✭ 387 (+1234.48%)
Mutual labels:  valve, source-engine
HammerPatch
Modification of Source Valve Hammer Editor to fix some issues. Fixes brush vertex precision loss.
Stars: ✭ 49 (+68.97%)
Mutual labels:  valve, source-engine
source-engine-model-loader
Three.js loader for parsing Valve's Source Engine models
Stars: ✭ 54 (+86.21%)
Mutual labels:  valve, source-engine
Async Gamequery Lib
A high-performance java game query library designed for steam/source based games and others
Stars: ✭ 88 (+203.45%)
Mutual labels:  valve, source-engine
Bee2 Items
Standard Items for the BEE2.4
Stars: ✭ 83 (+186.21%)
Mutual labels:  valve, source-engine
Blendersourcetools
The Blender Source Tools add Source engine support to Blender, the free 3D modelling suite.
Stars: ✭ 112 (+286.21%)
Mutual labels:  valve, source-engine
Bee2.4
Tool to mod Portal 2's Puzzlemaker
Stars: ✭ 152 (+424.14%)
Mutual labels:  valve, source-engine
Mastercomfig
A modern Team Fortress 2 performance and customization config
Stars: ✭ 390 (+1244.83%)
Mutual labels:  valve, source-engine
Sourcedemorender
Multithreaded, hardware accelerated solution to create high quality movies for the Source engine.
Stars: ✭ 152 (+424.14%)
Mutual labels:  valve, source-engine
Sourcebans Pp
Admin, ban, and comms management system for the Source engine
Stars: ✭ 210 (+624.14%)
Mutual labels:  valve, source-engine
JavaSteam
Java library that provides an interface to directly interact with Valve's Steam servers.
Stars: ✭ 70 (+141.38%)
Mutual labels:  valve
meta-up-board
Yocto BSP meta layer for the UP Board
Stars: ✭ 27 (-6.9%)
Mutual labels:  bsp
vdf
📜 Package for working with Valve's text and binary KeyValue format
Stars: ✭ 146 (+403.45%)
Mutual labels:  valve
vdf
A Lexer and Parser for Valves Data Format (known as vdf) written in Go
Stars: ✭ 30 (+3.45%)
Mutual labels:  valve

GoDoc Go report card GolangCI Build Status CircleCI codecov

Bsp

Go library for handling Source Engine .bsp map files.

Features:

  • Read support for (most) non-xbox360 BSPs (v20,21). v19 support limited, may work
  • Freely modify and resize any Lump data
  • Limited write support, mostly untested
Not all lumps are currently supported, but can be freely read and modified, as they are treated as []byte

The following lumps currently have a full implementation for v20 & v21 BSPs (tested against CS:S & CS:GO):

0: Entdata
1: Planes
2: Texdata
3: Vertexes
4: Visibility
5: Nodes
6: Texinfo
7: Faces
8: Lighting
9: Occlusion
10: Leafs
11: FaceId
12: Edges
13: Surfedges
14: Models
15: WorldLight
16: Leaffaces
17: LeafBrushes
18: Brushes
19: Brushsides
20: Areas
21: AreaPortals
26: DispInfo
27: OriginalFaces
28: PhysDisp
30: VertNormals
31: VertNormalIndices
33: DispVerts
34: DispLightmapSamplePosition
35: Game lump (partial: sprp only)
36: LeafWaterData
37: Primitives
38: PrimVerts
39: PrimIndices
40: Pakfile
41: ClipPortalVerts
42: Cubemaps
43: Texdatastringdata
44: Texdatastringtable
45: Overlays
46: LeafMinDistToWater
47: FaceMacroTextureInfo
48: DispTris
51: LeafAmbientIndexHDR
52: LeafAmbientIndex
53: WorldLightHDR
54: WorldLightHDR
55: LeafAmbientLightingHDR
56: LeafAmbientLighting
58: FacesHDR
59: MapFlags
60: OverlayFades
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.

Usage

Minimal example of obtaining entdata from a BSP. The following will print the entdata lump (entdata is a single json-like string) of a specified .bsp to console.

package main

import (
	"github.com/galaco/bsp"
	"github.com/galaco/bsp/lumps"
	"log"
	"os"
)

func main() {
	f,_ := os.Open("de_dust2.bsp")

	// Create a new bsp reader
	reader := bsp.NewReader(f)
	
	// Read buffer
	file,err := reader.Read()
	if err != nil {
		log.Fatal(err)
	}
	f.Close()
    
	lump := file.Lump(bsp.LumpEntities).(*lumps.Entities)
	log.Println(lump.GetData())
}

Real World examples

Contributing

All contributions welcome. Known unsupported games/maps are especially useful.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].