SWY
Prince
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:
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...Give me about a week, and CivOne will have support for AI plugins.
Last edited: