|
Title: ARQA [DONEISH] Post by: Hangedman on January 17, 2011, 10:23:32 AM ARQA (http://dl.dropbox.com/u/7216965/Arqabuilds/smallimg.png)A game of instant death Core Engine ████████████████████ 100% complete Graphics ███████████████████░ 95% complete Local ██████████████████░░ 90% complete Netplay ░░░░░░░░░░░░░░░░░░░░ Temporarily cancelled FINAL BUILD FOR NOW, BUGFIXES MAY COME. (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaFeb27.swf) ARQA is a card game about swordfighting. It is quick, violent, and about exploiting every moment of weakness. It was in no way inspired by Nidhogg, but I today realized that I will forever be asked whether it was or not. In ARQA, both players are silent fighters on an unknown battlefield. All they have at their disposal are their techniques honed from a lifetime of skill. Each card is such a skill. Skills can be weighted, so to speak, to affect either the player or the opponent. All cards affect 3 stats: Attack, Finesse, and Defense. Most cards also increase Exhaustion to the user only, which climbs from 0 to 9 and then causes you to lose a turn at 9. The trick is: both players play at once, and both cards played resolve at once, unless they are special cards that deliberately occur second. Normal Cards > Special Cards > Killing Blow In order to win, you must gain a state of advantage. That is, have an opponent who has 0 in one stat and have 9 in one yourself. Then you can play a Killing Blow to win the game, so long as they do not prevent the stats from becoming balanced again. Title: Re: ARQA Post by: Inanimate on January 17, 2011, 11:04:29 AM
HAVE MY BABIES Title: Re: ARQA Post by: ChevyRay on January 17, 2011, 11:04:35 AM FLASHPUNKKKKK >:D do eeeet!
I will love you forever. Title: Re: ARQA Post by: Hangedman on January 17, 2011, 11:08:11 AM OKAY. FALSH IT FGONNNA BE (mouthful of celebratory croissant)
ALSO: Gonna make a meatspace version too. PLAYING FLASH GAMES IN REAL LIFE Title: Re: ARQA Post by: ChevyRay on January 17, 2011, 11:15:01 AM RAD. If you need assistance or anything, I'll try to be online as much as possible all week, just hit me up. Good luck!
:handshakeL: :wizard: :handshakeR: Title: Re: ARQA Post by: Hangedman on January 17, 2011, 02:22:04 PM Found this in a dumpster behind the 7/11. If no one claims it in 30 days I get to keep it
(http://dl.dropbox.com/u/7216965/arqamock1.png) Also, came up with a SUPER AWESOME mechanic for doing local multiplayer with closed hands. Will elaborate more later, suffice to say it riffs on ancient technology and Pokemon Stadium. Title: Re: ARQA Post by: Hangedman on January 17, 2011, 08:45:03 PM Working on card mockups.
Simple design and high-contrast design. Not really sure how I'm going to do images for all of them. (http://dl.dropbox.com/u/7216965/arqamockcard1.png) (http://dl.dropbox.com/u/7216965/arqamockcard2.png) Title: Re: ARQA Post by: Inanimate on January 17, 2011, 08:48:24 PM That is intriguingly cryptic.
Title: Re: ARQA Post by: Hangedman on January 17, 2011, 08:55:50 PM At midnight, once the compo is officially started, I will reveal the core concept and my basic mechanics.
Until then I am a :ninja: Title: Re: ARQA Post by: Hangedman on January 17, 2011, 09:52:21 PM Totally missed out on midnight, because I realized the forum time is borked and had to alter my time zone in the wrong direction twice to get it right.
Anyway: game info added to main post. I'm also going to link to milestones along the way there. LOCAL MULTIPLAY EXPLAINED: I had an interesting idea for local multiplay. Having both closed hands on one screen seemed utterly pointless. The Pokemon Stadium method seemed like the best course of action (hold down button to reveal cards so you can reconceal them quickly) but I realized that probably wasn't enough, because the numbers are too easy to read on the fly. So now I have the element method. At the beginning, each player selects an element. Instead of revealing cards when the button is held down, it reveals a series of numbers that represent the 5 cards in the hand. Each element will have a printable card and/or text file listing what cards the numbers correspond to. And each element has different numbers for each card. Eg. Holding down your key would show '28'. If you selected Fire, you could look at the Fire list you printed and see that 28 corresponds to the 'Push' card I posted above. While for all of the other elements, 28 represents a different card. I know it's a lot to take in, but thoughts? Title: Re: ARQA Post by: Inanimate on January 17, 2011, 09:56:39 PM This all sounds pretty genius. Looking forward to playing it!
Title: Re: ARQA Post by: Hangedman on January 18, 2011, 09:20:23 AM Okay, Flashpunk guys (especially Chevy), already need some help.
I am making one Entity for each card in the hand, but each one needs to be able to switch between being any card. Simple variable work, but the graphics. Should I use a spritemap? The filesize of the image the cards draw from will be monumental (if all cards are in one big file) and that could cause some serious lag. Or a graphicslist? Or something else? Title: Re: ARQA Post by: Sos on January 18, 2011, 09:25:09 AM I'd override _render()
Title: Re: ARQA Post by: Hangedman on January 18, 2011, 09:41:35 AM I'd override _render() :droop: I know how to do that, but I don't know how it would help me. Care to elaborate on the method you have in mind? Title: Re: ARQA Post by: Sos on January 18, 2011, 10:11:40 AM make _render not actually render the sprite, but render an arbitrary graphics of a card.
Title: Re: ARQA Post by: Hangedman on January 19, 2011, 12:23:25 PM Okay folks. I'm working on an algorithm that assigns a 50-card deck random values from 0-49, (DeckArray) and ensures there are no duplicates. I'm almost there, but i'm kind of stuck. The current algorithm re-randomizes each index once if it's already in the deck, but not again. Here's the code.
Code: //SHUFFLING DECK for (var h:int = 0; h < 50; h += 1) //50 CARDS IN DECK { var k:int = Math.floor(Math.random() * 50); //RAND FROM 0-49 for (var chk:int = 0; chk < h; chk += 1) //CHECK PREVIOUS CARDS { if (k == DeckArray[chk]) { k = Math.floor(Math.random() * 50); } } DeckArray[h] = k; //FINALLY INPUT VALUE } Just can't quite think this out. Little help? Title: Re: ARQA Post by: Sos on January 19, 2011, 12:41:10 PM I can do it in C, but i hope you get it
Code: int c,cards[DECK],shuffled[DECK],r; // you need to initialise 'shuffled to 0 (or sth that itsn't a card) here memset(shuffled,0,4*DECK); // null the array for (c=0;c<DECK;c++) // loop through UNSHUFFLED CARDS { r = rand()%DECK; // pick a random position in shuffled deck while (shuffled[r]) r=(r+1)%DECK; // get next pos if it's taken and wrap around if needed // got free (null) position, now place the card there shuffled[r] = cards[c]; } EDIT: so basically, the idea is that you DON'T pick a card for a shuffled deck slot, but assign a shuffled position to each card in the deck Title: Re: ARQA Post by: Lemming on January 19, 2011, 01:11:47 PM You can do this in-place in linear time, just find a random card that's not among the 'i' first cards, swap that with the i+1th card and don't touch it again.
I did a quick implementation in python, since it looks like pseudo-code. Most of the code is actually to generate the deck, but it's pretty sweet and should be clear. This one actually shuffles a 52-card array, but the algorithm can be used to randomize any array regardless of type or size, in linear time. So just create your array with values 0-49, then shuffle it. Code: import random class deck: def __init__(self): self.cards = [] for i in range(14): for j in ["Hearts", "Diamonds", "Clubs", "Spades"]: if i == 0: token = 'A' elif i == 11: token = 'J' elif i == 12: token = 'Q' elif i == 13: token = 'K' else: token = str(i) self.cards.append(token + " " + j) def shuffle(self): for i in range(len(self.cards)): # swap a random card with the first card, # and we have the first card figured out. idx = random.randint(i, len(self.cards)-1) # random index between i and the last card tmp = self.cards[idx] self.cards[idx] = self.cards[i] self.cards[i] = tmp d = deck() print(d.cards) #shuffle deck d.shuffle() print(d.cards) Relevant part (algorithm) for readability: Code: def shuffle(self): for i in range(len(self.cards)): # swap a random card with the first card, # and we have the first card figured out. idx = random.randint(i, len(self.cards)-1) # random index between i and the last card tmp = self.cards[idx] self.cards[idx] = self.cards[i] self.cards[i] = tmp Edit: I really wanna push this algorithm :-[ so here it is in C, if that helps, with 50 cards: Code: int cards[50]; size_t i; for(i = 0; i < 50; ++i) cards[i] = i; for(i = 50 - 1; i > 0; --i) { size_t idx = rand() % (i+1); int tmp = cards[i]; cards[i] = cards[idx]; cards[idx] = tmp; } Title: Re: ARQA Post by: TobiasW on January 19, 2011, 01:14:20 PM Another option would be to start with a sorted deck from 0..49, and then
Code: for (int i = 0; i < 49; i++) { swapCards(i, rand()%50); } I'm not sure and I'm no math pro, but I think Sos' wrap method might heighten the probability that cards are sorted after a long stretch of filled slots. For example: |8||5|6||7||4|10|2|9|3||||1||||| Now for 6 out of the 20 possibilities, the 11 would be placed after the 3. Then for 7 out of the 20 possibilities, the 12 would be placed after the 11. ...and so forth. edit: Oh, I took to long to post. Title: Re: ARQA Post by: Zaratustra on January 19, 2011, 01:16:20 PM jesus christ.
Code: int cards[52]; int place; for (i = 0; i < 52; i++) { cards[i] = -1; } for (i = 0; i < 52; i++) { do { place = random(52); } while (cards[place] != -1); cards[place] = i; } Title: Re: ARQA Post by: Sos on January 19, 2011, 01:34:40 PM man, you can do magic card tricks with these algos!
Title: Re: ARQA Post by: Hangedman on January 19, 2011, 02:05:13 PM Thanks for all the help, guys :lol: I'm well on my way now.
Title: Re: ARQA Post by: mjau on January 19, 2011, 02:07:49 PM Relevant part (algorithm) for readability: Code: def shuffle(self): for i in range(len(self.cards)): # swap a random card with the first card, # and we have the first card figured out. idx = random.randint(i, len(self.cards)-1) # random index between i and the last card tmp = self.cards[idx] self.cards[idx] = self.cards[i] self.cards[i] = tmp Edit: I really wanna push this algorithm :-[ so here it is in C, if that helps, with 50 cards: Code: int cards[50]; size_t i; for(i = 0; i < 50; ++i) cards[i] = i; for(i = 50 - 1; i > 0; --i) { size_t idx = rand() % (i+1); int tmp = cards[i]; cards[i] = cards[idx]; cards[idx] = tmp; } Listen to this guy ^ Code: a b c d e | - initialized a b c e | d - randomly picked card between #1-#5 (#4) a e c | b d - randomly picked card between #1-#4 (#2) a e | c b d - randomly picked card between #1-#3 (#3) e | a c b d - randomly picked card between #1-#2 (#1) | e a c b d - shuffled Title: Re: ARQA Post by: Hangedman on January 19, 2011, 08:53:19 PM Thanks to all who helped me out.
Here is the terribly anticlimactic fruit of today's labours. http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan19.swf (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan19.swf) Press Space once it loads to shuffle the deck. I got some other stuff done today, but it's mostly half-finished fragments, which I will work on as I find time. So hopefully there'll be more visible work tomorrow. Title: Re: ARQA Post by: Hangedman on January 21, 2011, 12:40:21 PM Thanks to help in the IRC, code was restructured substantially and I got a much better hold on what I can do with higher array functions.
You can now shuffle, deal, play and draw, and the deck auto-cycles and auto-shuffles. All I need now is to restrict actions to specific game phases, and add graphics to replace the mess of numbers. Once I have solid local multiplay, I'll get to work on netplay. Progress continues unabated, if kind of meandering. Also, more about the game's core mechanics coming later tonight, if I hit a certain milestone. Title: Re: ARQA Post by: ChevyRay on January 21, 2011, 12:47:26 PM On the shuffling, you can also go FP.shuffle(myArray) in FlashPunk to shuffle an array.
Title: Re: ARQA Post by: Sos on January 21, 2011, 02:01:07 PM On the shuffling, you can also go FP.shuffle(myArray) in FlashPunk to shuffle an array. How could you pwn our efforts to embed a cheaty shuffling in his game! Title: Re: ARQA Post by: Hangedman on January 21, 2011, 07:16:49 PM On the shuffling, you can also go FP.shuffle(myArray) in FlashPunk to shuffle an array. If only I had known! Well, I'm in too deep now (spins top) Title: Re: ARQA Post by: Hangedman on January 23, 2011, 08:05:30 PM Well, I'm still bashing away.
The core mechanics are all done, and I am well on track for my one-month-left milestone. A large part of the graphics are done, but utterly unused as of yet. Here's the latest build. http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan23.swf (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan23.swf) Card effects on stats are implemented, but it doesn't tell you what the stats are, what the cards are, or how they affect the players. All that will be much more easily communicated with the graphics. The final version will have far better and more clearly explained controls (and probably mouse controls). Just to explain further if you feel like tooling with it: You can target your opponent or yourself with any cards. When asked to select targets... Player 2 is on the top, and is targeted with Y (P1) and UP (P2) Player 1 is on the bottom, and is targeted with H (P1) and DOWN (P2). Time to get to graphics! Title: Re: ARQA Post by: Hangedman on January 26, 2011, 08:57:53 AM All the math is done! All the coding is done... almost!
One more hurdle! The Elite Beat Agents are off helping some hikkikomori leave his apartment so I can't call them for help, so I will call on the Indie Elite Agents instead! (Crossposted from the FP forums) I'm going to be importing 50-odd images for the cards in the deck of cards. Which would be the most efficient way to do this, both memory-wise, and data-entry-time-wise? Frames in an animation that read from a MASSIVE single image file? Much faster to code and easier to work with but requires one giant image being read constantly. Individual embedded images? If they are individually embedded, how would I go about changing the image of an existing object? Would I override render, or something else? Put the image info and such in an XML format? If so, how do I go about embedding and using them, as Embed doesn't seem to allow any variables to be used for source (it only takes straight directly input text strings)? If I can't get this worked out by tomorrow night at midnight, Any advice would be greatly appreciated. Title: Re: ARQA Post by: Eclipse on January 26, 2011, 11:13:23 AM jesus christ. Code: int cards[52]; int place; for (i = 0; i < 52; i++) { cards[i] = -1; } for (i = 0; i < 52; i++) { do { place = random(52); } while (cards[place] != -1); cards[place] = i; } you know this is going to waste a lot of time searching for an empty spot for the last card right? Instead of searching for a random spot you can just pick them randomly and placing them in order, this way there's no need to spend time searching for an empty spot. (But picking a card means you also have to shift the others to keep the array compact) Title: Re: ARQA Post by: Hangedman on January 26, 2011, 11:42:04 AM Well, I ended up using a hybrid shuffle method that is extremely efficient, mostly based on Lemming's method.
Also, I solved my graphical problem all by myself! The easiest method turned out to be the right one. Woooooo Title: Re: ARQA Post by: Hangedman on January 28, 2011, 08:44:46 AM Less talk more rock
http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan27.swf (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan27.swf) Basic mechanics are done. A couple of special cards don't work yet, I'm going to tie in the graphics to get the last few mechanics in. You can't win yet. Target selection will make far more sense with graphics. OT edited with more detail and explanation about the game. I'll look at menu/instructions soon too. Title: Re: ARQA Post by: rivon on January 30, 2011, 08:55:33 AM Some kind of pseudocode:
Code: cardsArray = [52] # array filled with the numbers or cards Just have two arrays, one with the cards, one empty. Pop (meaning to take them out of the array) random cards from the cardsArray and append them (meaning to put them in the end) of the other array. Simple as hell and I think also the fastest method.shuffledArray = [] # momentarily empty array while (len(cardsArray) != 0) { shuffledArray.append(cardsArray.pop(random(0, len(cardsArray)))) } Title: Re: ARQA Post by: Hangedman on January 30, 2011, 09:38:47 PM As incomprehensible as ever. But now you can see the cards.
http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan30.swf (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan30.swf) Can't figure out for the life of me whether I should do graphics or netplay first. Graphics = understandability, clearer direction, and that necessary hype. Netplay = intended functionality. Ima goda bed Title: Re: ARQA Post by: Hangedman on January 31, 2011, 09:34:00 AM Workin' on a stone board. A little C+C might help. The messy darkest inner areas are covered by game objects.
1) Granulated gray 2) Softened gray 3) Granulated brown 4) Softened brown (http://dl.dropbox.com/u/7216965/Arqabuilds/boardgran.png) (http://dl.dropbox.com/u/7216965/Arqabuilds/boardsoft.png) (http://dl.dropbox.com/u/7216965/Arqabuilds/boardbrowgran.png) (http://dl.dropbox.com/u/7216965/Arqabuilds/boardbrowsoft.png) Title: Re: ARQA Post by: Inanimate on January 31, 2011, 03:30:47 PM Second one, but maybe a bit more colorful?
Title: Re: ARQA Post by: Hangedman on January 31, 2011, 07:41:22 PM still chuggin' away
made it a bit fancier i guess don't know where to go from here. netplay i guess test coming up. gonna be a bit busy i guess still don't know if the target selection controls are easy to read. welp i guess http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan31.swf (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaJan31.swf) Title: Re: ARQA Post by: Maikel_Ortega on February 01, 2011, 02:20:57 AM I tried to test it, but ussually I don't know what i'm doing. Also, as I have a laptop and numpad is selected over the 789uiojklm keys with "Num Lock", it seems to select both players card as I press U/4.
By the way, the player at the top of the screen seems to have his controls inverted. This definitely need help texts, some kind of past moves log, something like that. It's pretty confusing right now. And maybe cards that act as killing blow with additional effects, as there seems to be a lack of them. And I don't know how to select the target of special cards. Anyway, I found this very original, quick to play, and the closest thing to swordfights on a cards game I've ever seen. Keep working on the netplay and I'll be glad to test this out :D Nice work! Title: Re: ARQA Post by: Hangedman on February 01, 2011, 07:18:16 AM Numpad! That just occurred to me, too. Bit of a problem.
I'm going to make the controls much, much simpler and much more clear. I just don't want it to be too obvious which cards the players are selecting. Half of the special cards don't have effects because they require a notification to ask for targets, which I am doing today. Thank you for actually playing it! I know it's rough, but I'm getting closer fast. Getting the UI right and easy to read is the important part. Title: Re: ARQA Post by: FinalSin on February 01, 2011, 07:18:49 AM I tried to play it - I really like the sound and look of it, but I need a tutorial. I am super-thick when it comes to tuff like this.
Title: Re: ARQA Post by: Hangedman on February 06, 2011, 04:13:27 PM Still coming along.
So are all the tests and essays I've got hitting me right about now. More to show tomorrow. Title: Re: ARQA Post by: Hangedman on February 07, 2011, 08:47:57 PM Aaaghblablphilosophyofarttestvsdhijfbiwefn
(http://dl.dropbox.com/u/7216965/Arqabuilds/2-07shot.png) Title: Re: ARQA Post by: NathanielEdwards on February 08, 2011, 08:19:47 AM Looking good man, keep it up.
Title: Re: ARQA Post by: Hangedman on February 18, 2011, 07:00:14 PM I'MMM NOT DEADDDD
ARGHHGGHGHHGHGHGH (game just about done. adding flash, last few mechanical instructions and images. then menu. sound comes last. sorry I've been so busy Nathaniel, haven't had a moment to spare even to work on this between my essays, but I managed to get it just about done and my biggest concern now is the game) HGHGNNGNNNGGGGG (If anyone is still willing to do music for neglectful busy me I only really need one track, and it must have kind of an eastern-ish flavour, haunting, piano is a plus, fake piano or real, bells are cool too, preferably fast paced rather than slow, must be loopable, fade in and out is okay but endless would be better) (>this song< (http://dl.dropbox.com/u/7216965/Arqabuilds/The%20Night%20of%20Yajnavalkya%27s%20Travel.mp3) by the eminent Aliceffekt (http://wiki.xxiivv.com/) is kind of what i'd like but i don't have time to tool around with music editing and while i would ask permission i really don't know if it's what i want as it might be a bit too loud and forceful) (menu music would be nice but at the moment is thoroughly unnecessary) (back to work) :handshakeL: :crazy: :handshakeR: Title: Re: ARQA Post by: Hangedman on February 26, 2011, 07:50:39 AM Penultimate Build (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaFeb26.swf)
All that's left is shine and menus. Menu is functional but does little but let you run a local game. Winning is now possible. A bit lazily implemented, but possible. Players now get exhausted when EX (the fourth stat) hits 9. They miss their next turn. The final touches will make this way more obvious (covering up your cards etc). Press F2 during game to turn on context-sensitive control help. Controls now: QAWSE for P1, IKOLP for P2. (Think of a W shape. It actually works well once you get the hang of it) and 12(3) and (8)90 for selecting targets/stats. All that's left is graphics, instructions, and netplay will be left until after the compo, as I would rather have a functional local game than a nonfunctioning netplay/local. Back soon. Title: Re: ARQA Post by: Hangedman on February 27, 2011, 01:42:42 PM No wait this is the penultimate build (http://dl.dropbox.com/u/7216965/Arqabuilds/ArqaFeb27.swf)
Almost done. Just about. Gonna do some cleaning, add some sounds, a bit more polish before time runs out. I hope the instructions and context help make the controls and gameplay more clear. Best of luck, gentlemen. Title: Re: ARQA [DONEISH] Post by: Hangedman on March 14, 2011, 05:23:03 PM Well, I never really had time to add any more. Tests and work will out.
Despite my lack of netplay, I at least managed two kinds of local multiplayer (http://dl.dropbox.com/u/7216965/Arqabuilds/arqadeck.png) |