OpenCiv1 Project - Open source rewrite of the original Civilization 1 Game designed by Sid Meier and Bruce Shelley in year 1991

Clearly the answer is to first use unsafe code to write a sufficiently crash-prone reimplementation of NTVDM and then then run the game code on that ;)
 
Clearly the answer is to first use unsafe code to write a sufficiently crash-prone reimplementation of NTVDM and then then run the game code on that ;)
You are definitely right :goodjob:. My bad, I should have rewritten DosBox emulator to use 186 CPU instructions and BIOS, DOS 4.x kernel and original Microsoft C compiler to ensure the quality of the bug translation, so we can enjoy both CPU, BIOS and Microsoft C compiler bugs :D Oh, I almost forgot: Long live the Pentium floating point Bugs! 🤭
 
Last edited:
Seriously though, keep up the great work - I've watched a lot of Civ history and this is a very cool recreation of the start of the history. I was a bit skeptical when the thread started but am very happy to see how this has turned out so far!
 
Seriously though, keep up the great work - I've watched a lot of Civ history and this is a very cool recreation of the start of the history. I was a bit skeptical when the thread started but am very happy to see how this has turned out so far!
It's nice to know that ;) Thank you
 
I'm going for a despotic conquest in this game (only one city as well). When I destroyed the French, the German settler spawned next to one of my units. Again not 100% but I thought the spawn rules avoided placing new settlers right next to the player but I could be wrong.
View attachment 695484

EDIT - when you destroy a civ by getting their settler it says "German civilization destroyed by !". In v05 of the DOS game it was "German civilization destroyed by barbarians". No actual difference in gameplay, just the text.
The above scenario i something I have seen a lot of times.
A few times the settler was spawned on the very same square as one of my units, and my unit became invisible.
But I was able to move my unit and it become visible again together with the spawned settler. Using Civ1/1
 
The above scenario i something I have seen a lot of times.
A few times the settler was spawned on the very same square as one of my units, and my unit became invisible.
But I was able to move my unit and it become visible again together with the spawned settler. Using Civ1/1
Yes, it's what I see in assembly code :)
 
Last edited:
Hello @rahorvat , is the RNG entirely based on player actions?

Could I record a play through in dosbox, load the same save in openciv and expect the same outcomes if I make the same decisions (including when I open menus etc). Or does exact timing also matter?

Just thinking of ways to do a side by side test.
 
Ahah, system date and time during the opening credits!

Edit - I see it's more complicated than that as the seed is reinitialised in various places including on the city screen based on city name. The question is, do any of the reinitialisations use date and time or is it only the initial value.

If they don't, we could pull the initial seed from dosbox and perhaps as a debug feature, force it to be the same in openciv. Then we could play side by side and hopefully get the same results.
 
Last edited:
Ahah, system date and time during the opening credits!

Edit - I see it's more complicated than that as the seed is reinitialised in various places including on the city screen based on city name. The question is, do any of the reinitialisations use date and time or is it only the initial value.

If they don't, we could pull the initial seed from dosbox and perhaps as a debug feature, force it to be the same in openciv. Then we could play side by side and hopefully get the same results.
Hi,
Currently I have some irreconcilable differences between DOS Civ and OpenCiv1 save game format. I have started to go in a direction of removing predefined limits (like number of players, units, cities, map...) and that have caused mayhem in a save game format. So, until I resolve these differences somehow... the new version is still in Unstable state.

And now regarding your question:
  • The DOS version initializes RNG (Random Number Generator) seed many times during the game play, so it's not possible to reproduce the exact RNG sequence.
  • There is also constant data corruption present in DOS version which means that some of the game decisions (AI, disasters...) will be different.
  • The RNG algorithm is different in OpenCiv1.

The proposed solution (to the problem) is to document (already started) all of the rules in Official Manual and OpenCiv1 code so we can compare these with game play.

I'm sure that veteran players will have no trouble spotting odd game behavior ;)

If anyone has any better idea please share... :)
 
Ok if the algorithm is different then that approach is definitely out! I'll continue just playing it and noting any unexpected behaviour as I come across it. Thanks
 
