Git Product home page Git Product logo

civ2-clone's Issues

Implement city report options

  • Warn when city growth halted (Aqueduct/Sewer System)
  • Show city improvements built
  • Show non-combat units built
  • Show invalid build instructions
  • Announce cities in disorder
  • Announce order restored in city
  • Announce "We Love The King Day"
  • Warn when food dangerously low
  • Warn when new pollution occurs
  • Warn when changing production will cost shields
  • "Zoom-to-City" NOT default action

Unit shields

Currently the units have no shields, this should be interface dependent since they are different in civ2 and TOT. Perhaps some sort of GetUnitTexture method on the active interface

Implement game options

  • Sound Effects
  • Music
  • Always wait at end of turn
  • Autosave each turn
  • Show enemy moves
  • No pause after enemy moves
  • Fast piece slide
  • Instant advice
  • Tutorial help
  • Move units w/ mouse (cursor arrows)
  • ENTER key closes City Screen

Memory issue

There's an ever increasing memory consumption when moving through the map.
There could be an issue with loading of this texture.
image

Game type parameter for TOT

TOT has an additional GameType parameter in sav file, which can either be:

  • original game,
  • sci-fi game,
  • fantasy game

From what I've tested sofar - if you load e.g. midgard scenario, which is a fantasy game, it first starts looking for assets in local midgard folder. Missing assets are then searched in "Fantasy" folder. If those assets are also missing in Fantasy folder or if that folder is for whatever reason missing, it then additionally searches for assets in "Original" folder.

Stuff like this needs to be added when defining search paths in LoadFile/Scenario dialogs and also when starting a new TOT game.

I'll try to deal with this, just putting issue here is any discussion is needed.

Implement graphic options

  • Throne Room
  • Diplomacy Screen
  • Animated Heralds
  • Civilopedia for Advances
  • High Council
  • Wonder Movies

Civ II: Test of Time support

Stlye-wise it looks like a different game, but except for some new features the base game is the same as classic Civ 2.

Missing references - Broken code

Hi guys,

I am trying to run the project but it seems like is missing a lot of dependencies and imports in the code that is in master branch, primarily related to the EtoFormsUI, especially the Ruleset class.

Am I doing something wrong? After importing the missing files, a lot of other errors happened.

I tried reverting to one commit prior, yet the issue persisted. Going back two commits altered the error; the Ruleset class was no longer missing, but now the EtoFormsUI.LocalPlayer class does not implement all the interface members.

I can't even run the project. It's frustrating. I love this game.

Can someone shed some light on my path?

I appreciate that

Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'MenuElement' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Players\Orders\ImprovementOrder.cs 20 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\ImageLoader\TerrainLoader.cs 14 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\ImageLoader\TerrainLoader.cs 27 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\ImageLoader\UnitLoader.cs 15 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\Images.ImportBitmaps.cs 16 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\Images.ImportBitmaps.cs 45 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\Images.ImportBitmaps.cs 147 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\Images.ImportBitmaps.cs 172 Active
Error CS0246 The type or namespace name 'PlayerColour' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\MapImages.cs 15 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Main.ShowPopupBox.cs 17 Active
Error CS0535 'LocalPlayer' does not implement interface member 'IPlayer.MapChanged(List)' EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Players\LocalPlayer.cs 14 Active
Error CS0535 'LocalPlayer' does not implement interface member 'IPlayer.WaitingAtEndOfTurn()' EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Players\LocalPlayer.cs 14 Active
Error CS0535 'LocalPlayer' does not implement interface member 'IPlayer.Civilization' EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Players\LocalPlayer.cs 14 Active
Error CS0535 'LocalPlayer' does not implement interface member 'IPlayer.Ui' EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Players\LocalPlayer.cs 14 Active
Error CS0246 The type or namespace name 'Ruleset' could not be found (are you missing a using directive or an assembly reference?) EtoFormsUI C:\Users\feedc\Source\Repos\Civ2-clone\EtoFormsUI\EtoFormsUI\Bitmaps\ImageLoader\CityLoader.cs 13 Active

