Be a Supporter!

The Flash 'Reg' Lounge

  • 1,597,638 Views
  • 64,358 Replies
New Topic Respond to this Topic
Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 04:37 AM Reply

At 3/31/13 03:07 AM, GeoKureli wrote: I think intellisense has removed capitalization as an issue entirely. also lowercase int and void is consistent because they are primitive datatypes, which affects how the == operator will work on the datatype. I'd like Boolean to be bool in flash, and Number to be float. but I assume they left it capitalized so people could move from as2 without hassle.

But what about String? There isn't consistency. HaXe, on the other hand, looked at AS3's primitive types and chose to capitalise. I don't see how intellisense removes issues whatsoever - it's there as an aid, not to fix anything. It doesn't make a language better because it's not a component of the language. Consistency issues should be dealt with by the designers of the language, not by third parties in hacky ways.

SantoNinoDeCebu
SantoNinoDeCebu
  • Member since: Jul. 20, 2002
  • Offline.
Forum Stats
Supporter
Level 32
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:29 AM Reply

Syntax should never be the defining factor of whether you choose a language! (Unless you got to put dolla signs before variables!!!)

I've come from doing cross platform mobile apps using various things like Unity and Marmalade, but when I finally looked at Haxe/NME not to long ago I was pleasantly surprised! I've been able to fairly seamlessly re-write my as3 code into haxe with just a few minor syntax changes. Definitely my top choice for making any cross platform 2d apps.

There are a few quirks with the language - as there are with any language.

Try compile this!

var j:Int = 20;
var q:Int = 10;
  
var b:Int = j / q;

'characters 2-20: Float should be Int'

It seems that dividing an int by another int will implicitly cast the result to a Float? And you cannot implicitly cast Floats to Int, so you're stuck having to do Std.Int() around cases like this.
It's open source so I imagine you can manually add implicitly casting Floats to Int if you know how.. but I don't!

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:37 AM Reply

Please play through this game if you have time! I have a message for you guys at the end...

  • Insane RPS
    Insane RPS by FlyingColours

    Play against other players in the most insane RPS game EVER!

    Score
    Under Judgment
    Type
    Game
    Popularity
    5 Views
    Rated
    Everyone

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 12:19 PM Reply

At 3/31/13 10:37 AM, FlyingColours wrote: Please play through this game if you have time! I have a message for you guys at the end...
http://www.newgrounds.com/portal/view/614178

aww, thank you :D
and yeah, I realized it as soon as the first message appeared. No random stranger playing a game on the internet is that quick, that well rehearsed, and that helpful.
Would have been much more realistic if after a few seconds it said "lolz your a noob"

fun fact, typing that out gave me a hernia
another fun fact, the code you presented at the end gave me cancer. Yeah, i'm completely fucked.

Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 12:32 PM Reply

At 3/30/13 06:45 PM, GeoKureli wrote: I like that Haxe is multiplatform, but if I want to make an .exe I'd rather use a language with method/operator overloading.

What difference does the fact that you get an .exe specifically make in needing method/operator overloading? o.O

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 01:18 PM Reply

At 3/31/13 10:37 AM, FlyingColours wrote: Please play through this game if you have time! I have a message for you guys at the end...

Yeah, I had to throw OOP out a few times in this RPG, I have random static functions that only get used once for once specific reason, event dispatching all over because of the weird architecture of my code...but whatever.

Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Audiophile
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 02:39 PM Reply

At 3/31/13 10:37 AM, FlyingColours wrote: Please play through this game if you have time! I have a message for you guys at the end...
http://www.newgrounds.com/portal/view/614178

aww what a qt3.14


Concerned Joe (not mine but still cool)

BBS Signature
PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 02:40 PM Reply

At 3/31/13 10:37 AM, FlyingColours wrote: Please play through this game if you have time! I have a message for you guys at the end...
http://www.newgrounds.com/portal/view/614178

I knew what was up very early. How did i win any matches if your ai picks rock paper scissor after me? lol

You could of easily trolled the fuck out of me if you didn't make it possible for me to win and added some sort of dialoge text chat on the AI's part. I would of never messaged just a simple "hello" in different variations woulda been enough.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 02:42 PM Reply

At 3/31/13 10:37 AM, FlyingColours wrote: Please play through this game if you have time! I have a message for you guys at the end...
http://www.newgrounds.com/portal/view/614178

hahah good stuff. I figured it out after like the 2nd guess.

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 08:10 PM Reply

Thanks, guys. :)

aww, thank you :D
and yeah, I realized it as soon as the first message appeared. No random stranger playing a game on the internet is that quick, that well rehearsed, and that helpful.
Would have been much more realistic if after a few seconds it said "lolz your a noob"
fun fact, typing that out gave me a hernia
another fun fact, the code you presented at the end gave me cancer. Yeah, i'm completely fucked.

Sorry! :P I don't think the message was the only reason you figured it out, though... Perhaps you've seen my post in the lounge about making an April Fool's Day game? Perhaps you know I don't have the ability to make an online multiplayer game anyway (even Mattster's Drawing Grounds isn't real-time)?

I knew what was up very early. How did i win any matches if your ai picks rock paper scissor after me? lol

You could of easily trolled the fuck out of me if you didn't make it possible for me to win and added some sort of dialoge text chat on the AI's part. I would of never messaged just a simple "hello" in different variations woulda been enough.

Haha! When I tested it, the AI kept picking scissors... but that's the way Math.ceil(Math.random()*3) works, apparently. I did mean to type in more dialogue, but I was running out of time, and I wanted it to pass through judgement on AFD in all time zones (time is very important since AFD is a half-day event). I could also make it impossible to win, but then... I already have three ways for the AI to cheat (one round -> 2/3, 2/3->3/5, and the paper-scissors hybrid) and if I made it impossible to win, rage reviews will ensue...

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 08:56 PM Reply

At 3/31/13 08:10 PM, FlyingColours wrote:

have three ways for the AI to cheat (one round -> 2/3, 2/3->3/5, and the paper-scissors hybrid) and if I made it impossible to win, rage reviews will ensue...

My ai i programmed for tic tac toe cannot be beaten.

But if you know how to play it also cannot win.

Should i program a gui for it and upload it to newgrounds for people to rage over?

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:05 PM Reply

At 3/31/13 08:56 PM, PMMurphy wrote:
At 3/31/13 08:10 PM, FlyingColours wrote:
have three ways for the AI to cheat (one round -> 2/3, 2/3->3/5, and the paper-scissors hybrid) and if I made it impossible to win, rage reviews will ensue...

My ai i programmed for tic tac toe cannot be beaten.

But if you know how to play it also cannot win.

Should i program a gui for it and upload it to newgrounds for people to rage over?

As great an idea as that is, Mint has already done that.

  • Tic Tac Toe+
    Tic Tac Toe+ by MintPaw

    Everyone likes a little Tic Tac Toe right?

    Score
    2.87 / 5.00
    Type
    Game
    Popularity
    2,733 Views
    Rated
    Everyone

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:10 PM Reply

ahhhhh

Did you look at his source code?

I hard-coded the fuck out of my solution to tic-tac-toe.

I literally saved datastructures of all the losses play by play and single handedly solved all the problems my initial design couldn't solve.

I used some technique i read in a technical paper.
Link me to his project? I wnna play against it and mine at the same time and see if we pick different locations.

Also did he start with the center location only? Or does his ai pick random locations based on tactical decisions?

In other words.

Does he tell it to pick center then start running his ai?

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:14 PM Reply

His ai isn't unbeatable.

I beat it.

he didn't solve one off the wall strategy you can do when you go first.

So he didn't fully test it.

But hes prolly not a perfectionist like me.

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:16 PM Reply

I used some technique i read in a technical paper.

Could you link to that? It would probably make an interesting read. Thanks!

Link me to his project? I wnna play against it and mine at the same time and see if we pick different locations.

Um, is it that the link didn't show up for you? It's here.

Also did he start with the center location only? Or does his ai pick random locations based on tactical decisions?

In other words.

Does he tell it to pick center then start running his ai?

The player always comes first in his game.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:23 PM Reply

The paper's aren't free. i get them for free because im a student at a university.

But if you want to read about it its the technical papers that describe The program called anaconda for checkers.

I used the concept of how they analyzed boards without the complex programming and it basically solved 80% of the problems i had to solve.

Then i had no clue what to do afterwards.

I programmed my ai a long time ago. So i could prolly do it better now.

One of the seniors at my department programmed a flawless tic-tac-toe ai in like 40 or 50 lines of code.

Mine is like 300.

Idk how he did it.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:36 PM Reply

THere are actually quite a few strategies you can do that will win everytime you do it.

I'd say a total of 4 strategies that will win no matter what.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 09:45 PM Reply

At 3/31/13 09:36 PM, PMMurphy wrote: THere are actually quite a few strategies you can do that will win everytime you do it.

I'd say a total of 4 strategies that will win no matter what.

I take that back.

Every single two-way strategy there is can beat this program.

Just keep playing it over and over again until it falls for it. The locations are randomly picked hardcoded solutions because the developer knows how to play tic-tac-toe. The ai doesn't solve the problem at all. Because the answers fluctaute in no actual pattern.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:04 PM Reply

At 3/31/13 09:45 PM, PMMurphy wrote:
At 3/31/13 09:36 PM, PMMurphy wrote: THere are actually quite a few strategies you can do that will win everytime you do it.

I'd say a total of 4 strategies that will win no matter what.
I take that back.

Every single two-way strategy there is can beat this program.

Just keep playing it over and over again until it falls for it. The locations are randomly picked hardcoded solutions because the developer knows how to play tic-tac-toe. The ai doesn't solve the problem at all. Because the answers fluctaute in no actual pattern.

tic tac toe is easy when you go first, pick a corner, if they pick an adjacent corner you pick the opposite corner that you started with. the rest will be all blocks to victory.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:12 PM Reply

You obviously havn't solved tic-tac-toe fully and made it so its impossible to lose no matter who goes first or who does what.

My ai in tic-tac-toe cannot simply be beaten. No matter what.

Idc what strategy you use. I solved everything.

GeoKureli
GeoKureli
  • Member since: Apr. 1, 2003
  • Offline.
Forum Stats
Supporter
Level 19
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:20 PM Reply

At 3/31/13 10:12 PM, PMMurphy wrote: You obviously havn't solved tic-tac-toe fully and made it so its impossible to lose no matter who goes first or who does what.

If I go first it's impossible to lose, unless you count obviously bad moves.

My AI in tic-tac-toe cannot simply be beaten. No matter what.

that's not really difficult, especially if the AI goes first. tic tac toe is an incredibly simple game.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:27 PM Reply

At 3/31/13 10:20 PM, GeoKureli wrote:
At 3/31/13 10:12 PM, PMMurphy wrote: You obviously havn't solved tic-tac-toe fully and made it so its impossible to lose no matter who goes first or who does what.
If I go first it's impossible to lose, unless you count obviously bad moves.
My AI in tic-tac-toe cannot simply be beaten. No matter what.
that's not really difficult, especially if the AI goes first. tic tac toe is an incredibly simple game.

You can go first you can't beat it.

I simulated every possible game scenario ever and solved everything.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:31 PM Reply

Tic-tac-toe may be a more simplair version of other games. But there are many strategies you have to solve in order to make an ai that cannot be beaten.

There are a total of like 10 or 12 different variations of two way problems.

That yea, if you solve the hard-coded way is easy.

But thats bad programming.

You gotta find algorithms that solve anything thrown at you and it should work on nxn sized boards where n is any given number from 0 to infinity.

My code doesn't do that.

Hard-coding solutions to ai is bad programming and bad ai.

I hard-coded my solutions simply because i just wanted to have it done. Many people solve tic-tac-toe over and over again when practicing artificial intelligence because its easy software to recreate because the game IS simple.

Chess ai and checkers ai, most of it is hardcoded and not really ai.

There are tons of ai you would consider "good" but in reality its terrible.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:33 PM Reply

At 3/31/13 08:10 PM, FlyingColours wrote: Sorry! :P

'twas a joke :P

I don't think the message was the only reason you figured it out, though... Perhaps you've seen my post in the lounge about making an April Fool's Day game? Perhaps you know I don't have the ability to make an online multiplayer game anyway (even Mattster's Drawing Grounds isn't real-time)?

Nope, it really was the first message that gave it away for me. I never saw a post, and I didn't know you didn't know how to connect a Flash-whatever to a server-side script. It's quite easy, believe it or not. Just the goddamn security restrictions screw everything up most of the time. AIR solves this, mostly. Thank god.


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 10:48 PM Reply

At 3/31/13 10:33 PM, egg82 wrote:
I don't think the message was the only reason you figured it out, though... Perhaps you've seen my post in the lounge about making an April Fool's Day game? Perhaps you know I don't have the ability to make an online multiplayer game anyway (even Mattster's Drawing Grounds isn't real-time)?
Nope, it really was the first message that gave it away for me. I never saw a post, and I didn't know you didn't know how to connect a Flash-whatever to a server-side script. It's quite easy, believe it or not. Just the goddamn security restrictions screw everything up most of the time. AIR solves this, mostly. Thank god.

It may be easy for you, but my PHP skills don't go much further than echo. I can't even make a session (though I'm gonna have to learn to do that soon).

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 11:06 PM Reply

At 3/31/13 10:48 PM, FlyingColours wrote: It may be easy for you, but my PHP skills don't go much further than echo. I can't even make a session (though I'm gonna have to learn to do that soon).

doesn't need to be PHP, anything that gives back text is fine. Hell, you could even completely toss a web server in favor of something else that just shoots back a few bytes through socket connections.

Though if you wanted to go the PHP route, haz a codez.

it's just a couple quick classes dealing with a bit of simple security stuffs, but you should be able to get the idea of OOP PHP from that.


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 11:10 PM Reply

I have no idea what happens when you program the server side script with flash or whatever.

I have avery minimal idea of what that even means. I don't really read papers on servers or networking. I basically focus in artificial intelligence.

But i am highly curious.

Will you elaborate and teach me some background knowledge?

Do you know why you get these security restrictions when you try to attach to a server (are you doing it from client side?)

If your doing it from client side how does that interfere with security? Is it the server's secrurity that causes problems?

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 11:32 PM Reply

At 3/31/13 11:10 PM, PMMurphy wrote: I have no idea what happens when you program the server side script with flash or whatever.

I have avery minimal idea of what that even means. I don't really read papers on servers or networking. I basically focus in artificial intelligence.

But i am highly curious.

Will you elaborate and teach me some background knowledge?

Sure. Don't call me an expert or anything, because I sure as hell am not (and may be totally wrong), but i'll share what i've learned.

Do you know why you get these security restrictions when you try to attach to a server (are you doing it from client side?)

The reason for security restrictions is to make sure the client doesn't get their system bricked by an exploit. AS3 very, very much has that power. With AS3 (and AIR in particular) we can access pretty much everything on the system. In order to access anything, however, the program itself first needs permission from the system's admin(s). I personally have discovered a way to circumvent the Adobe installer for AIR applications, but if your system's even slightly secure it'll ask you if you really want to open the exe you downloaded.

Security restrictions also protect servers from unauthorized access. It's impossible to get information from a site in AS3 without first loading their security policy XML file. In some ways, this is nice, in others it's just ridiculous. Security's so tight with the XML thing that i'm 99% sure you can't even load HTTP headers without it.

If your doing it from client side how does that interfere with security? Is it the server's secrurity that causes problems?

After you get beyond the CML business it's just a standard client/server relationship. Send/receive data from specified sockets, maybe attempt to account for latency if you like pain.


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 11:33 PM Reply

At 3/31/13 11:06 PM, egg82 wrote:
At 3/31/13 10:48 PM, FlyingColours wrote: It may be easy for you, but my PHP skills don't go much further than echo. I can't even make a session (though I'm gonna have to learn to do that soon).
doesn't need to be PHP, anything that gives back text is fine. Hell, you could even completely toss a web server in favor of something else that just shoots back a few bytes through socket connections.

Though if you wanted to go the PHP route, haz a codez.

it's just a couple quick classes dealing with a bit of simple security stuffs, but you should be able to get the idea of OOP PHP from that.

Thanks, but we haven't really got into the networking unit at school yet, and I don't even know what socket connections are, and how they shoot back bytes... Once I have, and once I know enough PHP, I'll look back at your zip again. Thanks.

PMMurphy
PMMurphy
  • Member since: May. 27, 2012
  • Offline.
Forum Stats
Member
Level 01
Programmer
Response to The Flash 'Reg' Lounge Mar. 31st, 2013 @ 11:51 PM Reply

It doesn't make any logical sense to me. If as3 is a known scripting language and scripting language require internet connections and the ability to latch on the networks and servers. Why the hell would it get blocked?

What was created first. AS3 or the server's security?

If the security was created first i can underestand why it would flag as3 but also, why isn't there an easy approach to get around this?

I understand people can create malicious code inside as3 and scripting languages but the big question is why didn't some smart guy handle this problem already?

I mean they have a general formula for catching a pokemon. if they have that why do we have this problem?

Makes no sense.