CsDBPF
A C# library for interfacing with Simcity 4 DBPF files.
Install / Use
/learn @noah-severyn/CsDBPFREADME
csDBPF
C# library for Simcity 4 DBPF files.
WIP: Dec 2021 - ?
The goal of csDBPF is to provide full functionality for reading, modifying, writing DBPF files with the aim of making batch modifications easy. It is currently being designed to be used as a base for a new generation of SC4 modding tools.
Explanation of this Library
At a high level, a DBPFFile ("file") is the container for SC4 DBPF data. The main components of the file include the Header, ListOfTGIs, and ListOfEntries. The Header stores important information about the file itself, and the ListOfTGIs and ListOfEntries store information about subfiles. Each DBPF file is broken into one or more DBPFEntry ("entries" or "subfiles"). For further information on these, refer to the list of entries contained in SC4D Wiki article Filetypes. Each entry has a type which is established form its TGI. This informs what kind of data the entry stores and how it should be interpreted.
Exemplar and Cohort type entries are composed of one or more DBPFProperty ("properties"). Using a modified version of new_properties.xml to load the list of all of the known properties into DBPFExemlarProperty, each property in the entry can be identified and parsed accordingly.
For other types of entries, the data is interpreted directly from its byte array. This process varies depending on the type of entry (text, bitmap, xml, etc.).
The data for a particular entry or property will remain in its raw byte form until a DecodeEntry() or DecodeProperty() function is called to translate the byte data into a "friendly" format.
QFS/RefPak compression of DBPF files is handled through QFS.net, a joint project between myself and Killeroo.
Code Examples
Refer to this repository's wiki for functional code samples and an explanation of how they work.
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
