Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #46  
Old June 26th, 2003, 07:31 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Risk] RE: Risk

Risk sounds like a good idea, looking at the interim description.

I think a future PHP contest should be to design a PHP script that, given a text description of a person's face, can use GD to draw what the face looks like, just like a professional criminal sketch-person would.

Reply With Quote
  #47  
Old June 26th, 2003, 07:40 PM
TheReverend TheReverend is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 13 TheReverend User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to TheReverend
[Risk] RE: Risk

Happylight,

Not everyone will necessarily be getting the bonus soldiers on the same turn. You have to take over a country in order to get a bonus token, and not everyone will be able to do this.

;-)

Reply With Quote
  #48  
Old June 26th, 2003, 08:33 PM
jorgen jorgen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hardenberg, Holland<marquee>
Posts: 284 jorgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: Risk

I like the idea of lefty: storing the data in a text file.

Now my comment on the formulas:

la = Loss Attacker
ld = Loss Defender
a = Armies Attacker
d = Armies Defender

la = round( (0.85d^2)/a ) // Little simplified without the min();

0.5 results in no losses at all:

0.5 < (0.85d^2)/a)
0.5 = (0.85d^2)/a)
0.85d^2 = 0.5a
1.7d^2 = a // Break-even

So if the defender has 5 armies, the attacker needs 1.7*5^2 = 1.7*25 = 42.5 = 43 armies if he doesn't want to loose any armies.

So theoraticly it's possible an attacker does not lose any armies. Sounds a little bit strange to me...

I'd say: Use that formula with a miminum losses of 1 armie

Reply With Quote
  #49  
Old June 26th, 2003, 10:53 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Risk] RE: Risk

I think that this will be a viable contest.

I have a question. What if a proxy-script makes it past the first round?

Reply With Quote
  #50  
Old June 27th, 2003, 07:13 AM
ciaccia ciaccia is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ferrara, Italy
Posts: 18 ciaccia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
[Risk] RE: Risk

I had a quick look to the interim rules and it seems really interesting... I just hope to find some time to code my script

Great work, xs0

Reply With Quote
  #51  
Old June 27th, 2003, 07:14 AM
jorgen jorgen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hardenberg, Holland<marquee>
Posts: 284 jorgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: Risk

XS0: I think the rules should be altered a little bit. On the first turn there are three GET parameters: youare, start and board:
If a territory is unoccupied the value of that territory will be x. To my mind the value should be the letter of the controller without a number of armies. So the script with letter A knows which territories belong to which player. It's important to know because of placing the 20 soldiers...

Do you get my point?

Reply With Quote
  #52  
Old June 27th, 2003, 07:58 AM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: Risk

Quote:
Instead of sending the board in the URL, why not store the board in a file called board.txt, [snip] and may even allow for boards of varying size, varying player count, etc.

That's exactly what I don't want.. I want it to be simple to implement one's strategy, which it is not, when the problem is generic (i.e. it is unknown what the board will be like). I think this will lead to more interesting games, because strategies will be more evolved. I even deleted two lands, so you always start with 10

Quote:
I'm not adverse to a little luck if you wanted to add it into the rules - gives a bit more reality

Well, I think that luck can really ruin your day, when you don't have it. And it's not that realistic. I often play Risk with my computer, and it is really stupid that sometimes you attack 20 to 5 and manage not to win... But anyway, the main idea about the formulas is that the scripts don't get called for each little attack, but only once for each turn.

Quote:
About the bonus token part? How about changing it so you only have to exchange for more soldiers when you have 5 or more tokens so that everyone won't be getting the bonus on the same turn. You can pick a turn when you need the extra soldiers. And also you won't know when your opponent will get the bonus.

Well, I though about this quite a lot, but decided against it. First, the whole idea with the original game is to wait for a better combo of cards, which can't happen here. Second, it would add an otherwise really unneccesary command. Third, theoretically it's not very important - the rules are the same for all players, so it doesn't make a big difference overall.

Quote:
So theoraticly it's possible an attacker does not lose any armies. Sounds a little bit strange to me...

