CivOne - An Open Source remake of Civilization 1

OK, so I tested the latest version. What I notice is a slower performance even very early in the game. The lag is annoying. I'll see if this happens with every game.
I'll also try to test some features you've shown in the changelog just to see how they work out.
 
Hi axx, thank you for testing.
Right now I'm optimizing nearly every part of the code. My goal is to reduce the number of lines of code and make the code more efficient.
I'm very much aware of the lag issues and will I get it these issues resolved, don't worry. :)

I will fire up my somewhat older PC this weekend and see if I can find ways to get it running more smoothly on that machine.

Edit: It's a bit silly, really, that a remake of an ancient dos game has so much trouble running on modern hardware. I'm sure I'm doing something wrong... there's a lot of room for improvement and I'm learning new things every time I'm working on CivOne. :D

Edit 2: I've made some changes that should really speed up the game, even on slower computers. Problem is: It's leaky, so memory usage currently increases with about 1MB per second. I'm busy profiling and figuring out where the leaks are. Once it's done, the game will perform a lot better.
As a result, of course, a new version will not be finished today. I'm (once again) aiming at the end of the week. Don't worry, I am working on it.

Edit 3: The memory leaks have been fixed. I'm looking at other parts of the code that slow down the game. After that, back to the short list of new features I wanted to implement. Target for next preview is friday.

Edit 4: Sorry about the (apparent) lack of progress... but a lot has happened in the code.
I've reduced the lines of code of the game by about 2000. I've made about 5000 changes to the code in the past week, and still not a single additional feature added to the game. The map drawing code is a bit broken currently... so I won't be posting a new release yet.
Trust me: I'm working on something good. Once the map drawing bug is fixed, I will start working on the shortlist.
 
Last edited:
Yes, it's an issue with many older games running in Dosbox, not just Civone. Stick to your own schedule, game optimization usually follow later on in development anyway.

EDIT: Tried out the plugin and it works OK :thumbsup:
One more thing, I noticed that when starting a game (and only 9 squares are visible) the game runs ok. But enabling shift5+6 and revealing the world the game slows down considerably. This is before I even build my first city.
 
Last edited:
Hello from Moscow :-)

I see, the progress is going on. That's awesome! Maybe it sounds funny, but i'm waiting for CIVONE more than any games.

I wonder, how many of us, the ones who love CIV1 most, here? 10, 100, 1000? I'm still thinking about free-will donation to the author.
 
Hi ColdRock,

The thing about donations is: It creates expectations that I may not be able to meet. I can not promise I'll finish CivOne, although I hope that if I'm not able to finish it, at least someone else will continue with the work I've put into it.
I do not need donations, but thank you for the kind suggestion. Please, if you have some money to spare, use it to help those in need. I usually donate some part of my salary to organizations that help children and animals.

About the progress: I'm not spending as much time on this as I would like, but spending time with family is more important. I'll try to get a new build online within two weeks.
I've made a lot of changes without making a lot of visual progress. A large part of the drawing code has been rewritten and once I'm done with it, it should be a lot friendlier to read. That should make modding easier in the future. The performance of the drawing code has also improved, although it could still be better.

I'll report back with more updates in a couple of days.
 
SWY - As someone who's worked on Civ-related projects for the better part of the decade, I think you're making the right call. I only ever took one donation for what I did (which was announced up front as an incentive for anyone at CFC reaching a specific milestone, and was when I was still a poor college student), and if you don't need it financially, not having those additional expectations set is the right way to go. And even if the donors themselves don't state or have expectations, there's still that psychological element to it, which I suspect is often the bigger of the two. I'm glad that I've long since removed any ability to donate, and thus don't have any psychological guilt when it turns out that things take longer than anticipated, or that I spent the past several weeks hanging out with friends and not working on the editor, or just never got around to an idea because there are more ideas than time to implement them. Often all three of those are the case :lol:. I never wind up spending as much time on my project as I'd like, but you are right that family is more important.

