Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Questions About Empire Server Logic

 
   Games (Home) -> Hints about Empire RSS
Next:  HP Empireclassic Now Hearing Prayers  
Author Message
ross613

External


Since: Nov 03, 2008
Posts: 4



(Msg. 1) Posted: Mon Nov 03, 2008 4:05 pm
Post subject: Questions About Empire Server Logic
Archived from groups: rec>games>empire (more info?)

Back in the mid-to-late 1990s, I was an Empire player (played a
country called Laurasia) and have become interested in the game
again....but as a programmer instead of as a player. Consequently, I
am in the process of putting together a new implementation of the
Empire Server - not that I'm announcing any kind new release, since
this could be a project that never sees the light of day so to speak.
I'm undertaking this challenge purely for the "fun" of trying to put
something of this sort together, although if it gets far enough along
I'll definitely post it as an open source endeavour.

Why do this at all? Well apart from my own curiosity about what the
challenges involve might be, there are a number of reasons that come
to mind, but I'm not going to go into them because they're either self-
evident or irrelevant since there's nothing to talk about in a
practical sense yet. The code is less than 1000 lines at the moment
and grows very slowly - my time is very short for creating hobby code
these days.

But while I am doing this, it would help to have answers to a few
questions those who've contributed to existing server logic might be
able to answer:

Land Units vs. Ships

Why do land units get names and ships don't? There seems to be a
capacity for land units to be assigned names:

lcm hcm mil guns shells avail tech $
War band 5 0 100 0 0 1 0 $500
Supply Wagon 5 5 50 0 0 2 0 $500
GPG Commandos 15 15 25 1 2 5 150 $800
artillery 1 40 60 70 20 40 17 100 $1000
Jump infantry 35 25 100 5 10 9 400 $3000
marines 1 20 10 100 2 4 5 200 $2000

Now let's contrast a similar list of ships:

lcm hcm avail tech $
fishing boat 1 25 15 12 0 $300
cargo ship 1 60 40 29 0 $500
ore ship 1 60 40 29 0 $500
slave ship 1 60 40 29 0 $500
passenger ship 1 60 40 29 0 $500
trade ship 1 200 100 81 0 $2500
frigate 30 30 19 0 $600
battleship 1 50 50 31 0 $800

The first listing has a "War Band", "Supply Wagon" and "GPG Commandos"
which don't seem to be in nay list available to the deity in the
latest Wolfpack install which means these units were retired or they
got titled differently somehow, but no such example suggested a
similar function for ships. Did I get that right? If not - please
correct me. And if so, my question remains: was there a rationale for
implementing names for land units and not for ships?

I'm likely to have a few more questions as time goes on, but won't
post 'em all at once here. Although I've looked through the existing
Wolfpack code and I have many questions, I'm inclined to read and
research ahead of asking questions that might otherwise prove obvious
by reading literature. Incidentally, if someone has an up-to-date
link for Chad Zabel's Deity's Handbook, it would be appreciated - the
links on the Wolfpack site all seem to be broken.

Thanks!
RH
Back to top
Login to vote
rkoenderink

External


Since: Jul 21, 2005
Posts: 114



