Actionscript 3 :: Pathfinding Implementation Not Giving Expected Results

Aug 10, 2011

My AS3 A* pathfinding implementation sometimes doesn't returns the most efficient route, rather like this:[code]The problem: i should have a total score of (distance to end) 30 + (distance from start) 10 = 40, while the tile above i should have a total score of (distance to end) 40 + (distance from start) 14 = 54. Why is 54 being picked instead of 40, I don't know - I use this to find the node with lowest total score on the open list:[code]

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Trace Array Not Producing Expected Results?

May 21, 2010

I am producing an array of numbers 1-25, shuffling and tracing the output. When I 'Test Movie' I am not getting the expected results. What I get is something like this.

[Code]...

View 7 Replies

ActionScript 3.0 :: Preload Class Giving Odd Results?

Mar 5, 2009

I believe I've got this set up to where you can test it out of the box. (Just add photo.jpg)

If you're getting the same results I am, there's a few things that aren't right. One, the main movieclip looks to be duplicated. The other is it's tracing something that shouldn't be traced, a percentage value and some weird random fraction (1.180283....etc). I've removed all the trace statements, which leads me to ask, is there a Flash cache of some sort? I know in past versions the file size would stay the same unless you renamed the fla file.. there something like that for classes?

I know there's a lot of video keywords, it will eventually load video.

View 8 Replies

Flex :: HitTestPoint Not Giving Correct Results

Sep 27, 2010

I have a movie clip on which I have added a MouseEvent.MOUSE_OUT listener.[code]...

Now the logic is to remove the movie clip on MOUSE_OUT and add it back to stage on MouseOver of another button. The intended functionality is like a slider showing some info

The MouseEvent.MOUSE_OUT firing in this case is not functioning always as expected. When I move the mouse out of the moveclip fast it fires. If I moveout very slowly it does not fire and consequently the movieclip remains on the stage. [code]...

View 4 Replies

ActionScript 3.0 :: Timer To Control Main Timeline Change Giving Me Bad Results

Oct 3, 2009

I have a timer to try and have my main timeline frame change every X amount of time. I just would like to cycle the frames as if they were an image slideshow or something. It works almost works by this I mean It will cycle frames 1-4 but then it wont go back to 1 with this code. It will go to frame 2 after frame 4 then the timing and randomness get even worse.[code]

View 6 Replies

ActionScript 3.0 :: Pathfinding Through Waypoints?

Apr 30, 2008

I need to create a pathfinding algorithm that goes through some predefined waypoints. Most of the examples I have found are about tile based layouts and the one that comes close to what i need is this:hich, unfortunately, I don't understand.Basically have a movieclip containing three different types of clips: Cities, roads and marked roads where something happens when you cross it.Going from city to city should always result in passing through the blue or orange waypoints jumping from one point to the next nearest point.

View 4 Replies

IDE :: Pathfinding With Direction Tiles

Oct 25, 2009

I've been experimenting with path finding, in particular the A* algorithm. I've understand the basics for it and can currently get an object to move from point A to B avoiding walls. However I'm trying to create one way blocks, (then eventually add turn left and right only and T juncs etc) so I don't have to use thick walls to prevent the object from taking a certain route. The code I have so far is....

[Code]...

View 1 Replies

Actionscript 3 :: Pathfinding For Groups Of Objects?

Feb 7, 2012

Is there any open-source algorithm for path-finding that can handle groups of objects? I'm developing a (flash) game like Age of Empires.

I will be using AS3, but I can translate any code or pseudo-code.

View 1 Replies

ActionScript 2.0 :: AI Pathfinding For Text-Based Game?

Jun 1, 2010

Pretty much what I am looking to do is have an NPC find the shortest path from their location to the player's. Everything is turn-based, so the NPC would have the capability to move from one room to another adjacent room in one turn. Keep in mind that there would be no physical manifestation of the code, other than some text that would be displayed when the NPC enters the same room as the player.And as an added aspect if possible I would like the ability to stop NPCs from entering the same room as the player once they've reached it if the room/door/entrance is locked.So the end result would be something like this...

