Open source rewrite of the original Civilization game (1991) - OpenCiv1 Project

I've been playing it and sofar the only real bug is with the palace view - there are no transitions when building palace pieces and a part of the panel doesn't disappear.
Other than that there's a noticeable increase in game speed, it's more normal now. So god job overall. :xmas:
Thanks ;)

Edit: Also, for me the #1 'optional' feature would be introduction of hitpoints. Reading Digital antiquarian's Civ1 entry, Sid based his game on a game called Empire (from 1977. One look at a screenshot from that game and it's pretty evident he even copied the looks). However he removed the damage rating system from Empire so you have those battleship loses to militia situations. It's what makes Civ1 what it is, but it would be nice to have an option to make it a bit more complex than that.
Yes, I know there are some small graphical issues still, they will be fixed with time...

We'll soon (I hope, in a few months) get to the point where we will discuss additions to the game. But for now I'm more focused on basic game engine :)
 
Wow this is amazing work - creating a virtual CPU until it can be rewritten in C#?! :worship:
I tried this on Linux with monodevelop and expected it would take a few hours of debugging ... but it worked out of the box. Only issue I noticed so far is some menu texts - will create an issue.

Once rahorvat (and hopefully others) have reverse engineered the assembly then hopefully we can finally get closure on Gandhi with nukes!

I work as a backend engineer in a Linux environment, so I probably can't be much help in the short term, but would love to contribute when I can be useful. I have played all the Civilization versions but always come back to Civ1 when need a break. I would love to understand more how it works under the hood and hopefully extend it, such as improving the AI.
 
Last edited:
Wow this is amazing work - creating a virtual CPU until it can be rewritten in C#?! :worship:
I tried this on Linux with monodevelop and expected it would take a few hours of debugging ... but it worked out of the box. Only issue I noticed so far is some menu texts - will create an issue.
Thanks ;)
This small graphics issues are not a priority right now, I would like to do more work with main codebase before tackling that minor graphics issues.
Anyway, most of these issues will go away as I start to transfer codebase (when finished) to JavaScript/HTML5.

Once rahorvat (and hopefully others) have reverse engineered the assembly then hopefully we can finally get closure on Gandhi with nukes!
Well, this is my own personal side project. The point is to rewrite entire code and not reverse engineer (Copyright issues)... ;)

Btw, the Ghandi problem is not present in this version as far as I have tried to reproduce problem and analyze the code.

I work as a backend engineer in a Linux environment, so I probably can't be much help in the short term, but would love to contribute when I can be useful. I have played all the Civilization versions but always come back to Civ1 when need a break. I would love to understand more how it works under the hood and hopefully extend it, such as improving the AI.

Any help wherever you can contribute will be much appreciated :)
 
Last edited:
  • Like
Reactions: rbp
I know you haven't gotten to sound yet, but I'd like to ask some questions and make some suggestions regarding sound and music, if you don't mind?

I expect you're going to have some trouble with this. Other than the PC beeper, modern computers and operating systems are not able to provide reproduction of any of the sound modes supported in the original game.

* The adlib/soundblaster mode works by writing registers to the appropriate I/O addresses of the original hardware. None of this in any way will work on a modern computer. You might be able to bundle in a free/open OPL emulation engine, such as those used by DosBOX.

* I don't know anything about Tandy/PCjr mode, but I expect it'll be in the exact same boat.

* The MIDI data present in the game is targeted for the pre-General-MIDI Roland MT-32 and it's descendants such as the LAPC-I and CM-32L. This hardware is extremely scarce, and while the excellent MUNT project can provide an authentic emulation, it requires firmware dumps that Roland's lawyers have made a pain in the ass of themselves about. I would suggest it makes little sense to committing programming time to implementing support for hardware that's almost non-existent in today's world.

Of these sound modes, the Roland will offer by *far* the most robust music reproduction - see this for an example:

Many other efforts to re-implement DOS games of this era have gone the route of enhancing or replacing the music engine to play looped OGG files on demand, and I have been happy to provide high-quality Roland music packs for these games. This same approach also allows for a third-party to create highly-authentic Adlib/Soundblaster packs, someone could even roll together a Tandy music pack if they were so inclined. Or a musically-talented individual could produce and distribute completely new and custom music!

Civilization presents an additional challenge in that what limited sound effects the game has are also reproduced via the same synth method - In the case of Roland, the game plays back custom instruments as needed to produce the effects. The only sound effects the game does, so far as I remember, is a "skirmish" or "cannon" sound during combat.

If we can nail down the specifics of how the files need to be formatted and laid out, I'd be delighted to start putting together a Civilization Roland music pack for you.
 
I know you haven't gotten to sound yet, but I'd like to ask some questions and make some suggestions regarding sound and music, if you don't mind?

I expect you're going to have some trouble with this. Other than the PC beeper, modern computers and operating systems are not able to provide reproduction of any of the sound modes supported in the original game.

* The adlib/soundblaster mode works by writing registers to the appropriate I/O addresses of the original hardware. None of this in any way will work on a modern computer. You might be able to bundle in a free/open OPL emulation engine, such as those used by DosBOX.

* I don't know anything about Tandy/PCjr mode, but I expect it'll be in the exact same boat.

* The MIDI data present in the game is targeted for the pre-General-MIDI Roland MT-32 and it's descendants such as the LAPC-I and CM-32L. This hardware is extremely scarce, and while the excellent MUNT project can provide an authentic emulation, it requires firmware dumps that Roland's lawyers have made a pain in the ass of themselves about. I would suggest it makes little sense to committing programming time to implementing support for hardware that's almost non-existent in today's world.

Of these sound modes, the Roland will offer by *far* the most robust music reproduction - see this for an example:

Many other efforts to re-implement DOS games of this era have gone the route of enhancing or replacing the music engine to play looped OGG files on demand, and I have been happy to provide high-quality Roland music packs for these games. This same approach also allows for a third-party to create highly-authentic Adlib/Soundblaster packs, someone could even roll together a Tandy music pack if they were so inclined. Or a musically-talented individual could produce and distribute completely new and custom music!

Civilization presents an additional challenge in that what limited sound effects the game has are also reproduced via the same synth method - In the case of Roland, the game plays back custom instruments as needed to produce the effects. The only sound effects the game does, so far as I remember, is a "skirmish" or "cannon" sound during combat.

If we can nail down the specifics of how the files need to be formatted and laid out, I'd be delighted to start putting together a Civilization Roland music pack for you.
Welcome! Yes hearing the real Roland MT-32 versions of the Civ1 music tracks is quite an experience. You may find this thread below of interest as a few years ago I came across a guy doing authentic Roland Civ1 recordings on youtube and he kindly gave me his recordings (possibly in OGG format too) which I used to replace all the music WAV files in the Windows version of Civ1. Thankfully because the windows version used separate WAV files for sound effects any tampering with music options had no effect unlike with the DOS version. It will be interesting to see how Rahorvat wants to tackle this one if he plans to replicate the limitations of the DOS version.
 
That YouTube post makes mention of a "jukebox" program for Civilization 1. *Please* tell me that exists somewhere I can download, because it would make creating a Roland music pack about a million times less painful.
 
I expect you're going to have some trouble with this. Other than the PC beeper, modern computers and operating systems are not able to provide reproduction of any of the sound modes supported in the original game.

* The adlib/soundblaster mode works by writing registers to the appropriate I/O addresses of the original hardware. None of this in any way will work on a modern computer. You might be able to bundle in a free/open OPL emulation engine, such as those used by DosBOX.

* I don't know anything about Tandy/PCjr mode, but I expect it'll be in the exact same boat.

* The MIDI data present in the game is targeted for the pre-General-MIDI Roland MT-32 and it's descendants such as the LAPC-I and CM-32L. This hardware is extremely scarce, and while the excellent MUNT project can provide an authentic emulation, it requires firmware dumps that Roland's lawyers have made a pain in the ass of themselves about. I would suggest it makes little sense to committing programming time to implementing support for hardware that's almost non-existent in today's world.

There is original Microprose additional General MIDI sound driver available here: https://forums.civfanatics.com/threads/civdos-additional-sound-drivers.549674/

I have listened to it and it does sound good.

Of these sound modes, the Roland will offer by *far* the most robust music reproduction - see this for an example:

Perhaps General MIDI sound driver would be the best way to go since it is compatible with general MIDI format.

The only problem is that I don't want to use original music, I have already asked some people if they are willing to compose similar sound/music/tunes so that we don't infringe on some COPYRIGHT toes! and the answer is yes.

I yet have to extract MIDI files (every MIDI sound, because there are those which are uncommon and hard to capture) from General MIDI driver so the newly composed music can be in the spirit of the original music.
 
That YouTube post makes mention of a "jukebox" program for Civilization 1. *Please* tell me that exists somewhere I can download, because it would make creating a Roland music pack about a million times less painful.
I found the jukebox not so long ago (basically after having the same thoughts as you on the matter!), it's missing incidental music like the short versions of the tunes and we love the king day, but it works using the original sound code so you can indeed use it to record the original roland tracks easily.

 
There is original Microprose additional General MIDI sound driver available here: https://forums.civfanatics.com/threads/civdos-additional-sound-drivers.549674/

I have listened to it and it does sound good.
I'd even advise caution here, as some modern platforms like phones and such don't even offer any MIDI playback capability at all.

Regarding copyright, I'd suggest looking at how projects like OpenXCom work - they don't offer *any* of the original game data for download themselves - just their binaries and configuration files. The user is required to provide the original game data to play OpenXCom.

Even for something like my proposed Roland music packs, I would never suggest bundling them together with your work.

Respectfully, I'm not really interested in playing "Not Civilization". I want to play the original Civilization on a modern computer without the kludginess of DosBOX. If your code-base can cater to both use-cases, that would be awesome.
 
There's some fascinating stuff in that archive, I managed to dig up an actual list of changes in patch 3 which I don't think I'd ever seen before.

----------- NEW in Version 3.0 -------------

23. Cities must have a population base of five or more to support
taxman or scientist specialists.

24. Under a Despotic government, citizen unhappiness will increase with the
number of cities you control. This may lead to 'very unhappy' citizens,
(recognizable by their red shirts) who must first be coverted to
normal unhappy citizens before then can become contented. This effect
occurs to a lesser degree under other government types.

25. A maximum of 3 units per city may be used to impose martial law.
(i.e. Convert unhappy citizens to content citizens.)

26. Cities may be renamed at any time. Click on the RENAME box or press the
'r' key on the city status screen.

27. Transport units no longer count against city unhappiness under
Republic/Democracy.

28. The maintainence cost of Barracks has been changed to 1/2/3 coins at
the Prince and King difficulty levels, and 2/3/4 coins at the Emperor level.

----------- END of File -------------
 
I'd even advise caution here, as some modern platforms like phones and such don't even offer any MIDI playback capability at all.

The MIDI playback (even SoundFonts) can be easily achieved with some additional libraries. Also, the final music/sounds don't have to be in a MIDI format.

Regarding copyright, I'd suggest looking at how projects like OpenXCom work - they don't offer *any* of the original game data for download themselves - just their binaries and configuration files. The user is required to provide the original game data to play OpenXCom.

Even for something like my proposed Roland music packs, I would never suggest bundling them together with your work.

Yes, I got that ;) Sorry if I was not clear enough about that.

Respectfully, I'm not really interested in playing "Not Civilization". I want to play the original Civilization on a modern computer without the kludginess of DosBOX. If your code-base can cater to both use-cases, that would be awesome.
For that we have FreeCiv :)

If I wanted to radically change the game I would not start from the original.
Also, we don't need another Civ-like game, there are enough already :)

What will change in the new version:
  1. Graphics (the new graphics will be as close as possible to the spirit of the original version).
  2. Music/Sounds (again in the spirit of the original as close as possible).
  3. Some text where appropriate.
  4. Design (Map zoom functionality, some small updates, also some dialogs will be slightly different).
  5. Multilanguage capability.
  6. Multiplayer capability.
  7. Cheat capability.
  8. Plugin capability (can override rules, graphics and music/sounds).

What will stay the same:
  1. Original game rules and logic (except for established bugs).
  2. Overall look and feel of the original game.

I assure you that I want to preserve the look and feel of the old game version as close as possible.

I hope that this answers your concerns.
 
Last edited:
I know you haven't gotten to sound yet, but I'd like to ask some questions and make some suggestions regarding sound and music, if you don't mind?

My first thought was about development, but, what I should have said was (from user perspective):

Sure you can, but it would be you own private mod/addon/plugin. 😁
 
Last edited:
What will change in the new version:
  1. Graphics (the new graphics will be as close as possible to the spirit of the original version).
  2. Music/Sounds (again in the spirit of the original as close as possible).
  3. Some text where appropriate.
  4. Design (Map zoom functionality, some small updates, also some dialogs will be slightly different).
  5. Multilanguage capability.
  6. Multiplayer capability.
  7. Cheat capability.
  8. Plugin capability (can override rules, graphics and music/sounds).
How do you plan to change graphics and what sort of 'cheating' do you have in mind (probably something Sid would be opposed to, but even Civ2 has a dedicated cheat menu and I think we need some tools to easily fiddle with the game after 30+ years).
Also your repo seems to be experiencing a spike in popularity.
 
How do you plan to change graphics and what sort of 'cheating' do you have in mind (probably something Sid would be opposed to, but even Civ2 has a dedicated cheat menu and I think we need some tools to easily fiddle with the game after 30+ years).
Also your repo seems to be experiencing a spike in popularity.

I plan for graphics to change in a way that the new graphics reminds of a old graphics as much as possible, yet, not so similar that copyright would be violated in any way.

Don't have a clear plan (yet) about graphic plugins, but it wouldn't be hard to use different Map sprites, a color set for UI and possibly other elements depending on a plugin.

Don't see why Sid would be against cheating. It's a matter of free will and personal choice. People cheat all the time in real life (if they choose to).

To be completely transparent, in a "GEnie CIVILIZATION CONFERENCE" (civgecon.txt file, Microprose ftp) Sid and Bruce discourage cheating with keys by saying "...We strongly discourage the use of the 'cheat' keys. This information is used for our debugging only...", but in a context they speak about cheat keys (Shift-56) specifically and not cheating in game generally.

Even Microprose ftp site offered cived.zip and civedt.zip where you can change (cheat) almost anything.
I remember in a old days people shared hex offsets where you can change different parameters in CIV.
There is even CIVILIZA.FAQ and civc.zip (Microprose ftp) which specifically talks about and give a cheating tool.

Perhaps one day we will hear what Sid has to say about the matter, but for now, my personal opinion about the matter is: I think that forcing people not to cheat would be wrong.

Every Civilization (after original), CivNet also (I think) and Alpha Centauri (as I remember) has a cheat options.
Of course, you couldn't submit your score. Also cheating would be disabled in a multiplayer games.

What sort of cheating? Well, with JCivEd you can do almost anything. I think that part of that should be in OpenCiv1. I will certainly open a discussion about cheating when the time comes to implement it.

Yes, the guys which do for other games, what I'm doing for a Civilization, have contacted me. Never knew that a tool like Disassembler (which I constructed specifically for Civ) already exists, just look at Spice86. I already have seen a Japanese article about the project... Things are starting to heat up. I just hope that I sufficiently removed all parts that could be offensive to Copyright people 😁
 
Last edited:
Top Bottom