1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

CivOne - An Open Source remake of Civilization 1

Discussion in 'Civ1 - General Discussions' started by SWY, Oct 3, 2014.

  1. fire-eggs

    fire-eggs Chieftain

    Joined:
    Jun 19, 2019
    Messages:
    29
    My first thought, after letting my subconscious mull on it, was to add a small delay in the 'Goto' code: pause a short while between 'moves'.

    Pondering further, the 'invisible barbarians' thing might be the same problem: when a unit completes a move, there needs to be a pause so the user can see and adjust to any results. I don't recall off-hand how many "movement done" handlers there are, but that seems like an appropriate location to experiment with.

    Action on the screen is definitely too fast: transition away from the current unit is large and jarring sometimes.

    A well-designed game loop should take system speed into account and provide a consistent and smooth update behavior. I've been focused on bug fixes and features to-date and have not dug into the foundations yet.
     
  2. fire-eggs

    fire-eggs Chieftain

    Joined:
    Jun 19, 2019
    Messages:
    29
    On the subject of A* goto, I was playing yesterday and observed that units would move "off road", even though taking the road "should" be faster. Using my crude MSPaint skills, I attempt to show an example here:

    upload_2019-7-21_11-6-14.png

    Chariot in City 2, I tell it to go to City 1. The optimal route would be to take the roads in brown to city 3 then to city 1: 1 turn to get part way to city 1, then 2 partial moves to city 1 on turn 2, with 4 partial moves remaining.

    However, the chariot took the black route which happened to be through hills. So 2 turns to move through the hills at least.

    I know of a bug where a terrain's movement cost is not being taken into account. Might this bug be the cause of the poor choice of A*, or something else?
     
  3. rehn

    rehn Chieftain

    Joined:
    Nov 18, 2007
    Messages:
    14
    Yes I have seen that too. It is about the estimated cost of the individual steps. I am adjusting my algorithm for that. Not released yet. Will do some more tweaking/testing.
    Related questions. In CivDos: When moving on rail, manually: no cost. When using goto, cost is the same as on road. Is that something we want to keep in CivOne ?
    I have found that if diplomats/(chariots?) is moving to a mountain square it sometimes fails if it has 2 steps left but always makes it if it has only one step left.(keep this "bug"?).
    If sea unit is entering a city it loses all remaining movement points. I would like to change that

    Btw: I have implemented "h" ( not "g": typo in github comments) for air units, Interpreted as " goto city/carrier" if outside city/carrier. Code in BaseUnitAir.cs, minor adds in BaseUnit.cs
     
    Last edited: Jul 22, 2019
  4. fire-eggs

    fire-eggs Chieftain

    Joined:
    Jun 19, 2019
    Messages:
    29
    Having rail behave different with goto makes no sense to me. As long as there is a stop condition to prevent a unit from moving infinitely, then rail should _always_ be zero cost...

    Looking forward to it!

    I'll have to play around with it but that don't sound right to me ... CivOne has a bug in this area but I've not investigated how Microprose behaves.
     
    Last edited: Jul 22, 2019
  5. Volcanon

    Volcanon Chieftain

    Joined:
    Jun 12, 2006
    Messages:
    296
    He's right about rail not working the same with goto. I never realized it was to prevent infinite loops, but it was very annoying that you couldn't avoid having to micro the movement of armies across an empire after railroad was invented. Seems like you could avoid stopping looped movement by hitting Escape or the space bar.

    Anyway I followed this ages ago and it looks fun now. Maybe like a more polished version of FreeCiv, which I could never get into because it just felt like a very rough clone of Civ 2.
     
  6. fire-eggs

    fire-eggs Chieftain

    Joined:
    Jun 19, 2019
    Messages:
    29
    I don't know that to be the case, but given no movement expense, I would assume the AI could easily get into a state of moving a unit back-and-forth forever.

    One potential solution that occurred to me much later is to let the human have cost-free railroad goto, and not the AI. It would be a pleasant reverse-benefit!
     
  7. Volcanon

    Volcanon Chieftain

    Joined:
    Jun 12, 2006
    Messages:
    296
    I've seen AI units move in a loop so it seems plausible.
     
  8. FelipeCG

    FelipeCG Chieftain

    Joined:
    Aug 6, 2019
    Messages:
    2
    Nice project, I'd like to contribute programming, but I wonder If I have the required skills... any tips for those who just got here and want to contribute, what should I do to grasp everything done so far (besides reading this thread)?
     
  9. fire-eggs

    fire-eggs Chieftain

    Joined:
    Jun 19, 2019
    Messages:
    29
    How are your Civilization skills? ;) Playing the game and identifying discrepancies between this and the original game is important.

    You can look at any post of darkpanda's to read in-depth descriptions of the original DOS code. Possibly too deep for getting started tho.

    You can look at SWY's Github repository which is the base we're working from. Unfortunately, the code is not documented or described. You can look at the issues there for things that need doing.

    My Github fork is the most "advanced" right now, where I've fixed a bunch of bugs. You can look at the Issues there to see stuff that I'm tracking. Or diff my code vs SWY's and try to understand the changes, what was fixed, and where.
    There are over 100 TODO items in the code.

    I've not yet spent any time trying to get stuff organized / documented.

    There are a bunch of areas which are missing functionality or haven't been examined, in addition to listed issues:

    diplomacy
    fog-of-war
    alternative graphics
    plug-in support / testing / samples; mod support (alternate pictures)
    nuclear meltdown on city disorder [City.cs, NewTurn()]
    Force Democracy civilization into revolution on extended city disorder [City.cs, NewTurn()]
    accumulate & show game replay
    civilization rankings & announcement
    land barbarian spawning [in progress?]
    civilization score
    powergraph
    demographics (?)
    difficulty levels
    game save / load fully compatible with Civ DOS
    fix SDL issues: "frame rate", graphics glitches
    build, package, install
    unit test support and actual tests
    palace: drawing and update
    "best civilization" report

    AI:
    - city production
    - science advances
    - movement [in progress]
    - barbarian logic

    Many of those are big-and-hairy items but there are smaller bits that could be teased out to tackle.
     
    Last edited: Aug 8, 2019
  10. hospital

    hospital Chieftain

    Joined:
    Feb 8, 2018
    Messages:
    62
    Pretty sure SWY merged my PR for that a few months ago.
     
  11. fire-eggs

    fire-eggs Chieftain

    Joined:
    Jun 19, 2019
    Messages:
    29
    Yup, my bad. Mis-interpreted a TODO.

    Should read:
    - Force Democracy civilization into revolution on extended city disorder [City.cs, NewTurn()]

    Updated - thanks!
     
  12. FelipeCG

    FelipeCG Chieftain

    Joined:
    Aug 6, 2019
    Messages:
    2
    Thanks for the detailed answer. I browsed the project, got familiarized and checked the links. I guess I have to understand it better before I contribute. It feels awesome.
     

Share This Page