-------[E]
[P][ ][ ][ ][ ]

--------[ ]
[P][ ][ ][E][ ][code]..........

Only difference is that there would be no graphical representation.

View 1 Replies

ActionScript 3.0 :: Rudimentary Pathfinding/collision Detection?

Jun 6, 2009

I have a question regarding seemingly relatively simple collision detection and pathfinding. Thus far I've been doing pathfinding using the A* algorithm and nodes, but I want to do something simpler for a current project.

Simply put, I just want a character to traverse directly from point A to point B, and pillar-hump around any obstacles he encounters. Of course, if the unfortunate character walks into a concave area, he would never be able to get out... that's fine. Here's an illustration of the initial setup, what A* will do, and what I actually want to do:

I was wondering if anyone here has ever done this, and if so, could suggest the best way to go about doing it?

View 2 Replies

ActionScript 3.0 :: Incorporate The Actual Pathfinding Between The Vertices?

Aug 29, 2011

I'm making my own dynamic 2D polygon pathfinder and have reached the point where i need to incorporate the actual pathfinding between the vertices. I figured Dijkstras algorithm would do the trick. If you know of better algorithms for mesh-pathfinding, please tell me. I know i could write it from scratch with reference to C, but I'm sure there are more efficient algorithms out there than the one I'd come up with.

View 8 Replies

ActionScript 3.0 :: Isometric Grid Movement On Mouse Click With Pathfinding Bug?

Mar 23, 2012

I am currently working on a very simple isometric3d game with a hero to move to mouse click position, using path-finding. I am trying to code everything myself step by step,as a beginner , i am well aware of asolib3d but I don't want to use it...I have read tutorials and few books I completely done with my isometric3d map. i create my path finding A-star class which is working perfectly with 2d grid tiles, but when i try to use it with isometric3d grid world it doesn't work properly.