Improve README

Hi!

Just found this:) It would be helpful if just a bit more information could be added in the README on how to get started.

  • how to install/build
  • prerequisites
  • also maybe:
    • status of project. Is it pretty much complete?
    • extensibility? What does Lua-support mean? Etc.

Thanks!

Implement Advisor windows

  • Chat with kings
  • Consult high council
  • City status
  • Defense minister
  • Foreign minister
  • Attitude advisor
  • Trade advisor
  • Science advisor
  • Casualty timeline

Dialog not closed

I was doing some testing and disabled drawing of base view in MapControl.cs (line Raylib.DrawTexture(_currentView.BaseImage, paddedXLoc, paddedYLoc, Color.WHITE)).
The dialog appears in the background but probably shoudn't:

Clipboard02

Saving game

So we can either:

  1. save the game as in the original binary .sav format (this shouldn't be a problem as the whole .sav structure is more or less figured out)
  2. save the game in a newer format which would make editing the saved game easier and new stuff could also be added, but this means you can't open the file with the original game (is this even important?)

Feature Request: use Bilinear/Bicubic interpolation scaling on zooming

Hello. First of all, I post here since it seems that Github is the only active place of the Civ2 clone project. I'm sorry if the Issues section is not the right place to post feature requests.

One thing that Civ2 bugs me is it use nearest-neighbor interpolation scaling when zooming in/out. This cause two problems:

First, graphic looks pixelated when zooming in. Back in 1999, when played Civ2 with a CRT screen, this problem was inconspicuous since CRT screens have built-in anti-aliasing. But this problem becomes obvious when using a modern LCD screen.

Pixelated graphic when zooming in:
1

Second, a even more serious problem cause by nearest-neighbor interpolation is that, graphics distorted when doing non-integer scaling. And all unit graphic in UI of Civ2 are scaling non-integerly.

Here you can see the pikes and lances (which supposed to be straight) of the units are seriously distorted:
2

Using bilinear/bicubic interpolation scaling on zooming can fix the problem. So I request that, if possible, add an option to enable bilinear/bicubic interpolation scaling in the Civ2-clone project.

Thanks for reading my post!

RaylibUI.Mac does not exist

Hello, I am testing this on an M2 Max running Sonoma 14.1.1 and on building the project I get the following error on running the .NET Core Launch Mac build configuration (after clean/build) :

Civ2-clone/RaylibUI/bin/Debug/net6.0/RaylibUI.Mac' does not exist.

I don't see this RaylibUI.Mac file inside the net6.0 folder. I looked at upgrading to 5.0.0 of Raylib-cs, but there were quite a few errors with that change.

What civ can see vs what is there

I've recently added a structure to a Tile that records what a civ can see in terms of improvements vs what is actually there, is this information stored in the sav file? We should probably load it, I'm going to rework the map rendering so each civ's map show what they know rather than the actual game state

Transparency

We've hardcoded transparency colors but this can give bad results. These colors vary in scenarios.
For Civ2gold the last 3 colors in image palette define transparency.
For TOT the last bit in every 16-bit color seems to set transparency.
Anyway based on this we'll have to set alpha in our images.

Make File.Exists case insensitive for linux (gtk)

(for .txt files like Game/game, Labels/labels, etc.)
See here:

public static string GetFilePath(string filename, IEnumerable<string> searchPaths = null, params string[] extensions)
{
if (searchPaths != null)
{
foreach (var path in searchPaths)
{
var searchPath = path + Path.DirectorySeparatorChar + filename;
if (extensions.Length > 0)
{
foreach (var extension in extensions)
{
var filePath = searchPath + "." + extension;
if (File.Exists(filePath))
{
return filePath;
}
}
}
else if (File.Exists(searchPath))
{
return searchPath;
}
}
}
var rootPath = Settings.Civ2Path + filename;
if (File.Exists(rootPath))
{
return rootPath;
}
Console.WriteLine(filename + " not found!");
return null;
}

Windows (WinForms) doesn't have this problem.

No website?

Civ 2 is the best version of the game.

Let's make a website!

Is there an android version planned?

Adjust Menus for TOT

The default menu layout is for MPG the TOT interface needs to adjust this to reflect the different layout of the TOT menu.txt

Unit Actions

The Eto version had most unit actions working, it probably wouldn't be to complex to migrate that code over

Some issues with BitmapStorage

  1. The Raylib.LoadImageFromMemory function for _imageCache

    _imageCache[sourceKey] = Raylib.LoadImageFromMemory(Path.GetExtension(path).ToLowerInvariant(), File.ReadAllBytes(path));

    works well only for gifs but not for bmps so we probably have to use our custom implementation here (I'm referring to LoadPropertiesFromPic function in RaylibUtils).

  2. We probably don't need to define transparent colours in BitmapStorage and then do this:

    if (bitmapStorage.Transparencies != null)

    since transparent colours are already defined in the colour palette of the file (pngs work different but we already deal with that). If 1) is solved then the cached image will have transparent colours fixed.

  3. Extraction of images and textures in CityLoader, TerrainLoader, etc. differs from the implementation mentioned in 1) with _imageCache. This needs to be cleaned up so that the bitmap & texture loading logic is consistent throughout the project.

