Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411426 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 09:42:31 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityJams & EventsCompetitionsVersus (Moderator: Melly)ARQA [DONEISH]
Pages: 1 [2] 3
Print
Author Topic: ARQA [DONEISH]  (Read 14950 times)
Sos
Level 8
***


I make bad games


View Profile WWW
« Reply #20 on: January 19, 2011, 01:34:40 PM »

man, you can do magic card tricks with these algos!
Logged

Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #21 on: January 19, 2011, 02:05:13 PM »

Thanks for all the help, guys  Cheesy I'm well on my way now.
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
mjau
Level 3
***



View Profile
« Reply #22 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 Embarrassed 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
Logged
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #23 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

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.
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #24 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.
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
ChevyRay
Guest
« Reply #25 on: January 21, 2011, 12:47:26 PM »

On the shuffling, you can also go FP.shuffle(myArray) in FlashPunk to shuffle an array.
Logged
Sos
Level 8
***


I make bad games


View Profile WWW
« Reply #26 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!
Logged

Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #27 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)
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #28 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

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!
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #29 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, they'll bulldoze the rec centre I'll miss my milestone for finishing the code, and have to throw myself on my tablet stylus in disgrace!
Any advice would be greatly appreciated.
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Eclipse
Level 10
*****


0xDEADC0DE


View Profile WWW
« Reply #30 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)
« Last Edit: January 26, 2011, 11:19:14 AM by Eclipse » Logged

<Powergloved_Andy> I once fapped to Dora the Explorer
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #31 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
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #32 on: January 28, 2011, 08:44:46 AM »

Less talk more rock

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.
« Last Edit: January 28, 2011, 09:25:29 AM by Hangedman » Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
rivon
Level 10
*****



View Profile
« Reply #33 on: January 30, 2011, 08:55:33 AM »

Some kind of pseudocode:
Code:
cardsArray = [52] # array filled with the numbers or cards
shuffledArray = [] # momentarily empty array

while (len(cardsArray) != 0)
{
   shuffledArray.append(cardsArray.pop(random(0, len(cardsArray))))
}
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.
Logged
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #34 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

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
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #35 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







Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Inanimate
Level 10
*****

☆HERO OF JUSTICE!☆


View Profile
« Reply #36 on: January 31, 2011, 03:30:47 PM »

Second one, but maybe a bit more colorful?
Logged
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #37 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
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Maikel_Ortega
Level 1
*


...and the stars, my destination.


View Profile WWW
« Reply #38 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!
Logged

Melee Studios:http://melee-studios.com<br />Forever WIP (ESP devlog): http://maikel.londite.es/devlog/
Hangedman
Level 10
*****


Two milkmen go comedy


View Profile WWW
« Reply #39 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.
Logged

AUST
ITIAMOSIWE (Play it on NG!) - Vision
There but for the grace of unfathomably complex math go I
Pages: 1 [2] 3
Print
Jump to:  

Theme orange-lt created by panic