ActionScript Code:
package  {
import com.sayConcept.isometric.IsoUtils;
import com.sayConcept.isometric.GraphicTile;

[code]....

my character movement is not correct. If hero position=0,0 and I click 0,10 on my iso grid instead of moving down he will move on the right side. If I am in the middle and I click on the left he will move right. and like few steps for where it supposes to stop... my pathfinding is ok in 2d but isometric the movement is weird...

View 0 Replies

Php :: IRC Client Implementation On Web Platforms

Jun 18, 2010

I want to put an IRC client in my webpage. I know there are many clients but not opensource ones (I didn't find any). So, do you know some free and open source projects to implement an irc client on a webpage? I mean is it a good idea to have one made in flash?, one made in html5?, one made in javascript/php?.

View 4 Replies

Actionscript 3 :: Correct Implementation Of MVC?

Nov 10, 2011

All the program does is you click a button and it tells you how many times you clicked the button in a textfield. Document Class: This is the entry point of the code.

[Code]...

View 3 Replies

Actionscript :: Inline Interface Implementation?

Aug 14, 2009

Is something like this possible in Actionscript?

Java:

URLFetcherFactory.setCreator(
new IURLFetcherCreator() {
public IURLFetcher create() {
return new URLFetcher();

[code].....

View 2 Replies

Flash :: Good Implementation Of Polymorphism?

Jul 17, 2010

This is working, but is this a good example of polymorphism?[code]...

View 1 Replies

AS3 :: C - Implementation Of Upper Power Of Two Algorithm

Mar 1, 2011

I have been trying to implement the Round Up Power Of 2 algorithm outlined in the following link in AS3.

[Code]...

The algorithm works great for most of the values I've tested. It is mentioned that this will return 0 when given an input value of 0 which is technically incorrect but I'm ok with that output. What I'm not ok with is when given an input of 1 I get and output of 1. I'm thinking that this must be a caveat of AS3 and its wonky uint implementation but I can't seem to figure it out. I have also tried using the >>> logical shift operator to the same result. My C is a little rusty, but I'm not sure how this would even return 2 in C. Can someone explain to me whats going wrong here? I assume if an input of 1 was a special case it would have been mentioned in the above link.

View 1 Replies

Actionscript 3 :: Class Implementation With Interface?

Sep 11, 2011

I have created the following classes for sharing images. They implement an interface, but I need a way of switching between them with user interaction. I've done it the following way:As you can see, service 1 and service 2 implement iSharingServices, and inherit from PolimorphSharing.PolimorphSharing is simply and an abstract class that implements the methods I want public from Service 1 and Service 2. Those methods will then be overridden on the Service 1 and Service 2. Because I need a way to switch the service in runtime, I've created a gateway class that inherits from PolimorphSharing. I can then call it the following way:

private var sharingService:PolimorphSharing = new SharingServicesGW('svc1').createService();

This all works flawlessly, and I can now switch between services with no problem whatsoever. However, I feel there's something wrong about it, so I would like to ask you guys for some advice on how to better implement this.

UPDATE:
Just adding some more insight to this. Basically the idea here is for my client to be able to upload images with various different public sharing services such as imageshack, imgur etc. I want my client to be able to select the service in which the image is to be published to (hence the "switching between them with user interaction" bit of the question.

The method that does the uploading bit, is requestShareImage(), processResults() simply turns whatever gets returned to a unique format, so my client can read off it always the same way. getObject() is my accessor, and onIOError will handle exceptions with any of the public API's

View 1 Replies

ActionScript 3.0 :: Best Pausable Timer Implementation

Oct 23, 2009

as we know, the Timer class flash gives us does not support any pause/unpause functionality. if you stop and then start a timer, it resarts at the beginning of it's interval period, advancing the repeat counter once. sometimes you want to pause the timer mid-interval, and resume from where you left off I have seen one attempt at a custom timer subclass that supports pause/unpause, but it was pretty shaky anyone actually nailed this?

View 4 Replies

ActionScript 3.0 :: HitTestPoint( X, Y, True); Implementation?

Jun 2, 2009

Testing this function and running it 11k times on a shape where I use:
 
shape.opaqueBackground = true;            shape.cacheAsBitmap = true;
 
Is extremely slow.. It seems to take 4 to 5 seconds to check a 101 x 101 tectangular area.I'm wondering how it is implemented...I know the code for the SDK is available?I can 'getPixel' from a bitmap to get the very exact color of that pixel in 1/1000 that time.If I happen to have the bitmap data.But with a shape that is already 'treated as a bitmap' (see above) using hitTestPoint  can stop your system. It should not be vastly inferior to work with Shapes than it is with bmp data..

View 3 Replies

ActionScript 2.0 :: Implementation Class ImageViewer?

Sep 8, 2009

I'm trying to implement class ImageViewer in AS2 (Actionscript 2).Here is the full source attached:

[URL]

I receive an error.I'm not sure if container_mc is the instance name of the image that is converted in movieclip symbol.

View 1 Replies

ActionScript 3.0 :: Implementation Of Html WYSIWYG In Flex?

Sep 16, 2009

is there any way to build html WYSIWYG in flex like Microsoft front page? i didn't found any thing on the web like this? second question is : is there any good rich text editor that support text completion function like ( like code IDE 's )

View 1 Replies

Flex :: Could Not Resolve <s:Method> To A Component Implementation

Nov 4, 2009

How do I do this in Flex 4?

<mx:RemoteObject id="srv" destination="product" channelSet="{channelSet}"
fault="faultHandler(event)">
<mx:method name="getProducts" result="getProducts_resultHandler(event)"/>
</mx:RemoteObject>

I got

Could not resolve <s:Method> to a component implementation.

When trying to do this

<s:RemoteObject id="roMajor"
destination="MajorSrv"
fault="Alert.show('Remote Object Error')" >
<s:Method name="AddMajor" result="roMajorResult(event)"/>
</s:RemoteObject>

View 1 Replies

Actionscript 3 :: Remote Implementation For HTTPService In Flex?

Jan 15, 2010

In my flex application I am using httpService to connect to the server, for the response from server I wanted it to convert the http response to flex object, Is there any remote implementation availabe for the above purpose

View 2 Replies

Flex :: Zend AMF Implementation And AMF Protocol Security?

Jan 15, 2010

I have a Flex frontend connecting via RemoteObject to Zend Framework's Zend Amf. This is my only means to transport data between client layer (Flex) and the application and persistence layers (LAMP with Zend Framework).Some ways I can address security are as follows:

I can address TLS by using mx.messaging.channels.SecureAMFChannel in my services-config.xml file and ensuring Flash player is loaded into a HTTPS wrapper and is in fact using HTTPS since the AMF protocol is layered on top of HTTP RemoteObject has a setCredentials method with which I can pass AMF authentication headers to protect user related data. Assuming TLS was actually secure I can expose methods on the endpoint after authenticating the User.I can protect against cross-site scripting and other FLASH vulnerabilities with a properly set up crossdomain.xml how to I protect my endpoint against another AMF consumer? For instance, if there were another AMF consumer (not Flash so not bound by crossdomain.xml and Flash sandbox security) other than my Flex client that knew my endpoint, what would stop it from using methods that the endpoint exposes?

As far as I know I essentially need a way to authenticate my Flex application against my Zend Amf endpoint. After AMF consumer authentication, I have some of the security mechanisms I mentioned above to protect certain pieces of data (like User authentication). I can not embed some sort of authentication mechanism into my Flex swf because the swf is vulnerable to decompilation (the swf can not be trusted). While sensitive data is protected via User authentication the unprotected data is hardly public but as far as I can tell is totally open for public consumption.

View 2 Replies

Java :: Best Standard Style For ToString Implementation?

Oct 15, 2010

We have a lot of objects for which we like to implement a simple toString to output attributes of the object. Some of these attributes may be complex objects themselves. Is there any standard, or simply just a best practice for a style? I'm thinking something like:
[SimpleClassName] { prop1:value, prop2:value }

In which case a nested value would look like:
[SimpleClassName] { prop1:value, prop2:[NestedObject] { prop3:value}}
We are using Java but I find myself asking the same question in most languages!

View 7 Replies

Flash :: Format Of Flv-videos For A RTMP-implementation?

Nov 14, 2010

I'm implementing the RTMP-protocol for my bachelor thesis. I got through the handshake and application connect process and received the play-command from my client which is actually a jw player.But I now stuck with the audio and video-messages. I can't find something about the exactly built-up of these messages neither in the specification nor somewhere else.What should i do with the metadata and header of the flv-file? Can I send the whole tag and audio-/video-data from my file in the RTMP-audio- and video-messages?

View 1 Replies

Flex :: Could Not Resolve <fx:Script> To A Component Implementation?

Mar 5, 2011

i created project with flexmojos maven archtype..i used flexmojos:flexbuilder and compile/run with FlashBuilder 4 everything is okay but when i try to compile project with flexmojos i got following error: ERROR] Z:....srcmainflexMain.mxml:[6,-1] Could not resolve < fx:Script > to a component implementation.INFO] BUILD FAILURE

my mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

[code].....

View 1 Replies

Flex :: Implementation Of Value Object Design Pattern?

Jun 20, 2011

I am just looking design patterns used in Flex. Any value object design pattern and how is it implemented in Flex.

View 3 Replies

ActionScript3 :: Interface Implementation Without Public Accessor?

Sep 28, 2011

In C#, it's possible implementing interface methods without making implementing method as public. For example,

void ITest.SomeMethod()
{
// ...
}

Is there equivalent for ActionScript3?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved