Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - niccosw

Pages: 1
1
Shared Resources / Electrotank Multiplayer Kit (Note: Discontinued)
« on: November 16, 2011, 03:44:18 am »
[UPDATE - April 15th 2012]
I'm no longer providing support for this Kit. I encourage Stencyl users who have an interest in it to stay in contact with each other on this thread and share any changes and modifications they make. It's open-source, so feel free to copy / paste / modify any code that I worked on. It's yours, not mine.


For the past several weeks I've been working on developing a multiplayer version of the RPG Town and Dialog Kit using an Electrotank socket server. I've gotten it to the point where it has basic functionality and have decided to release it. Due to the heavy dependencies in this Kit, I will not be uploading it to the Forge. You can download it here as a zip file instead.

Here is a video demonstrating the Kit in action:
http://youtu.be/O8Ll61YI0Fo

What the Electrotank Kit can do at this point:

* Create a LogIn Screen – Players can type in their user name. There is no password or authentication yet.
* Select an Actor –  The available actors are displayed. More can be added easily to the Actor Selector scene by attaching an actor with only the new CharacterSelector behavior. It can be modified in Design View to keep track of game stats.
* Grid Movement – Players can use grid movement behavior that updates their location for all players to see. It tries to reduce bandwidth by only communicating when the movement key is pressed down and released, instead of constant updates. It also does error checking each time the player comes to a stop in case they have missed their target.
* Text Chat – Players can hit ENTER, type a message and hit ENTER again and it will be displayed above their actor. There is an error right now that keeps the message stationary and may keep it permanently if the speaker leave the room before it is removed.
* Other Players – Other players appear and disappear as they log in out of the server and enter and exit the scene.


To get this running a developer needs to:

* Install ES5 on their test machine or on a server – There are some YouTube tutorials on how to do this and you can get help at Electrotank's site.
* Use the ES5 SWC files – This is included with the zip file below.
* Enter the Host URL in the Electrotank LogIn behavior – The behavior's default is set to the default ES5 instillation on a local test machine. You won't have to touch this during local testing.
* Run the server as a service if on a local test machine

2
Shared Resources / Video Actor
« on: July 22, 2011, 10:52:24 pm »
Video Actor
version 1.0 - uploaded July 23rd 2011
Flash only

Video Actor is behavior that allows you to stream video directly into an actor's current sprite. This behavior only works with Flash games (not iStencyl or any other platform). What this means is that video files can behave as normal actors in a game. They can be placed on different layers and interact with other game objects.



Is it possible to change a video during runtime?
Yes. For example, 4-way movement can trigger different video streams. To do this, set 'newVideoURL' on this behavior and tell it to 'changeVideoURL'.


Does this work with Flixel Pause and Volume control?
Yes.

Can I use FLV files with transparency?
Yes, but they are a bit slower than regular video. Be sure to click the check box in the behavior or you will see a trippy ghosting effect.

Is it possible to have multiple video actors running at the same time?
Yes, but this can use up a lot of resources. Use the debug console to watch your FPS. The larger the videos and the higher the frame rate, the more taxing it is.

Can I use this with HD video?
I don't suggest it. A 640x480 game will run much smoother than a 1280x720 or a 1920x1080 game. Going into Full Screen mode will drastically slow the performance as well, even for small games. If you must use HD, then use Stage Video and try to use only one or two videos at a time.

What is Stage Video? Is this the same Stage Video as Flash 10.2+?
No, this is not the same as Flash 10.2+ Stage Video. I guess I should rename it, shouldn't I? Hmmm. Maybe Static Video.

This places the video in front of the game where the actor cannot move or interact with the game. It will also obscure the Flixel pause and volume screens, but they will still function. Using this method there is a significant performance increase. Use this for full screen cutscenes and other non-interactive parts of the game.

Is there a sample game?
You can play the sample game from StencylForge in the "Video Actor" behavior. I'll look into posting a sample on stencyl.com but to do that I need to be allowed to host video there as well.

Will this behavior work with portals, such as Kongragate or Newgrounds?
Probably not. The video needs to be local or on the same server, unless there is a crossdomain.xml file. Most portals do not allow extra files to be uploaded without special permission.

How do I test video locally?
If you want to test using a relative path, you should place the video files in "StencylWorks\plaf\flash". Then you would call them by name like "myVideo.flv". I often create a separate folder called "assets" in the "flash" folder. Then I call: "assets/myVideo.flv". If I placed the folder higher in the hierarchy, such as "StencylWorks\assets" then I would use "../../assets/myVideo.flv".


I hope you get some use out of this. There is talk about making it an official part of the engine in the future. If you have any problems or suggestions, please post them here. I'll be making updates periodically to the code.

3
When using the init function, Actor.MoveTo will overwrite previously set Actor.SetX/Y values. This happens with the code blocks as well. This is not occurring with other tweening functions like Actor.SpinTo.

