CivOne - An Open Source remake of Civilization 1

Even though @SWY appears to have put this project on a back-burner, IIRC, his original intention with CivOne was to reproduce original Civ(DOS), bugs and all.

By that criterion, manual moves on rails should be free, whereas GoTo's on rails cost the same as a road. Similarly, the GoTo dateline-bug should also be retained, where e.g. Bombers (and ships?) fly (sail?) away from the dateline, when GoTo'd to a point just the other side of it.
I think it should reflect the dos game but I have no issue having a configuration setting that enables fixes to dos behaviour.
 
I know SWYs intention was to reproduce original Civ(DOS), bugs and all. And of cause he can do what he want.
But if I am going to engage further in this project I would like to do some careful improvements ( without removing the general flavor of the game ).
First, fix some obvious bugs, like the date line problem.
Fix cheats like sentry in a city and get new movement points at wake up at the same turn.
What would be interesting to try is to improve AI. As it is now AI need massive "discount" when building city improvements and units to
have a chance against a reasonable skillful human.

Maybe we can run both paths. SWY doing his thing and somebody else is going for an improved version ??

Btw: have added some advanced saved games I used for testing at https://github.com/EnockNitti/CivOne
 
I imagine that limiting Go-To movement on railroads was to avoid some endless hopping between two tiles or sth.

Anyway I remember SWY mentioning that some obvious bugs should be removed (like that strange snow which appears on upper parts of maps late in the game), while keeping the game as close to original as possible. You would however have an option to run the game with fixes (such as without the Go-To movement limitation).
 
I find the movement cost in Civ1 a bit inconsistent sometimes.
Is there any documentation about the cost in different situations ?
I have found that if a diplomat is moving to a mountain square it sometimes fails if it has 2 steps left but always makes it if it has only one step left.
 
:hmm: First time I heard of this, Civ acts strange sometimes. Sadly my laptop is broken and I can't test this myself.
I did research on road movement behavior (https://github.com/SWY1985/CivOne/issues/132) and SWY implemented some logic but this issue can be opened anytime (I'm not 100% convinced it's the correct implementation, the results don't always converge to a number I thought they should).
 
>I think it should reflect the dos game but I have no issue having a configuration setting that enables fixes to dos behaviour.

>But if I am going to engage further in this project I would like to do some careful improvements ( without removing the general flavor of the game ).

I'm in both camps. I want it to be possible to have a "Microprose consistent" game, but to also have settings / options / plugins to fix historic glitches or add new features. (I'll be darned if the AI gets to auto-build Wonders !!! :mad: ) I'm currently running with an auto-settlers-cheat variation, but need to figure out how to make it a plugin.

Frankly, unless we (or DarkPanda :) ) disassembles more of the original code, we're going to have to make up some stuff as we go along. So a pure-Microprose variant seems tough to achieve.
 
>I find the movement cost in Civ1 a bit inconsistent sometimes.

I'm tracking a movement bug in my repo as issue #8. In short, units are allowed to move even when the cost of moving into the target terrain exceeds the movement "points" it has left.

I've fixed one bug: waking a unit up from sentry could give it extra moves (esp. on a road).

I know I've seen a rundown on movement rules someplace but I cannot remember where ...
 
I took the liberty to replace the function CalculateContinentSize(). Had an old algorithm for that kind of work that I like to use..... :) The old code is still i place in case someone wants to compare.

This is great! Your version is correct and consistent with Microprose! Here is an apples-to-apples compare of SWY's version vs yours (using the output from JCivEd).
First, the terrain for reference:
terrain.PNG
CalculateContinentSizeRs() version:
enoch_nitti.PNG
And SWY's version. Note how continent 3 is incorrectly split in two continents, and continent numbers start at 2.
SWY.PNG

My thanks for this better version! I've incorporated it into my latest release.
 
