Gamers' Lounge :  Conqueror! Forum
Arrange meeting times for new games, discuss past games and strategies, socialize with other players. 
Pages: 123Next
Current Page: 1 of 3
A new project
Posted by: Paars ()
Date: August 23, 2010 01:58PM

/*

"With respect to Alexey and Xuul for creating the great Conquerorgame"

Everything between '/*'and '*/' should be considered as commentary, information given about whats being done or still should be done, '//////' at the end of a line is also commentary specific for that line .

This project is somewhat going to be conquerorgame clone, (Yes I started 1 again, but instead of madman start coding we put the plan on paper first) probably will be programmed in Java with the idea of it
being downloadable, but also a webbrowser version being created(Which in Java isn't hard to switch too).

Since Xuul and Alexey are very busy in real life with jobs etc and do not have much spare time to update Conquerorgame, also because the
coding is old/messy I decided to start a sort of rebuild. However, nothing of the original Conquerorgame looks/pictures will be copied without permission from Alexey.
As for now(And probably will stay that way) this will be completely open source and there are absolutely no plans to make a profit nor will there ever be.

Currently Working on this project:
Paars: Designer, Coder
Acro: Designer(Ai, Creating algoritms)

We can always use more people to help out, if you're interested please post it in here and what exactly you would like to help out with.
Just suggestions or possible idea's or options are always welcome.
Also still actively looking for someone to create sounds(Hopefully your offer still stands Rippe?) And Graphics(People who're any good with Photoshop)

*/




----------------------------------------------------
Starting options
----------------------------------------------------

Register -> Database needed, insert values
Connect -> Database needed, retrieve values, compare values -> Move to lobby system
Multiplayer Ipgame -> In case server is down etc give option to host/connect through Ip -> Host creates minor lobby system
Single Player -> Skip Lobby System, move to Main game class

----------------------------------------------------
Lobby System
----------------------------------------------------

Playerlist -> show players online, playerStatus
Gamelist -> show available games,
Main chat -> option autoscrolling, deny spam, Admin/moderator functions(checked in database), whisper option
Create -> Insert game name, password protected?, -> move to create game options
Join -> insert pass? -> move to picking capital
Options -> (Not sure which options yet)

----------------------------------------------------
Game Joining/Creating options
----------------------------------------------------

Create -> amount of players, select countries/capitals, ai options(resources/strength/style), game timer, turn timer, team select,teamchanging allowance, allied victory? victory conditions, fog of war?, Cancel game -> AllowJoining, Cancel game -> Start Game , Cancel Game
Join -> Select Capital, cancel game -> Ready/unready, cancelgame ->if game started -> Game System else wait

----------------------------------------------------
Game System
----------------------------------------------------

Standard buildup options(create map and such), game timer, turn timer, year , season, local chat, buttons(options etc)
Place player/Ai capitals(player owns country?country has player?or Both)
Countries -> set player influence
Set Locals -> gold, armies, advantages, farms, production
If fog of war -> Show only visible countries else show all

-----------------------------------------------------------

if host end turns -> loop through Ai -> Ai orders -> if aiDone &&AND&& playersDone->turn changing proces|| OR || if turn timer ends -> Do Ai loop again ->Turn changing proces
if player select country(Which is not in fog of war) AND owns it -> showAllInfo , include productionOptions else showPartlyInfo
if player drags country1 to country2 &&AND&& player owns country1 &&AND&& country2 == country1Neighbor &&AND&& soldierAmount !=NOT IS!= 0 &!=And not is &!= Turn changing Proces &&AND&& moveAmount <LESS< than 5 -> Display moving/War optionScreen -> Cancel(do nothing) or Accept(moveAmount +=1, add moveOrder to MovingOrderArray)

-----------------------------------------------------------

/*

We need to get whats inside the head of a great ConuerorGame gamer or gamers into Artifical Intelligence. Why do you make the choises or moves that you do, can we make the ai think steps ahead?
What needs to be taken into consideration is the skill level of the ai such as easy/medium/hard/equalyToMaster :P, also if the Ai if Passive/Aggressive/Random/ComnenusStyle(without the cheating part)
The ai could also be made stronger by giving them for example: more starting resources, stronger soldiers?,cheaper soldiers?increased productivity?Which will be options for the host to decide

*/


Ai Orders -> Do Ai stuff -> end turn -> sendData -> Back to Ai Loop /////////// Ai will be created by Acro



-----------------------------------------------------------
/*
This part should be cleaned up, will be fixed in real coding(This is mostly Pseudo-coding)
*/


Production Options -> this(Country).getProducedboolean == false -> showChange, show this(Country).getProduction, if Player.getGold >=more then or equals >= this(Country).getProduction.Costs-minus-this(Country).getCurrentProduced && this(Country).getMaxAllowedBuyingUnits >=more then or equals >= this(Country).getBoughtUnits -> showBuyButton , if this(Country).getProducedboolean == true -> showUndoButton
if changeButton ==equals== clicked > this(Country).getProduction.moveNextinList > goto Production options again
if buyButton ==equals== clicked -> Player.setGold -= (this(Country),getProductionCosts-this(Country).getCurrentProduced) ->getTempCurrentProduced.setGetCurrentProduced,getCurrentProduced set to 0, changeButton.setInvisible, if this(Country.getProduction == unitType) &&AND&& this(Country).getBoughtunits <Less< this(COuntry).getMaxAllowedBuyingUnits &&AND&& player.getGold >= more then or equals >= this(Country).getProductionCosts -> set this(Country).producedboolean = true ELSE buyButton.setInvisible
if undoButton ==equals== clicked -> Player.setGold += (this(Country.getProductionCosts-this(Country).getTempCurrentProduced) ->setProductionAmount -= 1,if this(Country).getProductionAmount !=NOT IS != 0 THEN player.setGold = getProductionAmount*Times*this(Country).getProductionCosts , setCurrentProduced = getTempCurrentProduced, setProductionboolean = false -> Goto Production options again
if clearOrdersButton ==equals== clicked -> player.setOrderArray = null, player.setMoveAmount = 0 // if clear orders clean this players OrderArray and set moveAmount back to 0

-----------------------------------------------------------
/*
Till so far, expect updates coming soon
*/

Options: ReplyQuote
Re: A new project
Posted by: Master ()
Date: August 23, 2010 09:10PM

Sorry but I don't think I have any skills that can help you guys (except suggestions for the Master-ai - awesome btw), but it sounds great! I hope you succeed. Good luck.

Options: ReplyQuote
Re: A new project
Posted by: Akiran ()
Date: August 23, 2010 09:49PM

i have school shoulda done sooner jesus

Options: ReplyQuote
Re: A new project
Posted by: -RIPPE- ()
Date: August 24, 2010 07:20AM

i could provide grafics (look at my magnificent photoshop works released before) and sound but i think if you make a new game it should be in a diffrent setting that it cant be connected to conq so nothing scratches conqs unique surface. i somehow dont like the idea of a "better" conq copy. i just love the original too much and therefor respect alex work. something like a postnuke american civil war (though americas map is pretty boring) or something else. we better go new ways using our knowledge and experience anyway.

Options: ReplyQuote
Re: A new project
Posted by: LikeNoOthers ()
Date: August 24, 2010 02:43PM

i wish i could help, but i cant think of anything i could help with.. I am not so familiar with programming, and not really skilled with graphics.

Options: ReplyQuote
Re: A new project
Posted by: Scum ()
Date: August 24, 2010 09:56PM

I have photoshop, some lower level courses on how to use it, along with some lower level photography and developing professional digital photographs using photoshop. I also have a brother who attended Art Institute in Seattle who I can bounce the pictures off when he has the time.

Options: ReplyQuote
Re: A new project
Posted by: Paars ()
Date: August 26, 2010 09:12AM

I'm in Belgium now @ gf. Back on Sunday I LL be having the chance for an extended reply. To think/work on Ai and such you do not have to be a programmer. The programmer just has to implements the coding of the ai thinking which can just be written out in English.

Also when im back i ll post the newest update.

grtz Paars



Edited 1 time(s). Last edit at 08/26/2010 09:13AM by Paars.

Options: ReplyQuote
Re: A new project
Posted by: sixamplayer ()
Date: August 27, 2010 01:32PM

well getting the english directions for an AI could be taken right from these forums and cleaned up. Paars Strategy?

Options: ReplyQuote
Re: A new project
Posted by: acro ()
Date: August 27, 2010 03:54PM

Not quite that simple six.

Options: ReplyQuote
Re: A new project
Posted by: sixamplayer ()
Date: August 28, 2010 12:29AM

i realise that. i used to do some programming but i'm just saying that anybody could do that part.

anyway i just logged in here to make one small request of this project. please make the game capable of being full screen so i do not have to sit a half meter from my screen to be able to read it

Options: ReplyQuote
Re: A new project
Posted by: Paars ()
Date: September 05, 2010 12:00PM

A small update, I build the basic Country class.

----------------------------------------------------
Starting options
----------------------------------------------------

Register -> Database needed, insert values
Connect -> Database needed, retrieve values, compare values -> Move to lobby system
Multiplayer Ipgame -> In case server is down etc give option to host/connect through Ip -> Host creates minor lobby system
Single Player -> Skip Lobby System, move to Main game class

----------------------------------------------------
Lobby System
----------------------------------------------------

Playerlist -> show players online, playerStatus
Gamelist -> show available games,
Main chat -> option autoscrolling, deny spam, Admin/moderator functions(checked in database), whisper option
Create -> Insert game name, password protected?, -> move to create game options
Join -> insert pass? -> move to picking capital
Options -> (Not sure which options yet)

----------------------------------------------------
Game Joining/Creating options
----------------------------------------------------

Create -> amount of players, select countries/capitals, ai options(resources/strength/style), game timer, turn timer, team select,teamchanging allowance, allied victory? victory conditions, fog of war?, Cancel game -> AllowJoining, Cancel game -> Start Game , Cancel Game
Join -> Select Capital, cancel game -> Ready/unready, cancelgame ->if game started -> Game System else wait

----------------------------------------------------
Game System
----------------------------------------------------

/* Country Class, will obviously be put in a seperate class/file */
class Country
{
Player player;
String capital;
String name;
Country[] neighborArray;
int population; // will be number *times* 10000
int culture; // 1,2,3 == primitive, developped, advanced respectively
int neighborCount; // starts at 0 just works as pointer for the neighborArray
int soldiers;

public Country(String name,int neighborAmount) //When Creating a new country a name has to be given, also the amount of neighbors, constructor creates local country values as well
{
this.name = name;
neighborArray = new Country[neighborAmount]; // preparation to adding neighbors
// randomize the population between certain values 1 to 4 * 10000
// randomize a number 1 to 10 where 1 to 7 == culture 1, and > more then > 7 == Culture 2
// randomize soldier between 1 and X value;
}
public void addPlayer(Player player)
{
this.player = player;
}
public void setCapital(String playerName)
{
capital = playerName;
}
public void setNeighbor(Country neighbor)
{
neighborArray[neighborCount] = neighbor; // at this place in the array at a neighbor
neighborCount += 1; // increment the pointer in array by 1
}
public void buildPopulation() // increase population
{
population+=10000;
}
public void buildCulture()
{
culture++;
}
public void setSoldiers(int soldiers)
{
this.soldiers = soldiers;
}


}

String[] seasonArray = {"Spring","Summer","Autumn","Winter"};
int tTMinuts, tTSeconds , gTMinuts, gTSeconds, year; // tt = turntimer, gt = gametimer
Country[] countryArray = new Country[72?] // CountryArray may switch to a Vector
countryArray[0] = new Country("name"); // Run Through all countries

countryArray[0].addNeighbor(countryName); // Run through every country again and add its neighbors, in Countryclass add to neighborArray and increment array number by 1;
countryArray[0].addNeighbor(countryName); // etc, do all Countries like this, BORING



Standard buildup options(create map and such), game timer, turn timer, year , season, local chat, buttons(options etc)
Place player/Ai capitals(player owns country?country has player?or Both)
Countries -> set player influence
Set Locals -> gold, armies, advantages, farms, production
If fog of war -> Show only visible countries else show all

-----------------------------------------------------------

if host end turns -> loop through Ai -> Ai orders -> if aiDone &&AND&& playersDone->turn changing proces|| OR || if turn timer ends -> Do Ai loop again ->Turn changing proces
if player select country(Which is not in fog of war) AND owns it -> showAllInfo , include productionOptions else showPartlyInfo
if player drags country1 to country2 &&AND&& player owns country1 &&AND&& country2 == country1Neighbor &&AND&& soldierAmount !=NOT IS!= 0 &!=And not is &!= Turn changing Proces &&AND&& moveAmount <LESS< than 5 -> Display moving/War optionScreen -> Cancel(do nothing) or Accept(moveAmount +=1, add moveOrder to MovingOrderArray)

-----------------------------------------------------------

/*

We need to get whats inside the head of a great ConuerorGame gamer or gamers into Artifical Intelligence. Why do you make the choises or moves that you do, can we make the ai think steps ahead?
What needs to be taken into consideration is the skill level of the ai such as easy/medium/hard/equalyToMaster :P, also if the Ai if Passive/Aggressive/Random/ComnenusStyle(without the cheating part)
The ai could also be made stronger by giving them for example: more starting resources, stronger soldiers?,cheaper soldiers?increased productivity?Which will be options for the host to decide

*/


Ai Orders -> Do Ai stuff -> end turn -> sendData -> Back to Ai Loop /////////// Ai will be created by Acro



-----------------------------------------------------------
/*
This part should be cleaned up, will be fixed in real coding(This is mostly Pseudo-coding)
*/


Production Options -> this(Country).getProducedboolean == false -> showChange, show this(Country).getProduction, if Player.getGold >=more then or equals >= this(Country).getProduction.Costs-minus-this(Country).getCurrentProduced && this(Country).getMaxAllowedBuyingUnits >=more then or equals >= this(Country).getBoughtUnits -> showBuyButton , if this(Country).getProducedboolean == true -> showUndoButton
if changeButton ==equals== clicked > this(Country).getProduction.moveNextinList > goto Production options again
if buyButton ==equals== clicked -> Player.setGold -= (this(Country),getProductionCosts-this(Country).getCurrentProduced) ->getTempCurrentProduced.setGetCurrentProduced,getCurrentProduced set to 0, changeButton.setInvisible, if this(Country.getProduction == unitType) &&AND&& this(Country).getBoughtunits <Less< this(COuntry).getMaxAllowedBuyingUnits &&AND&& player.getGold >= more then or equals >= this(Country).getProductionCosts -> set this(Country).producedboolean = true ELSE buyButton.setInvisible
if undoButton ==equals== clicked -> Player.setGold += (this(Country.getProductionCosts-this(Country).getTempCurrentProduced) ->setProductionAmount -= 1,if this(Country).getProductionAmount !=NOT IS != 0 THEN player.setGold = getProductionAmount*Times*this(Country).getProductionCosts , setCurrentProduced = getTempCurrentProduced, setProductionboolean = false -> Goto Production options again
if clearOrdersButton ==equals== clicked -> player.setOrderArray = null, player.setMoveAmount = 0 // if clear orders clean this players OrderArray and set moveAmount back to 0

-----------------------------------------------------------

Options: ReplyQuote
Re: A new project
Posted by: Paars ()
Date: September 08, 2010 05:21AM

I now work from monday till friday from 8 am to 6 pm, + 45 minut travel time. And 2 weekends a month I work saturdays from 6 am to 3 pm and sundays 12 pm to 6 pm, so I have less time to work on this project. But I´m still Working on it regularely but it will take longer.

Be expecting an update within the next few days.

Paars.

Options: ReplyQuote
Re: A new project
Posted by: Paars ()
Date: September 13, 2010 10:22PM

As expted I haven´t had a lot of time for coding, but I´m going to post the classes I´ve been working on here anyway to show at least some progress. ;) And yes the few classes I coded are far from done. The code for a lobby System I made somewhere in the past just need to get it from my other pc.

-----------------------------------------------------------------
MainGame Class(Yes I used a lot from my faircongame program saved me hella lot of typing)

-----------------------------------------------------------------
import javax.swing.*;

/**
* Created by IntelliJ IDEA.
* User: Paars
* Date: 7-sep-2010
* Time: 10:23:23
* To change this template use File | Settings | File Templates.
*/
public class MainGame extends JFrame
{

JFrame jFrame = new JFrame();

public MainGame(boolean setup, Player[] playerArray)
{
buildNeighbors();
if(setup) // If the game has to be created still
{
for(int i=0;i < allCountriesArray.length;i++)
{
allCountriesArray.buildLocals(); // setup local countries
}

for(int i=0;i < playerArray.length;i++)
{
playerArray.getCapitalCountry().buildCapital();
}
}
jFrame.setBounds(0,0,1000,1000);
jFrame.setVisible(true);
jFrame.setLayout(null);
jFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}

// Creating all the Countries, naming them
private Country
Morocco=new Country("Morocco");Country Tangiers=new Country("Tangiers");Country Algiers=new Country("Algiers");Country Tunis=new Country("Tunis");Country Tripoli=new Country("Tripoli");Country Cyrenaica=new Country("Cyrenaica");Country Egypt=new Country("Egypt");Country Palestine=new Country("Palestine");Country Syria=new Country("Syria");Country Cyprus=new Country("Cyprus");
Country Natolia=new Country("Natolia");Country Nicaea=new Country("Nicaea");Country Crete=new Country("Crete");Country Greece=new Country("Greece");Country Macedonia=new Country("Macedonia");Country Byzantium=new Country("Byzantium");Country Bulgaria=new Country("Bulgaria");Country Moldavia=new Country("Moldavia");Country Crimea=new Country("Crimea");Country Ukraine=new Country("Ukraine");
Country Muscovy=new Country("Muscovy");Country Finland=new Country("Finland");Country Sweden=new Country("Sweden");Country Norway=new Country("Norway");Country Scotland=new Country("Scotland");Country Ulster=new Country("Ulster");Country Eire=new Country("Eire");Country Wales=new Country("Wales");Country Northumberland=new Country("Northumberland");Country England=new Country("England");
Country Brittany=new Country("Brittany");Country Gascony=new Country("Gascony");Country Castile=new Country("Castile");Country Leon=new Country("Leon");Country Portugal=new Country("Portugal");Country Aragon=new Country("Aragon");Country Aquataine=new Country("Aquataine");Country Iledefrance=new Country("Iledefrance");Country Normandy=new Country("Normandy");
Country Flanders=new Country("Flanders");Country Holland=new Country("Holland");Country Luxembourg=new Country("Luxembourg");Country Burgundy=new Country("Burgundy");Country Provence=new Country("Provence");Country Corsica=new Country("Corsica");Country Sardinia=new Country("Sardinia");Country Sicilia=new Country("Sicilia");Country Napoli=new Country("Napoli");
Country Roma=new Country("Roma");Country Genoa=new Country("Genoa");Country Helvetica=new Country("Helvetica");Country Rhineland=new Country("Rhineland");Country Saxony=new Country("Saxony");Country Hannover=new Country("Hannover");Country Denmark=new Country("Denmark");Country Brandenburg=new Country("Brandenburg");Country Bohemia=new Country("Bohemia");
Country Austria=new Country("Austria");Country Venetia=new Country("Venetia");Country Dalmatia=new Country("Dalmatia");Country Hungary=new Country("Hungary");Country Poland=new Country("Poland");Country Transylvania=new Country("Transylvania");Country Serbia=new Country("Serbia");Country Wallachia=new Country("Wallachia");Country Prussia=new Country("Prussia");
Country Podolia=new Country("Podolia");Country Lithuania=new Country("Lithuania");Country Livonia=new Country("Livonia");Country Grenada=new Country("Grenada");

// Adding all the countries in an array, easier to loop through.
Country allCountriesArray[] =
{
Morocco,Tangiers,Algiers,Tunis,Tripoli,Cyrenaica,Egypt,Palestine,Syria,
Cyprus,Natolia,Nicaea,Crete,Greece,Macedonia,Byzantium,Bulgaria,Moldavia,Crimea,Ukraine,Muscovy,Finland,
Sweden,Norway,Scotland,Ulster,Eire,Wales,Northumberland,England,Brittany,Gascony,Castile,
Leon,Portugal,Aragon,Aquataine,Iledefrance,Normandy,Flanders,Holland,Luxembourg,Burgundy,
Provence,Corsica,Sardinia,Sicilia,Napoli,Roma,Genoa,Rhineland,Helvetica,Saxony,Hannover,Denmark,Brandenburg,
Bohemia,Austria,Venetia,Dalmatia,Hungary,Poland,Transylvania,Serbia,Wallachia,Prussia,Podolia,Lithuania,Livonia,
Grenada
};

// Adding all the neighbors to all Countries
public void buildNeighbors()
{
Morocco.addNeighbors(new Country[]{Tangiers});
Tangiers.addNeighbors(new Country[]{Morocco, Grenada, Algiers});
Algiers.addNeighbors(new Country[]{Tangiers, Tunis});
Tunis.addNeighbors(new Country[]{Algiers, Tripoli, Sicilia, Sardinia});
Tripoli.addNeighbors(new Country[]{Tunis, Cyrenaica});
Cyrenaica.addNeighbors(new Country[]{Tunis, Egypt});
Egypt.addNeighbors(new Country[]{Cyrenaica, Palestine});
Palestine.addNeighbors(new Country[]{Egypt, Syria, Cyprus});
Syria.addNeighbors(new Country[]{Palestine, Cyprus, Natolia});
Cyprus.addNeighbors(new Country[]{Palestine, Syria, Natolia});
Natolia.addNeighbors(new Country[]{Cyprus, Syria, Nicaea});
Nicaea.addNeighbors(new Country[]{Natolia, Crete, Greece, Byzantium});
Crete.addNeighbors(new Country[]{Greece, Nicaea});
Greece.addNeighbors(new Country[]{Crete, Nicaea, Macedonia});
Macedonia.addNeighbors(new Country[]{Crete, Nicaea, Byzantium, Bulgaria, Napoli, Dalmatia, Serbia});
Byzantium.addNeighbors(new Country[]{Macedonia, Nicaea, Bulgaria,});
Bulgaria.addNeighbors(new Country[]{Byzantium, Macedonia, Serbia, Wallachia, Moldavia});
Moldavia.addNeighbors(new Country[]{Byzantium, Wallachia, Transylvania, Poland, Podolia, Ukraine, Crimea});
Crimea.addNeighbors(new Country[]{Moldavia, Ukraine});
Ukraine.addNeighbors(new Country[]{Crimea, Moldavia, Lithuania, Muscovy, Podolia});
Muscovy.addNeighbors(new Country[]{Ukraine, Lithuania, Livonia, Finland});
Finland.addNeighbors(new Country[]{Muscovy, Sweden});
Sweden.addNeighbors(new Country[]{Finland, Denmark, Norway});
Norway.addNeighbors(new Country[]{Sweden, Denmark, Scotland});
Scotland.addNeighbors(new Country[]{Norway, Ulster, Northumberland});
Ulster.addNeighbors(new Country[]{Scotland, Eire, Wales, Northumberland});
Eire.addNeighbors(new Country[]{Ulster, Wales});
Wales.addNeighbors(new Country[]{Eire, Ulster, Northumberland, England});
Northumberland.addNeighbors(new Country[]{Wales, Scotland, Ulster, England});
England.addNeighbors(new Country[]{Northumberland, Wales, Brittany, Normandy, Flanders, Holland});
Brittany.addNeighbors(new Country[]{England, Gascony, Iledefrance, Normandy});
Gascony.addNeighbors(new Country[]{Brittany, Aquataine, Iledefrance, Aragon, Castile});
Castile.addNeighbors(new Country[]{Gascony, Leon, Aragon, Grenada});
Leon.addNeighbors(new Country[]{Castile, Grenada, Portugal});
Portugal.addNeighbors(new Country[]{Leon, Grenada});
Aragon.addNeighbors(new Country[]{Grenada, Castile, Gascony, Aquataine});
Aquataine.addNeighbors(new Country[]{Aragon, Gascony, Iledefrance, Provence});
Iledefrance.addNeighbors(new Country[]{Aquataine, Brittany, Normandy, Burgundy, Provence, Gascony});
Normandy.addNeighbors(new Country[]{Iledefrance, England, Brittany, Flanders, Burgundy, Luxembourg});
Flanders.addNeighbors(new Country[]{Normandy, England, Holland, Luxembourg});
Holland.addNeighbors(new Country[]{Flanders, England, Hannover, Saxony});
Luxembourg.addNeighbors(new Country[]{Holland, Normandy, Flanders, Saxony, Burgundy, Rhineland, Helvetica});
Burgundy.addNeighbors(new Country[]{Luxembourg, Iledefrance, Provence, Helvetica, Genoa, Normandy});
Provence.addNeighbors(new Country[]{Burgundy, Aquataine, Iledefrance, Genoa, Corsica});
Corsica.addNeighbors(new Country[]{Provence, Genoa, Roma, Sardinia});
Sardinia.addNeighbors(new Country[]{Corsica, Tunis});
Sicilia.addNeighbors(new Country[]{Tunis, Napoli});
Napoli.addNeighbors(new Country[]{Sicilia, Roma, Macedonia});
Roma.addNeighbors(new Country[]{Napoli, Corsica, Genoa, Venetia});
Genoa.addNeighbors(new Country[]{Roma, Corsica, Provence, Burgundy, Helvetica, Venetia});
Helvetica.addNeighbors(new Country[]{Genoa, Burgundy, Luxembourg, Rhineland, Austria, Venetia});
Rhineland.addNeighbors(new Country[]{Helvetica, Luxembourg, Saxony, Bohemia, Austria});
Saxony.addNeighbors(new Country[]{Rhineland, Luxembourg, Holland, Hannover, Brandenburg, Bohemia});
Hannover.addNeighbors(new Country[]{Saxony, Holland, Denmark, Brandenburg});
Denmark.addNeighbors(new Country[]{Hannover, Norway, Sweden});
Brandenburg.addNeighbors(new Country[]{Hannover, Saxony, Bohemia, Poland});
Bohemia.addNeighbors(new Country[]{Brandenburg, Saxony, Rhineland, Austria, Poland, Hungary});
Austria.addNeighbors(new Country[]{Bohemia, Rhineland, Helvetica, Venetia, Hungary, Dalmatia});
Venetia.addNeighbors(new Country[]{Austria, Genoa, Roma, Dalmatia, Helvetica});
Dalmatia.addNeighbors(new Country[]{Venetia, Austria, Hungary, Serbia, Macedonia});
Hungary.addNeighbors(new Country[]{Dalmatia, Austria, Poland, Transylvania, Serbia, Bohemia});
Poland.addNeighbors(new Country[]{Hungary, Brandenburg, Moldavia, Podolia, Prussia, Transylvania, Bohemia});
Transylvania.addNeighbors(new Country[]{Poland, Hungary, Serbia, Wallachia, Moldavia});
Serbia.addNeighbors(new Country[]{Transylvania, Wallachia, Bulgaria, Macedonia, Dalmatia, Hungary});
Wallachia.addNeighbors(new Country[]{Serbia, Transylvania, Moldavia, Bulgaria});
Prussia.addNeighbors(new Country[]{Poland, Podolia, Lithuania});
Podolia.addNeighbors(new Country[]{Prussia, Poland, Moldavia, Lithuania, Ukraine});
Lithuania.addNeighbors(new Country[]{Podolia, Livonia, Muscovy, Lithuania, Prussia});
Livonia.addNeighbors(new Country[]{Lithuania, Muscovy});
Grenada.addNeighbors(new Country[]{Tangiers, Portugal, Leon, Castile, Aragon});
}

}

-------------------------------------------------------------------------------
Country Class

-------------------------------------------------------------------------------

import java.util.Random;

/* Country Class, will obviously be put in a seperate class/file */
class Country
{
Player player;
String capital;
String name;
Country[] neighborArray;
int population; // will be number *times* 10000
int culture; // 1,2,3 == primitive, developped, advanced respectively
int neighborCount; // starts at 0 just works as pointer for the neighborArray
int soldiers;

public Country(String name, boolean setup) //When Creating a new country a name has to be given, also the amount of neighbors, constructor creates local country values as well
{
this.name = name;
}
public Country(String name)
{
this.name=name;
}
public Country(String name, String capital)
{
this.name=name;
this.capital = capital;
}
public void buildLocals()
{
Random r = new Random();
soldiers =(r.nextInt(4)+1);
population = (r.nextInt(4)+1);
culture = (r.nextInt(10)+1);
if(culture < 8)
culture = 1;
else
culture = 2;
}
public void buildCapital()
{
population = 3;
Random r = new Random();
soldiers = r.nextInt(3)+1;
}
public void addPlayer(Player player)
{
this.player = player;
}
public Player getPlayer()
{
return player;
}
public void setCapital(String playerName)
{
capital = playerName;
}
public String getCapital()
{
return capital;
}
public void addNeighbors(Country[] neighbors)
{
neighborArray = neighbors; // at this place in the array at a neighbor
}
public Country[] getNeighborArray()
{
return neighborArray;
}
public Country getCountry()
{
return this;
}
public void buildPopulation() // increase population
{
population++;
}
public int getPopulation()
{
return population;
}
public void buildCulture()
{
culture++;
}
public int getCulture()
{
return culture;
}
public void setSoldiers(int soldiers)
{
this.soldiers = soldiers;
}
public int getSoldiers()
{
return soldiers;
}
}


--------------------------------------------------------------------------------
Player Class(Multiple constructors easier for joining into the game

--------------------------------------------------------------------------------

import java.util.Vector;
import java.util.Random;

/**
* Created by IntelliJ IDEA.
* User: Paars
* Date: 7-sep-2010
* Time: 9:51:31
* To change this template use File | Settings | File Templates.
*/
public class Player
{

// login - retrieve database player information
Player player;
String playerName;
Country capitalCountry;
Vector countryVector;
int gold;

public Player(String playerName)
{
this.playerName = playerName;
}
public Player(String playerName, Country capitalCountry)
{
this.playerName = playerName;
this.capitalCountry = capitalCountry;
this.countryVector.add(capitalCountry);
Random r = new Random();
gold = r.nextInt(6) + 8;
}

public void addCountry(Country country)
{
countryVector.add(country);
}
public void removeCountry(Country country)
{
countryVector.remove(country);
}

public void setGold(int gold)
{
this.gold += gold;
}

public String getPlayerName()
{
return playerName;
}
public Country getCapitalCountry()
{
return capitalCountry;
}
public Vector getCapitalVector()
{
return countryVector;
}


}

--------------------------------------------------------------------------------
Battle Class so far, really not near done.

--------------------------------------------------------------------------------

import javax.swing.*;
import java.awt.event.KeyListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
import java.awt.*;

/**
* Created by IntelliJ IDEA.
* User: Paars
* Date: 7-sep-2010
* Time: 9:31:38
* To change this template use File | Settings | File Templates.
*/
public class Battle extends JFrame implements KeyListener, MouseListener
{
JFrame moveScreen = new JFrame();
JTextField jtfArmyNumber = new JTextField();
JLabel jlMaxArmyNumber = new JLabel();
JButton jbAccept = new JButton("Accept"), jbCancel = new JButton("Cancel");

public Battle(Country c1, Country c2 )
{
moveScreen.setBounds(400,400,300,300);
moveScreen.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
moveScreen.setVisible(true);
moveScreen.setLayout(new FlowLayout()); // Temporarely, will later be positioned absolute

moveScreen.add(jtfArmyNumber);
moveScreen.add(jlMaxArmyNumber);
jlMaxArmyNumber.setText("Max Armies \n"+ c1.getSoldiers() );
moveScreen.add(jbAccept);
moveScreen.add(jbCancel);


}

public void keyTyped(KeyEvent e)
{
//To change body of implemented methods use File | Settings | File Templates.
}

public void keyPressed(KeyEvent e)
{
//To change body of implemented methods use File | Settings | File Templates.
}

public void keyReleased(KeyEvent e)
{
if(e.getKeyCode() == KeyEvent.VK_ENTER)
{
// if possible, accept, add moveOrder to MoveOrderList
}
}

public void mouseClicked(MouseEvent e) {
//To change body of implemented methods use File | Settings | File Templates.
}

public void mousePressed(MouseEvent e) {
//To change body of implemented methods use File | Settings | File Templates.
}

public void mouseReleased(MouseEvent e) {
//To change body of implemented methods use File | Settings | File Templates.
}

public void mouseEntered(MouseEvent e) {
//To change body of implemented methods use File | Settings | File Templates.
}

public void mouseExited(MouseEvent e) {
//To change body of implemented methods use File | Settings | File Templates.
}
}

--------------------------------------------------------------------------------
MoveOrder class at least its a start

--------------------------------------------------------------------------------
/**
* Created by IntelliJ IDEA.
* User: Paars
* Date: 7-sep-2010
* Time: 9:39:38
* To change this template use File | Settings | File Templates.
*/
public class MoveOrder
{
int sendSoldiers;
Country c1, c2;

public MoveOrder(Country c1, Country c2, int sendSoldiers)
{
this.sendSoldiers = sendSoldiers;
this.c1 = c1;
this.c2 = c2;
}

public int getSendSoldiers()
{
return sendSoldiers;
}

public Country getAttackingCountry()
{
return c1;
}

public Country getDefendingCountry()
{
return c2;
}
}



----------------------------------------------------------------------------------
Also created a turnOrder class but really not worth posting it yet.

Paars

Options: ReplyQuote
Re: A new project
Posted by: Xi ()
Date: September 15, 2010 12:45PM

I will give $1 to anyone who recites the last post out loud.

Options: ReplyQuote
Re: A new project
Posted by: acro ()
Date: September 16, 2010 04:05AM

Xi Wrote:
-------------------------------------------------------
> I will give $1 to anyone who recites the last post
> out loud.


I just did. Please let me know your preferred payment method.

Options: ReplyQuote
Re: A new project
Posted by: sixamplayer ()
Date: September 16, 2010 11:53AM

post it on youtube acro so we can watch

Options: ReplyQuote
Re: A new project
Posted by: -RIPPE- ()
Date: September 16, 2010 01:37PM

ok i have no idea what paars is doin there but it looks kinda good... so i made a rough setting to place a new game at.

Attachments: conq2085.jpg (295.6 KB)  
Options: ReplyQuote
Re: A new project
Posted by: Paars ()
Date: September 23, 2010 12:45PM

Ok, I finally arranged to get my old pc here.
I set it up but it gave me some problems so after a lot of cursing, bitching deathwishes etc. I managed to get it working.
I got some very important old java coding, which I used to build a main lobby system + chat system. Also the basic coding to add images and such.

Options: ReplyQuote
Re: A new project
Posted by: LikeNoOthers ()
Date: September 23, 2010 05:02PM

The one i were testing with you?

Options: ReplyQuote
Re: A new project
Posted by: Paars ()
Date: September 23, 2010 06:08PM

yeah, but with slight updates. I do need to rewrite all of it, but its still very usefull.

Options: ReplyQuote
Pages: 123Next
Current Page: 1 of 3


Sorry, only registered users may post in this forum.