- Jan 24, 2011
Looks like you pretty much nailed it!
This is an earlier screenshot, notice how dithering is missing. Drawing an isometric grid like this with indexes of tiles shifted left and right depending on which column you're at was much more difficult than it would seem.Looks like you pretty much nailed it!
This is an earlier screenshot, notice how dithering is missing. Drawing an isometric grid like this with indexes of tiles shifted left and right depending on which column you're at was much more difficult than it would seem.
Anyway I managed to get city panels going and all the Advisor and World panes, importing of SAV files was practically done, also making of units/cities/civs etc. And a bunch of other panels. This is quite simple in winforms. I was actually doing unit moving and attack animations and attack logic when I stopped as my real-life work was tiring me.
I'm actually thinking of making it with Mono so it would work on Linux.
I was also thinking of moving the project to github but it's too amateurishly done.
Here's a quick perspective from a Civ4 modder: Why don't you guys just rip out the stuff you don't like (Civics, combat etc) from civ4 and then re-create civ2 with the civ4 engine?. The game logic is completely open source so you have full freedom to do what you want. You can even have the isometric perspective if you want (it's used by some mods like Afterworld). The downside would ofc be that you'd still be "chained" to the Civ4 exe (which is unlikely to be made open source any time soon)
Just to be clear, I don't expect this to be THE open-source Civ2 project. Most programmers prefer C/C++ with which the original was made, so it would be nice if someone (more experienced than me) started something similar where we could all contribute. One central project is better than several solo-ones.
Can confirm I just loaded an old game I had somewhere and it appears to work quite well ( I did fork it and made a few changes to get it to build, not sure if it was my clone from git).Thanks. BTW drawing a map is a mess right now. I don't like how it's done, it's not in line with how the original does it so I'm redoing all of this right now. Also there are some memory issues, I plan on tackling them, but overall the GC does its job.
Regarding map drawing - the original does some simplifications zoomed out, like no drawing of coastlines which I implemented (right pic is mine). I'm doing everything with 32bpp bitmaps, the originals were 8bpp but it's a hassle working with them, also why limit ourselves to a 256 palette...
View attachment 580189 View attachment 580190
Can confirm I just loaded an old game I had somewhere and it appears to work quite well ( I did fork it and made a few changes to get it to build, not sure if it was my clone from git).
I really like the coastline and road stuff! I know that can't have been easy to do. nice
Not sure if you'd considered (and I may be teaching to suck eggs..) but it may be easier to have zoom done by using a camera style system so a:
PointF to represent the worldPos (in the window)
and another float to represent the mapScale
this is from memory but I think its right, making the coords of a tile would be:
tileWidth = (int)(stdTileWidth * mapScale);
tileHeight = (int)(stdTileHeight * mapScale);
drawTileAtX = (int)((tileX + worldPos.X) * tileWidth);
drawTileAtY = (int)((tileY + worldPos.Y) * tileHeight);
You could then adjust the zoom by *= 0.05 or whatever to get an incremental zoom using the mouse wheel and get smooth scrolling.. I'm not sure if that'd help or make things more complicated :/
Also I know there's various issues in regards to the draw string methods, TextRenderer vs Drawstring yields different results depending on the context in which it's used..