I can try to deal with this.

Menu styling

The menus look wrong, the styles for MPG and TOT should be corrected

Improvement effects

  • Palace
  • Barracks
  • Granary
  • Temple
  • MarketPlace
  • Library
  • Courthouse
  • City Walls
  • Aqueduct
  • Bank
  • Cathedral
  • University
  • Mass Transit
  • Colosseum
  • Factory
  • Manufacturing Plant
  • SDI Defense
  • Recycling Center
  • Power Plant
  • Hydro Plant
  • Nuclear Plant
  • Stock Exchange
  • Sewer System
  • Supermarket
  • Superhighways
  • Research Lab
  • SAM Missile Battery
  • Coastal Fortress
  • Solar Plant
  • Harbor
  • Offshore Platform
  • Airport
  • Police Station
  • Port Facility
  • (Capitalization)
  • Pyramids
  • Hanging Gardens
  • Colossus
  • Lighthouse
  • Great Library
  • Oracle
  • Great Wall
  • Sun Tzu's War Academy
  • King Richard's Crusade
  • Marco Polo's Embassy
  • Michelangelo's Chapel
  • Copernicus' Observatory
  • Magellan's Expedition
  • Shakespeare's Theatre
  • Leonardo's Workshop
  • J. S. Bach's Cathedral
  • Isaac Newton's College
  • Adam Smith's Trading Co.
  • Darwin's Voyage
  • Statue of Liberty
  • Eiffel Tower
  • Women's Suffrage
  • Hoover Dam
  • Manhattan Project
  • United Nations
  • Apollo Program
  • SETI Program
  • Cure for Cancer

Update status panel

Population, gold, info etc. need to be added to status panel. Offsets of what's currently drawn also needs to be updated.
I'll try to deal with this.

Cities don't build anything

Apologies for noob way of posting the solution:

Game.ActionsCities.cs

