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


Similar Posts:


ActionScript 3.0 :: Text Based Action Adventure Game?

Nov 3, 2011

I'm currently working on an action adventure game and have run into some issues. I am using flash CS4 and AS3. On the stage I have created a user input text field with the instance name of textbox and a button with the instance name of btn. I'm trying to set it up so that when the user types in a word that word is cross referenced with an array and a function is run. I have noticed that some times the functions are not run in the order there typed. For example if I type "enterdoor. lookaround." Than the following is traced.

" you have entered the door.
.
you are looking around, but don't see anything.
. "

Which is good but if I reverse the order and type "lookaround. enterdoor." then I receive the following.

"you are looking around, but don't see anything.
.
.
you have entered the door. "

Also if I were to type "gobacklookaroundenterdoor" then the following is displayed.

"go back you have entered the door. you are looking around, but don't see anything."

Notice that the function "enterdoor" is run before "lookaround" even thou "lookaround" was typed first. Also if I were to type "enterdoorlookaround enterdoorlookaround" then the following is displayed.

"you have entered the door.
you are looking around, but don't see anything.
you are looking around, but don't see anything.
you have entered the door. "

I cant seem to figure out why the functions are not run in the order they are typed by the user. Not sure if this helps but I have determined that if a function is typed 3 times or more then it only returns the function twice. For instance if I were to input "enterdoorenterdoorenterdoor" then the following is displayed.

"you have entered the door.
you have entered the door. "

I would also like for the user to have the option of typing a function as many times in a row as needed. It seems to me that I'm missing some thing simple. I was thinking if I change the commands "array" to an "associative array" it might process the functions in the correct order. It seems to me that the commands array is being compared to the inputholder array.

this.stop();
import flash.events.*;
btn.addEventListener(MouseEvent.CLICK,textChanged)

[code]....

View 1 Replies

ActionScript 3.0 :: Tile Based Game - Creating Multiple Sprites Based On Frames

Nov 17, 2009

I'm relatively new to AS3. There's one thing that I don't quite understand about Sprites. I'm making a tile based game, and all the tile graphics for a level are inside one movie clip in each frame. Would I be able to go about creating multiple sprites based on the frames in said movieclip's timeline I would I have to go through and make a separate library graphic for each.

View 2 Replies

C# :: How To Code An Web-browser Based Multiplayer Game

Jun 30, 2010

If I wanted to code a desktop-based game, I could pull some XNA code and UDP sockets and make a decent multiplayer game. I would have an extremely clear of how to code the game I wanted.But if I wanted to code a browser-based online multiplayer game, how would I do it?ou can't use XNA....I've been looking at some questions and I'm seeing PHP and ASP.NET and Silverlight and Flash and Java as the alternative languages...I really don't understand how it works. I mean, for a desktop-based game, you're opening a UDP socket and accepting clients and transferring data, updating player states, drawing the results using XNA. But in a browser, how do you open a socket and stuff? How does that concept work, communicating to people in realtime through a web-browser.

View 6 Replies

Create UDP And TCP Connections In A Browser-based Game?

Nov 13, 2010

I'm working on a game and want the freedom to choose between UDP and TCP connections in the future when I decide to add multiplayer. I'm not sure how something like this would work in the browser with security.

There are two scenarios I can think of for multiplayer. The first is that a player becomes the host of the game (in the browser) and thus would need to communicate with other players directly via TCP or UDP. This would save me on bandwidth costs.

The second scenario would be to have the web server host the game and pass messages back and forth to the clients again via TCP or UDP.

Do Flash or Java applets let me do something like this? If not is there an alternative I can use for the browser or am I stuck with moving to providing a game download and installation?

View 3 Replies

ActionScript 3.0 :: Tile Based Pacman Game?

Feb 28, 2010

I am trying to make a pacman game and was advised that collision detection for a game like this is much easier if you create it using a tile based methodology. I have the map created and the character moves fine around the grid. But once I added collision detection it seems to be a bit off and inconsistent. Im not entirely sure what the problem is with the collisions.

View 9 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 1/2 :: Game Score - Points To Be Time Based

Jul 18, 2009

Is there an actionscript for a point system? I want my points to be time based from this script
stop();
count = 60;
countdown = function(){count--;
if (count ==0){clearInterval(doCountdown);
gotoAndStop(11);
clearInterval(doCountdown);
}}doCountdown = setInterval(countdown, 1000);

View 5 Replies

Flash :: Turn Based Strategy Game Techniques?

Feb 12, 2010

I want to make a turn base strategy game. I was just curious if anyone had any sources or books that explains the concept and architect of designing a turn based strategy game or any turn based game.

View 2 Replies

Java :: Platform For Web-based Multi-player Game?

Sep 28, 2010

I'm developing a web-based fantasy football game. Most of the game is a straight-forward web application built on top of Linux/Apache/Php/MySQL.

I'm trying to figure out how to implement the draft application. The draft date and time will be scheduled in advance by each league's owner. Up to 32 users may be logged on for a given league's draft, and there is no limit to how many drafts may be happening concurrently. The users will take turns selecting players, and each user's turn will have a time limit. I'd like for all the users to be able to see whose turn it is, how much time that user has left to select a player, who they select, and which players are still available. If there are users in the league who are not logged in during the draft I'd like to be able to detect that and automatically assign players to them rather than waiting for the time to run out on their turn. Ideally I'd also like to have a chat window so the users could chat with one another during the draft.

My background is in desktop application development, so if necessary I could write server code in C#/.NET or Java. As far as I can see these are the options: PHP/AJAX - It seems like it would be possible to have all the state for the draft in the database and have the operations for the draft run in PHP triggered by requests from the clients? I guess in this case the draft doesn't start until at least one user logs in, and it seems like it would be a lot of polling requests to the server if I want everyone notified quickly when a user makes a selection.

[Code]...

View 2 Replies

Flash :: Web Development - Not To Target 10 For A Browser - Based Game?

Oct 25, 2010

There's clearly a bunch of new stuff in Flash 10, I'm seeing a bunch in the Graphics class so far. Struggling a bit to reconcile it with what I know already but it looks useful - render lists and 3D transforms, etc - however I wondered if there are good arguments for targeting Flash 9 since I can definitely manage without all the new stuff I don't know. Like support on non-Windows devices, wide adoption of Flash 9 Vs 10, etc.

View 1 Replies

Flash :: Make Based Game Without Graphic Skills?

Oct 29, 2010

If I have a designer make the necessary graphics, what do I need to learn to make a flash based game?

I already understand the backend server work that would need to talk to the 'front end' part of the game i.e. how the flash game will make requests to the backend servers for storing/retrieving data in xml/json etc.

View 3 Replies

Actionscript 3 :: Making Interesting Flash Based Game?

Mar 25, 2011

how to make a interesting flash based game?

View 1 Replies

Actionscript 3 :: Component Based Architecture In Game Development?

Oct 1, 2011

I have been thinking of trying out component based architecture for game development. I have read some blog posts and articles about it but I have a few things I have not sorted out yet. When I say component based I mean that you can add components to a ComponentManager that updates all components in its list. I want to try this to avoid getting classes that inherits variables and functions that they donīt need. I really like the idea of having an really simple entity class with a lot of components working side by side without getting bloated. Also, it is easy to remove and add functionality at runtime wich makes it really cool.

This is what I am aiming for.

// this is what the setup could be like
entity.componentManager.add(new RigidBody(3.0, 12.0));
entity.componentManager.add(new CrazyMagneticForce(3.0));
entity.componentManager.add(new DrunkAffection(42.0, 3.0));
// the game loop updates the component manager which updates all components
entity.componentManager.update(deltaTime);

Communication: Some of the components need to communicate with other components I canīt rely on the components to be self-sustaining. Sometime they will need to communicate with the other components.In Unity 3D, you can access the components using GetComponent().I was thinking of doing it like this, but what happens if you have two components of the same type? Maybe you get a Vector back.

var someComponent : RigidBody = _componentManager.getComponent(RigidBody);

Priority: Some components need to update before others

Some components need to update before others to get the correct data for the current game loop. I am thinking of adding a PRIORITY to each component, but I am not sure that this is enough. Unity uses LateUpdate and Update but maybe there is a way to get an even better control of the order of execution.

[URL]

View 1 Replies

ActionScript 3.0 :: Tile Based Game Depth Sorting?

Oct 1, 2007

I've been playing around with ActionScript 3. They have a new way of placing clips onto the stage, "addChild(clip)," which automatically places the clip onto the stage with it's own depth. So here's my problem, when making a tile based game, I have to constantly depth sort to make sure the object lower on the screen has the higher depth than an object higher on the screen. Pretty much, their depth depended on their y-coord. Does ActionScript 3 still let us play with depths?