All that said, this is still one of my favorite current projects at CFC. Although I've never played Civ1, what you (and DarkPanda before you) have done with it is among the most interesting projects I've seen here. I've followed a few Civ-re-implementation projects here in the past, and I don't know of any that have made it this far - even outside of CFC, FreeCiv is the only one that has made it as far. Your tenacity with it, and revisiting it even when real life necessitates a several-months gap, is what really sets it apart from previous efforts I have seen, and has enabled it to get so far. That it's at least reasonably close to feature complete is highly unusual, and quite commendable :goodjob:.
 
This project sounds great! I run the original Civ 1 through DosBox to get around the end of Dos on new machines and I look forward to seeing what you come up with in the end. I have been playing this game since it originally came out in the 90's and I love that there is still such a fondness out there for it :) (I am sooooo old! Lol)
 
Hey SWY!

It is great that you keep working on this project when your time permits! Thank you for this! Your effort is appreciated!
Many have said before, what are you doing for the Civilization games community is a wonderful thing, and I hope you won't give up.
The old classic civ will not change, so there is plenty of time to remake it, just think of it this way :)

One thing - when I am writing this, I cannot access your web site (civone), because my browsers say it is not secure.

I hope you are OK. Good luck to you and your family!
 
I'm so sorry to everyone waiting for updates... I wish a week had 7 more days.
I'm doing well, thank you. I have not abandoned CivOne, and there's some exciting changes that I've been working on. Just need to find some time to finish them :-) Thanks for all the support.

@Laterego : I've renewed the certificate. I should create an auto renew script for that, thanks for mentioning it.
 
I have just (mostly) finished creating a SDL runtime to replace the current OpenTK runtime, and my first impression is that it's very fast. CPU usage is down too. I need to implement a couple of things (folder open dialog (fixed) and mouse drag currently don't work), and there's some annoying open bugs, some of which are caused by my optimizations.
I will try to fix most annoying bugs and post a new version tomorrow today.

Edit: I'm building a new version right now.

Edit 2: It's only going to be a 64 bit build for now, the 32 bit build has some issue(s).

Edit 3: Here's the changelog:
- Split the code into multiple runtimes (currently SDL, OpenTK and Win32)
- Switched the focus to the SDL runtime
- Fixed: GoTo icon (capital G) on units was not always visible, even though GoTo was active
- Fixed: GIF files (for screenshots and map exports) were invalid and could not render correctly in Firefox. This has been fixed
- Fixed: Game crash on Save Game screen
- Fixed: Disable Build Fortress option if player doesn't have Construction
- Fixed: Multiple city manager issue (removed ugly workaround for this bug)
- Reimplemented screenshot function into Game Logic (ctrl+F5)
- Reimplemented expanded screen size (non-16:10 aspect ratio)
- Added startup parameter to skip data files check nag screen (allows the game to run without original files)
- Added startup parameter to run the game without data assets
- Added startup parameter to run the game without sound
- Added startup parameter to skip credits screen
- Added startup parameter to skip new game intro
- Added save game map to image function (ctrl+F6)
- Implemented expanded screen size for Credits and New Game screens
- AI improvement: AI won't attack with Settlers, Diplomats and Caravan units
- AI improvement: Smaller chance AI will use transport unit to attack
- AI improvement: Smaller chance AI will attack if opposing unit has stronger defense
- Several big code refactorings and namespace reorderings
- Simplified map drawing code (work in progress)
- Simplified GIF file code
- Moved several drawing methods to become more accessible for future plugin development (work in progress)
- Rewritten bitmap/bytemap code to use pointers and direct memory access (performance improvement)
- Optimized drawing code: Only draw a frame when there has been an update
- Optimized drawing code: Moved and rewritten a lot of code, use pointers and direct memory access for faster drawing
- Game map improvements (work in progress): Fixed game crash, correct rendering order, simplified game map drawing code
- Implemented Enemy Moves game option
- Only center on enemy unit when it's moving (reveal world)
- Load Civilopedia icon on demand (no preloading means faster game startup)
- Fixed GoTo -1,-1 when cancelling GoTo action
- Free graphics: Added graphics for all terrain types
- Free graphics: Added graphics replacement for new game menu
- Free graphics: Added graphics for city resource icons
- Free graphics: Added graphics for Settlers, Militia and Phalanx units
- Added initial implementation of Demographics screen
- Shrink city without city walls when losing attack
- Get gold when capturing a city
- Bug fix in new game handicap calculation (thanks to Ilya Sosnovsky)

