Welcome to GameHourz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

bug in move.c?

 
   Game Forums (Home) -> Hints about Empire RSS
Related Topics:
TBC Fast Package(1-70) - Any Class Free 2000G - Wow per level per level. Dear Sir or Madam Hot Sale!For all of our news and are some Special Package! We now provide measured by..

WinACE 2.5.0 - This version has a number of changes to support the xdump command for 4.3.0 version of the server. In addition, this version has some new tools and features and a number of bug fixes. WinACE 2.5.0 is available for download at..

Server 4.3.0, PZ5, Changeling and WinACE - There has been a number of changes to the server for 4.3.0. A few of these changes create problems for previous versions of WinACE. The biggest problem is with research column in show nuke output. So it is recommend that you use WinACE 2.5.0 or newer..

Suggested Linux client? - What linux client would you suggest for a fairly clueless player? The furthest I've ever gotten in empire was a frigate around. I think I might've gotten loaded on it. Do both ptkei and pei work with the new server? Any other..

Petting Zoo Five - Update #10 Report - We are now 10 updates into PZ5. All 9 countries are fully active and all are producing tech, ships, and whatnot. Dust is somewhat more plentiful in this game (in regards to the PZ series of games), and players are making lots of bars, thus they will..
Next:  Hints about Empire: Automate infra build via thr-like concept?  
Author Message
Ken Stevens

External


Since: Oct 16, 2007
Posts: 9



(Msg. 1) Posted: Wed Nov 07, 2007 8:30 pm
Post subject: bug in move.c?
Archived from groups: rec>games>empire (more info?)

I've written a parser for xdump in Java and am starting to write a
civmover tool that uses it. When reading the Empire source code, I
came across the following.

It seems to me that the calculation is taking mob1 - mob0. But mob0
is always higher than mob1. Is this a bug in move.c? Does it in fact
not matter what the eff is of a sector when you move into it?

double sector_mcost(struct sctstr *sp, int mobtype) {
double base, cost;

base = dchr[sp->sct_type].d_mob0;
if (base < 0)
return -1.0;

/* linear function in eff, d_mob0 at 0%, d_mob1 at 100% */
base += (dchr[sp->sct_type].d_mob1 - base) * sp->sct_effic / 100;
if (CANT_HAPPEN(base < 0))
base = 0;

P.S. I'll throw up my xdump parser on sourceforge when it's done

 >> Stay informed about: bug in move.c? 
Back to top
Login to vote
Ken Stevens

External


Since: Oct 16, 2007
Posts: 9



(Msg. 2) Posted: Wed Nov 07, 2007 8:37 pm
Post subject: Re: bug in move.c? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 7, 11:30 pm, Ken Stevens <khstev... RemoveThis @gmail.com> wrote:
> I've written a parser for xdump in Java and am starting to write a
> civmover tool that uses it. When reading the Empire source code, I
> came across the following.
>
> It seems to me that the calculation is taking mob1 - mob0. But mob0
> is always higher than mob1. Is this a bug in move.c? Does it in fact
> not matter what the eff is of a sector when you move into it?
>
> double sector_mcost(struct sctstr *sp, int mobtype) {
> double base, cost;
>
> base = dchr[sp->sct_type].d_mob0;
> base += (dchr[sp->sct_type].d_mob1 - base) * sp->sct_effic / 100;


I think what the author intended to write here is

base += (dchr[sp->sct_type].d_mob1 - base) * (100 - sp->sct_effic) /
100;

right?

Is this a real bug in move.c? I find it hard to believe that sector
efficiency doesn't affect mobcost and no-one has noticed...

 >> Stay informed about: bug in move.c? 
Back to top
Login to vote
Ken Stevens

External


Since: Oct 16, 2007
Posts: 9



(Msg. 3) Posted: Wed Nov 07, 2007 8:43 pm
Post subject: Re: bug in move.c? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Is this a real bug in move.c? I find it hard to believe that sector
> efficiency doesn't affect mobcost and no-one has noticed...

Silly me. I missed the +=. Thought it was an =. The code is fine.
Just ignore me...
 >> Stay informed about: bug in move.c? 
Back to top
Login to vote
Markus Armbruster

External


Since: Nov 18, 2004
Posts: 243



(Msg. 4) Posted: Thu Nov 08, 2007 7:07 am
Post subject: Re: bug in move.c? [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
 >> Stay informed about: bug in move.c? 
Back to top
Login to vote
Markus Armbruster

External


Since: Nov 18, 2004
Posts: 243



(Msg. 5) Posted: Thu Nov 08, 2007 7:07 am
Post subject: Re: bug in move.c? [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
 >> Stay informed about: bug in move.c? 
Back to top
Login to vote
Display posts from previous:   
   Game Forums (Home) -> Hints about Empire All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (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



[ Contact us | Terms of Service/Privacy Policy ]