View 2 Replies

ActionScript 3.0 :: Make A Multiplayer Hero-based RTS Game

Apr 12, 2011

I'm planning to make a multiplayer hero-based RTS game, similar to the gameplay of DotA/HoN/LoL. With about 10~ players max at once in a game. The latency and responsetime is key, trying to get as low ping as possible.And last but not least - I don't want to use any 3rd party solutions, such as smartfox server or any of the likes of it.So, with that said, what is the way to go if I'm going to build this properly? Java socket server? Python? Let me know what you think and please share resources since i haven't done anything similar before.

View 6 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 3.0 :: Show Msg To User Based On How Quickly Game Completed

Sep 3, 2011

I've developed a game that records how long it took to complete the game. At the end of the game it shows the user how long it too to complete. I want to be able display message to the user depending on how quickly they took to complete the game. I have set up a dynamic text box called "message" that will display the message, but I am struggling to figure out the syntax for :

If gametime is less than 60 secs then message = "well done thats very quick"
If gametime is between 60 and 80 secs then message = "Not bad at all"
If gametime is between 81 and 100 secs then message = "Its good but not good enough"
If gametime is between 101 and 120 secs then message = "You can do better than that!"
If gametime is between 121 and 140 secs then message = "Too slow, you need to practice"
If gametime is greater than 140 then message = "Did you fall asleep?"

View 3 Replies

ActionScript 2.0 :: A Mouse-focus Based Pause Function For A Game?

Mar 4, 2008

So your playing a flash game that's fast paced and mouse-based (hey that rhymes somewhat)... And then you accidentally move your mouse outside of the area of the swf... And then it pauses automatically with a "Continue" button, instead of you just dying or whatever. I've thought you could have a huge button the size of the stage and make it do something when the frame isn't 'mouseover' or whatever, but there's gotta be a better way. Also setting limits on the _xmouse and _ymouse wouldn't work cos sometimes the mouse moves too fast for them to accurately get the last mouseposition...

View 8 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

Java :: Get Started On A Simple Physics Based Game (with Angle / Power)?

Nov 28, 2011

Basically there will be a club and a ball. You can control the power and angle to hit the ball. How do I go about implementing this? Is flash the easiest way to go? I want to implement this as a facebook game. Any game libraries specific to this I can use to quickly implement a basic version? I am comfortable with Java and PHP.

View 1 Replies

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

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

ActionScript 3.0 :: Change Dynamic Text Color Based On Input Text

Aug 29, 2011

I have an input text box (txtInput) and a dynamic text box (dynTxt). I want the dynamic text to stay black but highlight a segment of that text in yellow depending on certain characters.

[Code]....

View 4 Replies

ActionScript 2.0 :: Enlarging Dynamic Text Box Based On Text Length?

Jul 29, 2004

Is there a way to set up a dynamic text box to increase in size (height) based on the length of text loaded into it?

View 2 Replies

ActionScript 1/2 :: Create Dynamic Text Box Based On The Some Length Of Text?

Sep 10, 2011

How to create the dynamic text box based on the length of the some text

View 1 Replies

IDE :: Add To Text Based On First Letters?

Jan 17, 2010

I'm trying to find a way to add to the front and back of a word in a string based on the letters it starts with.

For example if I had a string "I think http://www.facebook.com/ is better than http://twitter.com" it would look for the instance of "http://" and give me "I think <b>http://www.facebook.com/</b> is better than <b>http://twitter.com</b>"

View 9 Replies

ActionScript 2.0 :: CS3 Jumping To Frame Based On The Value In A Text Box?

Feb 23, 2011

I have a maths-based movie on which a number of points are allocated depending on the answers given to a series of multiple choice questions.

At the end of it, a person will score somewhere between 1 and 10 points depending on the answers they gave.

I have got to the stage where the system keeps track of the cumulative score, and at the conclusion, I have a text field on stage, which has an instance name of "results". When the person enters the frame, the results field displays the total number of points scored.

That is ok, but what I actually would like to happen is that the movie jumps to a different frame based on that figure, so that if they score 2, it would take them to the frame labelled "two" and if they score 9, it takes them to frame "nine"

Is there a way of effectively saying:

On frame enter
if results.text = 1 go to "one";
if results.text = 2 go to "two"
etc etc

I'm guessing that I need to use the:

_root.onEnterFrame = function(){
};

how to describe the bit in the middle...?

View 4 Replies







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