Last edited:
Ho...Ho..Hum...
Nice to hear that you incorporate my code. But there is something wrong here.
From memory:
The continents should be numbered is size order, with a start at 2. ( as in SWY's version)
Ocean should have number one.
On vacation so I can't check my code, but there should be some code that gives the continents the correct number
at the end of the function CalculateContinentSize
 
The continents should be numbered is size order, with a start at 2. ( as in SWY's version)

I had the same reaction - that continents should start with 2. To rebut, here is the output from a Microprose CivDos game:
upload_2019-7-18_11-49-14.png
Given SWY's goal of Microprose compatibility, your version is "more correct".

But your point about the continents should be in size order is valid.

What purpose, besides controlling Wonder impacts, does continent identification provide?
 
"What purpose, besides controlling Wonder impacts, does continent identification provide?"
My guesses:
Outcome of diplomacy, to know if you and AI are on the same continent.
In my experience it is good to have a lot of offensive units on the "AI-continent" when you are asking for gold
Starting conditions( extra settler etc). Number of AI on the same continentt, and size of continent.

About continent numbers:
I can have a look at my code in a few days. Are you sure you have copied my code correctly?
In the first pass of my code the continents gets there numbers in the order they are found. I am searching the map from one edge, the result do not seems to be consistent with that either.
Did you include the log outputs ?
Edit: how do I show continent numbers with JCivED ?
 
Last edited:
Are you sure you have copied my code correctly?
Attached is the Beyond Compare report, your last commit to master in Github (on left) vs my Github (on right).

The main difference is I tossed SWY's version and renamed yours to CalculateContinentSize(). Other minor differences are as suggested by Resharper.

Edit: how do I show continent numbers with JCivED ?

You want 'Continent & seas' in Raw Map Layers, with "Show all map" selected:
upload_2019-7-18_19-39-28.png


Edit: SWY's code does not save the continent ids to the .MAP file, nor does it save the MAP file in a fashion that JCivEd can load it. You'll want my changes in Map.LoadSave.cs if you want to view CivOne MAP files in JCivEd. And even then, JCivEd sometimes fails to load 'em.
 

Attachments

Last edited:
So looking at your code, and the logs, ContinentsSorted is nicely in descending order. For the example shown earlier, the log output is (paraphrased):
Map:Continent Nr = 5, Size 395
7 302
1 151
9 31
3 24
8 14
4 13
10 11
6 9
2 3

The problem is in the subsequent code to assign the "correct" continent id. This expression:
ContinentsSorted[ this[ x, y ].ContinentId - 1 ].ContinentId

doesn't do what you want. E.g. the original continent 10 becomes continent 2, original continent 2 becomes continent 7.

FYI.

[Sorry this forum removes all my nicely lined up columns.]
 
Continent number bug is corrected. I used your( fire-eggs) version of Map.Generate to work from.

I downloaded
fire-eggs/CivOne but I was unable to open the projects

Error messages was( for the 4 projects ):
G:\CivOne\CivOne-master_fire-eggs\CivOne-master\CivOne.csproj : error : Project file is incomplete. Expected imports are missing.
Reason is not obvious to me, do you have any idea what is missing ? ( before I spend time on this )
 
Error messages was( for the 4 projects ):
G:\CivOne\CivOne-master_fire-eggs\CivOne-master\CivOne.csproj : error : Project file is incomplete. Expected imports are missing.

That is irritating. From what I've read, this is most likely an incompatibility between Visual Studio 2017 and the installed/required .NET Core SDK. E.g. or here . "dotnet restore" might help?

SWY upgraded to .NET CORE 2.1 at some point and I've been working with that version. Perhaps we downgrade?

Edit: I spun up VS2017 and loaded the solution w/o errors. But I have .NET CORE 2.1 installed. I did push the .sln file as massaged by VS2017 - maybe that will help?
 
Last edited:
That is irritating. "dotnet restore" might help?
Thanks, that did it.

An another problem I have had all the time is that when I use "goto" ( standard or smart ) the units moves "jumpy"
and sometimes just are "teleported" to the destination with "invisible" intermediate steps.
Seems to be depending on debug mode on/off. I have made a fix by setting 2000 ms/s in RuntimeHandler but that is obviously not the right way to do it.
I am not familiar with this aspect of the game handling. Do you have any better suggestion ?
 
I am not familiar with this aspect of the game handling. Do you have any better suggestion ?

Not at this point. I need to dig through how screen updates take place, and timing issues.

Teleporting units aren't the only such situation: e.g. when barbarians appear from a hut, they usually don't show up unless I click on the map and manually force a refresh. Though I'm always running under the debugger, wonder if that has an impact?
 
Last edited:
Not at this point. I need to dig through how screen updates take place, and timing issues.
I think the problem is about priorities, the screen update is cpu-starvd. How this is handled in windows I have no idea.
The severity of the problem varies depending on what other things are running on the system ( my system is old....so... )
Edit: Runs much better in release mode, so maybe I have to live with it....
But I still think the "action" on the screen is a bit too fast, sometimes it is hard to catch all that is happening during AI moves.
 
Last edited:
Back
Top Bottom