CivOne - An Open Source remake of Civilization 1

I'm curious how you handle layers. In my Civ3 editor, I also have layers separated - but I draw on a per-tile basis. So I'll draw the base layer of tile 1, then the forest layer of tile 1, then the hills, then the cities, then the units, etc. Then do the same on tile 2. If the user has hills not drawn, then it's still one tile at a time, but the hills step is skipped. I could see an alternative, however, of drawing all the base layers, then all the forests, then all the hills, etc. Not sure if it would really matter from a performance/features standpoint.

Layers, in CivOne, are screens that may overlap. So, there's the main gameplay layer. When a dialog opens or a menu is displayed, it is drawn onto a separate layer. Before, all layers were combined and drawn as one picture. Now, each screen layer is drawn separately. It's just a small step into a direction that I'll continue on later.
The end goal will be to send drawing information along with the bitmap, and make it possible to replace certain drawing actions (like drawing text) with alternate drawing actions (like using a TrueType fonts instead of bitmap fonts). There's tons of complications to this, so I won't be able to implement this by the end of the week... but for a future version, I really want to be able to support plugins that can use higher resolution graphics.

The game tile layers are just small byte arrays that are drawn over each other. Each tile 'layer' is only 256 bytes in size, and I use unsafe pointer for (nearly) all drawing actions so it's very fast. I'd love to go into detail on this, but it'd need some time to explain it all (with code samples). Just let me know if you're interested.

I like your restructuring thoughts, separating human/computer/gameplay mechanic/barbarians. I'm curious how an AI plugin would work - would there be stages and hooks that a plugin could interoperate with? This is an area I don't know much about.

I'm actually working at the player seperation code right now. Give me about a week, and CivOne will have support for AI plugins. Then, I will try to explain how to make your own AI plugin.
But you're right about the stages and hooks part. The AI plugin will expose properties, methods and events that would be called upon on certain events (like movement required, research decisions or city actions) and the AI code will have to handle the event, make a decision or skip the action.

Which Select Folder dialog is used currently? It's amazing how many there are on Windows. My personal least-favorite is the folder tree without an option to paste in the path; so many clicks of the expand folder button. I'd probably take the Windows 3.1 two-pane style over that one; at least it works well with double clicks. But other than the tree one, anything from XP's default (five favorites on the left, "normal" right pane) works decently well.

I believe I currently use a very old Windows 95 folder selection dialog. Since .NET Core has no Windows Forms support (yet, it will be added in .NET Core 3.0), I need to use P/Invoke calls to open the dialogs myself. The current dialog works, but it looks dated, that's why I want to replace it.

Do all the platforms use GTK for the graphics? I can't remember which toolkit you chose for them.

When I started working on CivOne, I used WinForms on Windows, GTK on Linux and Cacao/MonoMac on MacOS X.
Then, I moved to OpenTK, because it was easier to maintain on multiple platforms.
Now, all platforms use SDL for graphics, which is a lot faster.

GTK is only used on Linux, and only for native dialogs. On Windows, the Win32 API is used. On macOS, there's a hacky implementation of Cacao using AppleScript, this needs to be changed to native Cacao. The macOS native calls are a bit cumbersome from C#, though... that's why I went with the AppleScript implementation at first.

Text references are a pain point in my editor, in part because I didn't bother with making things translatable for so long that I have what seems like a million strings. The other hazard is that my French is no longer good enough to do much of it myself, and the lack of volunteers and most things being hard-coded strings has created a chicken-or-the-egg problem. So I'd recommend tackling it before too long, and ideally having at least one translation, so the size of the problem isn't prohibitive later on. Kind of like supporting multiple CPU architectures - if a program only supports MIPS, it has no PowerPC version, and it's both hard to gain PowerPC users without support, and hard to commit the resources to support PowerPC without already having the users. But it's English and French instead of MIPS and PowerPC.

From my work, I've got a lot experience with adding/maintaining multi language support to existing applications, so I know exactly how I would need to implement this. It is a pain to do it within an existing application though, but fortunately CivOne isn't a very large project. I expect I will be able to transition everything to a references database in a couple of days.
I will probably add/maintain Dutch translations myself, and leave the other translations to people with more experience with those languages. That's why I want to add the translation functions to the website.

I like the website focus moving away from news, and the ideas to it (notably plugin database and translation contribution) are good. But they seem a little bit ahead of the game, and in past experience, off-CFC discussion forums usually struggle to garner enough new users (such as WePlayCiv, SOC [which no longer exists], there's probably a couple others I'm forgetting). Long-term, CivOne may become complete enough to avoid that problem, but I wouldn't put too much emphasis on that early, and would definitely keep updating this thread.

You are right, I know, but there's one thing about the website: I like working on it. It's low priority though.
I will keep the main discussion in this thread.