`                // Change shield production
                city.ShieldsProgress += city.Production;
                var maxUnitIndex = Game.Rules.UnitTypes.Length;
                int cost;
                // Units
                if (city.ItemInProduction < maxUnitIndex)
                {
                    var unitType = Game.Rules.UnitTypes[city.ItemInProduction];
                    cost = unitType.Cost * 10;
                    if (city.ShieldsProgress >= cost)
                    {
                        city.ShieldsProgress = 0;
                        Game.CreateUnit(unitType.Type, city.X, city.Y, false, true, false, false, city.Owner.Id, 0, 0, city.X, city.Y, CommodityType.Hides, OrderType.NoOrders, city, city.X, city.Y, 0, 0);
                    }

                }
                // Improvements
                else
                {
                    var improvementIndex = city.ItemInProduction - Game.Rules.UnitTypes.Length + 1;
                    var improvement = Game.Rules.Improvements[improvementIndex];
                    cost = improvement.Cost * 10;
                    if (city.ShieldsProgress >= cost)
                    {
                        city.ShieldsProgress = 0;
                        city.AddImprovement(improvement);
                    }
                }

For my convenience I also made additional method of creating units in Game.cs:

        public Unit CreateUnit(UnitType type, int x, int y, bool dead, bool firstMove, bool greyStarShield, bool veteran, int civId,
                                    int movePointsLost, int hitPointsLost, int prevX, int prevY, CommodityType caravanCommodity, OrderType orders,
                                    City homeCity, int goToX, int goToY, int linkOtherUnitsOnTop, int linkOtherUnitsUnder)
        {
            var validTile = CurrentMap.IsValidTileC2(x, y);

            var civilization = AllCivilizations[civId];
            Unit unit = new Unit
            {
                Id = civilization.Units.Count,
                TypeDefinition = Rules.UnitTypes[(int)type],
                Dead = dead || !validTile,
                CurrentLocation = validTile ? CurrentMap.TileC2(x, y) : null,
                Type = type,
                X = x,
                Y = y,
                MovePointsLost = movePointsLost,
                HitPointsLost = hitPointsLost,
                FirstMove = firstMove,
                GreyStarShield = greyStarShield,
                Veteran = veteran,
                Owner = civilization,
                PrevXY = new int[] { prevX, prevY },
                CaravanCommodity = caravanCommodity,
                Order = orders,
                HomeCity = homeCity,
                GoToX = goToX,
                GoToY = goToY,
                LinkOtherUnitsOnTop = linkOtherUnitsOnTop,
                LinkOtherUnitsUnder = linkOtherUnitsUnder
            };

            civilization.Units.Add(unit);
            return unit;
        }

Attack animation

The game crashes when an attack occurs as no animation frames have been provided.

We need to port the Attack animation to the new structure. (I guess it will be a sequence of animation elements similar to move I tried to make the code in the area flexible for possible future extensions)

Improvements in MPG vs TOT

Line 377 of the RulesParser refers to ImprovementType.Pyramids as the first wonder index.
var firstWonderIndex = Rules.Improvements.First(i => i.Type == ImprovementType.Pyramids).Id;

this works for MPG but TOT has an additional improvement so in TOT this is going to the (Capitalization) instead which will break city improvements.

Is there a way to do this more flexibly? Do we know at this stage of parsing the rules if we're looking at TOT or MPG?

Perhaps we could base this on the name? Could we assume that the first wonder is the first thing after Capitalisation? Or perhaps the first after a city improvement that has brackets around the name?

Update dialog tiles when loading game/scenario

We need to update the look of dialogs when loading a .sav or scenarios which have custom dialog and icon pictures.
Currently ImageUtils.SetLook(main.ActiveInterface); is only set at beginning of game in MainMenu.cs and left as-is.

For example, the wallpaper for TOT's status panel should be different for what's currently implemented (the icons.gif in TOT root directory is from MGE, the game should look for icon file in the local folder or one of the "fallback" folders (Original, Fantasy, SciFi)).

Test of Time DLL images

I tried pointing the app at a copy of TOT it didn't go well, we probably should support loading the images from the TOT DLLs as well

Fonts

Raylib uses a font which doesn't look anything like the one from the original game and thus needs to be changed.
Civ2 uses 2 fonts: Times new roman + Arial

So we can either

  • use a free font from the web (get something from e.g. google fonts which looks like the original font)
  • search and pull fonts built-in in win/max/linux/etc.

Your thoughts please.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.