I was rereading the thread and noticed I made this exact suggestion and you of course gave the same answer a year ago! Time flies 🤣
 
Something I've immediately noticed on my current playthrough.

World map start as Romans, on chieftan after 20ish turns
Version is latest master branch

The French only had Paris, it was completely undefended and size 1. I would expect them to have at least a defensive unit by now but that's not necessarily a bug on such a low skill level.

What is a bug is that I was allowed to capture the undefended size 1 city with no improvements or wonders. I believe it should have been razed/removed from the game. I'm sure someone will have posted the rules for that somewhere, I'll dig them up.

Save attached (after the city capture)

EDIT from the 'New Cities' section of the manual

Capturing Cities: Cities of other civilizations are normally
defended. If the defenders can be destroyed, a friendly army may move
into the city and capture it. A captured city is thereafter managed and
controlled by you in the same manner as any other city. Capturing an
enemy city may also result in the discovery of a new technology advance
and plundered cash.
Occupying an enemy city may destroy some improvements the city has
built, and it eliminates one point of population. Therefore, a city that
has only one point of population remaining is destroyed instead of
captured.
 

Attachments

Last edited:
Something I've immediately noticed on my current playthrough.

World map start as Romans, on chieftan after 20ish turns
Version is latest master branch

The French only had Paris, it was completely undefended and size 1. I would expect them to have at least a defensive unit by now but that's not necessarily a bug on such a low skill level.

What is a bug is that I was allowed to capture the undefended size 1 city with no improvements or wonders. I believe it should have been razed/removed from the game. I'm sure someone will have posted the rules for that somewhere, I'll dig them up.

Save attached (after the city capture)
Hm, not necessarily. Sometimes, if the city grows in the last second you will capture the city. It's also possible that this is a bug.
Have you tried to capture the city in DOS version?
I'm currently translating the rest of the code. And then we can tune (fix) small bugs.

I got the idea how to fix the save game format in the meantime, and hope that the implementation will be quick :)
 
Something I've immediately noticed on my current playthrough.
I know that this project already lasts a long time (almost 1.5 years already), but I just need a little more time until I'm satisfied with the quality of the code to tell people to seriously begin testing OpenCiv1.

This immediately brings to memory what I read about Civ development, and how Sid Meier has done the same until he was ready... 😄
 
Last edited:
Understood! You can count the number of successful DOS reassemblies on one hand, so you're doing extremely well to have basically made it to the point where the game is playable.
 
Understood! You can count the number of successful DOS reassemblies on one hand, so you're doing extremely well to have basically made it to the point where the game is playable.
I have never come across any DOS reassembly, perhaps because people were reluctant to share such assembly code for a fear of breaking the copyright law.
 
Off topic but the best I've ever seen is Duke 2 Reconstructed (Duke Nukem 2). If you compile with the correct compiler you get a byte for byte identical binary!
The same author has also done a 'modern' reimplementation called Rigel Engine.
Ah, so it's not a Civilization, but the other game. Yes, I have seen many games reconstructed in a similar way, but never the working disassembly of Civilization.

Perhaps I should have done direct code translation first 🤔. I have used both direct code, and code transformation approaches in OpenCiv1.
 
Last edited:
Yes, I have seen many games reconstructed in a similar way, but never the working disassembly of Civilization.
Oh yeah, you're definitely on your own there (unless someone has been doing it in secret and avoiding pretty much all publicity). As you know, people on here have disassembled specific routines to extract game rules, but all the other modern clone attempts have either been done by eye or just ended up using completely different rules. I think people lose interest when they realise just how tough it is to implement a good AI from scratch. Even good old civ 1 has a lot of rules to consider.
 
Just came across this thread, this is amazing news.

I haven't even tried the alpha versions yet but I am very much stoked about this,
setting up a remake game true to the original where hopefully you can tweak all kinds of variables
to have even more fun, this is pancakes with ice cream on top.

"Full release is planned for the end of 2024"

Should we set up some kind of GoFundMe page for Rahorvat to sweeten the deal a bit for him to finish the project?

I would love to contribute and hope others are in the same spirit.
 
Back
Top Bottom