It is possible to correct the problem using a runLater / "do after <sec> seconds" time delay.


4
Archives / FlxCamera / Multiple cameras
« on: June 24, 2011, 10:20:15 pm »
For the games I am building, having access to Flixel's FlxCamera functionality would be very useful.

Are there plans to implement it in the near future? Is it something that could be imported by the Stencyl community?

[EDIT] Here is an example of a split screen type of game you can create with this class:
http://flixel.org/features.html#cameras

5
Shared Resources / Scene barrier when using Grid Based Movement tip
« on: June 24, 2011, 09:28:40 pm »
Here is a tip to prevent the actor from leaving the scene when using Grid Based Movement.

In the listening blocks for movement, add IF blocks using the following formulas:
moveup: if y of self > 0
moveleft: if x of self > 0
movedown: if y of self < scene height - height of self
moveright: if x of self < scene height - width of self

Here is an example:

6
This is probably more of a general Flash question than a specific Stencyl question.

I've been testing my game with a large screen size and my computer started overheating! I checked my CPU and it was at 65 - 70% when testing with the standalone player. I experimented by turning my behaviors on and off, but the most effective strategy was to decrease my screen size.

Try it yourself:

1) Load the Action Adventure kit. Test it and check your CPU (mine was 30-35%)
http://i.imgur.com/1iSD7.png
2) Go into game settings and double the size of the screen (640x416 to 1280x832)
3) Test it. Even with 3/4ths of the screen size blank the CPU load will double (mine was 65-70%)
http://i.imgur.com/POTER.png

I did the same thing with a couple Flashpunk builds and the same thing happened:
Simple Demo: 13% at 800x600 vs. 20% at 1600x1200.
Complex Demo: 20% at 624x480 vs 60%! at 1248x960.

I tried it in Flex, but didn't get the same CPU increase. Is this a Flash issue or a Bitmap engine issue?

7
Ask a Question / setAnimation vs switchAnimation
« on: June 19, 2011, 06:05:01 pm »
Using the "Switch Animation to <animation attribute> for <self>" generates the code: actor.setAnimation("".toString());

According to the API there is another Actor method called switchAnimation.
http://api.stencyl.com/as3/stencyl/api/engine/actor/Actor.html#switchAnimation()

 ??? What's the difference?

8
Shared Resources / Stencyl Video Behavior
« on: June 17, 2011, 04:59:53 am »
This behavior has been updated. Use "Video Actor" instead.

http://community.stencyl.com/index.php/topic,2234.0.html

Quote
This behavior introduces video streaming into Stencyl. A single behavior file is attached to a scene with two attributes:
  • VideoURL - This can be local or on the web. File should be FLV, MP4 or other highly compressed format.
  • Scene to exit to - Another scene in the game that can be exited to when the video ends.

Hitting and releasing the SPACE bar will end the video. There is no crossdomain security implemented so it will not work with standard game portals. Use only on a single server or local file access.

Since video is played on a stage above the game, it is not effected by most game wide behaviors (pause, volume control, replay, etc) There may be issues with netstreams and/or connections not closing properly leading to memory leaks. Let me know if it slows your game down too much.

9
Shared Resources / External Sprite Loader
« on: June 13, 2011, 03:42:48 am »
This pack allows sprites to be loaded externally at runtime from a user's computer or from a single server. Crossdomain security is not set up yet so it can't load images from other servers and is unlikely to work with most game portals. Presently only one sprite is loaded per actor, but future versions will hopefully allow animations to be loaded.

Instructions:
Attach Load Sprite to an Actor.
Do NOT attach External Image.
Specify the URL in the actor's attributes of the behavior.

When the character loads, the sprite will be generated from an external file.

This uses code from this blogpost: http://www.iokat.com/posts/3/loading-external-images-for-use-with-flixel-sprites

10
Old Bugs (1.x/2.x) / StencylForge ViewDocumentation link undeletable
« on: June 09, 2011, 10:57:50 pm »
When using the Edit Documentation URL link in StencylForge, there is no way to delete the link after it has been created. It can be changed, but not deleted. Leaving an empty dialog box cancels the action. Leaving a space results in a broken link.

11
I was able to get XML reading working. I used this Kirupa tutorial:
http://www.kirupa.com/net/reading_xml_directly_pg1.htm

I'd like to use an attribute for the bookInput operation so users don't have to dig into the code, they can just set the fields to return. However, every time I pass it, it reads it as a string. Using {} and [] doesn't work. Any other ideas?

12
I've been trying to figure out how to load external sprites at runtime. Does the Flixel engine support this? I found a method in the API called "loadExtGraphic" but there doesn't seem to be a URLRequest parameter.

I tried implementing code from this thread, but without success:
http://flixel.org/forums/index.php?topic=813.0

Anyone else have some insight into this feature?

Pages: 1