(Msg. 2) Posted: Tue Nov 04, 2008 5:59 am
Post subject: Re: Questions About Empire Server Logic [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The ships have ship names not land units.

All units have the following information.
Unit Number
Unit Type
Abbreviated Unit Type

Land unit example

3 - Unit Number
Artillery - Unit Type
art - Abbreviated Unit Type

Ship example

3 - Unit Number
Fishing Boat - Unit Type
fb - Abbreviated Unit Type

Ship have additional ability to include a ship name using the name
command.
For example HMS-Wolfpack could be a ship name.

I am not sure why only ships have names as it is common place to name
planes as well.
In reality, the game is slow enough in the beginning to name ships at
the start of the game.
By the time you have land units and planes, you have too many units to
bother with naming them.
People tend to use fleet/wing/army to manage groups of uints once they
have lots of units.

The units are very customizable via the config files in the builtin
directory so you can create
you own unit types. Most deities do adjust the units when they host a
game.

There is some more information in the doc directory of the source code
about the game itself.

I also find the help file from WinACE to be very useful for searching
for commands and topics.

There are VS 2005 project files included in Empire Contribs v4.3.11
downloads on sourceforge
project empserver. You will need to match the changes in the files
for the source. If you need
an updated version of the project files you can email me at
rkoenderink @ yahoo.ca.

Ron K.
Back to top
Login to vote
ross613

External


Since: Nov 03, 2008
Posts: 4



(Msg. 3) Posted: Wed Nov 05, 2008 11:39 pm
Post subject: Re: Questions About Empire Server Logic [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 4, 8:59 am, "rkoender...@yahoo.ca" <rkoender....RemoveThis@yahoo.ca>
wrote:
> The ships have ship names not land units.
>
> All units have the following information.
> Unit Number
> Unit Type
> Abbreviated Unit Type
>
> Land unit example
>
> 3 - Unit Number
> Artillery - Unit Type
> art - Abbreviated Unit Type
>
> Ship example
>
> 3 - Unit Number
> Fishing Boat - Unit Type
> fb - Abbreviated Unit Type
>
> Ship have additional ability to include a ship name using the name
> command.
> For example HMS-Wolfpack could be a ship name.

Now that you mention it, I recall being able to give ships names and
wondered what had happened. My Windows server has a test
configuration with only a deity country so far, so hadn't gotten that
far yet.

> I am not sure why only ships have names as it is common place to name
> planes as well.
> In reality, the game is slow enough in the beginning to name ships at
> the start of the game.
> By the time you have land units and planes, you have too many units to
> bother with naming them.
> People tend to use fleet/wing/army to manage groups of uints once they
> have lots of units.

Has anyone ever considered creating a small database (or perhaps
large) of suggested names?

> The units are very customizable via the config files in the builtin
> directory so you can create
> you own unit types.  Most deities do adjust the units when they host a
> game.

Interesting - a feature that didn't exist when I last played, and one
to be preserved in any new work, certainly.

> There is some more information in the doc directory of the source code
> about the game itself.

I did find info files. As I said before, no Deity's Handbook - I'll
take another look for more information. I can be incredibly
unobservant sometimes. Wink

> I also find the help file from WinACE to be very useful for searching
> for commands and topics.

Again, a feature to be preserved - perhaps something I can steal from
WinACE source directly? (Haven't looked to be sure yet....)

> There are VS 2005 project files included in Empire Contribs v4.3.11
> downloads on sourceforge
> project empserver.  You will need to match the changes in the files
> for the source.  If you need
> an updated version of the project files you can email me at
> rkoenderink @ yahoo.ca.

Will do. Thanks for your offer of further assistance. I'm sure
you'll hear from me in the weeks ahead. I've got a large amount of
holiday time coming forward which I need to take soon and will spend
of it on this project of mine.

Gratefully,
RH
Back to top
Login to vote
Markus Armbruster

External


Since: Jul 20, 2005
Posts: 258



(Msg. 4) Posted: Sat Nov 08, 2008 1:55 pm
Post subject: Re: Questions About Empire Server Logic [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
Back to top
Login to vote
Markus Armbruster

External


Since: Jul 20, 2005
Posts: 258



(Msg. 5) Posted: Sat Nov 08, 2008 2:36 pm
Post subject: Re: Questions About Empire Server Logic [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I've heard of an effort or two to rewrite Empire from scratch, but no
one has succeeded so far. Good luck.

Last time I remember we talked about it is archived here:
http://groups.google.de/group/rec.games.empire/browse_thread/thread/72...af961ff

Unfortunately, I forgot to remove my x-no-archive in the little
treatise on our current code's structural problems I posted then. So
I just copy it here. Enjoy! And excuse the stupid typos.

Markus


This is not an exhaustive treatise, just a few selected points.
Moreover, it's about the server, not about the game's design, which is
an entirely different can of worms. And the final caveat: it is
purely hypothetical. I feel not the slightest urge to rewrite the
server. It's too big a mouthful for me to chew in my spare time.

Before anybody gets funny ideas on what I think about the hackers who
created the server as we know it: I consider it a pretty good design
for its time (especially after Dave Pare got concurrency right in
Empire 2). It aged gracefully enough to be still in use after more
than twenty years. Quite an achievement.

Naturally, the code has its share of structural problems due to its
age. Design tradeoffs that made plenty of sense then can make less
sense now.

I don't know what kind of machine the ancients used to create the
server, but I wouldn't be surprised if they had something like a
top-of-the line VAX, 32 Meg of main memory, crunching about 6 MIPS.
Wheee! I also wouldn't be surprised if some of you now own cell
phones more powerful than that.

Now, most of the time I hear someone claim that machines got so much
faster that we can do things differently, it's just a specious excuse
for going through half a dozen levels of frameworks, class libraries,
generators and whatnot to achieve the simplest things. Maybe there
are hard problems where you need all that[*], but Empire ain't.
Empire's a *simple* problem. It must be so, or else folks couldn't
have cracked it twenty years ago on something less powerful than your
cell phone.

With that out of the way, let me present two design issues where all
that extra power we have today would lead me to different tradeoffs:
storage, and separation of domain logic and presentation.


Application are commonly split into three layers: presentation (user
interface), domain logic, and storage.

The server does a reasonable job of encapsulating storage. But
presentation and domain logic are hopelessly entangled.

That's bad because it effectively limits us to the one presentation
built into the server: a text command line UI. We can't easily move
presentation into a smart client. Instead, our smart clients kind of
undo the server's presentation: they laboriously decipher the text
output, update their own model, and then provide their own
presentation on top of that.

How come the server was written that way? Were the server coders
dumb? Not at all. When you write a program at the very limit of what
you can code and your machine can run, you keep it as simple as you
possibly can. Entangling presentation with the domain logic is as
simple as printing what happens when it happens, in plain English.
You can hardly make it simpler than that.

Putting the presentation in the server that way also allows for a
really simple client. When your players log into your beefy VAX to
run clients, and said VAX already groans under the load of the server,
a really simple client is a big, big plus. Same if you get to port it
to yet another semi-compatible variant of Unix.

I don't know whether anybody back then even thought about it. I doubt
it. You don't solve problems by thinking about issues your kids might
have with your solution twenty years down the road. You go for the
simplest solution that could possibly work.


Now let's take a closer look at storage. Empire game state is simple
enough: a bunch of records describing game objects. State change is
less simple: it generally involves updating several game objects and
sending messages to clients. Say your fortress fires at a hostile
ship. The fortress gets charged a shell (update fortress object), the
ship gets damaged (update ship object), you get a satisfying message,
and your enemy gets a less satisfying one. All of this should happen
or none of it.

This cries for transactions. Which have nothing like that. We store
everything in flat files. To stave off chaos, we group related
updates and messages together and limit concurrency so that each group
always runs alone, not in parallel to any other group. Should we
crash halfway through a group, we likely leave corrupt game state
behind.

How come the server was written that way? Were the server coders
dumb? Not at all. This is again the simplest solution that could
possibly work. Mind, if you wanted a database back then, you got to
write it yourself.

To avoid misunderstandings: the last thing Empire needs is being tied
to some bloated database software that takes an army of consultants to
set up, and then some to keep it from self-destructing. That's for
enterprises. Use something lightweight.


Such big structural problems can be intimidating. Don't let them!
They may be big, but they're not the only ones worth attacking. There
are plenty of quite tractable problems around. Inquire within Smile


[*] I don't know. For some reason, my problems always become too
simple for all that once I invest a bit of energy to think about them.
Maybe that stuff's just needed to keep the architecture astronauts
aloft.
Back to top
Login to vote
rkoenderink

External


Since: Jul 21, 2005
Posts: 114



(Msg. 6) Posted: Sun Nov 09, 2008 6:08 am
Post subject: Re: Questions About Empire Server Logic [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> I don't know what kind of machine the ancients used to create the
> server, but I wouldn't be surprised if they had something like a
> top-of-the line VAX, 32 Meg of main memory, crunching about 6 MIPS.
> Wheee!  I also wouldn't be surprised if some of you now own cell
> phones more powerful than that.
>
When I first played it was on PDP-11 (1981). I used to connect with
my
home build 1200 baud acoustically coupled modem (4yr EE project).
It was bonus when we moved up to a VAX as few years later.

Ron K.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Installing Empire 4.3.9 Server [0/1] "empire-4.3.9.sfv" yE.. - Hello all just wondering if I can get some help installing a empire server. I get an error when issue the make comand see below: [empire@ip-208-109-206-106 empire-4.3.9]$ make cd . && autoconf /bin/sh: autoconf: command not found make: *** [con...

Interix version of the Empire Server - Is anybody using the Interix version of the Empire server? I would like to drop support for Interix version as there is a known bug in the error return codes from socket code. It is possible to fix but quite messy. Since the makefiles are being..

Compiling Empire Server in Windows - As people ask on occasion how to compile the empire server on Windows. Here are my notes. There are two options to compile. 1) MinGW/MSYS MinGW/MSYS is free compiler and linux/GNU environment. This package produces a Windows executable and can be..

Since we are NOT playing Empire, what ARE we playing? (non.. - OK Guys and Gals, You can't fool me. I know you are playing something!!! We all do. We play games because they are fun for us. ut not eveyone plays teh same types of games. Whether is board games (chess, risk, chutes and ladders), console games..

Getting back into Empire - Hi, I've recently become interested in getting back into Empire. To be more accurate, I should say getting into it to begin with, as I never fully grasped it last time and had some serious trouble which ultimately drove me away in frustration. Being..
       Games (Home) -> Hints about Empire All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
  Game Forums
 Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact