My project to clone Civ1

hannurabi

Warlord
Joined
Aug 29, 2005
Messages
173
I've had a project going on to create a clone of civ1 for long time. The point is to have game that feels like playing CivDOS, but with greater moddability. This is slow project that has already taken years and might never come to end. But since I always seem to come back to this project, I start this thread, because this might interest some other civ1 fanatics too.

So far I have made playable alpha version with simple AI. Demo is attached ( it's for Windows). I think it is already pretty nice although still missing lot of features.
Some of the missing features are:
  • Wonders
  • Spaceships
  • Victory conditions (it's in 'sandbox' mode)
  • Nuclear attacks
  • GUI is still missing lot of advisor screens etc
  • AI is still very simple and for example fail to use naval units correctly. However, if you play GiantEarth map, some civs may become very dangerous if let to grow big.
  • Diplomacy is missing. (It's simple war/peace)
  • Diplomat functions
Some differences to Civ1:
  • 14 civs
  • support for bigger maps
  • Irrigation requires lake, river or oasis, oceans don't allow irrigation
  • Might be more small things,that I can't remember just now

My goal is first to create game that is approximately same as original Civ1 and later make it moddable and do changes I want to do. If somebody is eager to help with AI or something else, I might consider releasing source codes. However it's worth noting that the sources aren't necessary so beautiful code.
 

Attachments

  • screen1.png
    screen1.png
    163.8 KB · Views: 696
I like playing around with code projects on my spare time too.. Nowadays, it's reimplementing my perl MUD client into C++11 using Clang compiler (on linux platform)..

What language and compiler are you using?

I like that most of the original graphics are kept.. If one actually ended up with a moddable civ it would have been great :)..

Looked into free civ once, but lost interest due to lack of features like diplomacy for instance..
 
I develop this with C++ in Visual Studio 2010. Graphics and input are handled with SFML library

Anyway, when I said it's not beautiful code, I really meant it. I've build this every now and then for years and I'm not really great programmer at all, but just have some passion for project like this. I have used C++ quite a basic way, not being very advanced with it. Some parts and things in source are just ugly and "bad".Changes are you would rather just wanna recreate everything from the scratch :)
However if you are not afraid of ugly code, I could comment some parts of the sources and send you them anyway I think. Maybe you want a sample of the code?
 
Well.. I've heard Visual Studio is a decent IDE, and Herb (Sutter) have made me curious as to testing it out, so testing out microsofts C++ compiler and their IDE might be relevant anyhow.

I work with creating search/storage platform for a huge company where everything needs to work all the time though, so at work it's all about creating clean code with little chance of failure and tons of tests.. But not exactly as clean when just coding for fun at home.. Wants results fast too.. Tests coverage usually suffers :)

I don't mind taking a look at the code.. Would be nice to see enough so I can try to get it compiling in visual studios myself though..
 
Hmm.. Guess there aren't any free versions of visual studios.. Not gonna pay $1200 dollars for a license.. I see there's a 90 day trial at least.. I see there's free express versions too.. Maybe the express 2012 desktop version is sufficient..
 
Wow just tried it, it is fantastic! to have more than 7 civs is a dream comes true... hope you manage to finish it. Love that the graphic is the same!
 
Don't put too much effort on it on my behalf.. Don't want to commit to anything :)
 
Hi,
I wish you good luck with this project. I do hope you can finish it sometime soon. I have been wanting to do this for 20 years, but never had the time. Now that I have the time I no longer have the will. Old age?:lol:
 
Not sure how you have divided your code, but if we get in some clean splits, it may be easier for several people to work on it.. I'm thinking along these lines:

Game engine.
- Generated giving it an instance of a generic game interface, and a set of player implementations to do the moves. Runs the game, calling the player interfaces to get decisions.

Scenarios.
- Creates new games.
- Decides what techs / improvements / unit exists.

Game setup user interface.
- Select a scenario.
- Allow player to pick settings from scenarios. Possibly some generic game engine settings too.
- Create a new game with given scenario with given settings.

Player user interface.
- Interacts with the game engine to give moves for a player.
- Should be possible to create the user interface pretty independent of game engine and scenarios. Need graphics for the units, and the tile types used in the map and so forth though.

Computer player
- Implements the player interface automatically creating moves.

Personally I don't really care about the GUI parts, but the game engine, and a player implementation for an AI should be more up my ally.. Not sure how much effort I'd want to put into civ1 though.. Could one actually make an implementation publicly available if one got it done, or would there be copyright issues? Civ1 is seriously old though, so guess they might think of it more of a commercial than an issue..
 
Wow just tried it, it is fantastic! to have more than 7 civs is a dream comes true... hope you manage to finish it. Love that the graphic is the same!
Hi,
I wish you good luck with this project. I do hope you can finish it sometime soon. I have been wanting to do this for 20 years, but never had the time. Now that I have the time I no longer have the will. Old age?

Thanks for engouraging words.

Not sure how you have divided your code, but if we get in some clean splits, it may be easier for several people to work on it.. I'm thinking along these lines:

Game engine.
- Generated giving it an instance of a generic game interface, and a set of player implementations to do the moves. Runs the game, calling the player interfaces to get decisions.

Scenarios.
- Creates new games.
- Decides what techs / improvements / unit exists.

Game setup user interface.
- Select a scenario.
- Allow player to pick settings from scenarios. Possibly some generic game engine settings too.
- Create a new game with given scenario with given settings.

Player user interface.
- Interacts with the game engine to give moves for a player.
- Should be possible to create the user interface pretty independent of game engine and scenarios. Need graphics for the units, and the tile types used in the map and so forth though.

Computer player
- Implements the player interface automatically creating moves.

Personally I don't really care about the GUI parts, but the game engine, and a player implementation for an AI should be more up my ally.. Not sure how much effort I'd want to put into civ1 though.. Could one actually make an implementation publicly available if one got it done, or would there be copyright issues? Civ1 is seriously old though, so guess they might think of it more of a commercial than an issue.

I've been bit out of inspiration to work on this project lately, so I haven't yet sent you the sources.

Currently my code is divided as following:

Global level:
  • Game object: object that keeps track on game state, including nation, AI, map, unit and city objects.
  • MapView object: this object has functions to draw the map.
  • OtherView object: functions to draw city screen and menus etc.
  • SFGui object: object to handle gui library functions I'm using.
  • Controller object: Reads user input and calls draw functions.

Although it may sound like MVC design patter, it's not really that:mischief:

Think I'll try to restructure the code more along the lines you wrote, sounds like good way to go. I don't like setting myself deadlines on hobby projects, but I'll try to send you the sources during this month.Maybe.:)

And no, I'm not afraid of copyrights since it would be free game anyway. To feel more safe, original graphics could be dropped from release and/or provide them as external download.
 
I've got a git repository I can stuff the code in and make available for you and possibly some more people.. So if you wanna I can put the code in there and I might be able to help a bit with the changes..

Regarding the copyright, as freeciv seems to work out fine, I don't think there should be much issues either.. If the graphics can be kept in images which can easily be exchanged, I guess if it ends up being an issue using original graphics it will be easy to exchange them.. I want to make a change anyhow, to make it visible whether a river tile is shielded or not :D..
 
If the graphics can be kept in images which can easily be exchanged, I guess if it ends up being an issue using original graphics it will be easy to exchange them.. I want to make a change anyhow, to make it visible whether a river tile is shielded or not :D..

Now that there is code out there able to natively read PIC format files, the safest approach, in my opinion, is to require users to possess the original CIV (and its PIC files) that will be used by your code to render stuff. That way, you don't distribute anything that you didn't create by yourself in the first place.

Is there any public way to access your git repository ?
 
I've got a git repository I can stuff the code in and make available for you and possibly some more people.. So if you wanna I can put the code in there and I might be able to help a bit with the changes..

I would be interested in this repository, do you have a link?

I've had a plan to port civ1 for a long time but my goal would be to create an exact clone of the current game but make nearly all aspects of it moddable. The awesome research done by darkpanda and Gowron has convinced me that it should be possible to recreate all the algorithms in the original game by analyzing the bytecode in civ.exe
 
I would be interested in this repository, do you have a link?

I've had a plan to port civ1 for a long time but my goal would be to create an exact clone of the current game but make nearly all aspects of it moddable. The awesome research done by darkpanda and Gowron has convinced me that it should be possible to recreate all the algorithms in the original game by analyzing the bytecode in civ.exe

I haven't heard about humbe for months. I still have his code somewhere but I'm not sure I should give it out without his permission.

Personally I haven't been lately inspired to work on this project any more.
 
I haven't heard about humbe for months. I still have his code somewhere but I'm not sure I should give it out without his permission.

Personally I haven't been lately inspired to work on this project any more.

I totally get how you feel. I'm like this myself regarding civ 1. I suddenly get the urge to play it out of nowhere, and then after a few weeks I lose interest. But I always seem to come back, and every time I do I get the urge to mod it to squeeze more game play out of the old game.
 
I totally get how you feel. I'm like this myself regarding civ 1. I suddenly get the urge to play it out of nowhere, and then after a few weeks I lose interest. But I always seem to come back, and every time I do I get the urge to mod it to squeeze more game play out of the old game.

How familiar this sounds :)

weevil, did you start anything yet in that direction? Coding? Reverse-engineering of CIV?
I must say, that's definitely something I want to do too: a replica of Civ, where you can play games just like in the original, but with possibilities to enhance features: bigger maps, more players/Civs, custom colors, and obviously as much moddability as possible.
If you care for a joint effort, you can count me in.
 
How familiar this sounds :)

weevil, did you start anything yet in that direction? Coding? Reverse-engineering of CIV?
I must say, that's definitely something I want to do too: a replica of Civ, where you can play games just like in the original, but with possibilities to enhance features: bigger maps, more players/Civs, custom colors, and obviously as much moddability as possible.
If you care for a joint effort, you can count me in.

I've only been looking at civ.exe, slowly trying to figure out how it is put together. So it's all just ideas in my head, which is why I wanted to look at the work hannurabi and humbe had made.
 
Top Bottom