Hi, please pretend I didn't write that last post. Arno's mention of 65535 instead of 2billion threw me.
I think Max Shariy's post has something going for it. Another alternative is to use arbitrary-precision numbers like Microsoft did when they rewrote the Windows calculator a few years ago, but that's probably quite a bit more work.
To: atlantisdev@yahoogroups.com From: pixelcat@... Date: Thu, 4 Feb 2010 16:00:59 -0600 Subject: RE: [atlantisdev] giving large amounts of men skill bug
Why are you compiling this with a 16-bit compiler?
> To: atlantisdev@yahoogroups.com > From: al-s@... > Date: Sun, 24 Jan 2010 22:52:15 +0100 > Subject: [atlantisdev] giving large amounts of men skill bug > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I found the bug, that's buggin (urgh, horrible pun :D) my players for > some time now. > > While giving large amount of men from one unit to another (same faction) > the receiving unit allways receives only a very small amount of skill > ... I found why. The calculating of the receiving units skill is done > only with normal, sometimes with unsinged integers. Thus the max number > of days is 65535 if the unsinged int is used. This divided by 180 and we > have a max amount of 364 men that can be given without problems. (145 > leaders obviously). And since my players are giving amounts of about 5k > men with comb 3 they are loosing all their skills by doing so ... > > I'll try and find every involved int and replace it with unsinged long > > Thus 9,5 mil leaders with level 5 skills can be given without problems, > that should be ok. 40,992,764,608,200,000 leaders could be handled if we > would use unsinged long long, but I don't know what this would do to our > performance and I think if a faction is in the need to move more than > 9,5 mil leaders with any skill at level five to another unit, it's time > to call him the winner and start the game new :D > > If anybody has had his hands inside the giving men and splitting skills > algorithms and can give me a hand, feel free to contact me, I'm limping > forward by try and error at the moment to find all the places I can, > can't, have to and mustn't change to long at the moment :) > > Greetings > Arno > > > p.s.: maybe we should, especialy for the v5 engine think of changing all > integers involved with amounts of men or skill days to unsigned long... > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iD8DBQFLXMEPalu2gJKSTtwRAsmlAJ9o/Q/9rcPeqkbQXmN7Oj6t4Rer/wCggDBs > quPBne2K6uqb9aCJTmlqHk4= > =WLy+ > -----END PGP SIGNATURE----- > > > ------------------------------------ > > To Post a message, send it to: atlantisdev@eGroups.com > To Unsubscribe, send a blank message to: atlantisdev-unsubscribe@...! Groups Links > > <*> To visit your group on the web, go to: > http://groups.yahoo.com/group/atlantisdev/ > > <*> Your email settings: > Individual Email | Traditional > > <*> To change settings online go to: > http://groups.yahoo.com/group/atlantisdev/join > (Yahoo! ID required) > > <*> To change settings via email: > atlantisdev-digest@yahoogroups.com > atlantisdev-fullfeatured@yahoogroups.com > > <*> To unsubscribe from this group, send an email to: > atlantisdev-unsubscribe@yahoogroups.com > > <*> Your use of Yahoo! Groups is subject to: > http://docs.yahoo.com/info/terms/ >
Why are you compiling this with a 16-bit compiler?
> To: atlantisdev@yahoogroups.com > From: al-s@... > Date: Sun, 24 Jan 2010 22:52:15 +0100 > Subject: [atlantisdev] giving large amounts of men skill bug > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I found the bug, that's buggin (urgh, horrible pun :D) my players for > some time now. > > While giving large amount of men from one unit to another (same faction) > the receiving unit allways receives only a very small amount of skill > ... I found why. The calculating of the receiving units skill is done > only with normal, sometimes with unsinged integers. Thus the max number > of days is 65535 if the unsinged int is used. This divided by 180 and we > have a max amount of 364 men that can be given without problems. (145 > leaders obviously). And since my players are giving amounts of about 5k > men with comb 3 they are loosing all their skills by doing so ... > > I'll try and find every involved int and replace it with unsinged long > > Thus 9,5 mil leaders with level 5 skills can be given without problems, > that should be ok. 40,992,764,608,200,000 leaders could be handled if we > would use unsinged long long, but I don't know what this would do to our > performance and I think if a faction is in the need to move more than > 9,5 mil leaders with any skill at level five to another unit, it's time > to call him the winner and start the game new :D > > If anybody has had his hands inside the giving men and splitting skills > algorithms and can give me a hand, feel free to contact me, I'm limping > forward by try and error at the moment to find all the places I can, > can't, have to and mustn't change to long at the moment :) > > Greetings > Arno > > > p.s.: maybe we should, especialy for the v5 engine think of changing all > integers involved with amounts of men or skill days to unsigned long... > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iD8DBQFLXMEPalu2gJKSTtwRAsmlAJ9o/Q/9rcPeqkbQXmN7Oj6t4Rer/wCggDBs > quPBne2K6uqb9aCJTmlqHk4= > =WLy+ > -----END PGP SIGNATURE----- > > > ------------------------------------ > > To Post a message, send it to: atlantisdev@eGroups.com > To Unsubscribe, send a blank message to: atlantisdev-unsubscribe@...! Groups Links > > <*> To visit your group on the web, go to: > http://groups.yahoo.com/group/atlantisdev/ > > <*> Your email settings: > Individual Email | Traditional > > <*> To change settings online go to: > http://groups.yahoo.com/group/atlantisdev/join > (Yahoo! ID required) > > <*> To change settings via email: > atlantisdev-digest@yahoogroups.com > atlantisdev-fullfeatured@yahoogroups.com > > <*> To unsubscribe from this group, send an email to: > atlantisdev-unsubscribe@yahoogroups.com > > <*> Your use of Yahoo! Groups is subject to: > http://docs.yahoo.com/info/terms/ >
On Monday 25 January 2010 10:16:17 am Zorky wrote:
> 900 leaders teach a unit of 9000 men. One turn later the students have
> only gained 7 days, while 60 days are expected.
>
> The problem is caused by a maxint overflow in the teaching code, due
> to multiplying the size of one unit by the size of another unit, and
> then multiplied by a constant.
Why multiply unit sizes?
n teachers produce N = n*30*10 hours.
m students can take M = m*30 extra hours.
students take lesser of M and N.
with 32 bit integers overflows at around 2*10^9/300 = 0.7*10^7 = 7 million
teachers.
On Monday 25 January 2010 11:14:38 am Arno Saxena wrote:
> too, tho this won't be as easy as the giving...). As Enno has pointed
> out earlier, just moving from int to long isn't the correct way of
> thinking, since it will only postpone the problem...
On 32 bit systems both int and long are the same size, 32 bit, so replacement
will not achieve anything.
On the 64 bit systems, M$ compiler has both int and long at 32 bits, Unix-like
systems usually have 32 bit ints and 64 bit longs, so switching on Linux, for
example, might help.
Switching from shorts to ints might be beneficial, but quick search in the
source (v5) reveals that shorts are not used.
Either way, switching from 32 bit variables to 64 bit variables to solve a
problem which can easily be solved by applying correct algorithms is not the
right approach, I totally agree with Enno :)
Cheers,
Max
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Enno Rehling wrote:
>> p.s.: maybe we should, especialy for the v5 engine think of changing all
>> integers involved with amounts of men or skill days to unsigned long...
>
> Instead of wasting all that memory, you may want to read
> http://www.fefe.de/intof.html
>
> Enno.
>
Hi Enno,
I had a look into the assay you've recommended. Especialy of course the
"multiplication can overflow too" part. The ideas behind are good, and
of course this should be included everytime integers are multiplied and
undefined outcomes have to be excluded for security reasons. But the
routines described will only catch the overflows and do not solve them.
With this included to our code, we could only generate propper error
messages or split up the giving command internaly. With the first we
still would not be able to give large amounts of men, with the second
the code would become very arkward (ok, some would say even more arkward
:D). I don't think we can avoid changing the involved integers to
unsinged long....
while writing this, the idea of chopping the giving of large numbers of
men does sound better and better... putting the giving of men into a
last_man_given = false
while (!last_man_given) {
if (amount_men > max_amount_men) {
give max_amount_men
amount_men - max_amount_men
} else {
give amount_men
last_man_given = true
}
}
loop should do the trick ...
still I would have to think about adding up the give commands for the
report ...
I'll do some testing tonight, you guys could send me your input about
this approach...
greetings
Arno
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iD8DBQFLXeehalu2gJKSTtwRAhLJAJwJPJMJx8Y6RaMMB76EgvwKRxKMtQCgqVYi
jXW7RgFyBBwu9VtAFRd+eYA=
=Lhtw
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Zorky wrote:
> You can find a very simple fix for both issues below, tested to solve
> the problem with g++ (GCC) 4.1.2. With some luck your players can work
> with units containing 2M men without issues.
>
funny, this discussion is from 2003, my actual game is running the very
last v4 engine...
Anyway, thinking of an open ended amount of men to give, I would still
vote for the split give command (maybe with some thinking a split teach
too, tho this won't be as easy as the giving...). As Enno has pointed
out earlier, just moving from int to long isn't the correct way of
thinking, since it will only postpone the problem...
Greetings
Arno
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iD8DBQFLXe2dalu2gJKSTtwRAozBAJwL+vmtyOIOZ5Sg/GYJxm8QpjwQfwCglmAa
Ti35xE/oyvHdPnuo+1jH+XE=
=qHBH
-----END PGP SIGNATURE-----
Hi Arno,
I was investigating a bug in your game where teaching large units did
not work as it should. I checked out the 4.1.0 code and reproduced the
problem. The unit-split bug is similar to this one.
You can find a very simple fix for both issues below, tested to solve
the problem with g++ (GCC) 4.1.2. With some luck your players can work
with units containing 2M men without issues.
900 leaders teach a unit of 9000 men. One turn later the students have
only gained 7 days, while 60 days are expected.
The problem is caused by a maxint overflow in the teaching code, due
to multiplying the size of one unit by the size of another unit, and
then multiplied by a constant.
There was a thread in march 2003 about exactly this bug
http://groups.yahoo.com/group/atlantisdev/message/5024 , but
apparantly never was implemented, in part due to 64 bit integers (long
long) not being supported on all platforms. That should be no problem
now, 7 years later.
branches/PATCHES_410/runorders.cpp/monthorders.cpp:371
int days = (30 * unit->GetMen() * Globals->STUDENTS_PER_TEACHER);
<snip>
int tempdays = (umen * days) / students;
days = (30 * 900 * 10) = 270000;
tempdays = (9000 * 270000) / 9000;
tempdays = (2430000000) / 9000; The temporary value exceeds maxint
(2147483647) and overflows:
tempdays = (-1864967296) / 9000 = -207219.
Instead of the expected bonus of 30 days this teacher gives
-207219/9000 = -23 days.
Also patching a similiar unit-split bug in the same way (which already
can trigger for a skill-5 unit with 2200 leaders).
Patch is below.
Greetings,
Zorky
Index: monthorders.cpp
===================================================================
380c380
< int tempdays = (umen * days) / students;
---
int tempdays = ((long long)umen * days) / students;
Index: skills.cpp
===================================================================
119c119
< temp->days = (days * leave) / total;
---
temp->days = ((long long)days * leave) / total;
===================================================================
Citeren Arno Saxena <al-s@...>:
> I found the bug, that's buggin (urgh, horrible pun :D) my players for
> some time now.
>
> While giving large amount of men from one unit to another (same faction)
> the receiving unit allways receives only a very small amount of skill
> p.s.: maybe we should, especialy for the v5 engine think of changing all
> integers involved with amounts of men or skill days to unsigned long...
Instead of wasting all that memory, you may want to read
http://www.fefe.de/intof.html
Enno.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I found the bug, that's buggin (urgh, horrible pun :D) my players for
some time now.
While giving large amount of men from one unit to another (same faction)
the receiving unit allways receives only a very small amount of skill
... I found why. The calculating of the receiving units skill is done
only with normal, sometimes with unsinged integers. Thus the max number
of days is 65535 if the unsinged int is used. This divided by 180 and we
have a max amount of 364 men that can be given without problems. (145
leaders obviously). And since my players are giving amounts of about 5k
men with comb 3 they are loosing all their skills by doing so ...
I'll try and find every involved int and replace it with unsinged long
Thus 9,5 mil leaders with level 5 skills can be given without problems,
that should be ok. 40,992,764,608,200,000 leaders could be handled if we
would use unsinged long long, but I don't know what this would do to our
performance and I think if a faction is in the need to move more than
9,5 mil leaders with any skill at level five to another unit, it's time
to call him the winner and start the game new :D
If anybody has had his hands inside the giving men and splitting skills
algorithms and can give me a hand, feel free to contact me, I'm limping
forward by try and error at the moment to find all the places I can,
can't, have to and mustn't change to long at the moment :)
Greetings
Arno
p.s.: maybe we should, especialy for the v5 engine think of changing all
integers involved with amounts of men or skill days to unsigned long...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iD8DBQFLXMEPalu2gJKSTtwRAsmlAJ9o/Q/9rcPeqkbQXmN7Oj6t4Rer/wCggDBs
quPBne2K6uqb9aCJTmlqHk4=
=WLy+
-----END PGP SIGNATURE-----
Ahha, I remember that game. It was quite fun from beginning, old good allies
who don't play anymore these days - many were still interested in Atlantis and
playing. We had an interesting war with The Judges and their friends. Game died
long time ago and will not come back :)
Yeah, speaking of Atlantis. I would like to join a new one to see what I learned
from recent defeats :)
Beigtais,
Dii Minores
--- In atlantisdev@yahoogroups.com, crying@... wrote:
>
> Hello!
>
> my English is very bad , but... Who remembers the World is Arroyo? GM can
recover the World? or new Game
>
>
>
> Hostile : The Guardsmen (1), Silent Ones (15), Cutting Edge Trading Company
(48), The Judges (12), Twin Skies (8), Creatures (2), Elven Liberation Front
(41)
>
>
>
> Ally : Dark Man (21), Army of Shining Moon (39), Black Dragon (42), Dii
Minores (18), Snobbish Strutters (19), RealmKeepers (24), Woodoo (30), The
Fallen Angels (17), 'Arry (54), Anchorites (66), North Pole Elves (43), Annunaki
The Elders (60), Therias (61), Aelita (62), Haus Fafner (73)
>
my English is very bad , but... Who remembers the World is Arroyo? GM can recover the World? or new Game
Hostile : The Guardsmen (1), Silent Ones (15), Cutting Edge Trading Company (48), The Judges (12), Twin Skies (8), Creatures (2), Elven Liberation Front (41)
Ally : Dark Man (21), Army of Shining Moon (39), Black Dragon (42), Dii Minores (18), Snobbish Strutters (19), RealmKeepers (24), Woodoo (30), The Fallen Angels (17), 'Arry (54), Anchorites (66), North Pole Elves (43), Annunaki The Elders (60), Therias (61), Aelita (62), Haus Fafner (73)
Sorry, I didn't get the question :)
Is DSN server alive? Nice to hear.
This group is also alive and we are looking forward to final A5 release or any
other game similar to Atlantis :)
----- Original Message ----
> From: Trevor <t_whyatt@...>
> To: atlantisdev@yahoogroups.com
> Sent: Fri, November 6, 2009 11:27:02 AM
> Subject: Re: [atlantisdev]
>
> +2 here
>
> crying@... wrote:
> >
> > +1 who else?
> >
> > Sure,
> > we are still alive
> >
> > Loria
> > On Thu, Nov 05, 2009 at 12:57:05AM +0300, crying@...
> > wrote:
> > > dsnlab /atlantis@... / - It is live!
> > > There is still who live?
> > >
> > > --
> > >
> > > MadCap
> >
> > Reply to sender
> >
> > | Reply to group
> >
> > Messages in this topic
> >
>
> > (2)
> > MARKETPLACE
> > Mom Power: Discover the community of moms doing more for their
> > families, for the world and for each other
> >
>
> >
> > Yahoo! Groups
> >
>
> >
> > Switch to: Text-Only
> >
> ,
> > Daily Digest
> >
>
> > Unsubscribe
> >
> > Terms of Use
> > .
> >
> >
> >
> >
> >
> >
>
>
>
> ------------------------------------
>
> To Post a message, send it to: atlantisdev@eGroups.com
> To Unsubscribe, send a blank message to:
> atlantisdev-unsubscribe@...! Groups Links
>
>
>
To: atlantisdev@yahoogroups.com From: crying@... Date: Fri, 6 Nov 2009 12:42:40 +0300 Subject: Re: Re: [atlantisdev]
+1 who else?
Sure, we are still alive
Loria On Thu, Nov 05, 2009 at 12:57:05AM +0300, crying@... wrote: > dsnlab /atlantis@incub.ru/ - It is live! > There is still who live? > > -- > > MadCap
Loria On Thu, Nov 05, 2009 at 12:57:05AM +0300, crying@... wrote: > dsnlab /atlantis@incub.ru/ - It is live! > There is still who live? > > -- > > MadCap
Sure,
we are still alive
Loria
On Thu, Nov 05, 2009 at 12:57:05AM +0300, crying@... wrote:
> dsnlab /atlantis@.../ - It is live!
> There is still who live?
>
> --
>
> MadCap
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Hi,
I managed to prima the game database. Also adding of players works ...
(this is done via a utility which is unaware of different libraries...
which you are able to tell the game itself )
I will try to add the files detected to the svn
Next Step will be running a turn :)
Loria
On Thu, Oct 22, 2009 at 02:20:50PM +0200, Enno Rehling wrote:
> egroupsmx wrote:
> > any news on this??
>
> I'm currently moving from Norway to the US, and haven't been able to do
> anything Olympia-related for a while. I plan to test running a turn when
> I'm settled in California, but until then, don't expect much progress.
>
> Howevr, the code works fairly okay now, and if you want to start a game,
> I would urge you to give it a try and check back if you get stuck
> somewhere. Both Piotr and I can probably give you pointers.
It seems to be quite some work to prime the olympia lib, so a first
testturn could be run.
Did someone of you already done that ...
Loria
egroupsmx wrote:
> any news on this??
I'm currently moving from Norway to the US, and haven't been able to do
anything Olympia-related for a while. I plan to test running a turn when
I'm settled in California, but until then, don't expect much progress.
Howevr, the code works fairly okay now, and if you want to start a game,
I would urge you to give it a try and check back if you get stuck
somewhere. Both Piotr and I can probably give you pointers.
Enno.
any news on this??
--- In atlantisdev@yahoogroups.com, Enno Rehling <enno.rehling@...> wrote:
>
> FYI:
>
> Piotr and I invested some more time in this. We have managed to create
> start a game, set up accounts and factions, and run a turn. There's a
> problem where the reporting program does not exactly match with the
> output of the game, and we haven't tried actually writing orders, but
> we're calling it progress anyhow.
>
> Enno.
>
FYI:
Piotr and I invested some more time in this. We have managed to create
start a game, set up accounts and factions, and run a turn. There's a
problem where the reporting program does not exactly match with the
output of the game, and we haven't tried actually writing orders, but
we're calling it progress anyhow.
Enno.
Thanks again!!!
> Hello egroupsmx,
> I have deleted the original file, for it was not up to date anymore. You can
find a new version for TAG at
> http://arcadia.harmus.de/stuff/tagdata.zip
> I did not have much time to work on it recently, nor could I contact Enno for
some other reasons. I hope You manage to make a further step towards running
this.
>
> Regards,
>
> Piotr
>
>
>
> --- In atlantisdev@yahoogroups.com, "egroupsmx" <egroupsmx@> wrote:
> >
> >
> > > yes, TAG does compile now. Good job!
> > > Here is a link where the current data base files are stored:
http://arcadia.harmus.de/stuff/olympiadata.zip
> >
> > Was anyone able to download the .zip??? The link isn't working anymore...
> >
>
Thanks!!! going there now...
> Hello,
> the essay can be found at
> http://www.emacswiki.org/alex/PlayByEmailGame
> Regards,
> Piotr
>
> --- In atlantisdev@yahoogroups.com, "egroupsmx" <egroupsmx@> wrote:
> >
> > --- In atlantisdev@yahoogroups.com, "iyhael" <iyhael@> wrote:
> > > There is an excellent essay by Alex Schröder, the author of the original
Atlantis, about the game mechanics of the type of game we are playing about, and
design arguments for his never finished games Olligarchy and Nulligarchy.
> > > Regards,
> > > Piotr
> >
> > Do you know where I can get a copy of the essay?
> >
> > Thanks!
> >
>
> > I did not have much time to work on it recently, nor could I contact Enno for some other reasons. I hope You manage to make a further step towards running this. > > Yeah, I was going to ask about that :-)
I'm going to try to fiddle with it a bit later this week or this weekend.
On Wed, Sep 30, 2009 at 9:37 AM, iyhael <iyhael@...> wrote:
> I did not have much time to work on it recently, nor could I contact Enno for
some other reasons. I hope You manage to make a further step towards running
this.
Yeah, I was going to ask about that :-)
Hello egroupsmx,
I have deleted the original file, for it was not up to date anymore. You can
find a new version for TAG at
http://arcadia.harmus.de/stuff/tagdata.zip
I did not have much time to work on it recently, nor could I contact Enno for
some other reasons. I hope You manage to make a further step towards running
this.
Regards,
Piotr
--- In atlantisdev@yahoogroups.com, "egroupsmx" <egroupsmx@...> wrote:
>
>
> > yes, TAG does compile now. Good job!
> > Here is a link where the current data base files are stored:
http://arcadia.harmus.de/stuff/olympiadata.zip
>
> Was anyone able to download the .zip??? The link isn't working anymore...
>
Hello,
the essay can be found at
http://www.emacswiki.org/alex/PlayByEmailGame
Regards,
Piotr
--- In atlantisdev@yahoogroups.com, "egroupsmx" <egroupsmx@...> wrote:
>
> --- In atlantisdev@yahoogroups.com, "iyhael" <iyhael@> wrote:
> > There is an excellent essay by Alex Schröder, the author of the original
Atlantis, about the game mechanics of the type of game we are playing about, and
design arguments for his never finished games Olligarchy and Nulligarchy.
> > Regards,
> > Piotr
>
> Do you know where I can get a copy of the essay?
>
> Thanks!
>
> yes, TAG does compile now. Good job!
> Here is a link where the current data base files are stored:
http://arcadia.harmus.de/stuff/olympiadata.zip
Was anyone able to download the .zip??? The link isn't working anymore...
--- In atlantisdev@yahoogroups.com, "iyhael" <iyhael@...> wrote:
> There is an excellent essay by Alex Schröder, the author of the original
Atlantis, about the game mechanics of the type of game we are playing about, and
design arguments for his never finished games Olligarchy and Nulligarchy.
> Regards,
> Piotr
Do you know where I can get a copy of the essay?
Thanks!