Edit:
Give me about a week, and CivOne will have support for AI plugins.
Actually, I almost forgot... I'm going on holiday this week and I don't think I'll be taking my notebook. So it's probably going to be two weeks, then...
 
Last edited:
Thanks for the reply, I appreciate it! Graphics is one of those things where my personal projects could benefit, but my work ones wouldn't, and as a result I haven't dove into it much. SDL seems to support a lot of languages; might be a good excuse to try something like Rust. Although I've also managed to paint myself into a corner by my existing Civ-related projects being in Java, which SDL doesn't support... who would have thought back in 2009 that C# would in some ways have more convenient cross-platform support a decade later? But that's my dilemma in pushing the graphics forward - even if I could get the graphics working, I'd have tens of thousands of lines of Civ related code to move to a new language.

The layers concept makes sense, particularly with the eye to replacement later on. I would be interested in the tile layers, if only as an example of something Civ-related with SDL.

And definitely understand the website being something you like working on, and therefore receiving attention. That's the best part about personal projects for me - when I want to work on a part of it that's interesting, even if it's not high priority, I can do that. Well, maybe the second-best part after solving problems that are more applicable to me than the ones on my day job tend to be.

No rush on account of me; I'm also traveling this week, and always have more projects than time for them anyway.
 
When testing my code for use of the AStar algorithm in the "goto" command I experienced 2 things.
1. The barbarians (from ship) are really stupid, landed, killed the only defender in my capital but then just started to wander around randomly without entering the city.
2. Disasters seems to be much too frequent.

About the "goto": Have a pending pull request on that. If someone has a really large continent saved, please check it out
The implementation is a bit slow since the algorithm is run for every step.
It can easily be improved to be only run once for every turn if it is too slow as now.
 
Last edited:
Hi rehn. Thank you for your contribution!

The current AI is using random GoTo to any visible tile. It makes the AI really stupid. The correct logic for GoTo has been figured out and the details are somewhere in a forum thread here. I haven't been made time to implement it yet, though.
The AI should get better with the current branch that I'm working on.

As for the GoTo AStar algorithm: I've added a comment to your PR. Basicly, I want to pull your code, but it won't be made the standard, especially if there are performance issues. Can you make the appropriate changes to make the AStar algorithm optional, with a Patch setting to choose between the default and the AStar algorithm. If you need any help or pointers with that, please let me know.
 
hi to all,
where i can find the latest version of your mod, because your site is down

thanks in advance
 
Looks like the authors dedication has waned, the last checkin to his git was three quarters of a year ago and he failed to even get his site running again at the already postponed date.
Maybe it's time for the "it's dead Jim" gif?

Too bad, it all had such a promising start.
 
Looks like the authors dedication has waned, the last checkin to his git was three quarters of a year ago and he failed to even get his site running again at the already postponed date.
Maybe it's time for the "it's dead Jim" gif?

Too bad, it all had such a promising start.
I wouldn't write off the project leader yet. Sometimes life gets in the way of fun.

All the soure is on github, someone else can always take it over if necessary.
 
thanks you,

i have found the source in github, but i do not know the files that i may use for lates version.
if you can help?

thanks
 
thanks you,

i have found the source in github, but i do not know the files that i may use for lates version.
if you can help?

thanks
I don't know how to make the installer but I made a zip of a build of master as of now. If you replace the files in your civone folder with these files it should work. Of course make a backup first and don't blame me if something goes wrong...

https://www.dropbox.com/s/evx7xqct74mrqs1/civnet20190301.zip?dl=0
 
thanks mate,

for your time.
i am hoping someone continue this mod.

thanks again
 
i have download for the first post the 715r-alpha.
i follow below the swy. instuctions


Extract the zip, to a folder (ex.: C:\Games\CivOne\).
Make sure you have .NET 4.0 installed.

The game will ask where the original Civilization files are, and copy them to the data directory.

!!! For now, only English game files are supported. If you're testing with another language, the game might crash !!!

To run the game, start .\bin\CivOne.exe or .\CivOne.bat
To run the game setup, start .\Setup.bat
To run the game demo, start .\Demo.bat

To make screenshots, press Ctrl+F5.
To make a screenshot of the entire map, press Ctrl+F6.

If you want to load save files from the original game, you can copy them to .\saves\{drive_letter}.

The game is made with .NET 4.0, so it should run on Windows XP with SP3 and higher, but I've only tested it on Windows 10. Please let me know your system/software specs and how the game performs.

Please, report any bugs in this thread or (better) create an Issue on GitHub. When reporting issues, please be as detailed as possible.
Thank you for testing. :D


then in the folder (ex.: C:\Games\CivOne\). adds other stuff. attachment below
 

Attachments

Back
Top Bottom