Author Topic: Hnefatafl: The Viking Board Game (download on page 7)  (Read 27884 times)

0 Members and 1 Guest are viewing this topic.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Proposal for interested BASIC coders
« Reply #15 on: March 26, 2010, 08:19:05 pm »
Yeah, those sizes are feasible. Not as easy, but still doable.
Made even easier because the board doesn't move or change too much. Mostly just adding pieces.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55936
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Proposal for interested BASIC coders
« Reply #16 on: March 26, 2010, 08:20:00 pm »
i guess 4v4 or 5v5 would be better then

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Proposal for interested BASIC coders
« Reply #17 on: March 26, 2010, 08:21:50 pm »
Oh, they look 3x3 but I guess I'm miscounting. Thanks :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Proposal for interested BASIC coders
« Reply #18 on: March 26, 2010, 08:23:24 pm »
Oh, they look 3x3 but I guess I'm miscounting. Thanks :)

You're seeing correct. There's a blank row at the top and right side to separate the pieces

Offline Zera

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 737
  • Rating: +82/-7
  • Monochrome Artisan
    • View Profile
Re: Proposal for interested BASIC coders
« Reply #19 on: March 26, 2010, 08:43:19 pm »
What do you think about this? (using 5x5)


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55936
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Proposal for interested BASIC coders
« Reply #20 on: March 26, 2010, 09:13:45 pm »
nice!

Offline Zera

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 737
  • Rating: +82/-7
  • Monochrome Artisan
    • View Profile
Re: Proposal for interested BASIC coders
« Reply #21 on: March 26, 2010, 09:43:45 pm »
Biggest trouble is representing the king's throne. This is the only board tile that needs to be emphasized in some way. It appears in the center, as well as each corner. The tile is important in determining both captures, and victory.

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: Proposal for interested BASIC coders
« Reply #22 on: March 26, 2010, 10:02:49 pm »
I'm really willing to give this program a try!
Will you either attach the rules on post or PM me them? Or if you don't have time to write all of them, I can always wiki it.

Edit:btw, the 5x5 tile looks really nice!
« Last Edit: March 26, 2010, 10:03:18 pm by jsj795 »


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Zera

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 737
  • Rating: +82/-7
  • Monochrome Artisan
    • View Profile
Re: Proposal for interested BASIC coders
« Reply #23 on: March 26, 2010, 10:43:04 pm »
Here is a great page detailing specific rules - captures, victory conditions, etc. It also has diagrams.

I should note that the game is very historic, and as such, there is not an official recollection of the rules. What we know about the game is mostly extrapolation. The above site says Hnefatafl is played on a 13x13 board, but this is actually debated. Most versions I've seen use 11x11. (including the one I'm planning) Some versions don't include the more advanced capture rules; like shieldwall. I'm trying to make a version that is as thorough as possible.

I don't have all the assets completed - just what you've seen in the thread so far. AP is currently looking into coding it, so I don't want to bring anyone else in on the project unless they consult with him, as well. It might be awkward if multiple people took a stab at it, and coded several versions at once. :P

Current shots:

« Last Edit: March 26, 2010, 11:49:22 pm by Zera »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55936
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Proposal for interested BASIC coders
« Reply #24 on: March 27, 2010, 12:03:20 am »
I love these ^^

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Proposal for interested BASIC coders
« Reply #25 on: March 27, 2010, 04:05:27 am »
Using those 2 pictures and my limited knowledge of Hnefatafl, the progress so far is attached.
It's just the title screen, picking attacker or defender, and showing who's turn it is based on your choice. (With the GUI so far.)

Posting this because I couldn't sleep and I wanted to show everyone that I'm definitely going through with this project.
(Zera, let me know what you think so far and if there's any changes you want made.)

EDIT: Core engine's mostly done. Just missing rules on capturing king, the shield-wall rule, and winning in general.
Of course, I haven't even started on the AI yet. I'll throw up another screenshot later.
« Last Edit: March 27, 2010, 09:28:08 am by {AP} »

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: Proposal for interested BASIC coders
« Reply #26 on: March 27, 2010, 11:50:06 am »
Wow nice! Glad you are working on it, {AP}!
I better start reading the rules to play on calc!

Question tho. Will it be available to play against human, not just AI? It would be fine on calc, I guess...
Oh, and how about AI vs. AI for people who wants to get a quick glimpse of some of the strategies that AI use?
I know I'm asking too much at this point, but I want to know if it would be feasible.
« Last Edit: March 27, 2010, 11:50:18 am by jsj795 »


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Zera

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 737
  • Rating: +82/-7
  • Monochrome Artisan
    • View Profile
Re: Proposal for interested BASIC coders
« Reply #27 on: March 27, 2010, 12:36:45 pm »
Great job, AP! Looks very accurate so far. I like the layout you use for the player status info.

Quote
Question tho. Will it be available to play against human, not just AI? It would be fine on calc, I guess...
Oh, and how about AI vs. AI for people who wants to get a quick glimpse of some of the strategies that AI use?
I know I'm asking too much at this point, but I want to know if it would be feasible.

I suppose that is up to AP. I don't know what the technical limitations of pure BASIC would be, in that respect.

I originally only intended for A.I. versus human.
« Last Edit: March 27, 2010, 12:38:08 pm by Zera »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55936
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Proposal for interested BASIC coders
« Reply #28 on: March 27, 2010, 01:36:24 pm »
Wow very nice indeed. Nice job so far, I hope you finish this :)

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Proposal for interested BASIC coders
« Reply #29 on: March 27, 2010, 04:27:23 pm »
Alrighty, I've almost completely finished the engine which means I'm closing in on coding the AI.
 (Progress on Engine: Everything but shieldwall rule and the custom options (which we hope to make into the final version))

This is where I need a bit of help. If anyone has had some experience coding an AI and/or can write up a bit of pseudo-code to get me started it'd help greatly. If you need, here's the notes on behaviors I took from Zera, but I don't need you to write up the whole code, I'm just looking for an efficient way to fit an AI of this caliber into RAM.
 
Code: [Select]
General and specific A.I. strategies:

-------
 Black
-------

 - Initial movement: Black at 6B will move to 6C, 6J will move to 6I, 10F to 9F
 and 2F to 3F. (if not obstructed, or wandering into a capture) This is a common
 opening move for the black side.

 - Will attempt to surround the throne from all sides whenever possible. (but
 will not carelessly position itself to become captured)

 - If the king moves toward any corner boundary, all remaining black pieces will
 attempt to obstruct his path, and pre-emptively obstruct his path to other
 corners as well.


-------
 White
-------

 - Initial movement: Pieces at 7D, 7G, 5D and 5G are among the first white
 pieces to move, as their movement does not set other white pieces up to be
 captured. Almost any other movements would result in this. Until these pieces
 are captured, or black pieces are not prepared to capture any white pieces up
 against the throne, other white pieces will try to avoid moving around.

 - Pieces directly bordering the king's throne will remain stationary as long as
 possible, to avoid giving black the opportunity to surround the king. If the
 outer white pieces are moved away and the bordering pieces could be captured up
 against the king's throne, then they will move themselves out of the way.

 - The king will generally not attempt to move unless a number of white and / or
 black pieces have been captured, or there is a very expedient route for his
 escape that isn't likely to be obstructed. (i.e., a corner of the board is
 almost completely empty)

-------------
 Other Notes
-------------

Well, it may just be necessary for the A.I. to only plan moves that protect its essential assets,
and go after essential opponent assets. Otherwise, the A.I. would just move toward the most
expedient route of capturing opponent pieces.

For the black side, the four corners would be considered assets that need to be guarded, and the
king's throne would be considered an asset that needs to be surrounded. For the white site, the king
would consider the four corners an asset that simply needs to be reached, and the white pieces
would consider the center throne an asset that needs to be guarded.

When there are no available moves to pursue these assets, or they are already protected / seized,
then the A.I. would just choose the fastest route to capture opponent pieces.

That is, for all intents and purposes, good enough to have a decent A.I. It does not provide any kind
of real strategy or thinking to the A.I., however. The A.I. would not be robust enough to plot ways to
trick opponents, or make them arrange their pieces so they can pursue their assets more easily.
« Last Edit: March 27, 2010, 05:17:01 pm by {AP} »