Well, if you consider that each soldier-piece can represent, say, 1000 troops, it's not that unrealistic. If the losses are spread over the 43 armies, after rounding , there's no loss in either of those. If you make a minimum of one loss on each side, it lends itself to abuse - you can attack a stronger army with one soldier each time, and cause a loss, which shouldn't happen... And you can also think of it this way - big armies have air support with napalm to drop ;)

Quote:
I have a question. What if a proxy-script makes it past the first round?

It can't. It doesn't actually receive any points, just fills a place on the ladder.

Quote:
To my mind the value should be the letter of the controller without a number of armies. So the script with letter A knows which territories belong to which player. It's important to know because of placing the 20 soldiers...

AFAIK, there are variants on this, but the reason I decided on this particular variation is because the first player has an important advantage throughout the game (first to attack, first to get bonus soldiers, etc.). This is his disadvantage.

Well, it seems most people like the idea, so we'll make this the contest. I'll talk with Matt and it should get on the official page soon.

Reply With Quote
  #53  
Old June 27th, 2003, 01:17 PM
mugane mugane is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Charlottesville, VA USA
Posts: 425 mugane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to mugane Send a message via Yahoo to mugane
[Risk] RE: Risk

Jorgen, seriously, I don't want to start an off-topic discussion but I think that chess is a little more complicated than you presume. And it takes years to know the game pretty well.

If you know the moves of the pieces and the rules of the game you will find that although there are simple defensive and offensive strategies, all of them without fail are ineffective against more complicated, less intuitive strategies, which are virtually inexhaustible in number. Assigning value to pieces does not simply require knowing their positions and piece-types but also their possible positions for n moves (until checkmate) in the future. There is only one piece of value in the game, the rest are limbs. There is no requirement to win the fight with all or any of your limbs.

I want to suggest chess for the contest, perhaps so that this point can be illustrated. Coding a perfect chess game is impossible with today's technology.

Perhaps if the board and pieces were reduced (say 5x5, no knights, no bishops) it would be less horrifying a concept.

But anyhow.... the risk game issue: Will someone please tell me HOW the formulas will work? Perhaps post one? How come nobody else seems to think that this is an important factor?

Reply With Quote
  #54  
Old June 27th, 2003, 01:22 PM
Jester Jester is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: England
Posts: 271 Jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: Risk

Formulas for the battles?

// $atts is the number of attackers
// $defs is the number of defenders

$loss_attacker=min($atts, round(0.85*$defs*$defs/$atts));
$loss_defender=min($defs, round(0.65*$atts*$atts/$defs));

Check xs0's interim rules above.

Reply With Quote
  #55  
Old June 27th, 2003, 01:36 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: Risk

The defender always defends with all soldiers. Let's say he has 5. You have 30 soldiers on a neighbouring territory. You can attack with anywhere from 1 to 29 soldiers.

If you attack with 5:
loss_attacker=round(0.85*5*5/5)=4
loss_defender=round(0.65*5*5/5)=3
So you will lose 4, and the defender 3, so defender will then have 2 and you will have 26 soldiers.

If you attack with 6:
loss_attacker=round(0.85*5*5/6)=4
loss_defender=round(0.65*6*6/5)=5
So you will also lose 4, but the defender will lose all 5, so on your original territory you will have 24 and on the conquered territory you will have 2 soldiers.

If you attack with 29, you will only lose 1, and 28 will move to the new territory.

Reply With Quote
  #56  
Old June 27th, 2003, 01:38 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Risk] RE: Risk

can i attack from territory i just conqured in this turn

Reply With Quote
  #57  
Old June 27th, 2003, 01:43 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: Risk

Yes, you can

Reply With Quote
  #58  
Old June 27th, 2003, 01:55 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Risk] RE: Risk

Let's get this show on the road.

Reply With Quote
  #59  
Old June 27th, 2003, 01:55 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[Risk] RE: Risk

what if i attack with 10 and defender has 10, i lose 9 and defender loses 3, does 1 soldier comes back to land i am attacking from or what??

Reply With Quote
  #60  
Old June 27th, 2003, 02:00 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[Risk] RE: RE: Risk

Quote:
what if i attack with 10 and defender has 10, i lose 9 and defender loses 3, does 1 soldier comes back to land i am attacking from or what??

In that case, you lose 9, defender loses 7, and 1 soldier stays where he is.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [Risk] Risk


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump