Recent posts by mgthefourth on Kongregate

Flag Post

Topic: Game Programming / Which of these AI styles do you prefer:

whoops

Sorry skyboy, I never noticed I had BOTID and CUSTID switched around! I fixed it now and the as3 actually runs faster. It seems that replacing the BOTID (a one digit integer) with the CUSTID (a 9 character string) was causing big problems server side and returning something like 12 lines of errors in the <errors> tag of its xmlrpc and heavily distorting my bot statistics at the same time!

Its clear now that if I implement Aesica and ErlendHL’s tips the actionscript is easily a better choice than the flex.

Thanks again,

mg

 
Flag Post

Topic: Game Programming / Which of these AI styles do you prefer:

CUSTID and BOTID are constat strings (hence the upper-case) containing variables which tell my server which version is POSTing.

I’ve done some thinking and you’re probably right, I might use the action script version because it’d probably work better with the rest of the game. All the same I think its always good to ask around and I’m still interested to hear if anyone has any particular preference.

Also if you have any tips about how I could speed up my AS3 code then please let me know.

 
Flag Post

Topic: Game Programming / C++ or C#?

If you are just whetting your programming appetite, the language you start off with does not really matter. When you’ve done enough programming languages like C++, C# and Java actually start looking quite similar when compared to some other languages (*ahem SmallTalk). Really you are best starting off with Java as it is VERY object oriented and Object Oriented Programming is the future (and present) of programming. Changing language is surprisingly easy.

If you don’t believe me take a look at the following programs to multiply numbers together:

C#

static double multiply(double a, double b)
{
    return a * b;
}

C++

double multiply(double a, double b)
{
   return a * b;
}

Java

public static double multiply(double a, double b) 
{ 

    return a*b;

}
 
Flag Post

Topic: Game Programming / Which of these AI styles do you prefer:

Originally posted by skyboy:

Originally posted by mgthefourth:

I suspect (as the AI is actually hosted on a separate server) it has something to do with the speed with which flex processes httpRequests. If you don’t believe me try them both out.

flex doesn’t process the requests, flash processes them in both cases. flex is mostly just a UI package based entirely in actionscript.

the problem is in your code; something’s being done differently

//Vars to send
var variables:URLVariables = new URLVariables();
variables.botid = CUSTID;
variables.custid = BOTID;
variables.input = input;

//Create the HTTP request object
var request:URLRequest = new URLRequest(URL);
request.method = URLRequestMethod.POST;
request.data = variables;

//Initiate the request
requestor.dataFormat = URLLoaderDataFormat.TEXT;
requestor.addEventListener( Event.COMPLETE, xmlRPCRequestComplete );
requestor.addEventListener( IOErrorEvent.IO_ERROR, xmlRPCRequestError );
requestor.addEventListener( SecurityErrorEvent.SECURITY_ERROR, xmlRPCRequestError );
requestor.load( request );

etc…

seems pretty efficient to me…

But I digress, nobody has actually answered my question…

 
Flag Post

Topic: Game Programming / Which of these AI styles do you prefer:

Originally posted by BobTheCoolGuy:

The first one is very difficult to read because of the text and background colors. I’m curious to how the flex version is faster, as flex has much more overhead than a pure AS3 project.

I thought so too, until I finished this part of the project.

I suspect (as the AI is actually hosted on a separate server) it has something to do with the speed with which flex processes httpRequests. If you don’t believe me try them both out.

 
Flag Post

Topic: Game Programming / Which of these AI styles do you prefer:

I’ve recently started programming a (fairly ambitious) game, during one part of which the player must hold a conversation with a computer AI and extract information from it.

I have programmed examples two different styles of interface which I can use but both have their limitations:

-

Flex 3:

http://www.kongregate.com/games/mgthefourth/alice-ai-bot-chat-chat-with-an-artificial-intelligence

-

Actionscript:

http://www.kongregate.com/games/mgthefourth/alice-ai-bot-chat-v2-chat-with-another-artificial-intelligence

-

The Flex 3 version is faster, but the interface looks less “digital”. The as3 version is slower but allows me to have a “green text on black screen” syle interface.

 
Flag Post

Topic: Serious Discussion / Is There An Undeniably Selfless Act?

I don’t think anyone here is realising the difference between a selfless good deed and a selfless act. An act is anything, ANYTHING we do. So if i’m walking down the street and I trip and fall by accident then my falling is an act committed by me with no premeditation or self involved nature it is selfless.

Similarly if I am sleeping and I shout out in my sleep I do so subconsciously without any self in concious mind, now if my shout wakes up my next door neighbour just as a burglar enters his house my neighbour will not be robbed, as a result of something I did totally by accident.

 
Flag Post

Topic: Kongregate Labs / cant find game developing programs for imac

If you are looking for a Game Maker style program then google search “stencyl” which runs on mac, otherwise the flex SDK runs on any computer running java, and you could use Eclipse as an IDE (google search both)

 
Flag Post

Topic: Kongregate Labs / Flash Game Makers

Just as an extra note, when you get started in either of these libraries/engines make sure to select flash player 10 as output rather than flash player 9, you do this in Flash Develop by selecting project>properties and then changing the dropdown labled target to Flash Player 10.

 
Flag Post

Topic: Kongregate Labs / Flash Game Makers

Ok, SgtKYB you need to learn AS3 which is the object oriented programming language used for flash. If you are planning on learning this just for making games then I reccomend you check out The FlashPunk Tutorials . Which take you through the programming and set-up step by step and introduce you to the free flash punk game libraries.

If you dont like the look of flashpunk then take a look at flixel . Or push button engine .

Happy coding!

 
Flag Post

Topic: Collaborations / Need Someone to share 50% rev

Sure, I don’t mind taking a look at the bugs for a name in the credits, as for designing parts of the game, it sounds interesting, I’ll pm you.

 
Flag Post

Topic: The Arts / Check out this sweet little thang :)

Very nice, how did you make it?

 
Flag Post

Topic: Off-topic / Can you fly?

I learnt to fly at the age of four but got bored and haven’t tried since…

 
Flag Post

Topic: Collaborations / Need Someone to share 50% rev

The game certainty looks good, if your’e worried about your code being buggy I can check it out for you but please, for the love of god, comment it before showing it to anyone unless you want them to laugh very loudly and then kill you.

On the subject of graphics I would highly recommend you use the scion developer tool-kit (just search on kongregate) although I don’t think it has anything to do with fruit included.

 
Flag Post

Topic: Game Programming / Flex 3 and the Kong API?

This is the code i’m pasting in:
*

import flash.display.LoaderInfo;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.system.Security;

// Pull the API path from the FlashVars
var paramObj:Object = LoaderInfo(root.loaderInfo).parameters;

// The API path. The “shadow” API will load if testing locally.
var apiPath:String = paramObj.kongregate_api_path ||
http://www.kongregate.com/flash/API_AS3_Local.swf&#8221;;

// Allow the API access to this SWF
Security.allowDomain(apiPath);

// Load the API
var request:URLRequest = new URLRequest(apiPath);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
this.addChild(loader);

// Kongregate API reference
var kongregate:*;

// This function is called when loading is complete
function loadComplete(event:Event):void
{
// Save Kongregate API reference
kongregate = event.target.content;

// Connect to the back-end kongregate.services.connect(); // You can now access the API via: // kongregate.services // kongregate.user // kongregate.scores // kongregate.stats // etc…

}
*
The errors I get say that it does not recognize the properties mentioned.

 
Flag Post

Topic: Game Programming / API Documentation

This might be the wrong place to ask, but does anyone know if you cn get the API to work in Adobe Flex Builder 3 or in Flash Develop?

 
Flag Post

Topic: Game Programming / Flex 3 and the Kong API?

I am a Flex Builder 3 user and I am having massive problems manually importing the Kong API.

When I copy and paste the reccomended code i get a series of errors, all referring to properties that are contained in the API (which flex obviously cant see)

Ia anyone having a similar problem? And if so how did you get round it?