SDL runtime specific:
- Implemented new SDL runtime

OpenTK runtime specific:
- Fixed: Playing sounds was no longer working after runtime split (OpenTK runtime)
- Fixed: Full screen toggle on Linux

Win32 runtime specific:
- Implemented experimental win32/gdi+ (legacy) client (.NET 4.6.1)

Known issues:
- See issue list here: https://github.com/SWY1985/CivOne/issues
- There are map drawing issues/artifacts due to work in progress. This is a known issue and I'm working on a solution
- Load/Save games is not working correctly, expect huge issues
- The 32-bit SDL version is broken, that's why it's missing

The new version can be downloaded here: https://www.civone.com/Download
 
Last edited:
  • Like
Reactions: axx
Great really nice to see you back in action :thumbsup:.
I posted a new issue just to get back on track, but I won't be nitpicking unless I encounter something serious. Yes, a lot of functions that were implemented in previous version are now gone, but I guess this is only natural since you are implementing SDL runtime. Otherwise the game seems to run just fine.
 
Hi axx. Thank you for testing.
How is the lag in this new version? I've tried running CivOne on my Windows tablet, which has an Atom processor, and the game was a smooth as possible. Can you confirm this?
The game should not be missing features, just graphics and input glitches. Can you name an example of features you are missing so I can see where they've gone?

I am hopeful that I'll get the 32-bit issues resolved today, so I'll try to post a new version later today.

Edit:
Yes, the 32-bit issue has been resolved. As promised, I've created a new version, which includes the following fixes (since r1226):
  • Fixed: Incorrect gold value when capturing a city from a player with no gold
  • Fixed: The 32-bit Windows version did not work
Download is here: https://www.civone.com/Download
 
Last edited:
Well I've been playing some more and these are some things I have noticed (not really features but just graphical changes):
- after unit moves next to black square, the square is not immediately updated (only happens in the next turn or after you move with a mouse),
- hoovering over the menus doesn't bring that turquise color (I know you implemented this in earlier versions),
- conquering a city gives you a weird number of gold pieces
- enemy movement leaves a small line in the movement path which quickly disappears
- other minor graphical issues really not worth mentioning at this time

Been playing for about one hour (till ~1500 AD) and the game seems to run just fine, no noticeable lag or slowdown, whatever you did it seems to work. Also found more bugs but I'll have to check existing issues so not to double post them.

EDIT: BTW I've been playing around myself nothing too serious but let's say you inspired me to start some coding again, really appreciate what you're doing
https://imgur.com/a/1VTP7
 
Last edited:
Nice, a Civ2 clone! What language are you using?

Thank you for the bug reports, it's really useful.

I have created a new build (r1236), which is just a minor bug fix and the first Linux build. If anyone is using Linux, please let me know how it runs for you.

Here's the changes since r1231:
  • Fixed: Corrected help text
  • Fixed: Error when modifying custom setting
  • Fixed: GTK folder open dialog did not work on Linux
  • Added option to force software rendering on SDL (for legacy computers and some Virtual Machine types)
  • Added 64-bit Linux build
Now that the SDL version seems to be running well, I will try to focus on getting some issues on GitHub resolved this weekend, perhaps even implement a one or two features, and post another version in a couple of days.

Downloads, as usual, available here: https://www.civone.com/Download
 
I'm using c#. Just a little hobby project of mine.

No more lag. Which is great as it was one thing that made the game unplayable before.
 
Last edited:
Please keep me updated on your project, I'd love to see where it's going. If you need any help, just let me know.

I'm glad the lag issue has been resolved. The game even runs decently on my Raspberry Pi 3 now. :) I knew I should have switched to SDL for a while now, but I never got to it. I'll probably drop the OpenTK runtime as it's become useless.
There's a new version (r1246) up on the website, because some of the bugs you reported recently have been fixed.

Here's the changes since r1236:
  • Fixed: AI should not attack Settlers
  • Fixed: It is no longer possible to attack sea units with land units
  • Fixed: Do not show city conquered animation if the human player is not involved
  • Fixed: No more ghost cities on game start
  • Fixed: Incorrect load game path on Linux
  • Fixed: Saving game did not save game options
  • Implemented mouse drag on SDL client
  • Implemented loading/saving Enemy Moves game option
Downloads (win32, win64 and linux64) are available here: https://www.civone.com/Download

Edit: I'm also still on a quest to make the game more playable on non-16:10 resolutions. Here's my latest progress on the City Manager screen. The second screenshot is made in full screen at my full HD screen.

FN4SqYD.gif

Original resolution: 320x200 (16:10)

Am33bpK.gif

Expanded resolution: 384x216 (16:9)

Edit 2: I will now attempt to fix loading/saving games (and make it compatible with the original game) once and for all. This is going to take a while...

Edit 3: I've completely rewritten load/save games, making it easier to implement and in preperation to allow future plugins to implement custom load/save game formats. The custom formats will be needed when CivOne needs to save games that won't fit in the original save game format (more than 128 cities, more than 128 units per player, more than 8 players, bigger (or smaller) maps).
Currently, I have only implemented about 50% of the save game fields so the save games are not yet compatible with the original game but the most difficult part of the task is complete.
Loading original Civilization save games into CivOne is almost working, but there's a couple of bugs that I'll need to fix first.
I expect that I'll need about 70-80% of the save game fields to make CivOne games load sort of succesfully into the original game.
With luck, I'll post a new version on sunday.

Edit 4: Moved changelog to seperate post.
 
Last edited:
As promised, a new version (r1279) is available on the CivOne website.
In this version, a lot of changes have been made to the load/save game code, but the games are not compatible with the original game yet so please don't report any bugs on loading CivOne games into the original game.
Here's the list of changes since r1246:
  • Fixed: Refresh map/explore tiles after moving unit with more than move per turn
  • Fixed: Control, Alt and Shift keys no longer fire key events without another key (fixes Ctrl+F5 for screenshots)
  • Fixed: Memory corruption issues when saving game on Linux
  • Fixed: Endless Choose Government screens when loading game with less than 7 players
  • Fixed: Home, End and Slash buttons are now working on the SDL version
  • Fixed: Input box now accepts the Slash character
  • Fixed: Game crash when AI could only move into Zone of Control tile
  • Fixed: Cancelling city name costs 1 movement point
  • Fixed: Correctly report which player destroyed an enemy (it used to show Barbarians destroyed nearly all players)
  • Fixed: Do not show message when human player dies
  • Implemented: Expanded view for City Manager
  • Implemented: Map is centered on unit or asset after loading a game (thanks to uHappyLogic)
  • Implemented: City name id instead of free city name, for compatibility with original save games
  • Moved some Game logic into seperate files
  • Rewritten load/save games (work in progress)
  • Added initial API support for custom game save files
Download available here: https://www.civone.com/Download
 
Well I'm making one of my sporadic visits to CF and it's lovely to see that progress is still being made where possible! I know I promised to be back more often but as SWY and others have also experienced, life gets in the way - I'm now studying for a degree and have a 2 week old son!

To be fair, my realm of expertise with Civ was whether the 'feel' and functions were right. Now you've implemented so much of the original game, its folk like axx that can offer a lot more in terms of bug testing than I can. I'll still be checking out the updates as they come out though and am always rooting for this project!!!
 
  • Like
Reactions: SWY
Thanks SWY, but this is the second time around for me - my daughter will be 4 next March!

Just a glutton for punishment!
 
Back
Top Bottom