The implementation notes given below are neither complete nor particularly lucid. I have just put them there for the use of people who might want to know more about the state of the project.
Interface
Notes:
1. P - Planned but not implemented feature
2. PI - Partially implemented, don’t know exactly how far yet
to go, most PIs are at least somewhat functional
3. #I - 1/2I = about half implemented
4. FI - final implementation - Very little so far!
Important: A "**" in the code or comments means a known needed improvement, kludge, or other incomplete and potentially dangerous aspect of the code.
Toolbar [class ToolBarFrame, PI ] is designed to always be available.
Has Buttons for:
1. new turn (and x10, x100), [FI]
2. map button to generate local maps, [FI]
3. tech to access tech devel chart for the civ, [PI] and
4. Econ button [PI]
5. Diplomacy [P]
6. Government [P]
7. Other Buttons… whatever’s useful
8. Pull Downs for various utility functions - suggestions? [P]
Detail Map [class MapSquaresFrame, PI , drawing on MapCanvas,
PI] is the main map the player interacts with (Right now it shows
a hunk of the world (taken from the earth map) in a scrolling panel. The
detail map has:
1. Zoom in and out through menu item sq Size (in pixels) [PI]
and scrolling [FI]
2. Shows map with (currently) nxn squares depending on Sq Size
setting
with info depending on option set by radio buttons -
zooming [PI] goes from about 50x50 squares with only a little information
(I plan a bubble-popup with more detailed information on a square
available) up to current 5x5
3. Can be set to show ECON , MIL_FORCE, econ. SITES,
TERRAIN, and OVERVIEW [PI] in a radio button group.
a. ECON - stats on capacity in the five econ sectors (Farm, Res, Prod,
Infra, Merch.),
b. MIL_FORCE - shows political control and military units in
each square, see 4.
c. SITES - sites correspond to Potential economic capacity if
developed. Good sites are 50% better than normal sites
d. TERRAIN - displays code for terrain, greens = good farmland,
grays hills…
e. OVERVIEW - whatever the most useful aggregate of above turns out
to be [P]
4. Mil forces setting is how military movement and combat are
run. Due to lack of movement AI, units just teleport to their
final destination. To move units you select (with left mouse button,
LMB) by clicking on their boxes. Then select (LMB) a square to move
to. Finally press ‘m’ for move. NOTE: movement is simultaneous
in this game. You will not see where the others are moving until
combat is resolved. If you see a unit disappear, its usually due
to a mutual-annihilation attack where someone moved in, and now the two
of them are history. Sometime soon we’ll need drag-n-drop too.
However, it might be worth waiting since the version of the JDK after 1.1
is supposed to have explicit drag-n-drop support classes.
5. I have tiled terrain that is not so great but functional.
This could be used in the TERRAIN map in some way. The file is GameTiles.gif,
and comes from a programming project called Antiquity that was put up on
a BB. The guys who worked on it gave up due to lack of time and put
it up on an "if you can use this … great" basis. The tiles are 32x32
versions of 16x16 bitmaps. Further info is in MapSquare.java
6. Msc. Function key actions that act on Selected squares.
These are a mixture of game functions and diagnostics show in the dos window.
Some only use one sq
F1 - bring up provFrame to display economic info for ALL Selected sqs
that are yours
F2 - same as F1 but works for all civs squares
F3 - EconStrategy for civ selected on map
F4 - Tech for civ selected on map
F5 - Move settlers into selected squares(s) that are vacant costs $100
for 2 pop
F6 - Swap playerCiv with civ whose square is selected. PlayerCiv
is now the other
'm' - move selected military units to selected square
'c' - show status of whole civ of selected sq (in a ProvFrame,
but for whole civ)
'v' - show vital square status of civ of selected sq/prov
for finetuning mil AI
'f' - show foreign square status of selected sq/prov
's' - select all mil units of player visible that aren't frontLine
'S' - toggle select on or off for all mil units of player visible
'x' - shift map center to selected square (isn't smart enough
to do the scrolling frame too)
'z' - "zaps" all selected squares to off
World Map (not shown in screen shot) [class SmallMapFrame,
contains WholeMapPanel, PI ] is the large-distance map the player interacts
with (Right now it shows the whole earth map) This Frame is
Dumb at the Moment and Does Nothing other than Look Pretty. Someday
Detail Map and World Map will be the same class, with different calling
parameters (window size, zoom level, display type). That way you
can access all the capabilities from both types. it will allow zooming
into a particular area of interest in a Detail Map, either by opening a
new Detail Map, or replacing the existing one. I suggest disabling
the World Map as soon as the program is fired up since its poor method
of screen updating is very slow.
1. Zoom in and out [P] and scrolling [FI]
2. Shows map currently zoomed all the way out, 320x200 squares
with colors depending on terrain, one pixel per square.
3. menus are currently commented out
TechFrame (not shown in screen shot) handles allocation
of a civ’s resources to achieve technical advances. It also lets
the player know the progress that is being made to reach each advance,
and whether any prerequisite technologies are needed to make further progress.
TechFrame is derived from ProvFrame (not via inheritance, just pasted code).
Aside from ugliness it does most of the job it is finally intended to do.
The top set of "Limit" boxes serve no function for now. Eventually
they will be $ allocs for tech areas not yet firmed up. Here Alloc
means what fraction of $ dedicated to tech research gets spent on each
of the eight extant tech areas. Money is used here as a catch-all
for various ways that a player might influence the civ to develop.
Total Allocs are normed to sum to 100%.
Terms in the textArea in TechFrame are shown below using the Res sector
as an example.
"Resources" Readout | Explanation |
Level: 0 | current level in resources sector |
Progr.: 103 | points earned so far |
Needed: 2500 | Average points needed for advance
(50-150% of this amount may actually be needed) |
Turns: 1100+ | At this rate it will take 1100 years. Growth of your civ’s size will help a lot in decreasing this. When you get closer to attaining the tech level a range will be shown like 28 - 156. This means the soonest you might get the tech level is 28 turns and the most 156. -56 - 65 means you’re already above the lowest threshold, hence -56, with 65 the max. |
Trade: 0 | merchant contribution, round to nearest integer |
Sector: 1 | contribution of workers in sector (**slaves don’t contrib) |
Invest: 1 | points per turn coming from money allocated to "research", rounded |
%/turn: 0 | % progress/turn as int |
Pre-Req:
MW1, Bronze Working |
Resources level 1 requires MetalWorking 1. Civ can research Res1, but will never achieve it until it understands Bronze Working since bronze tools are necessary. As currently configured the pre-reqs will sometimes overwrite each other since the length of the text field allocated isn’t enough. Look at the other Tech classes in the Civilization Advances Chart if you want to learn more. |
Core Game Classes - (this stuff is way out of date)
// Game - main class of the game, keeps track of:
// 1) Civilizations thru civs[]
// 2) Frames extant thru framesOpen[]
// 3) executing turns
// 4) loads in maps used
// 5) calculates info on the civs' relative positions in military and
production areas
// these will eventually be run through filters before
the info gets to the civs
// ** save info in 5 periodically so that the historical
info is available for planning
//
// ** will eventually run the weather, random events like volcanic
eruptions, and neutrals
( guys too small or timid to be civs [also we can't afford the overhead
to run all the mapSquares of the earth civ provinces
// class Civ
//
// This is one of the core classes in the game
// 1) It defines a particular civilization's size, through how
many Provinces it has
// 2) A civs approach to winning, through military and economic
strategies
// 3) the civ's strategy to develop/acquire desirable technololgies
// 4) Keeps track of military units...
class Province - header info in ProvFrame above
class MapSquare - lots of info on prototypes for how roads and rivers
will work is in the class variables area