Giter VIP home page Giter VIP logo

opencity2k's Introduction

OpenCity2k

The goal of this project is to have a free/open source re-implementation of SimCity 2000 that is faithful to the original as well as an enhanced version with various bugfixes and enhancements including: infinite cities, more graphical customization, more types of networks, more buildings, history tracking/replays, multiplayer support, rebalancing and more.

Documentation of the various binary file formats and of the simulation behaviour can be found at https://github.com/dfloer/SC2k-docs.

Project Structure

Note that this is very preliminary and subject to change.

Server

This runs the simulation directly and handles updates to the client. Likely written in Python. This model was chosen to make future multiplayer support easier.

Client

Contains the game engine and code for communicating with the server. Likely written in something better supported for game development, though kivy(kivent) and Panda3D are engine options.

Current Status

Implementing basic functionality and parsing of game assets. Initial focus is around parsing .sc2 city files, .mif tilesets, .scn scenarios as well as all game assets, which will need to be sourced independently of this project as EA still claims copyright on them.

Requirements

  • pillow
  • python 3.6+

Currently supported features.

  • Opening and uncompressing city files.
  • Saving uncompressed and compressed city files.
  • Parsing the TEXT_USA files.
  • Parsing SMALLMED.DAT, SPECIAL.DAT and LARGE.DAT sprite data files.
  • Parsing MIFF files.

Libraries

sc2_iff_parse.py

Basic, low-level functions for parsing IFF files, implemented for the quirks of the various formats SC2k has with its files. Also includes support for opening Mac formatted cities, something which the Win95 SC2k version lacks.
Considered more-or-less complete in terms of game functionality.

sc2_parse.py

Functions to parse the raw, uncompressed data into a city and all it's associated pieces.
Support for parsing most of the savegame complete, but not all of it yet.

utils.py

Helpful utility functions that get used all over.

image_parse.py

Used to parse SC2k's internal image format.
Considered more-or-less complete in terms of game functionality.

tileset_parse.py

Used to parse MIFF (.mif) tilesets. Considered more-or-less complete in terms of game functionality, but there could be some tilesets that it can't open out there. Testing has been limited.

Utilities

  • text_usa_parse.py: Extracts the contents of TEXT_USA.DAT. Currently very raw output.

    • -d/--data: the path to TEXT_USA.DAT
    • -i/--index: the path to TEXT_USA.IDX
    • -t/--text: optional path for exported text file. Omitting this will write to stdout.
  • data_usa_parse.py: Extracts the contents of DATA_USA.DAT, the newspaper data files.

    • -i/--input: the path to DATA_USA.IDX and DATA_USA.DAT
    • -o/--output: path for exported text file.
    • -d/--debug: enable debug printing.
    • -j/--json: path for exported json file. Optional.
  • tileset_parse.py: Extracts the contents of LARGE.DAT, SMALLMED.DAT and SPECIAL.DAT and saves them as either PNGs, or animated gifs of the colour cycling animation.

    • -i/--input: Path to the directory containing the 3 data files.
    • -o/--output: Path to the directory to save output in.
    • -p/--palette: Path to the file containing the palette to load. Note that this will likely be PAL_MSTR.BMP.
    • -w/--write-palette: Path and filename for the palette to be written to. Useful for debugging.
    • -a/--animate: Create animated gifs of each sprite, using the game's colour cycling system for basic animations. Saved in the same output folder as specificed in -o/--output.
    • -d/--dump: Most useful for debugging, dumps each raw frame for the animation. Saved in same output folder as animations are.
  • miff_parse.py: Turns the contents of a .mif file into their sprites, much like tileset_parse.py does.

    • -i/--input: Path to the directory containing the 3 data files.
    • -o/--output: Path to the directory to save output in.
    • -p/--palette: Path to the file containing the palette to load.
    • -a/--animate: Create animated gifs of each sprite, using the game's colour cycling system for basic animations. Saved in the same output folder as specificed in -o/--output.

    Examples:

    There are some examples included what are mostly for my testing, but they should help explain how the libraries work at the least. They are located in Examples & Utilities and there is a readme there with more.

    Editor:

    There is a very experimental start to an editor/game engine using Panda3D in the editor branch. It's nowhere near working anywhere past poorly rendering a city and panning it. A lot more work needs to go into it, and I might move on from it.

    License:

    This project is using the AGPLv3, a copy of which is found in LICENSE.md

opencity2k's People

Contributors

dfloer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

opencity2k's Issues

Screenshots?

I think people will be more interested in testing this reimplementation and maybe collaborate with some code if you show its current state with some screenshots (even early ones!).

Python 3.11 compatibility

Hello, any plans on upgrading to Python 3.11 ?

Im interested on editing the symCycle data but i don't have Python 3.9 or older, since 3.10 the Collection library is deprecated and removed.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.